summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/sync_manager_impl.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-15 10:52:22 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-15 10:52:22 +0000
commit4481310bb3797923613fed387f34ec6848533a76 (patch)
tree37df25e4d23d579c2729a1d1b57de45187dc3ff5 /sync/internal_api/sync_manager_impl.h
parent5d30ae6153623cc8f67a036afdb7537ebce0d681 (diff)
downloadchromium_src-4481310bb3797923613fed387f34ec6848533a76.zip
chromium_src-4481310bb3797923613fed387f34ec6848533a76.tar.gz
chromium_src-4481310bb3797923613fed387f34ec6848533a76.tar.bz2
sync: Reduce work done to process bookmark changes
The ChangeReorderBuffer and BookmarkChangeProcessor collaborate to handle bookmark-specific ordering and hierarchy requirements. With a bit of help from the directory and some changes to these classes, we can achieve the same effect as before with less work. Prior to this CL, the BookmarkChangeProcessor would apply a position-affecting from sync to the bookmark model by updating all siblings of the position change in left to right order. The idea was to have all the predecessors of the modified item in sync before applying the change. The ChangeReorderBuffer helps out by manufacturing fake changes for siblings of position changes, and delivering them all to the BookmarkChangeProcessor in syncable::Directory left-to-right order. This CL works solves the issue by splitting the work up into two separate passes. On the first pass, any modified nodes are moved to the far right within their parent folder. The second pass iterates over these modified items in syncable::Directory left-to-right position order, and moves them to the proper index in the bookmark model. This has the same effect as the earlier algorithm: all predecessors are synced at the time of the final move operation. This should be much cheaper than modifying all the siblings of a position change. This new algorithm also allows us to remove lots of sibling ordering requirements from the ChangeReorderBuffer and related functions, since the BookmarkChangeProcessor no longer requires its changes to be delivered in sibling order. It also no longer needs to manufacture fake changes for siblings of position changes. This CL also includes a few cosmetic changes to the BookmarkChangeProcessor. BUG=123429 Review URL: https://chromiumcodereview.appspot.com/16507010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl.h')
-rw-r--r--sync/internal_api/sync_manager_impl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sync/internal_api/sync_manager_impl.h b/sync/internal_api/sync_manager_impl.h
index 3d2c2cf..a916b30 100644
--- a/sync/internal_api/sync_manager_impl.h
+++ b/sync/internal_api/sync_manager_impl.h
@@ -20,6 +20,7 @@
#include "sync/internal_api/js_sync_encryption_handler_observer.h"
#include "sync/internal_api/js_sync_manager_observer.h"
#include "sync/internal_api/public/sync_manager.h"
+#include "sync/internal_api/public/user_share.h"
#include "sync/internal_api/sync_encryption_handler_impl.h"
#include "sync/js/js_backend.h"
#include "sync/notifier/invalidation_handler.h"