OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 //------------------------------------------------------------------------------ | 6 //------------------------------------------------------------------------------ |
7 // Description of the life cycle of a instance of MetricsService. | 7 // Description of the life cycle of a instance of MetricsService. |
8 // | 8 // |
9 // OVERVIEW | 9 // OVERVIEW |
10 // | 10 // |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 GetInstance()->SetRecording(true); | 406 GetInstance()->SetRecording(true); |
407 GetInstance()->SetReporting(true); | 407 GetInstance()->SetReporting(true); |
408 } | 408 } |
409 | 409 |
410 // static | 410 // static |
411 void MetricsService::Stop() { | 411 void MetricsService::Stop() { |
412 AutoLock lock(metrics_service_lock_); | 412 AutoLock lock(metrics_service_lock_); |
413 | 413 |
414 GetInstance()->SetReporting(false); | 414 GetInstance()->SetReporting(false); |
415 GetInstance()->SetRecording(false); | 415 GetInstance()->SetRecording(false); |
416 | |
417 if (GetInstance()->user_permits_upload_) | |
418 g_metrics_upload_thread_.Get().Stop(); | |
MAD
2010/12/16 19:51:59
Is this in adherence with the following comment ar
Vitaly Buka (NO REVIEWS)
2010/12/16 20:40:36
Done.
mad-corp
2010/12/17 00:36:37
Yeah, now, but what if it changes? And it's not ob
| |
416 } | 419 } |
417 | 420 |
418 void MetricsService::SetRecording(bool enabled) { | 421 void MetricsService::SetRecording(bool enabled) { |
419 if (enabled == recording_active_) | 422 if (enabled == recording_active_) |
420 return; | 423 return; |
421 | 424 |
422 if (enabled) { | 425 if (enabled) { |
423 if (client_id_.empty()) { | 426 if (client_id_.empty()) { |
424 client_id_ = GenerateClientID(); | 427 client_id_ = GenerateClientID(); |
425 // Save client id somewhere. | 428 // Save client id somewhere. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 version += "-F"; | 607 version += "-F"; |
605 if (!version_info.IsOfficialBuild()) | 608 if (!version_info.IsOfficialBuild()) |
606 version.append("-devel"); | 609 version.append("-devel"); |
607 return version; | 610 return version; |
608 } else { | 611 } else { |
609 NOTREACHED() << "Unable to retrieve version string."; | 612 NOTREACHED() << "Unable to retrieve version string."; |
610 } | 613 } |
611 | 614 |
612 return std::string(); | 615 return std::string(); |
613 } | 616 } |
OLD | NEW |