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

Unified Diff: chrome/browser/sync/glue/typed_url_model_associator.cc

Issue 302173004: sync: Specialize functions that fetch type root (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/typed_url_model_associator.cc
diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc
index 1a0503e2249506433c3fd4a24ed4dc91b820c663..1cfafa91f7eb2900644470d1f057aa21b12d2c05 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator.cc
+++ b/chrome/browser/sync/glue/typed_url_model_associator.cc
@@ -37,8 +37,6 @@ static const int kMaxTypedUrlVisits = 100;
// RELOAD visits, which will be stripped.
static const int kMaxVisitsToFetch = 1000;
-const char kTypedUrlTag[] = "google_chrome_typed_urls";
-
static bool CheckVisitOrdering(const history::VisitVector& visits) {
int64 previous_visit_time = 0;
for (history::VisitVector::const_iterator visit = visits.begin();
@@ -220,8 +218,8 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() {
syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare());
syncer::ReadNode typed_url_root(&trans);
- if (typed_url_root.InitByTagLookup(kTypedUrlTag) !=
- syncer::BaseNode::INIT_OK) {
+ if (typed_url_root.InitTypeRoot(syncer::TYPED_URLS) !=
+ syncer::BaseNode::INIT_OK) {
return error_handler_->CreateAndUploadError(
FROM_HERE,
"Server did not create the top-level typed_url node. We "
@@ -458,7 +456,7 @@ bool TypedUrlModelAssociator::DeleteAllNodes(
// Just walk through all our child nodes and delete them.
syncer::ReadNode typed_url_root(trans);
- if (typed_url_root.InitByTagLookup(kTypedUrlTag) !=
+ if (typed_url_root.InitTypeRoot(syncer::TYPED_URLS) !=
syncer::BaseNode::INIT_OK) {
LOG(ERROR) << "Could not lookup root node";
return false;
@@ -491,7 +489,7 @@ bool TypedUrlModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) {
*has_nodes = false;
syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare());
syncer::ReadNode sync_node(&trans);
- if (sync_node.InitByTagLookup(kTypedUrlTag) != syncer::BaseNode::INIT_OK) {
+ if (sync_node.InitTypeRoot(syncer::TYPED_URLS) != syncer::BaseNode::INIT_OK) {
LOG(ERROR) << "Server did not create the top-level typed_url node. We "
<< "might be running against an out-of-date server.";
return false;

Powered by Google App Engine
This is Rietveld 408576698