diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 23:07:19 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-22 23:07:19 +0000 |
commit | 2862086530e94dab7ab55e842601661aabd8a408 (patch) | |
tree | 31fc3c9027af9d89c1fdfd671cfe1ea1968e0c8c /net/socket/tcp_client_socket_win.cc | |
parent | 81cbbeba77b50e09cf52c7da09ed5ff88056cd28 (diff) | |
download | chromium_src-2862086530e94dab7ab55e842601661aabd8a408.zip chromium_src-2862086530e94dab7ab55e842601661aabd8a408.tar.gz chromium_src-2862086530e94dab7ab55e842601661aabd8a408.tar.bz2 |
Removed the static on all stats macros and changed the static declaration
of StatsCounter, StatsCounterTimer and StatsRate variables to auto. This
change would fix possibel race condition during static's initialization
in multi-threaded environments.
BUG=76980
TEST=unit tests in net, browser and plugins
R=jar@chromium.org
Review URL: http://codereview.chromium.org/6719011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_win.cc')
-rw-r--r-- | net/socket/tcp_client_socket_win.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc index d33bd40..5315f45 100644 --- a/net/socket/tcp_client_socket_win.cc +++ b/net/socket/tcp_client_socket_win.cc @@ -250,7 +250,7 @@ int TCPClientSocketWin::Connect(CompletionCallback* callback) { if (socket_ != INVALID_SOCKET) return OK; - static base::StatsCounter connects("tcp.connect"); + base::StatsCounter connects("tcp.connect"); connects.Increment(); net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT, @@ -515,7 +515,7 @@ int TCPClientSocketWin::Read(IOBuffer* buf, // false error reports. // See bug 5297. base::MemoryDebug::MarkAsInitialized(core_->read_buffer_.buf, num); - static base::StatsCounter read_bytes("tcp.read_bytes"); + base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(num); if (num > 0) use_history_.set_was_used_to_convey_data(); @@ -545,7 +545,7 @@ int TCPClientSocketWin::Write(IOBuffer* buf, DCHECK_GT(buf_len, 0); DCHECK(!core_->write_iobuffer_); - static base::StatsCounter writes("tcp.writes"); + base::StatsCounter writes("tcp.writes"); writes.Increment(); core_->write_buffer_.len = buf_len; @@ -567,7 +567,7 @@ int TCPClientSocketWin::Write(IOBuffer* buf, << " bytes, but " << rv << " bytes reported."; return ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES; } - static base::StatsCounter write_bytes("tcp.write_bytes"); + base::StatsCounter write_bytes("tcp.write_bytes"); write_bytes.Add(rv); if (rv > 0) use_history_.set_was_used_to_convey_data(); @@ -769,7 +769,7 @@ void TCPClientSocketWin::DidCompleteRead() { waiting_read_ = false; core_->read_iobuffer_ = NULL; if (ok) { - static base::StatsCounter read_bytes("tcp.read_bytes"); + base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(num_bytes); if (num_bytes > 0) use_history_.set_was_used_to_convey_data(); @@ -800,7 +800,7 @@ void TCPClientSocketWin::DidCompleteWrite() { << " bytes reported."; rv = ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES; } else { - static base::StatsCounter write_bytes("tcp.write_bytes"); + base::StatsCounter write_bytes("tcp.write_bytes"); write_bytes.Add(num_bytes); if (num_bytes > 0) use_history_.set_was_used_to_convey_data(); |