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

Side by Side Diff: chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc

Issue 1530763004: Add Statistics for SupervisedUserSettingService during merging and syncing data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/supervised_user/supervised_user_settings_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/legacy/supervised_user_shared_settings_ service.h" 5 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/json/json_reader.h" 11 #include "base/json/json_reader.h"
12 #include "base/json/json_writer.h" 12 #include "base/json/json_writer.h"
13 #include "base/metrics/histogram.h"
13 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
14 #include "base/prefs/scoped_user_pref_update.h" 15 #include "base/prefs/scoped_user_pref_update.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
17 #include "components/pref_registry/pref_registry_syncable.h" 18 #include "components/pref_registry/pref_registry_syncable.h"
18 #include "sync/api/sync_change.h" 19 #include "sync/api/sync_change.h"
19 #include "sync/api/sync_data.h" 20 #include "sync/api/sync_data.h"
20 #include "sync/api/sync_error.h" 21 #include "sync/api/sync_error.h"
21 #include "sync/api/sync_error_factory.h" 22 #include "sync/api/sync_error_factory.h"
22 #include "sync/api/sync_merge_result.h" 23 #include "sync/api/sync_merge_result.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 253 }
253 } 254 }
254 255
255 SyncMergeResult result(SUPERVISED_USER_SHARED_SETTINGS); 256 SyncMergeResult result(SUPERVISED_USER_SHARED_SETTINGS);
256 // Process all the accumulated changes. 257 // Process all the accumulated changes.
257 if (change_list.size() > 0) { 258 if (change_list.size() > 0) {
258 result.set_error( 259 result.set_error(
259 sync_processor_->ProcessSyncChanges(FROM_HERE, change_list)); 260 sync_processor_->ProcessSyncChanges(FROM_HERE, change_list));
260 } 261 }
261 262
262 // TODO(bauerb): Statistics? 263 UMA_HISTOGRAM_ENUMERATION("SupervisedUserSettingService.SyncMergeResult",
Bernhard Bauer 2016/01/04 12:53:30 Sorry, that comment should have been more detailed
Deepak 2016/01/05 03:45:16 Done.
264 result.model_type(), syncer::MODEL_TYPE_COUNT);
265
263 return result; 266 return result;
264 } 267 }
265 268
266 void SupervisedUserSharedSettingsService::StopSyncing(syncer::ModelType type) { 269 void SupervisedUserSharedSettingsService::StopSyncing(syncer::ModelType type) {
267 DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); 270 DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type);
268 sync_processor_.reset(); 271 sync_processor_.reset();
269 error_handler_.reset(); 272 error_handler_.reset();
270 } 273 }
271 274
272 syncer::SyncDataList SupervisedUserSharedSettingsService::GetAllSyncData( 275 syncer::SyncDataList SupervisedUserSharedSettingsService::GetAllSyncData(
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 NOTREACHED(); 340 NOTREACHED();
338 break; 341 break;
339 } 342 }
340 } 343 }
341 callbacks_.Notify(su_id, key); 344 callbacks_.Notify(su_id, key);
342 } 345 }
343 346
344 SyncError error; 347 SyncError error;
345 return error; 348 return error;
346 } 349 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/supervised_user/supervised_user_settings_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698