summaryrefslogtreecommitdiffstats
path: root/net/socket_stream
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 14:40:10 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-23 14:40:10 +0000
commitd144255434dd27109c30c4e7a8124d76d7e83a4b (patch)
tree2d3c9768230161683305bbac9cae4d60cb3b6a06 /net/socket_stream
parent6d5e8255ed5b7e8865fd20af2530953990376f9f (diff)
downloadchromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.zip
chromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.tar.gz
chromium_src-d144255434dd27109c30c4e7a8124d76d7e83a4b.tar.bz2
Properly lock access to static variables.
There were a few race conditions where the static method would test the validity of the hitograms_ static variable before attempting to use the lock_ to protect access to it but nothing then prevented the destructor to free both the lock_ and the hitograms_ memory. So I decided to not use a dynamic allocation of the static lock_ to resolve this problem. BUG=38354 TEST=Hard to repro exit scenario crashes. Review URL: http://codereview.chromium.org/5784005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket_stream')
-rw-r--r--net/socket_stream/socket_stream_metrics_unittest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/socket_stream/socket_stream_metrics_unittest.cc b/net/socket_stream/socket_stream_metrics_unittest.cc
index 64718e3..72ae142 100644
--- a/net/socket_stream/socket_stream_metrics_unittest.cc
+++ b/net/socket_stream/socket_stream_metrics_unittest.cc
@@ -15,7 +15,7 @@ using base::StatisticsRecorder;
namespace net {
TEST(SocketStreamMetricsTest, Initialize) {
- if (!StatisticsRecorder::WasStarted()) {
+ if (!StatisticsRecorder::IsActive()) {
// Create the recorder if not yet started, as SocketStreamMetrics
// relys on the StatisticsRecorder to be present. This is useful when
// tests are run with --gtest_filter='SocketStreamMetricsTest*'.