OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/sync/glue/bookmark_model_associator.h" | 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 | 699 |
700 void BookmarkModelAssociator::CheckModelSyncState() const { | 700 void BookmarkModelAssociator::CheckModelSyncState() const { |
701 std::string version_str; | 701 std::string version_str; |
702 if (bookmark_model_->root_node()->GetMetaInfo(kBookmarkTransactionVersionKey, | 702 if (bookmark_model_->root_node()->GetMetaInfo(kBookmarkTransactionVersionKey, |
703 &version_str)) { | 703 &version_str)) { |
704 syncer::ReadTransaction trans(FROM_HERE, user_share_); | 704 syncer::ReadTransaction trans(FROM_HERE, user_share_); |
705 int64 native_version; | 705 int64 native_version; |
706 if (base::StringToInt64(version_str, &native_version) && | 706 if (base::StringToInt64(version_str, &native_version) && |
707 native_version != trans.GetModelVersion(syncer::BOOKMARKS)) { | 707 native_version != trans.GetModelVersion(syncer::BOOKMARKS)) { |
708 UMA_HISTOGRAM_ENUMERATION("Sync.LocalModelOutOfSync", | 708 UMA_HISTOGRAM_ENUMERATION("Sync.LocalModelOutOfSync", |
709 syncer::BOOKMARKS, syncer::MODEL_TYPE_COUNT); | 709 ModelTypeToHistogramInt(syncer::BOOKMARKS), |
| 710 syncer::MODEL_TYPE_COUNT); |
710 // Clear version on bookmark model so that we only report error once. | 711 // Clear version on bookmark model so that we only report error once. |
711 bookmark_model_->DeleteNodeMetaInfo(bookmark_model_->root_node(), | 712 bookmark_model_->DeleteNodeMetaInfo(bookmark_model_->root_node(), |
712 kBookmarkTransactionVersionKey); | 713 kBookmarkTransactionVersionKey); |
713 } | 714 } |
714 } | 715 } |
715 } | 716 } |
716 | 717 |
717 } // namespace browser_sync | 718 } // namespace browser_sync |
OLD | NEW |