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

Unified Diff: chrome_frame/metrics_service.cc

Issue 5845004: Stop upload thread when stopping service. Leaked thread may crash process on... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/metrics_service.cc
===================================================================
--- chrome_frame/metrics_service.cc (revision 69412)
+++ chrome_frame/metrics_service.cc (working copy)
@@ -122,7 +122,8 @@
// started on. We don't have a good way of achieving this at this point. This
// thread object is currently leaked.
// TODO(ananta)
-// Fix this.
+// TODO(vitalybuka@chromium.org) : Fix this by using MetricsService::Stop() in
+// appropriate location.
base::LazyInstance<base::Thread, UploadThreadInstanceTraits>
g_metrics_upload_thread_(base::LINKER_INITIALIZED);
@@ -409,10 +410,15 @@
// static
void MetricsService::Stop() {
- AutoLock lock(metrics_service_lock_);
+ {
+ AutoLock lock(metrics_service_lock_);
- GetInstance()->SetReporting(false);
- GetInstance()->SetRecording(false);
+ GetInstance()->SetReporting(false);
+ GetInstance()->SetRecording(false);
+ }
+
+ if (GetInstance()->user_permits_upload_)
+ g_metrics_upload_thread_.Get().Stop();
}
void MetricsService::SetRecording(bool enabled) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698