mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
0b02d21584
--HG-- rename : toolkit/components/alerts/src/mac/Makefile.in => toolkit/components/alerts/mac/Makefile.in rename : toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.c => toolkit/components/alerts/mac/growl/CFGrowlAdditions.c rename : toolkit/components/alerts/src/mac/growl/CFGrowlAdditions.h => toolkit/components/alerts/mac/growl/CFGrowlAdditions.h rename : toolkit/components/alerts/src/mac/growl/CFGrowlDefines.h => toolkit/components/alerts/mac/growl/CFGrowlDefines.h rename : toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.c => toolkit/components/alerts/mac/growl/CFMutableDictionaryAdditions.c rename : toolkit/components/alerts/src/mac/growl/CFMutableDictionaryAdditions.h => toolkit/components/alerts/mac/growl/CFMutableDictionaryAdditions.h rename : toolkit/components/alerts/src/mac/growl/CFURLAdditions.c => toolkit/components/alerts/mac/growl/CFURLAdditions.c rename : toolkit/components/alerts/src/mac/growl/CFURLAdditions.h => toolkit/components/alerts/mac/growl/CFURLAdditions.h rename : toolkit/components/alerts/src/mac/growl/GrowlAbstractSingletonObject.h => toolkit/components/alerts/mac/growl/GrowlAbstractSingletonObject.h rename : toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.h => toolkit/components/alerts/mac/growl/GrowlApplicationBridge.h rename : toolkit/components/alerts/src/mac/growl/GrowlApplicationBridge.m => toolkit/components/alerts/mac/growl/GrowlApplicationBridge.m rename : toolkit/components/alerts/src/mac/growl/GrowlDefines.h => toolkit/components/alerts/mac/growl/GrowlDefines.h rename : toolkit/components/alerts/src/mac/growl/GrowlDefinesInternal.h => toolkit/components/alerts/mac/growl/GrowlDefinesInternal.h rename : toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.h => toolkit/components/alerts/mac/growl/GrowlPathUtilities.h rename : toolkit/components/alerts/src/mac/growl/GrowlPathUtilities.m => toolkit/components/alerts/mac/growl/GrowlPathUtilities.m rename : toolkit/components/alerts/src/mac/growl/GrowlPathway.h => toolkit/components/alerts/mac/growl/GrowlPathway.h rename : toolkit/components/alerts/src/mac/growl/GrowlPreferencesController.h => toolkit/components/alerts/mac/growl/GrowlPreferencesController.h rename : toolkit/components/alerts/src/mac/growl/GrowlTicketController.h => toolkit/components/alerts/mac/growl/GrowlTicketController.h rename : toolkit/components/alerts/src/mac/growl/Makefile.in => toolkit/components/alerts/mac/growl/Makefile.in rename : toolkit/components/alerts/src/mac/growl/license.txt => toolkit/components/alerts/mac/growl/license.txt rename : toolkit/components/alerts/src/mac/mozGrowlDelegate.h => toolkit/components/alerts/mac/mozGrowlDelegate.h rename : toolkit/components/alerts/src/mac/mozGrowlDelegate.mm => toolkit/components/alerts/mac/mozGrowlDelegate.mm rename : toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.h => toolkit/components/alerts/mac/nsAlertsImageLoadListener.h rename : toolkit/components/alerts/src/mac/nsAlertsImageLoadListener.mm => toolkit/components/alerts/mac/nsAlertsImageLoadListener.mm rename : toolkit/components/alerts/src/mac/nsAlertsService.h => toolkit/components/alerts/mac/nsAlertsService.h rename : toolkit/components/alerts/src/mac/nsAlertsService.mm => toolkit/components/alerts/mac/nsAlertsService.mm rename : toolkit/components/alerts/src/mac/nsAlertsServiceModule.cpp => toolkit/components/alerts/mac/nsAlertsServiceModule.cpp rename : toolkit/components/alerts/src/mac/nsNotificationsList.h => toolkit/components/alerts/mac/nsNotificationsList.h rename : toolkit/components/alerts/src/mac/nsNotificationsList.mm => toolkit/components/alerts/mac/nsNotificationsList.mm rename : toolkit/components/alerts/src/nsAlertsService.cpp => toolkit/components/alerts/nsAlertsService.cpp rename : toolkit/components/alerts/src/nsAlertsService.h => toolkit/components/alerts/nsAlertsService.h rename : toolkit/components/alerts/public/nsIAlertsService.idl => toolkit/components/alerts/nsIAlertsService.idl rename : toolkit/components/alerts/public/nsINotificationsList.idl => toolkit/components/alerts/nsINotificationsList.idl rename : toolkit/components/autocomplete/src/nsAutoCompleteController.cpp => toolkit/components/autocomplete/nsAutoCompleteController.cpp rename : toolkit/components/autocomplete/src/nsAutoCompleteController.h => toolkit/components/autocomplete/nsAutoCompleteController.h rename : toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.cpp => toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp rename : toolkit/components/autocomplete/src/nsAutoCompleteSimpleResult.h => toolkit/components/autocomplete/nsAutoCompleteSimpleResult.h rename : toolkit/components/autocomplete/public/nsIAutoCompleteController.idl => toolkit/components/autocomplete/nsIAutoCompleteController.idl rename : toolkit/components/autocomplete/public/nsIAutoCompleteInput.idl => toolkit/components/autocomplete/nsIAutoCompleteInput.idl rename : toolkit/components/autocomplete/public/nsIAutoCompletePopup.idl => toolkit/components/autocomplete/nsIAutoCompletePopup.idl rename : toolkit/components/autocomplete/public/nsIAutoCompleteResult.idl => toolkit/components/autocomplete/nsIAutoCompleteResult.idl rename : toolkit/components/autocomplete/public/nsIAutoCompleteSearch.idl => toolkit/components/autocomplete/nsIAutoCompleteSearch.idl rename : toolkit/components/autocomplete/public/nsIAutoCompleteSimpleResult.idl => toolkit/components/autocomplete/nsIAutoCompleteSimpleResult.idl rename : toolkit/components/commandlines/src/nsCommandLine.cpp => toolkit/components/commandlines/nsCommandLine.cpp rename : toolkit/components/commandlines/public/nsICommandLine.idl => toolkit/components/commandlines/nsICommandLine.idl rename : toolkit/components/commandlines/public/nsICommandLineHandler.idl => toolkit/components/commandlines/nsICommandLineHandler.idl rename : toolkit/components/commandlines/public/nsICommandLineRunner.idl => toolkit/components/commandlines/nsICommandLineRunner.idl rename : toolkit/components/commandlines/public/nsICommandLineValidator.idl => toolkit/components/commandlines/nsICommandLineValidator.idl rename : toolkit/components/contentprefs/src/nsContentPrefService.js => toolkit/components/contentprefs/nsContentPrefService.js rename : toolkit/components/contentprefs/src/nsContentPrefService.manifest => toolkit/components/contentprefs/nsContentPrefService.manifest rename : toolkit/components/downloads/src/nsDownloadManager.cpp => toolkit/components/downloads/nsDownloadManager.cpp rename : toolkit/components/downloads/src/nsDownloadManager.h => toolkit/components/downloads/nsDownloadManager.h rename : toolkit/components/downloads/src/nsDownloadManagerUI.js => toolkit/components/downloads/nsDownloadManagerUI.js rename : toolkit/components/downloads/src/nsDownloadManagerUI.manifest => toolkit/components/downloads/nsDownloadManagerUI.manifest rename : toolkit/components/downloads/src/nsDownloadProxy.h => toolkit/components/downloads/nsDownloadProxy.h rename : toolkit/components/downloads/src/nsDownloadScanner.cpp => toolkit/components/downloads/nsDownloadScanner.cpp rename : toolkit/components/downloads/src/nsDownloadScanner.h => toolkit/components/downloads/nsDownloadScanner.h rename : toolkit/components/downloads/public/nsIDownload.idl => toolkit/components/downloads/nsIDownload.idl rename : toolkit/components/downloads/public/nsIDownloadManager.idl => toolkit/components/downloads/nsIDownloadManager.idl rename : toolkit/components/downloads/public/nsIDownloadManagerUI.idl => toolkit/components/downloads/nsIDownloadManagerUI.idl rename : toolkit/components/downloads/public/nsIDownloadProgressListener.idl => toolkit/components/downloads/nsIDownloadProgressListener.idl rename : toolkit/components/feeds/src/FeedProcessor.js => toolkit/components/feeds/FeedProcessor.js rename : toolkit/components/feeds/src/FeedProcessor.manifest => toolkit/components/feeds/FeedProcessor.manifest rename : toolkit/components/feeds/public/nsIFeed.idl => toolkit/components/feeds/nsIFeed.idl rename : toolkit/components/feeds/public/nsIFeedContainer.idl => toolkit/components/feeds/nsIFeedContainer.idl rename : toolkit/components/feeds/public/nsIFeedElementBase.idl => toolkit/components/feeds/nsIFeedElementBase.idl rename : toolkit/components/feeds/public/nsIFeedEntry.idl => toolkit/components/feeds/nsIFeedEntry.idl rename : toolkit/components/feeds/public/nsIFeedGenerator.idl => toolkit/components/feeds/nsIFeedGenerator.idl rename : toolkit/components/feeds/public/nsIFeedListener.idl => toolkit/components/feeds/nsIFeedListener.idl rename : toolkit/components/feeds/public/nsIFeedPerson.idl => toolkit/components/feeds/nsIFeedPerson.idl rename : toolkit/components/feeds/public/nsIFeedProcessor.idl => toolkit/components/feeds/nsIFeedProcessor.idl rename : toolkit/components/feeds/public/nsIFeedResult.idl => toolkit/components/feeds/nsIFeedResult.idl rename : toolkit/components/feeds/public/nsIFeedTextConstruct.idl => toolkit/components/feeds/nsIFeedTextConstruct.idl rename : toolkit/components/feeds/public/nsIScriptableUnescapeHTML.idl => toolkit/components/feeds/nsIScriptableUnescapeHTML.idl rename : toolkit/components/feeds/src/nsScriptableUnescapeHTML.cpp => toolkit/components/feeds/nsScriptableUnescapeHTML.cpp rename : toolkit/components/feeds/src/nsScriptableUnescapeHTML.h => toolkit/components/feeds/nsScriptableUnescapeHTML.h rename : toolkit/components/filepicker/src/nsFilePicker.js => toolkit/components/filepicker/nsFilePicker.js rename : toolkit/components/filepicker/src/nsFilePicker.manifest => toolkit/components/filepicker/nsFilePicker.manifest rename : toolkit/components/filepicker/src/nsFileView.cpp => toolkit/components/filepicker/nsFileView.cpp rename : toolkit/components/filepicker/public/nsIFileView.idl => toolkit/components/filepicker/nsIFileView.idl rename : toolkit/components/find/src/nsFindService.cpp => toolkit/components/find/nsFindService.cpp rename : toolkit/components/find/src/nsFindService.h => toolkit/components/find/nsFindService.h rename : toolkit/components/find/public/nsIFindService.idl => toolkit/components/find/nsIFindService.idl rename : toolkit/components/microformats/src/Microformats.js => toolkit/components/microformats/Microformats.js rename : toolkit/components/parentalcontrols/public/nsIParentalControlsService.idl => toolkit/components/parentalcontrols/nsIParentalControlsService.idl rename : toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.cpp => toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp rename : toolkit/components/parentalcontrols/src/nsParentalControlsServiceWin.h => toolkit/components/parentalcontrols/nsParentalControlsServiceWin.h rename : toolkit/components/passwordmgr/src/crypto-SDR.js => toolkit/components/passwordmgr/crypto-SDR.js rename : toolkit/components/passwordmgr/public/nsILoginInfo.idl => toolkit/components/passwordmgr/nsILoginInfo.idl rename : toolkit/components/passwordmgr/public/nsILoginManager.idl => toolkit/components/passwordmgr/nsILoginManager.idl rename : toolkit/components/passwordmgr/public/nsILoginManagerCrypto.idl => toolkit/components/passwordmgr/nsILoginManagerCrypto.idl rename : toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl => toolkit/components/passwordmgr/nsILoginManagerIEMigrationHelper.idl rename : toolkit/components/passwordmgr/public/nsILoginManagerPrompter.idl => toolkit/components/passwordmgr/nsILoginManagerPrompter.idl rename : toolkit/components/passwordmgr/public/nsILoginManagerStorage.idl => toolkit/components/passwordmgr/nsILoginManagerStorage.idl rename : toolkit/components/passwordmgr/public/nsILoginMetaInfo.idl => toolkit/components/passwordmgr/nsILoginMetaInfo.idl rename : toolkit/components/passwordmgr/src/nsLoginInfo.js => toolkit/components/passwordmgr/nsLoginInfo.js rename : toolkit/components/passwordmgr/src/nsLoginManager.js => toolkit/components/passwordmgr/nsLoginManager.js rename : toolkit/components/passwordmgr/src/nsLoginManagerPrompter.js => toolkit/components/passwordmgr/nsLoginManagerPrompter.js rename : toolkit/components/passwordmgr/src/passwordmgr.manifest => toolkit/components/passwordmgr/passwordmgr.manifest rename : toolkit/components/passwordmgr/src/storage-Legacy.js => toolkit/components/passwordmgr/storage-Legacy.js rename : toolkit/components/passwordmgr/src/storage-mozStorage.js => toolkit/components/passwordmgr/storage-mozStorage.js rename : toolkit/components/places/src/AsyncFaviconHelpers.cpp => toolkit/components/places/AsyncFaviconHelpers.cpp rename : toolkit/components/places/src/AsyncFaviconHelpers.h => toolkit/components/places/AsyncFaviconHelpers.h rename : toolkit/components/places/src/Helpers.cpp => toolkit/components/places/Helpers.cpp rename : toolkit/components/places/src/Helpers.h => toolkit/components/places/Helpers.h rename : toolkit/components/places/src/History.cpp => toolkit/components/places/History.cpp rename : toolkit/components/places/src/History.h => toolkit/components/places/History.h rename : toolkit/components/places/src/PlaceInfo.cpp => toolkit/components/places/PlaceInfo.cpp rename : toolkit/components/places/src/PlaceInfo.h => toolkit/components/places/PlaceInfo.h rename : toolkit/components/places/src/PlacesCategoriesStarter.js => toolkit/components/places/PlacesCategoriesStarter.js rename : toolkit/components/places/src/PlacesDBUtils.jsm => toolkit/components/places/PlacesDBUtils.jsm rename : toolkit/components/places/src/PlacesUtils.jsm => toolkit/components/places/PlacesUtils.jsm rename : toolkit/components/places/src/SQLFunctions.cpp => toolkit/components/places/SQLFunctions.cpp rename : toolkit/components/places/src/SQLFunctions.h => toolkit/components/places/SQLFunctions.h rename : toolkit/components/places/src/VisitInfo.cpp => toolkit/components/places/VisitInfo.cpp rename : toolkit/components/places/src/VisitInfo.h => toolkit/components/places/VisitInfo.h rename : toolkit/components/places/public/mozIAsyncHistory.idl => toolkit/components/places/mozIAsyncHistory.idl rename : toolkit/components/places/public/mozIPlacesAutoComplete.idl => toolkit/components/places/mozIPlacesAutoComplete.idl rename : toolkit/components/places/src/nsAnnoProtocolHandler.cpp => toolkit/components/places/nsAnnoProtocolHandler.cpp rename : toolkit/components/places/src/nsAnnoProtocolHandler.h => toolkit/components/places/nsAnnoProtocolHandler.h rename : toolkit/components/places/src/nsAnnotationService.cpp => toolkit/components/places/nsAnnotationService.cpp rename : toolkit/components/places/src/nsAnnotationService.h => toolkit/components/places/nsAnnotationService.h rename : toolkit/components/places/src/nsFaviconService.cpp => toolkit/components/places/nsFaviconService.cpp rename : toolkit/components/places/src/nsFaviconService.h => toolkit/components/places/nsFaviconService.h rename : toolkit/components/places/public/nsIAnnotationService.idl => toolkit/components/places/nsIAnnotationService.idl rename : toolkit/components/places/public/nsIBrowserHistory.idl => toolkit/components/places/nsIBrowserHistory.idl rename : toolkit/components/places/public/nsIDynamicContainer.idl => toolkit/components/places/nsIDynamicContainer.idl rename : toolkit/components/places/public/nsIFaviconService.idl => toolkit/components/places/nsIFaviconService.idl rename : toolkit/components/places/public/nsILivemarkService.idl => toolkit/components/places/nsILivemarkService.idl rename : toolkit/components/places/public/nsIMicrosummaryService.idl => toolkit/components/places/nsIMicrosummaryService.idl rename : toolkit/components/places/public/nsINavBookmarksService.idl => toolkit/components/places/nsINavBookmarksService.idl rename : toolkit/components/places/public/nsINavHistoryService.idl => toolkit/components/places/nsINavHistoryService.idl rename : toolkit/components/places/public/nsIPlacesImportExportService.idl => toolkit/components/places/nsIPlacesImportExportService.idl rename : toolkit/components/places/public/nsITaggingService.idl => toolkit/components/places/nsITaggingService.idl rename : toolkit/components/places/src/nsLivemarkService.js => toolkit/components/places/nsLivemarkService.js rename : toolkit/components/places/src/nsMaybeWeakPtr.cpp => toolkit/components/places/nsMaybeWeakPtr.cpp rename : toolkit/components/places/src/nsMaybeWeakPtr.h => toolkit/components/places/nsMaybeWeakPtr.h rename : toolkit/components/places/src/nsMicrosummaryService.js => toolkit/components/places/nsMicrosummaryService.js rename : toolkit/components/places/src/nsMorkHistoryImporter.cpp => toolkit/components/places/nsMorkHistoryImporter.cpp rename : toolkit/components/places/src/nsNavBookmarks.cpp => toolkit/components/places/nsNavBookmarks.cpp rename : toolkit/components/places/src/nsNavBookmarks.h => toolkit/components/places/nsNavBookmarks.h rename : toolkit/components/places/src/nsNavHistory.cpp => toolkit/components/places/nsNavHistory.cpp rename : toolkit/components/places/src/nsNavHistory.h => toolkit/components/places/nsNavHistory.h rename : toolkit/components/places/src/nsNavHistoryQuery.cpp => toolkit/components/places/nsNavHistoryQuery.cpp rename : toolkit/components/places/src/nsNavHistoryQuery.h => toolkit/components/places/nsNavHistoryQuery.h rename : toolkit/components/places/src/nsNavHistoryResult.cpp => toolkit/components/places/nsNavHistoryResult.cpp rename : toolkit/components/places/src/nsNavHistoryResult.h => toolkit/components/places/nsNavHistoryResult.h rename : toolkit/components/places/public/nsPIPlacesDatabase.idl => toolkit/components/places/nsPIPlacesDatabase.idl rename : toolkit/components/places/public/nsPIPlacesHistoryListenersNotifier.idl => toolkit/components/places/nsPIPlacesHistoryListenersNotifier.idl rename : toolkit/components/places/src/nsPlacesAutoComplete.js => toolkit/components/places/nsPlacesAutoComplete.js rename : toolkit/components/places/src/nsPlacesAutoComplete.manifest => toolkit/components/places/nsPlacesAutoComplete.manifest rename : toolkit/components/places/src/nsPlacesExpiration.js => toolkit/components/places/nsPlacesExpiration.js rename : toolkit/components/places/src/nsPlacesImportExportService.cpp => toolkit/components/places/nsPlacesImportExportService.cpp rename : toolkit/components/places/src/nsPlacesImportExportService.h => toolkit/components/places/nsPlacesImportExportService.h rename : toolkit/components/places/src/nsPlacesIndexes.h => toolkit/components/places/nsPlacesIndexes.h rename : toolkit/components/places/src/nsPlacesMacros.h => toolkit/components/places/nsPlacesMacros.h rename : toolkit/components/places/src/nsPlacesModule.cpp => toolkit/components/places/nsPlacesModule.cpp rename : toolkit/components/places/src/nsPlacesTables.h => toolkit/components/places/nsPlacesTables.h rename : toolkit/components/places/src/nsPlacesTriggers.h => toolkit/components/places/nsPlacesTriggers.h rename : toolkit/components/places/src/nsTaggingService.js => toolkit/components/places/nsTaggingService.js rename : toolkit/components/places/src/toolkitplaces.manifest => toolkit/components/places/toolkitplaces.manifest rename : toolkit/components/places/src/utils.js => toolkit/components/places/utils.js rename : toolkit/components/satchel/src/formSubmitListener.js => toolkit/components/satchel/formSubmitListener.js rename : toolkit/components/satchel/src/nsFormAutoComplete.js => toolkit/components/satchel/nsFormAutoComplete.js rename : toolkit/components/satchel/src/nsFormAutoCompleteResult.jsm => toolkit/components/satchel/nsFormAutoCompleteResult.jsm rename : toolkit/components/satchel/src/nsFormFillController.cpp => toolkit/components/satchel/nsFormFillController.cpp rename : toolkit/components/satchel/src/nsFormFillController.h => toolkit/components/satchel/nsFormFillController.h rename : toolkit/components/satchel/src/nsFormHistory.js => toolkit/components/satchel/nsFormHistory.js rename : toolkit/components/satchel/public/nsIFormAutoComplete.idl => toolkit/components/satchel/nsIFormAutoComplete.idl rename : toolkit/components/satchel/public/nsIFormFillController.idl => toolkit/components/satchel/nsIFormFillController.idl rename : toolkit/components/satchel/public/nsIFormHistory.idl => toolkit/components/satchel/nsIFormHistory.idl rename : toolkit/components/satchel/public/nsIInputListAutoComplete.idl => toolkit/components/satchel/nsIInputListAutoComplete.idl rename : toolkit/components/satchel/src/nsInputListAutoComplete.js => toolkit/components/satchel/nsInputListAutoComplete.js rename : toolkit/components/satchel/src/satchel.manifest => toolkit/components/satchel/satchel.manifest rename : toolkit/components/startup/src/nsAppStartup.cpp => toolkit/components/startup/nsAppStartup.cpp rename : toolkit/components/startup/src/nsAppStartup.h => toolkit/components/startup/nsAppStartup.h rename : toolkit/components/startup/src/nsTryToClose.js => toolkit/components/startup/nsTryToClose.js rename : toolkit/components/startup/src/nsTryToClose.manifest => toolkit/components/startup/nsTryToClose.manifest rename : toolkit/components/startup/src/nsUserInfo.h => toolkit/components/startup/nsUserInfo.h rename : toolkit/components/startup/src/nsUserInfoMac.h => toolkit/components/startup/nsUserInfoMac.h rename : toolkit/components/startup/src/nsUserInfoMac.mm => toolkit/components/startup/nsUserInfoMac.mm rename : toolkit/components/startup/src/nsUserInfoOS2.cpp => toolkit/components/startup/nsUserInfoOS2.cpp rename : toolkit/components/startup/src/nsUserInfoUnix.cpp => toolkit/components/startup/nsUserInfoUnix.cpp rename : toolkit/components/startup/src/nsUserInfoWin.cpp => toolkit/components/startup/nsUserInfoWin.cpp rename : toolkit/components/typeaheadfind/public/nsITypeAheadFind.idl => toolkit/components/typeaheadfind/nsITypeAheadFind.idl rename : toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp => toolkit/components/typeaheadfind/nsTypeAheadFind.cpp rename : toolkit/components/typeaheadfind/src/nsTypeAheadFind.h => toolkit/components/typeaheadfind/nsTypeAheadFind.h rename : toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl => toolkit/components/url-classifier/nsIUrlClassifierDBService.idl rename : toolkit/components/url-classifier/public/nsIUrlClassifierHashCompleter.idl => toolkit/components/url-classifier/nsIUrlClassifierHashCompleter.idl rename : toolkit/components/url-classifier/public/nsIUrlClassifierStreamUpdater.idl => toolkit/components/url-classifier/nsIUrlClassifierStreamUpdater.idl rename : toolkit/components/url-classifier/public/nsIUrlClassifierTable.idl => toolkit/components/url-classifier/nsIUrlClassifierTable.idl rename : toolkit/components/url-classifier/public/nsIUrlClassifierUtils.idl => toolkit/components/url-classifier/nsIUrlClassifierUtils.idl rename : toolkit/components/url-classifier/public/nsIUrlListManager.idl => toolkit/components/url-classifier/nsIUrlListManager.idl rename : toolkit/components/url-classifier/src/nsURLClassifier.manifest => toolkit/components/url-classifier/nsURLClassifier.manifest rename : toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp => toolkit/components/url-classifier/nsUrlClassifierDBService.cpp rename : toolkit/components/url-classifier/src/nsUrlClassifierDBService.h => toolkit/components/url-classifier/nsUrlClassifierDBService.h rename : toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp => toolkit/components/url-classifier/nsUrlClassifierHashCompleter.cpp rename : toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h => toolkit/components/url-classifier/nsUrlClassifierHashCompleter.h rename : toolkit/components/url-classifier/src/nsUrlClassifierLib.js => toolkit/components/url-classifier/nsUrlClassifierLib.js rename : toolkit/components/url-classifier/src/nsUrlClassifierListManager.js => toolkit/components/url-classifier/nsUrlClassifierListManager.js rename : toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp => toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp rename : toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h => toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h rename : toolkit/components/url-classifier/src/nsUrlClassifierUtils.cpp => toolkit/components/url-classifier/nsUrlClassifierUtils.cpp rename : toolkit/components/url-classifier/src/nsUrlClassifierUtils.h => toolkit/components/url-classifier/nsUrlClassifierUtils.h rename : toolkit/components/urlformatter/public/nsIURLFormatter.idl => toolkit/components/urlformatter/nsIURLFormatter.idl rename : toolkit/components/urlformatter/src/nsURLFormatter.js => toolkit/components/urlformatter/nsURLFormatter.js rename : toolkit/components/urlformatter/src/nsURLFormatter.manifest => toolkit/components/urlformatter/nsURLFormatter.manifest rename : toolkit/profile/public/nsIProfileMigrator.idl => toolkit/profile/nsIProfileMigrator.idl rename : toolkit/profile/public/nsIToolkitProfile.idl => toolkit/profile/nsIToolkitProfile.idl rename : toolkit/profile/public/nsIToolkitProfileService.idl => toolkit/profile/nsIToolkitProfileService.idl rename : toolkit/profile/src/nsToolkitProfileService.cpp => toolkit/profile/nsToolkitProfileService.cpp
851 lines
28 KiB
JavaScript
851 lines
28 KiB
JavaScript
/* ***** BEGIN LICENSE BLOCK *****
|
||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||
*
|
||
* The contents of this file are subject to the Mozilla Public License Version
|
||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||
* the License. You may obtain a copy of the License at
|
||
* http://www.mozilla.org/MPL/
|
||
*
|
||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||
* for the specific language governing rights and limitations under the
|
||
* License.
|
||
*
|
||
* The Original Code is mozilla.org code.
|
||
*
|
||
* The Initial Developer of the Original Code is Mozilla Foundation.
|
||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||
* the Initial Developer. All Rights Reserved.
|
||
*
|
||
* Contributor(s):
|
||
* Justin Dolske <dolske@mozilla.com> (original authors)
|
||
* Paul O’Shannessy <paul@oshannessy.com> (original authors)
|
||
*
|
||
* Alternatively, the contents of this file may be used under the terms of
|
||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||
* of those above. If you wish to allow use of your version of this file only
|
||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||
* use your version of this file under the terms of the MPL, indicate your
|
||
* decision by deleting the provisions above and replace them with the notice
|
||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||
* the provisions above, a recipient may use your version of this file under
|
||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||
*
|
||
* ***** END LICENSE BLOCK ***** */
|
||
|
||
|
||
const Cc = Components.classes;
|
||
const Ci = Components.interfaces;
|
||
const Cr = Components.results;
|
||
|
||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||
|
||
const DB_VERSION = 3;
|
||
const DAY_IN_MS = 86400000; // 1 day in milliseconds
|
||
|
||
function FormHistory() {
|
||
this.init();
|
||
}
|
||
|
||
FormHistory.prototype = {
|
||
classID : Components.ID("{0c1bb408-71a2-403f-854a-3a0659829ded}"),
|
||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormHistory2,
|
||
Ci.nsIObserver,
|
||
Ci.nsIFrameMessageListener,
|
||
]),
|
||
|
||
debug : true,
|
||
enabled : true,
|
||
saveHttpsForms : true,
|
||
|
||
// The current database schema.
|
||
dbSchema : {
|
||
tables : {
|
||
moz_formhistory: {
|
||
"id" : "INTEGER PRIMARY KEY",
|
||
"fieldname" : "TEXT NOT NULL",
|
||
"value" : "TEXT NOT NULL",
|
||
"timesUsed" : "INTEGER",
|
||
"firstUsed" : "INTEGER",
|
||
"lastUsed" : "INTEGER",
|
||
"guid" : "TEXT"
|
||
},
|
||
},
|
||
indices : {
|
||
moz_formhistory_index : {
|
||
table : "moz_formhistory",
|
||
columns : ["fieldname"]
|
||
},
|
||
moz_formhistory_lastused_index : {
|
||
table : "moz_formhistory",
|
||
columns : ["lastUsed"]
|
||
},
|
||
moz_formhistory_guid_index : {
|
||
table : "moz_formhistory",
|
||
columns : ["guid"]
|
||
},
|
||
}
|
||
},
|
||
dbConnection : null, // The database connection
|
||
dbStmts : null, // Database statements for memoization
|
||
dbFile : null,
|
||
|
||
_uuidService: null,
|
||
get uuidService() {
|
||
if (!this._uuidService)
|
||
this._uuidService = Cc["@mozilla.org/uuid-generator;1"].
|
||
getService(Ci.nsIUUIDGenerator);
|
||
return this._uuidService;
|
||
},
|
||
|
||
// Private Browsing Service
|
||
// If the service is not available, null will be returned.
|
||
_privBrowsingSvc : undefined,
|
||
get privBrowsingSvc() {
|
||
if (this._privBrowsingSvc == undefined) {
|
||
if ("@mozilla.org/privatebrowsing;1" in Cc)
|
||
this._privBrowsingSvc = Cc["@mozilla.org/privatebrowsing;1"].
|
||
getService(Ci.nsIPrivateBrowsingService);
|
||
else
|
||
this._privBrowsingSvc = null;
|
||
}
|
||
return this._privBrowsingSvc;
|
||
},
|
||
|
||
|
||
log : function (message) {
|
||
if (!this.debug)
|
||
return;
|
||
dump("FormHistory: " + message + "\n");
|
||
Services.console.logStringMessage("FormHistory: " + message);
|
||
},
|
||
|
||
|
||
init : function() {
|
||
let self = this;
|
||
|
||
Services.prefs.addObserver("browser.formfill.", this, false);
|
||
|
||
this.updatePrefs();
|
||
|
||
this.dbStmts = {};
|
||
|
||
this.messageManager = Cc["@mozilla.org/globalmessagemanager;1"].
|
||
getService(Ci.nsIChromeFrameMessageManager);
|
||
this.messageManager.loadFrameScript("chrome://satchel/content/formSubmitListener.js", true);
|
||
this.messageManager.addMessageListener("FormHistory:FormSubmitEntries", this);
|
||
|
||
// Add observers
|
||
Services.obs.addObserver(function() { self.expireOldEntries() }, "idle-daily", false);
|
||
Services.obs.addObserver(function() { self.expireOldEntries() }, "formhistory-expire-now", false);
|
||
|
||
try {
|
||
this.dbFile = Services.dirsvc.get("ProfD", Ci.nsIFile).clone();
|
||
this.dbFile.append("formhistory.sqlite");
|
||
this.log("Opening database at " + this.dbFile.path);
|
||
|
||
this.dbInit();
|
||
} catch (e) {
|
||
this.log("Initialization failed: " + e);
|
||
// If dbInit fails...
|
||
if (e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
|
||
this.dbCleanup(true);
|
||
this.dbInit();
|
||
} else {
|
||
throw "Initialization failed";
|
||
}
|
||
}
|
||
},
|
||
|
||
|
||
/* ---- message listener ---- */
|
||
|
||
|
||
receiveMessage: function receiveMessage(message) {
|
||
// Open a transaction so multiple adds happen in one commit
|
||
this.dbConnection.beginTransaction();
|
||
|
||
try {
|
||
let entries = message.json;
|
||
for (let i = 0; i < entries.length; i++) {
|
||
this.addEntry(entries[i].name, entries[i].value);
|
||
}
|
||
} finally {
|
||
// Don't need it to be atomic if there was an error. Commit what
|
||
// we managed to put in the table.
|
||
this.dbConnection.commitTransaction();
|
||
}
|
||
},
|
||
|
||
|
||
/* ---- nsIFormHistory2 interfaces ---- */
|
||
|
||
|
||
get hasEntries() {
|
||
return (this.countAllEntries() > 0);
|
||
},
|
||
|
||
|
||
addEntry : function (name, value) {
|
||
if (!this.enabled ||
|
||
this.privBrowsingSvc && this.privBrowsingSvc.privateBrowsingEnabled)
|
||
return;
|
||
|
||
this.log("addEntry for " + name + "=" + value);
|
||
|
||
let now = Date.now() * 1000; // microseconds
|
||
|
||
let [id, guid] = this.getExistingEntryID(name, value);
|
||
let stmt;
|
||
|
||
if (id != -1) {
|
||
// Update existing entry
|
||
let query = "UPDATE moz_formhistory SET timesUsed = timesUsed + 1, lastUsed = :lastUsed WHERE id = :id";
|
||
let params = {
|
||
lastUsed : now,
|
||
id : id
|
||
};
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
this.sendStringNotification("modifyEntry", name, value, guid);
|
||
} catch (e) {
|
||
this.log("addEntry (modify) failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
} else {
|
||
// Add new entry
|
||
guid = this.generateGUID();
|
||
|
||
let query = "INSERT INTO moz_formhistory (fieldname, value, timesUsed, firstUsed, lastUsed, guid) " +
|
||
"VALUES (:fieldname, :value, :timesUsed, :firstUsed, :lastUsed, :guid)";
|
||
let params = {
|
||
fieldname : name,
|
||
value : value,
|
||
timesUsed : 1,
|
||
firstUsed : now,
|
||
lastUsed : now,
|
||
guid : guid
|
||
};
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
this.sendStringNotification("addEntry", name, value, guid);
|
||
} catch (e) {
|
||
this.log("addEntry (create) failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
}
|
||
},
|
||
|
||
|
||
removeEntry : function (name, value) {
|
||
this.log("removeEntry for " + name + "=" + value);
|
||
|
||
let [id, guid] = this.getExistingEntryID(name, value);
|
||
this.sendStringNotification("before-removeEntry", name, value, guid);
|
||
|
||
let stmt;
|
||
let query = "DELETE FROM moz_formhistory WHERE id = :id";
|
||
let params = { id : id };
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
this.sendStringNotification("removeEntry", name, value, guid);
|
||
} catch (e) {
|
||
this.log("removeEntry failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
},
|
||
|
||
|
||
removeEntriesForName : function (name) {
|
||
this.log("removeEntriesForName with name=" + name);
|
||
|
||
this.sendStringNotification("before-removeEntriesForName", name);
|
||
|
||
let stmt;
|
||
let query = "DELETE FROM moz_formhistory WHERE fieldname = :fieldname";
|
||
let params = { fieldname : name };
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
this.sendStringNotification("removeEntriesForName", name);
|
||
} catch (e) {
|
||
this.log("removeEntriesForName failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
},
|
||
|
||
|
||
removeAllEntries : function () {
|
||
this.log("removeAllEntries");
|
||
|
||
this.sendNotification("before-removeAllEntries", null);
|
||
|
||
let stmt;
|
||
let query = "DELETE FROM moz_formhistory";
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query);
|
||
stmt.execute();
|
||
this.sendNotification("removeAllEntries", null);
|
||
} catch (e) {
|
||
this.log("removeEntriesForName failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
// privacy cleanup, if there's an old mork formhistory around, just delete it
|
||
let oldFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||
oldFile.append("formhistory.dat");
|
||
if (oldFile.exists())
|
||
oldFile.remove(false);
|
||
},
|
||
|
||
|
||
nameExists : function (name) {
|
||
this.log("nameExists for name=" + name);
|
||
let stmt;
|
||
let query = "SELECT COUNT(1) AS numEntries FROM moz_formhistory WHERE fieldname = :fieldname";
|
||
let params = { fieldname : name };
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.executeStep();
|
||
return (stmt.row.numEntries > 0);
|
||
} catch (e) {
|
||
this.log("nameExists failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
},
|
||
|
||
entryExists : function (name, value) {
|
||
this.log("entryExists for " + name + "=" + value);
|
||
let [id, guid] = this.getExistingEntryID(name, value);
|
||
this.log("entryExists: id=" + id);
|
||
return (id != -1);
|
||
},
|
||
|
||
removeEntriesByTimeframe : function (beginTime, endTime) {
|
||
this.log("removeEntriesByTimeframe for " + beginTime + " to " + endTime);
|
||
|
||
this.sendIntNotification("before-removeEntriesByTimeframe", beginTime, endTime);
|
||
|
||
let stmt;
|
||
let query = "DELETE FROM moz_formhistory WHERE firstUsed >= :beginTime AND firstUsed <= :endTime";
|
||
let params = {
|
||
beginTime : beginTime,
|
||
endTime : endTime
|
||
};
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.executeStep();
|
||
this.sendIntNotification("removeEntriesByTimeframe", beginTime, endTime);
|
||
} catch (e) {
|
||
this.log("removeEntriesByTimeframe failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
},
|
||
|
||
|
||
get DBConnection() {
|
||
return this.dbConnection;
|
||
},
|
||
|
||
|
||
/* ---- nsIObserver interface ---- */
|
||
|
||
|
||
observe : function (subject, topic, data) {
|
||
if (topic == "nsPref:changed")
|
||
this.updatePrefs();
|
||
else
|
||
this.log("Oops! Unexpected notification: " + topic);
|
||
},
|
||
|
||
|
||
/* ---- helpers ---- */
|
||
|
||
|
||
generateGUID : function() {
|
||
// string like: "{f60d9eac-9421-4abc-8491-8e8322b063d4}"
|
||
let uuid = this.uuidService.generateUUID().toString();
|
||
let raw = ""; // A string with the low bytes set to random values
|
||
let bytes = 0;
|
||
for (let i = 1; bytes < 12 ; i+= 2) {
|
||
// Skip dashes
|
||
if (uuid[i] == "-")
|
||
i++;
|
||
let hexVal = parseInt(uuid[i] + uuid[i + 1], 16);
|
||
raw += String.fromCharCode(hexVal);
|
||
bytes++;
|
||
}
|
||
return btoa(raw);
|
||
},
|
||
|
||
|
||
sendStringNotification : function (changeType, str1, str2, str3) {
|
||
function wrapit(str) {
|
||
let wrapper = Cc["@mozilla.org/supports-string;1"].
|
||
createInstance(Ci.nsISupportsString);
|
||
wrapper.data = str;
|
||
return wrapper;
|
||
}
|
||
|
||
let strData;
|
||
if (arguments.length == 2) {
|
||
// Just 1 string, no need to put it in an array
|
||
strData = wrapit(str1);
|
||
} else {
|
||
// 3 strings, put them in an array.
|
||
strData = Cc["@mozilla.org/array;1"].
|
||
createInstance(Ci.nsIMutableArray);
|
||
strData.appendElement(wrapit(str1), false);
|
||
strData.appendElement(wrapit(str2), false);
|
||
strData.appendElement(wrapit(str3), false);
|
||
}
|
||
this.sendNotification(changeType, strData);
|
||
},
|
||
|
||
|
||
sendIntNotification : function (changeType, int1, int2) {
|
||
function wrapit(int) {
|
||
let wrapper = Cc["@mozilla.org/supports-PRInt64;1"].
|
||
createInstance(Ci.nsISupportsPRInt64);
|
||
wrapper.data = int;
|
||
return wrapper;
|
||
}
|
||
|
||
let intData;
|
||
if (arguments.length == 2) {
|
||
// Just 1 int, no need for an array
|
||
intData = wrapit(int1);
|
||
} else {
|
||
// 2 ints, put them in an array.
|
||
intData = Cc["@mozilla.org/array;1"].
|
||
createInstance(Ci.nsIMutableArray);
|
||
intData.appendElement(wrapit(int1), false);
|
||
intData.appendElement(wrapit(int2), false);
|
||
}
|
||
this.sendNotification(changeType, intData);
|
||
},
|
||
|
||
|
||
sendNotification : function (changeType, data) {
|
||
Services.obs.notifyObservers(data, "satchel-storage-changed", changeType);
|
||
},
|
||
|
||
|
||
getExistingEntryID : function (name, value) {
|
||
let id = -1, guid = null;
|
||
let stmt;
|
||
let query = "SELECT id, guid FROM moz_formhistory WHERE fieldname = :fieldname AND value = :value";
|
||
let params = {
|
||
fieldname : name,
|
||
value : value
|
||
};
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
if (stmt.executeStep()) {
|
||
id = stmt.row.id;
|
||
guid = stmt.row.guid;
|
||
}
|
||
} catch (e) {
|
||
this.log("getExistingEntryID failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
return [id, guid];
|
||
},
|
||
|
||
|
||
countAllEntries : function () {
|
||
let query = "SELECT COUNT(1) AS numEntries FROM moz_formhistory";
|
||
|
||
let stmt, numEntries;
|
||
try {
|
||
stmt = this.dbCreateStatement(query, null);
|
||
stmt.executeStep();
|
||
numEntries = stmt.row.numEntries;
|
||
} catch (e) {
|
||
this.log("countAllEntries failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
this.log("countAllEntries: counted entries: " + numEntries);
|
||
return numEntries;
|
||
},
|
||
|
||
|
||
expireOldEntries : function () {
|
||
this.log("expireOldEntries");
|
||
|
||
// Determine how many days of history we're supposed to keep.
|
||
let expireDays = 180;
|
||
try {
|
||
expireDays = Services.prefs.getIntPref("browser.formfill.expire_days");
|
||
} catch (e) { /* ignore */ }
|
||
|
||
let expireTime = Date.now() - expireDays * DAY_IN_MS;
|
||
expireTime *= 1000; // switch to microseconds
|
||
|
||
this.sendIntNotification("before-expireOldEntries", expireTime);
|
||
|
||
let beginningCount = this.countAllEntries();
|
||
|
||
// Purge the form history...
|
||
let stmt;
|
||
let query = "DELETE FROM moz_formhistory WHERE lastUsed <= :expireTime";
|
||
let params = { expireTime : expireTime };
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
} catch (e) {
|
||
this.log("expireOldEntries failed: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
let endingCount = this.countAllEntries();
|
||
|
||
// If we expired a large batch of entries, shrink the DB to reclaim wasted
|
||
// space. This is expected to happen when entries predating timestamps
|
||
// (added in the v.1 schema) expire in mass, 180 days after the DB was
|
||
// upgraded -- entries not used since then expire all at once.
|
||
if (beginningCount - endingCount > 500)
|
||
this.dbConnection.executeSimpleSQL("VACUUM");
|
||
|
||
this.sendIntNotification("expireOldEntries", expireTime);
|
||
},
|
||
|
||
|
||
updatePrefs : function () {
|
||
this.debug = Services.prefs.getBoolPref("browser.formfill.debug");
|
||
this.enabled = Services.prefs.getBoolPref("browser.formfill.enable");
|
||
this.saveHttpsForms = Services.prefs.getBoolPref("browser.formfill.saveHttpsForms");
|
||
},
|
||
|
||
//**************************************************************************//
|
||
// Database Creation & Access
|
||
|
||
/*
|
||
* dbCreateStatement
|
||
*
|
||
* Creates a statement, wraps it, and then does parameter replacement
|
||
* Will use memoization so that statements can be reused.
|
||
*/
|
||
dbCreateStatement : function (query, params) {
|
||
let stmt = this.dbStmts[query];
|
||
// Memoize the statements
|
||
if (!stmt) {
|
||
this.log("Creating new statement for query: " + query);
|
||
stmt = this.dbConnection.createStatement(query);
|
||
this.dbStmts[query] = stmt;
|
||
}
|
||
// Replace parameters, must be done 1 at a time
|
||
if (params)
|
||
for (let i in params)
|
||
stmt.params[i] = params[i];
|
||
return stmt;
|
||
},
|
||
|
||
|
||
/*
|
||
* dbInit
|
||
*
|
||
* Attempts to initialize the database. This creates the file if it doesn't
|
||
* exist, performs any migrations, etc.
|
||
*/
|
||
dbInit : function () {
|
||
this.log("Initializing Database");
|
||
|
||
let storage = Cc["@mozilla.org/storage/service;1"].
|
||
getService(Ci.mozIStorageService);
|
||
this.dbConnection = storage.openDatabase(this.dbFile);
|
||
let version = this.dbConnection.schemaVersion;
|
||
|
||
// Note: Firefox 3 didn't set a schema value, so it started from 0.
|
||
// So we can't depend on a simple version == 0 check
|
||
if (version == 0 && !this.dbConnection.tableExists("moz_formhistory"))
|
||
this.dbCreate();
|
||
else if (version != DB_VERSION)
|
||
this.dbMigrate(version);
|
||
},
|
||
|
||
|
||
dbCreate: function () {
|
||
this.log("Creating DB -- tables");
|
||
for (let name in this.dbSchema.tables) {
|
||
let table = this.dbSchema.tables[name];
|
||
let tSQL = [[col, table[col]].join(" ") for (col in table)].join(", ");
|
||
this.dbConnection.createTable(name, tSQL);
|
||
}
|
||
|
||
this.log("Creating DB -- indices");
|
||
for (let name in this.dbSchema.indices) {
|
||
let index = this.dbSchema.indices[name];
|
||
let statement = "CREATE INDEX IF NOT EXISTS " + name + " ON " + index.table +
|
||
"(" + index.columns.join(", ") + ")";
|
||
this.dbConnection.executeSimpleSQL(statement);
|
||
}
|
||
|
||
this.dbConnection.schemaVersion = DB_VERSION;
|
||
},
|
||
|
||
|
||
dbMigrate : function (oldVersion) {
|
||
this.log("Attempting to migrate from version " + oldVersion);
|
||
|
||
if (oldVersion > DB_VERSION) {
|
||
this.log("Downgrading to version " + DB_VERSION);
|
||
// User's DB is newer. Sanity check that our expected columns are
|
||
// present, and if so mark the lower version and merrily continue
|
||
// on. If the columns are borked, something is wrong so blow away
|
||
// the DB and start from scratch. [Future incompatible upgrades
|
||
// should swtich to a different table or file.]
|
||
|
||
if (!this.dbAreExpectedColumnsPresent())
|
||
throw Components.Exception("DB is missing expected columns",
|
||
Cr.NS_ERROR_FILE_CORRUPTED);
|
||
|
||
// Change the stored version to the current version. If the user
|
||
// runs the newer code again, it will see the lower version number
|
||
// and re-upgrade (to fixup any entries the old code added).
|
||
this.dbConnection.schemaVersion = DB_VERSION;
|
||
return;
|
||
}
|
||
|
||
// Upgrade to newer version...
|
||
|
||
this.dbConnection.beginTransaction();
|
||
|
||
try {
|
||
for (let v = oldVersion + 1; v <= DB_VERSION; v++) {
|
||
this.log("Upgrading to version " + v + "...");
|
||
let migrateFunction = "dbMigrateToVersion" + v;
|
||
this[migrateFunction]();
|
||
}
|
||
} catch (e) {
|
||
this.log("Migration failed: " + e);
|
||
this.dbConnection.rollbackTransaction();
|
||
throw e;
|
||
}
|
||
|
||
this.dbConnection.schemaVersion = DB_VERSION;
|
||
this.dbConnection.commitTransaction();
|
||
this.log("DB migration completed.");
|
||
},
|
||
|
||
|
||
/*
|
||
* dbMigrateToVersion1
|
||
*
|
||
* Updates the DB schema to v1 (bug 463154).
|
||
* Adds firstUsed, lastUsed, timesUsed columns.
|
||
*/
|
||
dbMigrateToVersion1 : function () {
|
||
// Check to see if the new columns already exist (could be a v1 DB that
|
||
// was downgraded to v0). If they exist, we don't need to add them.
|
||
let query;
|
||
["timesUsed", "firstUsed", "lastUsed"].forEach(function(column) {
|
||
if (!this.dbColumnExists(column)) {
|
||
query = "ALTER TABLE moz_formhistory ADD COLUMN " + column + " INTEGER";
|
||
this.dbConnection.executeSimpleSQL(query);
|
||
}
|
||
}, this);
|
||
|
||
// Set the default values for the new columns.
|
||
//
|
||
// Note that we set the timestamps to 24 hours in the past. We want a
|
||
// timestamp that's recent (so that "keep form history for 90 days"
|
||
// doesn't expire things surprisingly soon), but not so recent that
|
||
// "forget the last hour of stuff" deletes all freshly migrated data.
|
||
let stmt;
|
||
query = "UPDATE moz_formhistory " +
|
||
"SET timesUsed = 1, firstUsed = :time, lastUsed = :time " +
|
||
"WHERE timesUsed isnull OR firstUsed isnull or lastUsed isnull";
|
||
let params = { time: (Date.now() - DAY_IN_MS) * 1000 }
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
} catch (e) {
|
||
this.log("Failed setting timestamps: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
},
|
||
|
||
|
||
/*
|
||
* dbMigrateToVersion2
|
||
*
|
||
* Updates the DB schema to v2 (bug 243136).
|
||
* Adds lastUsed index, removes moz_dummy_table
|
||
*/
|
||
dbMigrateToVersion2 : function () {
|
||
let query = "DROP TABLE IF EXISTS moz_dummy_table";
|
||
this.dbConnection.executeSimpleSQL(query);
|
||
|
||
query = "CREATE INDEX IF NOT EXISTS moz_formhistory_lastused_index ON moz_formhistory (lastUsed)";
|
||
this.dbConnection.executeSimpleSQL(query);
|
||
},
|
||
|
||
|
||
/*
|
||
* dbMigrateToVersion3
|
||
*
|
||
* Updates the DB schema to v3 (bug 506402).
|
||
* Adds guid column and index.
|
||
*/
|
||
dbMigrateToVersion3 : function () {
|
||
// Check to see if GUID column already exists, add if needed
|
||
let query;
|
||
if (!this.dbColumnExists("guid")) {
|
||
query = "ALTER TABLE moz_formhistory ADD COLUMN guid TEXT";
|
||
this.dbConnection.executeSimpleSQL(query);
|
||
|
||
query = "CREATE INDEX IF NOT EXISTS moz_formhistory_guid_index ON moz_formhistory (guid)";
|
||
this.dbConnection.executeSimpleSQL(query);
|
||
}
|
||
|
||
// Get a list of IDs for existing logins
|
||
let ids = [];
|
||
query = "SELECT id FROM moz_formhistory WHERE guid isnull";
|
||
let stmt;
|
||
try {
|
||
stmt = this.dbCreateStatement(query);
|
||
while (stmt.executeStep())
|
||
ids.push(stmt.row.id);
|
||
} catch (e) {
|
||
this.log("Failed getting IDs: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
|
||
// Generate a GUID for each login and update the DB.
|
||
query = "UPDATE moz_formhistory SET guid = :guid WHERE id = :id";
|
||
for each (let id in ids) {
|
||
let params = {
|
||
id : id,
|
||
guid : this.generateGUID()
|
||
};
|
||
|
||
try {
|
||
stmt = this.dbCreateStatement(query, params);
|
||
stmt.execute();
|
||
} catch (e) {
|
||
this.log("Failed setting GUID: " + e);
|
||
throw e;
|
||
} finally {
|
||
stmt.reset();
|
||
}
|
||
}
|
||
},
|
||
|
||
|
||
/*
|
||
* dbAreExpectedColumnsPresent
|
||
*
|
||
* Sanity check to ensure that the columns this version of the code expects
|
||
* are present in the DB we're using.
|
||
*/
|
||
dbAreExpectedColumnsPresent : function () {
|
||
for (let name in this.dbSchema.tables) {
|
||
let table = this.dbSchema.tables[name];
|
||
let query = "SELECT " +
|
||
[col for (col in table)].join(", ") +
|
||
" FROM " + name;
|
||
try {
|
||
let stmt = this.dbConnection.createStatement(query);
|
||
// (no need to execute statement, if it compiled we're good)
|
||
stmt.finalize();
|
||
} catch (e) {
|
||
return false;
|
||
}
|
||
}
|
||
|
||
this.log("verified that expected columns are present in DB.");
|
||
return true;
|
||
},
|
||
|
||
|
||
/*
|
||
* dbColumnExists
|
||
*
|
||
* Checks to see if the named column already exists.
|
||
*/
|
||
dbColumnExists : function (columnName) {
|
||
let query = "SELECT " + columnName + " FROM moz_formhistory";
|
||
try {
|
||
let stmt = this.dbConnection.createStatement(query);
|
||
// (no need to execute statement, if it compiled we're good)
|
||
stmt.finalize();
|
||
return true;
|
||
} catch (e) {
|
||
return false;
|
||
}
|
||
},
|
||
|
||
|
||
/*
|
||
* dbCleanup
|
||
*
|
||
* Called when database creation fails. Finalizes database statements,
|
||
* closes the database connection, deletes the database file.
|
||
*/
|
||
dbCleanup : function (backup) {
|
||
this.log("Cleaning up DB file - close & remove & backup=" + backup)
|
||
|
||
// Create backup file
|
||
if (backup) {
|
||
let storage = Cc["@mozilla.org/storage/service;1"].
|
||
getService(Ci.mozIStorageService);
|
||
|
||
let backupFile = this.dbFile.leafName + ".corrupt";
|
||
storage.backupDatabaseFile(this.dbFile, backupFile);
|
||
}
|
||
|
||
// Finalize all statements to free memory, avoid errors later
|
||
for each (let stmt in this.dbStmts)
|
||
stmt.finalize();
|
||
this.dbStmts = [];
|
||
|
||
// Close the connection, ignore 'already closed' error
|
||
try { this.dbConnection.close() } catch(e) {}
|
||
this.dbFile.remove(false);
|
||
}
|
||
};
|
||
|
||
let component = [FormHistory];
|
||
var NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
|