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

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

Issue 7150023: Add protobuffer and model type for syncing custom search engines. Includes all boilerplate helper... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | chrome/browser/sync/protocol/nigori_specifics.proto » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/glue/data_type_manager_impl.h" 5 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 15 matching lines...) Expand all
26 syncable::NIGORI, // Listed for completeness. 26 syncable::NIGORI, // Listed for completeness.
27 syncable::BOOKMARKS, 27 syncable::BOOKMARKS,
28 syncable::PREFERENCES, 28 syncable::PREFERENCES,
29 syncable::AUTOFILL, 29 syncable::AUTOFILL,
30 syncable::AUTOFILL_PROFILE, 30 syncable::AUTOFILL_PROFILE,
31 syncable::EXTENSIONS, 31 syncable::EXTENSIONS,
32 syncable::APPS, 32 syncable::APPS,
33 syncable::THEMES, 33 syncable::THEMES,
34 syncable::TYPED_URLS, 34 syncable::TYPED_URLS,
35 syncable::PASSWORDS, 35 syncable::PASSWORDS,
36 syncable::SEARCH_ENGINES,
36 syncable::SESSIONS, 37 syncable::SESSIONS,
37 }; 38 };
38 39
39 COMPILE_ASSERT(arraysize(kStartOrder) == 40 COMPILE_ASSERT(arraysize(kStartOrder) ==
40 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, 41 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE,
41 kStartOrder_IncorrectSize); 42 kStartOrder_IncorrectSize);
42 43
43 // Comparator used when sorting data type controllers. 44 // Comparator used when sorting data type controllers.
44 class SortComparator : public std::binary_function<DataTypeController*, 45 class SortComparator : public std::binary_function<DataTypeController*,
45 DataTypeController*, 46 DataTypeController*,
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return; 279 return;
279 } 280 }
280 281
281 // We're done with the data type at the head of the list -- remove it. 282 // We're done with the data type at the head of the list -- remove it.
282 DataTypeController* started_dtc = needs_start_[0]; 283 DataTypeController* started_dtc = needs_start_[0];
283 DCHECK(needs_start_.size()); 284 DCHECK(needs_start_.size());
284 DCHECK_EQ(needs_start_[0], started_dtc); 285 DCHECK_EQ(needs_start_[0], started_dtc);
285 needs_start_.erase(needs_start_.begin()); 286 needs_start_.erase(needs_start_.begin());
286 287
287 if (result == DataTypeController::NEEDS_CRYPTO) { 288 if (result == DataTypeController::NEEDS_CRYPTO) {
288
289 } 289 }
290 // If the type started normally, continue to the next type. 290 // If the type started normally, continue to the next type.
291 // If the type is waiting for the cryptographer, continue to the next type. 291 // If the type is waiting for the cryptographer, continue to the next type.
292 // Once the cryptographer is ready, we'll attempt to restart this type. 292 // Once the cryptographer is ready, we'll attempt to restart this type.
293 if (result == DataTypeController::NEEDS_CRYPTO || 293 if (result == DataTypeController::NEEDS_CRYPTO ||
294 result == DataTypeController::OK || 294 result == DataTypeController::OK ||
295 result == DataTypeController::OK_FIRST_RUN) { 295 result == DataTypeController::OK_FIRST_RUN) {
296 StartNextType(); 296 StartNextType();
297 return; 297 return;
298 } 298 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 Source<DataTypeManager>(this), 438 Source<DataTypeManager>(this),
439 NotificationService::NoDetails()); 439 NotificationService::NoDetails());
440 } 440 }
441 441
442 void DataTypeManagerImpl::AddToConfigureTime() { 442 void DataTypeManagerImpl::AddToConfigureTime() {
443 DCHECK(!last_restart_time_.is_null()); 443 DCHECK(!last_restart_time_.is_null());
444 configure_time_delta_ += (base::Time::Now() - last_restart_time_); 444 configure_time_delta_ += (base::Time::Now() - last_restart_time_);
445 } 445 }
446 446
447 } // namespace browser_sync 447 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/protocol/nigori_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698