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

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

Issue 8573011: Event tracing for sync events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix line length issues Created 9 years, 1 month 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
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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 DCHECK(service_ != NULL) << "Sync service has not yet been set up."; 895 DCHECK(service_ != NULL) << "Sync service has not yet been set up.";
896 if (service_->sync_initialized()) { 896 if (service_->sync_initialized()) {
897 return service_->GetLastSessionSnapshot(); 897 return service_->GetLastSessionSnapshot();
898 } 898 }
899 return NULL; 899 return NULL;
900 } 900 }
901 901
902 bool ProfileSyncServiceHarness::EnableSyncForDatatype( 902 bool ProfileSyncServiceHarness::EnableSyncForDatatype(
903 syncable::ModelType datatype) { 903 syncable::ModelType datatype) {
904 VLOG(1) << GetClientInfoString( 904 VLOG(1) << GetClientInfoString(
905 "EnableSyncForDatatype(" + syncable::ModelTypeToString(datatype) + ")"); 905 "EnableSyncForDatatype("
906 + std::string(syncable::ModelTypeToString(datatype)) + ")");
906 907
907 syncable::ModelTypeSet synced_datatypes; 908 syncable::ModelTypeSet synced_datatypes;
908 if (wait_state_ == SYNC_DISABLED) { 909 if (wait_state_ == SYNC_DISABLED) {
909 synced_datatypes.insert(datatype); 910 synced_datatypes.insert(datatype);
910 return SetupSync(synced_datatypes); 911 return SetupSync(synced_datatypes);
911 } 912 }
912 913
913 if (service() == NULL) { 914 if (service() == NULL) {
914 LOG(ERROR) << "EnableSyncForDatatype(): service() is null."; 915 LOG(ERROR) << "EnableSyncForDatatype(): service() is null.";
915 return false; 916 return false;
(...skipping 17 matching lines...) Expand all
933 return true; 934 return true;
934 } 935 }
935 936
936 VLOG(0) << GetClientInfoString("EnableSyncForDatatype failed"); 937 VLOG(0) << GetClientInfoString("EnableSyncForDatatype failed");
937 return false; 938 return false;
938 } 939 }
939 940
940 bool ProfileSyncServiceHarness::DisableSyncForDatatype( 941 bool ProfileSyncServiceHarness::DisableSyncForDatatype(
941 syncable::ModelType datatype) { 942 syncable::ModelType datatype) {
942 VLOG(1) << GetClientInfoString( 943 VLOG(1) << GetClientInfoString(
943 "DisableSyncForDatatype(" + syncable::ModelTypeToString(datatype) + ")"); 944 "DisableSyncForDatatype("
945 + std::string(syncable::ModelTypeToString(datatype)) + ")");
944 946
945 syncable::ModelTypeSet synced_datatypes; 947 syncable::ModelTypeSet synced_datatypes;
946 if (service() == NULL) { 948 if (service() == NULL) {
947 LOG(ERROR) << "DisableSyncForDatatype(): service() is null."; 949 LOG(ERROR) << "DisableSyncForDatatype(): service() is null.";
948 return false; 950 return false;
949 } 951 }
950 952
951 service()->GetPreferredDataTypes(&synced_datatypes); 953 service()->GetPreferredDataTypes(&synced_datatypes);
952 syncable::ModelTypeSet::iterator it = synced_datatypes.find(datatype); 954 syncable::ModelTypeSet::iterator it = synced_datatypes.find(datatype);
953 if (it == synced_datatypes.end()) { 955 if (it == synced_datatypes.end()) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 return (synced_types.count(type) != 0); 1133 return (synced_types.count(type) != 0);
1132 } 1134 }
1133 1135
1134 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1136 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1135 DictionaryValue value; 1137 DictionaryValue value;
1136 sync_ui_util::ConstructAboutInformation(service_, &value); 1138 sync_ui_util::ConstructAboutInformation(service_, &value);
1137 std::string service_status; 1139 std::string service_status;
1138 base::JSONWriter::Write(&value, true, &service_status); 1140 base::JSONWriter::Write(&value, true, &service_status);
1139 return service_status; 1141 return service_status;
1140 } 1142 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/data_type_manager_impl.cc ('k') | chrome/browser/sync/syncable/model_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698