Bug 1387632: Rename ProfileStorage module to FormAutofillStorage. r=MattN
authorGeorge Dan, Ryan Neilsen, Dylan Turner <ninjaprawn@ninjaprawn.com>
Tue, 30 Jan 2018 14:44:59 -0800
changeset 401634 26403995065c
parent 401633 e949c6507507
child 401635 2a7e34625fb8
push id33351
push userbtara@mozilla.com
push dateWed, 31 Jan 2018 10:00:45 +0000
treeherdermozilla-central@7b46ef2ae141 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1387632
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1387632: Rename ProfileStorage module to FormAutofillStorage. r=MattN
browser/components/migration/tests/marionette/test_refresh_firefox.py
browser/extensions/formautofill/FormAutofillParent.jsm
browser/extensions/formautofill/FormAutofillStorage.jsm
browser/extensions/formautofill/FormAutofillSync.jsm
browser/extensions/formautofill/MasterPassword.jsm
browser/extensions/formautofill/ProfileStorage.jsm
browser/extensions/formautofill/content/editDialog.js
browser/extensions/formautofill/content/manageDialog.js
browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js
browser/extensions/formautofill/test/unit/head.js
browser/extensions/formautofill/test/unit/test_activeStatus.js
browser/extensions/formautofill/test/unit/test_addressRecords.js
browser/extensions/formautofill/test/unit/test_creditCardRecords.js
browser/extensions/formautofill/test/unit/test_getRecords.js
browser/extensions/formautofill/test/unit/test_migrateRecords.js
browser/extensions/formautofill/test/unit/test_savedFieldNames.js
browser/extensions/formautofill/test/unit/test_storage_syncfields.js
browser/extensions/formautofill/test/unit/test_storage_tombstones.js
browser/extensions/formautofill/test/unit/test_transformFields.js
toolkit/components/payments/content/paymentDialog.js
toolkit/components/payments/res/components/address-option.js
toolkit/components/payments/test/browser/head.js
tools/lint/eslint/modules.json
--- a/browser/components/migration/tests/marionette/test_refresh_firefox.py
+++ b/browser/components/migration/tests/marionette/test_refresh_firefox.py
@@ -419,17 +419,17 @@ class TestFirefoxRefresh(MarionetteTestC
           window.global = {};
           global.LoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1", "nsILoginInfo", "init");
           global.profSvc = Cc["@mozilla.org/toolkit/profile-service;1"].getService(Ci.nsIToolkitProfileService);
           global.Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
           global.FormHistory = Cu.import("resource://gre/modules/FormHistory.jsm", {}).FormHistory;
         """)
         self._formAutofillAvailable = self.runCode("""
           try {
-            global.profileStorage = Cu.import("resource://formautofill/ProfileStorage.jsm", {}).profileStorage;
+            global.profileStorage = Cu.import("resource://formautofill/FormAutofillStorage.jsm", {}).profileStorage;
           } catch(e) {
             return false;
           }
           return true;
         """)
 
     def runCode(self, script, *args, **kwargs):
         return self.marionette.execute_script(script,
--- a/browser/extensions/formautofill/FormAutofillParent.jsm
+++ b/browser/extensions/formautofill/FormAutofillParent.jsm
@@ -55,17 +55,17 @@ const {
   ENABLED_AUTOFILL_CREDITCARDS_PREF,
   CREDITCARDS_COLLECTION_NAME,
 } = FormAutofillUtils;
 
 function FormAutofillParent() {
   // Lazily load the storage JSM to avoid disk I/O until absolutely needed.
   // Once storage is loaded we need to update saved field names and inform content processes.
   XPCOMUtils.defineLazyGetter(this, "profileStorage", () => {
-    let {profileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+    let {profileStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
     log.debug("Loading profileStorage");
 
     profileStorage.initialize().then(() => {
       // Update the saved field names to compute the status and update child processes.
       this._updateSavedFieldNames();
     });
 
     return profileStorage;
@@ -91,17 +91,17 @@ FormAutofillParent.prototype = {
    *
    * @returns {boolean} Whether FormAutofillParent is initialized.
    */
   get initialized() {
     return this._initialized;
   },
 
   /**
-   * Initializes ProfileStorage and registers the message handler.
+   * Initializes FormAutofillStorage and registers the message handler.
    */
   async init() {
     if (this._initialized) {
       return;
     }
     this._initialized = true;
 
     Services.obs.addObserver(this, "sync-pane-loaded");
rename from browser/extensions/formautofill/ProfileStorage.jsm
rename to browser/extensions/formautofill/FormAutofillStorage.jsm
--- a/browser/extensions/formautofill/ProfileStorage.jsm
+++ b/browser/extensions/formautofill/FormAutofillStorage.jsm
@@ -89,17 +89,17 @@
  * When saving or updating a credit-card record, the storage will encrypt the
  * value of "cc-number", store the encrypted number in "cc-number-encrypted"
  * field, and replace "cc-number" field with the masked number. These all happen
  * in "_computeFields". We do reverse actions in "_stripComputedFields", which
  * decrypts "cc-number-encrypted", restores it to "cc-number", and deletes
  * "cc-number-encrypted". Therefore, calling "_stripComputedFields" followed by
  * "_computeFields" can make sure the encrypt-related fields are up-to-date.
  *
- * In general, you have to decrypt the number by your own outside ProfileStorage
+ * In general, you have to decrypt the number by your own outside FormAutofillStorage
  * when necessary. However, you will get the decrypted records when querying
  * data with "rawData=true" to ensure they're ready to sync.
  *
  *
  * Sync Metadata:
  *
  * Records may also have a _sync field, which consists of:
  * {
@@ -1736,23 +1736,23 @@ class CreditCards extends AutofillRecord
       return true;
     }
 
     this.update(guid, creditCardToMerge, true);
     return true;
   }
 }
 
-function ProfileStorage(path) {
+function FormAutofillStorage(path) {
   this._path = path;
   this._initializePromise = null;
   this.INTERNAL_FIELDS = INTERNAL_FIELDS;
 }
 
-ProfileStorage.prototype = {
+FormAutofillStorage.prototype = {
   get version() {
     return STORAGE_SCHEMA_VERSION;
   },
 
   get addresses() {
     if (!this._addresses) {
       this._store.ensureDataReady();
       this._addresses = new Addresses(this._store);
@@ -1799,10 +1799,10 @@ ProfileStorage.prototype = {
 
   // For test only.
   _saveImmediately() {
     return this._store._save();
   },
 };
 
 // The singleton exposed by this module.
-this.profileStorage = new ProfileStorage(
+this.profileStorage = new FormAutofillStorage(
   OS.Path.join(OS.Constants.Path.profileDir, PROFILE_JSON_FILE_NAME));
--- a/browser/extensions/formautofill/FormAutofillSync.jsm
+++ b/browser/extensions/formautofill/FormAutofillSync.jsm
@@ -14,17 +14,17 @@ ChromeUtils.import("resource://services-
 ChromeUtils.import("resource://services-sync/record.js");
 ChromeUtils.import("resource://services-sync/util.js");
 ChromeUtils.import("resource://services-sync/constants.js");
 ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "Log",
                                "resource://gre/modules/Log.jsm");
 ChromeUtils.defineModuleGetter(this, "profileStorage",
-                               "resource://formautofill/ProfileStorage.jsm");
+                               "resource://formautofill/FormAutofillStorage.jsm");
 
 // A helper to sanitize address and creditcard records suitable for logging.
 function sanitizeStorageObject(ob) {
   if (!ob) {
     return null;
   }
   const whitelist = ["timeCreated", "timeLastUsed", "timeLastModified"];
   let result = {};
@@ -218,17 +218,17 @@ FormAutofillTracker.prototype = {
     Services.obs.addObserver(this, "formautofill-storage-changed");
   },
 
   stopTracking() {
     Services.obs.removeObserver(this, "formautofill-storage-changed");
   },
 
   // We never want to persist changed IDs, as the changes are already stored
-  // in ProfileStorage
+  // in FormAutofillStorage
   persistChangedIDs: false,
 
   // Ensure we aren't accidentally using the base persistence.
   get changedIDs() {
     throw new Error("changedIDs isn't meaningful for this engine");
   },
 
   set changedIDs(obj) {
@@ -268,17 +268,17 @@ class AutofillChangeset extends Changese
     }
     return false;
   }
 
   delete(id) {
     let change = this.changes[id];
     if (change) {
       // Mark the change as synced without removing it from the set. We do this
-      // so that we can update ProfileStorage in `trackRemainingChanges`.
+      // so that we can update FormAutofillStorage in `trackRemainingChanges`.
       change.synced = true;
     }
   }
 }
 
 function FormAutofillEngine(service, name) {
   SyncEngine.call(this, name, service);
 }
@@ -287,17 +287,17 @@ FormAutofillEngine.prototype = {
   __proto__: SyncEngine.prototype,
 
   // the priority for this engine is == addons, so will happen after bookmarks
   // prefs and tabs, but before forms, history, etc.
   syncPriority: 5,
 
   // We don't use SyncEngine.initialize() for this, as we initialize even if
   // the engine is disabled, and we don't want to be the loader of
-  // ProfileStorage in this case.
+  // FormAutofillStorage in this case.
   async _syncStartup() {
     await profileStorage.initialize();
     await SyncEngine.prototype._syncStartup.call(this);
   },
 
   // We handle reconciliation in the store, not the engine.
   async _reconcile() {
     return true;
--- a/browser/extensions/formautofill/MasterPassword.jsm
+++ b/browser/extensions/formautofill/MasterPassword.jsm
@@ -109,17 +109,17 @@ this.MasterPassword = {
     }
     return cryptoSDR.decrypt(cipherText);
   },
 
   /**
    * Decrypts cipherText synchronously. "ensureLoggedIn()" needs to be called
    * outside in case another dialog is showing.
    *
-   * NOTE: This method will be removed soon once the ProfileStorage APIs are
+   * NOTE: This method will be removed soon once the FormAutofillStorage APIs are
    *       refactored to be async functions (bug 1399367). Please use async
    *       version instead.
    *
    * @deprecated
    * @param   {string} cipherText Encrypted string including the algorithm details.
    * @returns {string} The decrypted string.
    */
   decryptSync(cipherText) {
@@ -142,17 +142,17 @@ this.MasterPassword = {
 
     return cryptoSDR.encrypt(plainText);
   },
 
   /**
    * Encrypts plainText synchronously. "ensureLoggedIn()" needs to be called
    * outside in case another dialog is showing.
    *
-   * NOTE: This method will be removed soon once the ProfileStorage APIs are
+   * NOTE: This method will be removed soon once the FormAutofillStorage APIs are
    *       refactored to be async functions (bug 1399367). Please use async
    *       version instead.
    *
    * @deprecated
    * @param   {string} plainText A plain string to be encrypted.
    * @returns {string} The encrypted cipher string.
    */
   encryptSync(plainText) {
--- a/browser/extensions/formautofill/content/editDialog.js
+++ b/browser/extensions/formautofill/content/editDialog.js
@@ -10,17 +10,17 @@ const {classes: Cc, interfaces: Ci, util
 const AUTOFILL_BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
 const REGIONS_BUNDLE_URI = "chrome://global/locale/regionNames.properties";
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "profileStorage",
-                               "resource://formautofill/ProfileStorage.jsm");
+                               "resource://formautofill/FormAutofillStorage.jsm");
 ChromeUtils.defineModuleGetter(this, "MasterPassword",
                                "resource://formautofill/MasterPassword.jsm");
 
 class EditDialog {
   constructor(subStorageName, elements, record) {
     this._storageInitPromise = profileStorage.initialize();
     this._subStorageName = subStorageName;
     this._elements = elements;
--- a/browser/extensions/formautofill/content/manageDialog.js
+++ b/browser/extensions/formautofill/content/manageDialog.js
@@ -11,17 +11,17 @@ const EDIT_ADDRESS_URL = "chrome://forma
 const EDIT_CREDIT_CARD_URL = "chrome://formautofill/content/editCreditCard.xhtml";
 const AUTOFILL_BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "profileStorage",
-                               "resource://formautofill/ProfileStorage.jsm");
+                               "resource://formautofill/FormAutofillStorage.jsm");
 ChromeUtils.defineModuleGetter(this, "MasterPassword",
                                "resource://formautofill/MasterPassword.jsm");
 
 this.log = null;
 FormAutofillUtils.defineLazyLogGetter(this, "manageAddresses");
 
 class ManageRecords {
   constructor(subStorageName, elements) {
--- a/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js
+++ b/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js
@@ -4,17 +4,17 @@
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://formautofill/FormAutofillUtils.jsm");
 
-let {profileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+let {profileStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
 
 const {ADDRESSES_COLLECTION_NAME, CREDITCARDS_COLLECTION_NAME} = FormAutofillUtils;
 
 var ParentUtils = {
   async _getRecords(collectionName) {
     return new Promise(resolve => {
       Services.cpmm.addMessageListener("FormAutofill:Records", function getResult({data}) {
         Services.cpmm.removeMessageListener("FormAutofill:Records", getResult);
--- a/browser/extensions/formautofill/test/unit/head.js
+++ b/browser/extensions/formautofill/test/unit/head.js
@@ -54,19 +54,19 @@ Components.manager.addBootstrappedManife
 
 // Returns a reference to a temporary file that is guaranteed not to exist and
 // is cleaned up later. See FileTestUtils.getTempFile for details.
 function getTempFile(leafName) {
   return FileTestUtils.getTempFile(leafName);
 }
 
 async function initProfileStorage(fileName, records, collectionName = "addresses") {
-  let {ProfileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+  let {FormAutofillStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
   let path = getTempFile(fileName).path;
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   if (!records || !Array.isArray(records)) {
     return profileStorage;
   }
 
   let onChanged = TestUtils.topicObserved(
     "formautofill-storage-changed",
--- a/browser/extensions/formautofill/test/unit/test_activeStatus.js
+++ b/browser/extensions/formautofill/test/unit/test_activeStatus.js
@@ -1,16 +1,16 @@
 /*
  * Test for status handling in Form Autofill Parent.
  */
 
 "use strict";
 
 let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
-ChromeUtils.import("resource://formautofill/ProfileStorage.jsm");
+ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
 
 add_task(async function test_activeStatus_init() {
   let formAutofillParent = new FormAutofillParent();
   sinon.spy(formAutofillParent, "_updateStatus");
 
   // Default status is null before initialization
   Assert.equal(formAutofillParent._active, null);
   Assert.equal(Services.ppmm.initialProcessData.autofillEnabled, undefined);
--- a/browser/extensions/formautofill/test/unit/test_addressRecords.js
+++ b/browser/extensions/formautofill/test/unit/test_addressRecords.js
@@ -1,10 +1,10 @@
 /**
- * Tests ProfileStorage object with addresses records.
+ * Tests FormAutofillStorage object with addresses records.
  */
 
 "use strict";
 
 const TEST_STORE_FILE_NAME = "test-profile.json";
 const COLLECTION_NAME = "addresses";
 
 const TEST_ADDRESS_1 = {
--- a/browser/extensions/formautofill/test/unit/test_creditCardRecords.js
+++ b/browser/extensions/formautofill/test/unit/test_creditCardRecords.js
@@ -1,15 +1,15 @@
 /**
- * Tests ProfileStorage object with creditCards records.
+ * Tests FormAutofillStorage object with creditCards records.
  */
 
 "use strict";
 
-const {ProfileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+const {FormAutofillStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
 
 const TEST_STORE_FILE_NAME = "test-credit-card.json";
 const COLLECTION_NAME = "creditCards";
 
 const TEST_CREDIT_CARD_1 = {
   "cc-name": "John Doe",
   "cc-number": "1234567812345678",
   "cc-exp-month": 4,
@@ -141,17 +141,17 @@ const MERGE_TESTCASES = [
       "cc-number": "1234567812345678",
       "cc-exp-month": 4,
       "cc-exp-year": 2017,
     },
   },
 ];
 
 let prepareTestCreditCards = async function(path) {
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let onChanged = TestUtils.topicObserved(
     "formautofill-storage-changed",
     (subject, data) =>
       data == "add" &&
       subject.wrappedJSObject.collectionName == COLLECTION_NAME
   );
@@ -175,38 +175,38 @@ let do_check_credit_card_matches = (cred
     } else {
       Assert.equal(creditCardWithMeta[key], creditCard[key]);
     }
   }
 };
 
 add_task(async function test_initialize() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   Assert.equal(profileStorage._store.data.version, 1);
   Assert.equal(profileStorage._store.data.creditCards.length, 0);
 
   let data = profileStorage._store.data;
   Assert.deepEqual(data.creditCards, []);
 
   await profileStorage._saveImmediately();
 
-  profileStorage = new ProfileStorage(path);
+  profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   Assert.deepEqual(profileStorage._store.data, data);
 });
 
 add_task(async function test_getAll() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
 
   Assert.equal(creditCards.length, 2);
   do_check_credit_card_matches(creditCards[0], TEST_CREDIT_CARD_1);
   do_check_credit_card_matches(creditCards[1], TEST_CREDIT_CARD_2);
 
@@ -225,17 +225,17 @@ add_task(async function test_getAll() {
   creditCards[0]["cc-name"] = "test";
   do_check_credit_card_matches(profileStorage.creditCards.getAll()[0], TEST_CREDIT_CARD_1);
 });
 
 add_task(async function test_get() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
   let guid = creditCards[0].guid;
 
   let creditCard = profileStorage.creditCards.get(guid);
   do_check_credit_card_matches(creditCard, TEST_CREDIT_CARD_1);
 
@@ -245,17 +245,17 @@ add_task(async function test_get() {
 
   Assert.equal(profileStorage.creditCards.get("INVALID_GUID"), null);
 });
 
 add_task(async function test_add() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
 
   Assert.equal(creditCards.length, 2);
 
   do_check_credit_card_matches(creditCards[0], TEST_CREDIT_CARD_1);
   do_check_credit_card_matches(creditCards[1], TEST_CREDIT_CARD_2);
@@ -288,17 +288,17 @@ add_task(async function test_add() {
   Assert.throws(() => profileStorage.creditCards.add(TEST_CREDIT_CARD_EMPTY_AFTER_NORMALIZE),
     /Record contains no valid field\./);
 });
 
 add_task(async function test_update() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
   let guid = creditCards[1].guid;
   let timeLastModified = creditCards[1].timeLastModified;
 
   let onChanged = TestUtils.topicObserved(
     "formautofill-storage-changed",
@@ -307,17 +307,17 @@ add_task(async function test_update() {
       subject.wrappedJSObject.collectionName == COLLECTION_NAME
   );
 
   Assert.notEqual(creditCards[1]["cc-name"], undefined);
   profileStorage.creditCards.update(guid, TEST_CREDIT_CARD_3);
   await onChanged;
   await profileStorage._saveImmediately();
 
-  profileStorage = new ProfileStorage(path);
+  profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCard = profileStorage.creditCards.get(guid);
 
   Assert.equal(creditCard["cc-name"], undefined);
   Assert.notEqual(creditCard.timeLastModified, timeLastModified);
   do_check_credit_card_matches(creditCard, TEST_CREDIT_CARD_3);
 
@@ -362,17 +362,17 @@ add_task(async function test_update() {
     () => profileStorage.creditCards.update(guid, TEST_CREDIT_CARD_EMPTY_AFTER_UPDATE_CREDIT_CARD_1),
     /Record contains no valid field\./
   );
 });
 
 add_task(async function test_validate() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   profileStorage.creditCards.add(TEST_CREDIT_CARD_WITH_INVALID_EXPIRY_DATE);
   profileStorage.creditCards.add(TEST_CREDIT_CARD_WITH_2_DIGITS_YEAR);
   profileStorage.creditCards.add(TEST_CREDIT_CARD_WITH_SPACES_BETWEEN_DIGITS);
 
   let creditCards = profileStorage.creditCards.getAll();
 
@@ -388,48 +388,48 @@ add_task(async function test_validate() 
 
   Assert.equal(creditCards[2]["cc-number"].length, 16);
 });
 
 add_task(async function test_notifyUsed() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
   let guid = creditCards[1].guid;
   let timeLastUsed = creditCards[1].timeLastUsed;
   let timesUsed = creditCards[1].timesUsed;
 
   let onChanged = TestUtils.topicObserved("formautofill-storage-changed",
                                           (subject, data) => data == "notifyUsed");
 
   profileStorage.creditCards.notifyUsed(guid);
   await onChanged;
   await profileStorage._saveImmediately();
 
-  profileStorage = new ProfileStorage(path);
+  profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCard = profileStorage.creditCards.get(guid);
 
   Assert.equal(creditCard.timesUsed, timesUsed + 1);
   Assert.notEqual(creditCard.timeLastUsed, timeLastUsed);
 
   Assert.throws(() => profileStorage.creditCards.notifyUsed("INVALID_GUID"),
     /No matching record\./);
 });
 
 add_task(async function test_remove() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
   await prepareTestCreditCards(path);
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   let creditCards = profileStorage.creditCards.getAll();
   let guid = creditCards[1].guid;
 
   let onChanged = TestUtils.topicObserved(
     "formautofill-storage-changed",
     (subject, data) =>
@@ -438,17 +438,17 @@ add_task(async function test_remove() {
   );
 
   Assert.equal(creditCards.length, 2);
 
   profileStorage.creditCards.remove(guid);
   await onChanged;
   await profileStorage._saveImmediately();
 
-  profileStorage = new ProfileStorage(path);
+  profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   creditCards = profileStorage.creditCards.getAll();
 
   Assert.equal(creditCards.length, 1);
 
   Assert.equal(profileStorage.creditCards.get(guid), null);
 });
--- a/browser/extensions/formautofill/test/unit/test_getRecords.js
+++ b/browser/extensions/formautofill/test/unit/test_getRecords.js
@@ -1,17 +1,17 @@
 /*
  * Test for make sure getRecords can retrieve right collection from storage.
  */
 
 "use strict";
 
 let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
 ChromeUtils.import("resource://formautofill/MasterPassword.jsm");
-ChromeUtils.import("resource://formautofill/ProfileStorage.jsm");
+ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
 
 const TEST_ADDRESS_1 = {
   "given-name": "Timothy",
   "additional-name": "John",
   "family-name": "Berners-Lee",
   organization: "World Wide Web Consortium",
   "street-address": "32 Vassar Street\nMIT Room 32-G524",
   "address-level2": "Cambridge",
@@ -257,9 +257,8 @@ add_task(async function test_getRecords_
     }
     let mock = sinon.mock(target);
     mock.expects("sendAsyncMessage").once().withExactArgs("FormAutofill:Records",
                                                           testCase.expectedResult);
     await formAutofillParent._getRecords(testCase.filter, target);
     mock.verify();
   }
 });
-
--- a/browser/extensions/formautofill/test/unit/test_migrateRecords.js
+++ b/browser/extensions/formautofill/test/unit/test_migrateRecords.js
@@ -1,15 +1,15 @@
 /**
  * Tests the migration algorithm in profileStorage.
  */
 
 "use strict";
 
-const {ProfileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+const {FormAutofillStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
 
 const TEST_STORE_FILE_NAME = "test-profile.json";
 
 const ADDRESS_SCHEMA_VERSION = 1;
 const CREDIT_CARD_SCHEMA_VERSION = 1;
 
 const ADDRESS_TESTCASES = [
   {
@@ -234,30 +234,30 @@ let do_check_record_matches = (expectedR
   for (let key in expectedRecord) {
     Assert.equal(expectedRecord[key], record[key]);
   }
 };
 
 add_task(async function test_migrateAddressRecords() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   ADDRESS_TESTCASES.forEach(testcase => {
     info(testcase.description);
     profileStorage.addresses._migrateRecord(testcase.record);
     do_check_record_matches(testcase.expectedResult, testcase.record);
   });
 });
 
 add_task(async function test_migrateCreditCardRecords() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   CREDIT_CARD_TESTCASES.forEach(testcase => {
     info(testcase.description);
     profileStorage.creditCards._migrateRecord(testcase.record);
     do_check_record_matches(testcase.expectedResult, testcase.record);
   });
 });
--- a/browser/extensions/formautofill/test/unit/test_savedFieldNames.js
+++ b/browser/extensions/formautofill/test/unit/test_savedFieldNames.js
@@ -1,16 +1,16 @@
 /*
  * Test for keeping the valid fields information in initialProcessData.
  */
 
 "use strict";
 
 let {FormAutofillParent} = ChromeUtils.import("resource://formautofill/FormAutofillParent.jsm", {});
-ChromeUtils.import("resource://formautofill/ProfileStorage.jsm");
+ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm");
 
 add_task(async function test_profileSavedFieldNames_init() {
   let formAutofillParent = new FormAutofillParent();
   sinon.stub(formAutofillParent, "_updateSavedFieldNames");
 
   await formAutofillParent.init();
   await formAutofillParent.profileStorage.initialize();
   Assert.equal(formAutofillParent._updateSavedFieldNames.called, true);
--- a/browser/extensions/formautofill/test/unit/test_storage_syncfields.js
+++ b/browser/extensions/formautofill/test/unit/test_storage_syncfields.js
@@ -1,10 +1,10 @@
 /**
- * Tests ProfileStorage objects support for sync related fields.
+ * Tests FormAutofillStorage objects support for sync related fields.
  */
 
 "use strict";
 
 // The duplication of some of these fixtures between tests is unfortunate.
 const TEST_STORE_FILE_NAME = "test-profile.json";
 
 const TEST_ADDRESS_1 = {
--- a/browser/extensions/formautofill/test/unit/test_storage_tombstones.js
+++ b/browser/extensions/formautofill/test/unit/test_storage_tombstones.js
@@ -1,15 +1,15 @@
 /**
  * Tests tombstones in address/creditcard records.
  */
 
 "use strict";
 
-const {ProfileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+const {FormAutofillStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
 
 const TEST_STORE_FILE_NAME = "test-tombstones.json";
 
 const TEST_ADDRESS_1 = {
   "given-name": "Timothy",
   "additional-name": "John",
   "family-name": "Berners-Lee",
   organization: "World Wide Web Consortium",
@@ -34,17 +34,17 @@ let do_check_tombstone_record = (profile
   Assert.deepEqual(Object.keys(profile).sort(),
                    ["guid", "timeLastModified", "deleted"].sort());
 };
 
 // Like add_task, but actually adds 2 - one for addresses and one for cards.
 function add_storage_task(test_function) {
   add_task(async function() {
     let path = getTempFile(TEST_STORE_FILE_NAME).path;
-    let profileStorage = new ProfileStorage(path);
+    let profileStorage = new FormAutofillStorage(path);
     let testCC1 = Object.assign({}, TEST_CC_1);
     await profileStorage.initialize();
 
     for (let [storage, record] of [[profileStorage.addresses, TEST_ADDRESS_1],
                                    [profileStorage.creditCards, testCC1]]) {
       await test_function(storage, record);
     }
   });
--- a/browser/extensions/formautofill/test/unit/test_transformFields.js
+++ b/browser/extensions/formautofill/test/unit/test_transformFields.js
@@ -1,15 +1,15 @@
 /**
  * Tests the transform algorithm in profileStorage.
  */
 
 "use strict";
 
-const {ProfileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
+const {FormAutofillStorage} = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {});
 
 const TEST_STORE_FILE_NAME = "test-profile.json";
 
 const ADDRESS_COMPUTE_TESTCASES = [
   // Name
   {
     description: "Has split names",
     address: {
@@ -836,68 +836,68 @@ let do_check_record_matches = (expectedR
   for (let key in expectedRecord) {
     Assert.equal(expectedRecord[key], record[key]);
   }
 };
 
 add_task(async function test_computeAddressFields() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   ADDRESS_COMPUTE_TESTCASES.forEach(testcase => {
     info("Verify testcase: " + testcase.description);
 
     let guid = profileStorage.addresses.add(testcase.address);
     let address = profileStorage.addresses.get(guid);
     do_check_record_matches(testcase.expectedResult, address);
 
     profileStorage.addresses.remove(guid);
   });
 });
 
 add_task(async function test_normalizeAddressFields() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   ADDRESS_NORMALIZE_TESTCASES.forEach(testcase => {
     info("Verify testcase: " + testcase.description);
 
     let guid = profileStorage.addresses.add(testcase.address);
     let address = profileStorage.addresses.get(guid);
     do_check_record_matches(testcase.expectedResult, address);
 
     profileStorage.addresses.remove(guid);
   });
 });
 
 add_task(async function test_computeCreditCardFields() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   CREDIT_CARD_COMPUTE_TESTCASES.forEach(testcase => {
     info("Verify testcase: " + testcase.description);
 
     let guid = profileStorage.creditCards.add(testcase.creditCard);
     let creditCard = profileStorage.creditCards.get(guid);
     do_check_record_matches(testcase.expectedResult, creditCard);
 
     profileStorage.creditCards.remove(guid);
   });
 });
 
 add_task(async function test_normalizeCreditCardFields() {
   let path = getTempFile(TEST_STORE_FILE_NAME).path;
 
-  let profileStorage = new ProfileStorage(path);
+  let profileStorage = new FormAutofillStorage(path);
   await profileStorage.initialize();
 
   CREDIT_CARD_NORMALIZE_TESTCASES.forEach(testcase => {
     info("Verify testcase: " + testcase.description);
 
     let guid = profileStorage.creditCards.add(testcase.creditCard);
     let creditCard = profileStorage.creditCards.get(guid, {rawData: true});
     do_check_record_matches(testcase.expectedResult, creditCard);
--- a/toolkit/components/payments/content/paymentDialog.js
+++ b/toolkit/components/payments/content/paymentDialog.js
@@ -14,18 +14,18 @@ const paymentSrv = Cc["@mozilla.org/dom/
                      .getService(Ci.nsIPaymentRequestService);
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "profileStorage", () => {
   let profileStorage;
   try {
-    profileStorage = ChromeUtils.import(
-      "resource://formautofill/ProfileStorage.jsm", {}).profileStorage;
+    profileStorage = ChromeUtils.import("resource://formautofill/FormAutofillStorage.jsm", {})
+                                .profileStorage;
     profileStorage.initialize();
   } catch (ex) {
     profileStorage = null;
     Cu.reportError(ex);
   }
 
   return profileStorage;
 });
--- a/toolkit/components/payments/res/components/address-option.js
+++ b/toolkit/components/payments/res/components/address-option.js
@@ -10,17 +10,17 @@
  *                  email="foo@example.com"
  *                  country="USA"
  *                  name="Jared Wein"
  *                  postal-code="90210"
  *                  street-address="1234 Anywhere St"
  *                  tel="+1 650 555-5555"></address-option>
  * </rich-select>
  *
- * Attribute names follow ProfileStorage.jsm.
+ * Attribute names follow FormAutofillStorage.jsm.
  */
 
 /* global ObservedPropertiesMixin, RichOption */
 
 class AddressOption extends ObservedPropertiesMixin(RichOption) {
   static get observedAttributes() {
     return RichOption.observedAttributes.concat([
       "address-level1",
--- a/toolkit/components/payments/test/browser/head.js
+++ b/toolkit/components/payments/test/browser/head.js
@@ -12,17 +12,17 @@
 const BLANK_PAGE_PATH = "/browser/toolkit/components/payments/test/browser/blank_page.html";
 const BLANK_PAGE_URL = "https://example.com" + BLANK_PAGE_PATH;
 
 const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"]
                      .getService(Ci.nsIPaymentRequestService);
 const paymentUISrv = Cc["@mozilla.org/dom/payments/payment-ui-service;1"]
                      .getService().wrappedJSObject;
 const {profileStorage} = ChromeUtils.import(
-  "resource://formautofill/ProfileStorage.jsm", {});
+  "resource://formautofill/FormAutofillStorage.jsm", {});
 const {PaymentTestUtils: PTU} = ChromeUtils.import(
   "resource://testing-common/PaymentTestUtils.jsm", {});
 
 function getPaymentRequests() {
   let requestsEnum = paymentSrv.enumerate();
   let requests = [];
   while (requestsEnum.hasMoreElements()) {
     requests.push(requestsEnum.getNext().QueryInterface(Ci.nsIPaymentRequest));
--- a/tools/lint/eslint/modules.json
+++ b/tools/lint/eslint/modules.json
@@ -153,17 +153,17 @@
   "PdfJsNetwork.jsm": ["NetworkManager"],
   "PhoneNumberMetaData.jsm": ["PHONE_NUMBER_META_DATA"],
   "PlacesUtils.jsm": ["PlacesUtils"],
   "PluginProvider.jsm": [],
   "PointerAdapter.jsm": ["PointerRelay", "PointerAdapter"],
   "policies.js": ["ErrorHandler", "SyncScheduler"],
   "prefs.js": ["PrefsEngine", "PrefRec"],
   "prefs.jsm": ["Preference"],
-  "ProfileStorage.jsm": ["profileStorage"],
+  "FormAutofillStorage.jsm": ["profileStorage"],
   "PromiseWorker.jsm": ["BasePromiseWorker"],
   "PushCrypto.jsm": ["PushCrypto", "concatArray"],
   "quit.js": ["goQuitApplication"],
   "Readability.js": ["Readability"],
   "record.js": ["WBORecord", "RecordManager", "CryptoWrapper", "CollectionKeyManager", "Collection"],
   "recursive_importA.jsm": ["foo", "bar"],
   "recursive_importB.jsm": ["baz", "qux"],
   "reflect.jsm": ["Reflect"],