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

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 7995015: Add comment for fix to issue 95619 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better comment (for real this time) Created 9 years, 3 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) 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/profile_sync_service_harness.h" 5 #include "chrome/browser/sync/profile_sync_service_harness.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 #include <ostream> 10 #include <ostream>
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 (syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE)); 998 (syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE));
999 service_->OnUserChoseDatatypes(sync_everything, 999 service_->OnUserChoseDatatypes(sync_everything,
1000 synced_datatypes); 1000 synced_datatypes);
1001 1001
1002 // Wait some time to let the enryption finish. 1002 // Wait some time to let the enryption finish.
1003 return WaitForTypeEncryption(type); 1003 return WaitForTypeEncryption(type);
1004 } 1004 }
1005 1005
1006 bool ProfileSyncServiceHarness::WaitForTypeEncryption( 1006 bool ProfileSyncServiceHarness::WaitForTypeEncryption(
1007 syncable::ModelType type) { 1007 syncable::ModelType type) {
1008 // The correctness of this if condition depends on the ordering of its
1009 // sub-expressions. See crbug.com/95619.
1010 // TODO(rlarocque): Figure out a less brittle way of detecting this.
1008 if (IsTypeEncrypted(type) && 1011 if (IsTypeEncrypted(type) &&
1009 IsSynced() && 1012 IsSynced() &&
1010 GetLastSessionSnapshot()->num_conflicting_updates == 0) { 1013 GetLastSessionSnapshot()->num_conflicting_updates == 0) {
1011 // Encryption is already complete for |type|; do not wait. 1014 // Encryption is already complete for |type|; do not wait.
1012 return true; 1015 return true;
1013 } 1016 }
1014 1017
1015 std::string reason = "Waiting for encryption."; 1018 std::string reason = "Waiting for encryption.";
1016 wait_state_ = WAITING_FOR_ENCRYPTION; 1019 wait_state_ = WAITING_FOR_ENCRYPTION;
1017 waiting_for_encryption_type_ = type; 1020 waiting_for_encryption_type_ = type;
(...skipping 24 matching lines...) Expand all
1042 return (synced_types.count(type) != 0); 1045 return (synced_types.count(type) != 0);
1043 } 1046 }
1044 1047
1045 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1048 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1046 DictionaryValue value; 1049 DictionaryValue value;
1047 sync_ui_util::ConstructAboutInformation(service_, &value); 1050 sync_ui_util::ConstructAboutInformation(service_, &value);
1048 std::string service_status; 1051 std::string service_status;
1049 base::JSONWriter::Write(&value, true, &service_status); 1052 base::JSONWriter::Write(&value, true, &service_status);
1050 return service_status; 1053 return service_status;
1051 } 1054 }
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