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

Side by Side Diff: components/metrics/metrics_service.cc

Issue 1023783005: Merge Crashpad to the 42.0.2311 branch (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2311
Patch Set: Created 5 years, 9 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 | « components/crash/app/crashpad_mac.mm ('k') | components/metrics/metrics_service_client.h » ('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 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It is 10 // A MetricsService instance is typically created at application startup. It is
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 base::AddActionCallback(action_callback_); 419 base::AddActionCallback(action_callback_);
420 } 420 }
421 421
422 void MetricsService::DisableRecording() { 422 void MetricsService::DisableRecording() {
423 DCHECK(IsSingleThreaded()); 423 DCHECK(IsSingleThreaded());
424 424
425 if (!recording_active_) 425 if (!recording_active_)
426 return; 426 return;
427 recording_active_ = false; 427 recording_active_ = false;
428 428
429 client_->OnRecordingDisabled();
430
429 base::RemoveActionCallback(action_callback_); 431 base::RemoveActionCallback(action_callback_);
430 432
431 for (size_t i = 0; i < metrics_providers_.size(); ++i) 433 for (size_t i = 0; i < metrics_providers_.size(); ++i)
432 metrics_providers_[i]->OnRecordingDisabled(); 434 metrics_providers_[i]->OnRecordingDisabled();
433 435
434 PushPendingLogsToPersistentStorage(); 436 PushPendingLogsToPersistentStorage();
435 } 437 }
436 438
437 bool MetricsService::recording_active() const { 439 bool MetricsService::recording_active() const {
438 DCHECK(IsSingleThreaded()); 440 DCHECK(IsSingleThreaded());
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 local_state_->SetBoolean(path, value); 1252 local_state_->SetBoolean(path, value);
1251 RecordCurrentState(local_state_); 1253 RecordCurrentState(local_state_);
1252 } 1254 }
1253 1255
1254 void MetricsService::RecordCurrentState(PrefService* pref) { 1256 void MetricsService::RecordCurrentState(PrefService* pref) {
1255 pref->SetInt64(prefs::kStabilityLastTimestampSec, 1257 pref->SetInt64(prefs::kStabilityLastTimestampSec,
1256 base::Time::Now().ToTimeT()); 1258 base::Time::Now().ToTimeT());
1257 } 1259 }
1258 1260
1259 } // namespace metrics 1261 } // namespace metrics
OLDNEW
« no previous file with comments | « components/crash/app/crashpad_mac.mm ('k') | components/metrics/metrics_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698