summaryrefslogtreecommitdiffstats
path: root/chrome_frame/metrics_service.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 01:00:18 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-04 01:00:18 +0000
commit21a45aa27e785398610c797beec31adcc20210e7 (patch)
tree900558fa134ff6f6a5182d94fb9d702974e83c96 /chrome_frame/metrics_service.h
parent5395e9fd0212282f8cf3fe1f0830837c7f703a86 (diff)
downloadchromium_src-21a45aa27e785398610c797beec31adcc20210e7.zip
chromium_src-21a45aa27e785398610c797beec31adcc20210e7.tar.gz
chromium_src-21a45aa27e785398610c797beec31adcc20210e7.tar.bz2
Fix a race in the ChromeFrame metrics service start up code. This race could be triggered
if multiple BHO's attempted to start the metrics service object from different threads. Fix is to lock access to the Start and Stop methods. Fixes bug http://b/issue?id=3251823 BUG=3251823 TEST=none Review URL: http://codereview.chromium.org/5519007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/metrics_service.h')
-rw-r--r--chrome_frame/metrics_service.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome_frame/metrics_service.h b/chrome_frame/metrics_service.h
index 38eb1f4..baea9c8 100644
--- a/chrome_frame/metrics_service.h
+++ b/chrome_frame/metrics_service.h
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/lazy_instance.h"
+#include "base/lock.h"
#include "base/metrics/histogram.h"
#include "base/platform_thread.h"
#include "base/scoped_ptr.h"
@@ -146,8 +147,10 @@ class MetricsService : public MetricsServiceBase {
// The transmission timer id returned by SetTimer
int transmission_timer_id_;
+ // Used to serialize the Start and Stop operations on the metrics service.
+ static Lock metrics_service_lock_;
+
DISALLOW_COPY_AND_ASSIGN(MetricsService);
};
#endif // CHROME_FRAME_METRICS_METRICS_SERVICE_H_
-