Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/sync/glue/model_association_manager.cc

Issue 10392116: [Sync] Associate UI datatypes before non-UI datatypes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <functional> 6 #include <functional>
7 7
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 18 matching lines...) Expand all
29 29
30 namespace browser_sync { 30 namespace browser_sync {
31 // The amount of time we wait for a datatype to load. If the type has 31 // The amount of time we wait for a datatype to load. If the type has
32 // not finished loading we move on to the next type. Once this type 32 // not finished loading we move on to the next type. Once this type
33 // finishes loading we will do a configure to associate this type. Note 33 // finishes loading we will do a configure to associate this type. Note
34 // that in most cases types finish loading before this timeout. 34 // that in most cases types finish loading before this timeout.
35 const int64 kDataTypeLoadWaitTimeInSeconds = 120; 35 const int64 kDataTypeLoadWaitTimeInSeconds = 120;
36 namespace { 36 namespace {
37 37
38 static const syncable::ModelType kStartOrder[] = { 38 static const syncable::ModelType kStartOrder[] = {
39 syncable::NIGORI, // Listed for completeness. 39 syncable::NIGORI, // Listed for completeness.
40 syncable::BOOKMARKS, 40 syncable::BOOKMARKS, // UI thread datatypes.
41 syncable::PREFERENCES, 41 syncable::PREFERENCES,
42 syncable::AUTOFILL,
43 syncable::AUTOFILL_PROFILE,
44 syncable::EXTENSION_SETTINGS,
45 syncable::EXTENSIONS, 42 syncable::EXTENSIONS,
46 syncable::APP_SETTINGS,
47 syncable::APPS, 43 syncable::APPS,
48 syncable::THEMES, 44 syncable::THEMES,
49 syncable::TYPED_URLS,
50 syncable::PASSWORDS,
51 syncable::SEARCH_ENGINES, 45 syncable::SEARCH_ENGINES,
52 syncable::SESSIONS, 46 syncable::SESSIONS,
53 syncable::APP_NOTIFICATIONS, 47 syncable::APP_NOTIFICATIONS,
48 syncable::AUTOFILL, // Non-UI thread datatypes.
49 syncable::AUTOFILL_PROFILE,
50 syncable::EXTENSION_SETTINGS,
51 syncable::APP_SETTINGS,
52 syncable::TYPED_URLS,
53 syncable::PASSWORDS,
54 }; 54 };
55 55
56 COMPILE_ASSERT(arraysize(kStartOrder) == 56 COMPILE_ASSERT(arraysize(kStartOrder) ==
57 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, 57 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE,
58 kStartOrder_IncorrectSize); 58 kStartOrder_IncorrectSize);
59 59
60 // Comparator used when sorting data type controllers. 60 // Comparator used when sorting data type controllers.
61 class SortComparator : public std::binary_function<DataTypeController*, 61 class SortComparator : public std::binary_function<DataTypeController*,
62 DataTypeController*, 62 DataTypeController*,
63 bool> { 63 bool> {
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 return result; 494 return result;
495 } 495 }
496 496
497 base::OneShotTimer<ModelAssociationManager>* 497 base::OneShotTimer<ModelAssociationManager>*
498 ModelAssociationManager::GetTimerForTesting() { 498 ModelAssociationManager::GetTimerForTesting() {
499 return &timer_; 499 return &timer_;
500 } 500 }
501 501
502 } // namespace browser_sync 502 } // namespace browser_sync
503 503
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698