mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 507296 - Sync bookmarks and history in batched mode. r=thunder
Wrap the original SyncEngine._sync function with a call to runInBatchMode, so SQL disk writes happen at the end of batch mode instead of on every change.
This commit is contained in:
parent
96db27a500
commit
a77e420a8a
@ -87,7 +87,13 @@ BookmarksEngine.prototype = {
|
||||
logName: "Bookmarks",
|
||||
_recordObj: PlacesItem,
|
||||
_storeObj: BookmarksStore,
|
||||
_trackerObj: BookmarksTracker
|
||||
_trackerObj: BookmarksTracker,
|
||||
|
||||
_sync: function BookmarksEngine__sync() {
|
||||
Svc.Bookmark.runInBatchMode({
|
||||
runBatched: Utils.bind2(this, SyncEngine.prototype._sync)
|
||||
}, null);
|
||||
}
|
||||
};
|
||||
|
||||
function BookmarksStore() {
|
||||
|
@ -62,6 +62,12 @@ HistoryEngine.prototype = {
|
||||
_storeObj: HistoryStore,
|
||||
_trackerObj: HistoryTracker,
|
||||
|
||||
_sync: function HistoryEngine__sync() {
|
||||
Svc.History.runInBatchMode({
|
||||
runBatched: Utils.bind2(this, SyncEngine.prototype._sync)
|
||||
}, null);
|
||||
},
|
||||
|
||||
// History reconciliation is simpler than the default one from SyncEngine,
|
||||
// because we have the advantage that we can use the URI as a definitive
|
||||
// check for local existence of incoming items. The steps are as follows:
|
||||
|
@ -726,6 +726,7 @@ Svc.Prefs = new Preferences(PREFS_BRANCH);
|
||||
["Bookmark", "@mozilla.org/browser/nav-bookmarks-service;1", "nsINavBookmarksService"],
|
||||
["Crypto", "@labs.mozilla.com/Weave/Crypto;1", "IWeaveCrypto"],
|
||||
["Directory", "@mozilla.org/file/directory_service;1", "nsIProperties"],
|
||||
["History", "@mozilla.org/browser/nav-history-service;1", "nsINavHistoryService"],
|
||||
["Idle", "@mozilla.org/widget/idleservice;1", "nsIIdleService"],
|
||||
["IO", "@mozilla.org/network/io-service;1", "nsIIOService"],
|
||||
["Login", "@mozilla.org/login-manager;1", "nsILoginManager"],
|
||||
|
Loading…
Reference in New Issue
Block a user