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

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

Issue 481473002: Update first-sync-delay metric name to be consistent with others and add it to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | tools/metrics/histograms/histograms.xml » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 else 683 else
684 ShutdownImpl(syncer::STOP_SYNC); 684 ShutdownImpl(syncer::STOP_SYNC);
685 } 685 }
686 686
687 backend_mode_ = mode; 687 backend_mode_ = mode;
688 688
689 if (backend_mode_ == BACKUP) 689 if (backend_mode_ == BACKUP)
690 backup_start_time_ = base::Time::Now(); 690 backup_start_time_ = base::Time::Now();
691 691
692 if (backend_mode_ == SYNC && !backup_start_time_.is_null()) { 692 if (backend_mode_ == SYNC && !backup_start_time_.is_null()) {
693 UMA_HISTOGRAM_TIMES("first-sync-delay-by-backup", 693 UMA_HISTOGRAM_MEDIUM_TIMES("Sync.FirstSyncDelayByBackup",
694 base::Time::Now() - backup_start_time_); 694 base::Time::Now() - backup_start_time_);
695 backup_start_time_ = base::Time(); 695 backup_start_time_ = base::Time();
696 } 696 }
697 697
698 if (backend_mode_ == ROLLBACK) 698 if (backend_mode_ == ROLLBACK)
699 ClearBrowsingDataSinceFirstSync(); 699 ClearBrowsingDataSinceFirstSync();
700 else if (backend_mode_ == SYNC) 700 else if (backend_mode_ == SYNC)
701 CheckSyncBackupIfNeeded(); 701 CheckSyncBackupIfNeeded();
702 702
703 base::FilePath sync_folder = backend_mode_ == SYNC ? 703 base::FilePath sync_folder = backend_mode_ == SYNC ?
704 base::FilePath(kSyncDataFolderName) : 704 base::FilePath(kSyncDataFolderName) :
(...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after
2762 true)); 2762 true));
2763 } 2763 }
2764 2764
2765 bool ProfileSyncService::NeedBackup() const { 2765 bool ProfileSyncService::NeedBackup() const {
2766 return need_backup_; 2766 return need_backup_;
2767 } 2767 }
2768 2768
2769 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const { 2769 base::Time ProfileSyncService::GetDeviceBackupTimeForTesting() const {
2770 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime(); 2770 return backend_->GetSyncedDeviceTracker()->GetLocalDeviceBackupTime();
2771 } 2771 }
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698