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

Unified Diff: chrome/browser/sync/engine/nigori_util.cc

Issue 8402014: [Sync] Make GetFirstChildId return a flag indicating success (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 2 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/engine/nigori_util.cc
diff --git a/chrome/browser/sync/engine/nigori_util.cc b/chrome/browser/sync/engine/nigori_util.cc
index 7edd51496e39ea5ce048141ee15b5df953cb22f5..3e0c27ce1810b1f27c784fd42c007354ebd9374f 100644
--- a/chrome/browser/sync/engine/nigori_util.cc
+++ b/chrome/browser/sync/engine/nigori_util.cc
@@ -81,10 +81,11 @@ bool SpecificsNeedsEncryption(const ModelTypeSet& encrypted_types,
}
// Mainly for testing.
-bool VerifyDataTypeEncryption(BaseTransaction* const trans,
- browser_sync::Cryptographer* cryptographer,
- ModelType type,
- bool is_encrypted) {
+bool VerifyDataTypeEncryptionForTest(
+ BaseTransaction* const trans,
+ browser_sync::Cryptographer* cryptographer,
+ ModelType type,
+ bool is_encrypted) {
if (type == PASSWORDS || type == NIGORI) {
NOTREACHED();
return true;
@@ -97,8 +98,12 @@ bool VerifyDataTypeEncryption(BaseTransaction* const trans,
}
std::queue<Id> to_visit;
- Id id_string =
- trans->directory()->GetFirstChildId(trans, type_root.Get(ID));
+ Id id_string;
+ if (!trans->directory()->GetFirstChildId(
+ trans, type_root.Get(ID), &id_string)) {
+ NOTREACHED();
+ return false;
+ }
to_visit.push(id_string);
while (!to_visit.empty()) {
id_string = to_visit.front();
@@ -112,9 +117,14 @@ bool VerifyDataTypeEncryption(BaseTransaction* const trans,
return false;
}
if (child.Get(IS_DIR)) {
+ Id child_id_string;
+ if (!trans->directory()->GetFirstChildId(
+ trans, child.Get(ID), &child_id_string)) {
+ NOTREACHED();
+ return false;
+ }
// Traverse the children.
- to_visit.push(
- trans->directory()->GetFirstChildId(trans, child.Get(ID)));
+ to_visit.push(child_id_string);
}
const sync_pb::EntitySpecifics& specifics = child.Get(SPECIFICS);
DCHECK_EQ(type, child.GetModelType());
« no previous file with comments | « chrome/browser/sync/engine/nigori_util.h ('k') | chrome/browser/sync/engine/process_commit_response_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698