diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:02:16 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:02:16 +0000 |
commit | ce072a7181ea5d58133e33654133236f5d9f5551 (patch) | |
tree | 1b1c903fec3fd27038cd17cb4ae9ca17d3736e40 /net | |
parent | a8e2058011129cbef38bf89834ee01715556b392 (diff) | |
download | chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.zip chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.gz chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.bz2 |
Move platform_thread to base/threading and put in the base namespace. I left a
stub and "using" declarations in the old location to avoid having to change the
entire project at once.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6001010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/listen_socket.cc | 5 | ||||
-rw-r--r-- | net/disk_cache/block_files.cc | 4 | ||||
-rw-r--r-- | net/disk_cache/block_files.h | 4 | ||||
-rw-r--r-- | net/http/http_auth_controller.cc | 6 | ||||
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 4 | ||||
-rw-r--r-- | net/proxy/multi_threaded_proxy_resolver_unittest.cc | 5 | ||||
-rw-r--r-- | net/socket/tcp_client_socket_pool_unittest.cc | 10 |
7 files changed, 23 insertions, 15 deletions
diff --git a/net/base/listen_socket.cc b/net/base/listen_socket.cc index c964ec9..445d57d 100644 --- a/net/base/listen_socket.cc +++ b/net/base/listen_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,6 +22,7 @@ #endif #include "base/eintr_wrapper.h" +#include "base/threading/platform_thread.h" #include "net/base/net_util.h" #include "net/base/listen_socket.h" @@ -231,7 +232,7 @@ void ListenSocket::SendInternal(const char* bytes, int len) { send_buf += sent; len_left -= sent; } - PlatformThread::YieldCurrentThread(); + base::PlatformThread::YieldCurrentThread(); } } diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index 9d5de62..3eb4e35 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -8,7 +8,7 @@ #include "base/metrics/histogram.h" #include "base/string_util.h" #include "base/stringprintf.h" -#include "base/thread_checker.h" +#include "base/threading/thread_checker.h" #include "base/time.h" #include "net/disk_cache/cache_util.h" #include "net/disk_cache/file_lock.h" @@ -201,7 +201,7 @@ bool BlockFiles::Init(bool create_files) { if (init_) return false; - thread_checker_.reset(new ThreadChecker); + thread_checker_.reset(new base::ThreadChecker); block_files_.resize(kFirstAdditionalBlockFile); for (int i = 0; i < kFirstAdditionalBlockFile; i++) { diff --git a/net/disk_cache/block_files.h b/net/disk_cache/block_files.h index 5427a58..d677ba3 100644 --- a/net/disk_cache/block_files.h +++ b/net/disk_cache/block_files.h @@ -16,7 +16,9 @@ #include "net/disk_cache/addr.h" #include "net/disk_cache/mapped_file.h" +namespace base { class ThreadChecker; +} namespace disk_cache { @@ -87,7 +89,7 @@ class BlockFiles { char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. FilePath path_; // Path to the backing folder. std::vector<MappedFile*> block_files_; // The actual files. - scoped_ptr<ThreadChecker> thread_checker_; + scoped_ptr<base::ThreadChecker> thread_checker_; FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc index e97d06e..ddd0bdb 100644 --- a/net/http/http_auth_controller.cc +++ b/net/http/http_auth_controller.cc @@ -6,6 +6,7 @@ #include "base/metrics/histogram.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "net/base/auth.h" #include "net/base/host_resolver.h" @@ -90,8 +91,9 @@ void HistogramAuthEvent(HttpAuthHandler* handler, AuthEvent auth_event) { // used on the same thread, in which case there are no race conditions. If // there are race conditions (say, a read completes during a partial write), // the DCHECK will correctly fail. - static PlatformThreadId first_thread = PlatformThread::CurrentId(); - DCHECK_EQ(first_thread, PlatformThread::CurrentId()); + static base::PlatformThreadId first_thread = + base::PlatformThread::CurrentId(); + DCHECK_EQ(first_thread, base::PlatformThread::CurrentId()); #endif HttpAuthHandler::AuthScheme auth_scheme = handler->auth_scheme(); diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index 02edd05..c35c572 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -25,7 +25,7 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "base/stringprintf.h" -#include "base/thread_checker.h" +#include "base/threading/thread_checker.h" #include "base/time.h" #include "googleurl/src/gurl.h" #include "net/base/io_buffer.h" @@ -80,7 +80,7 @@ class OCSPIOLoop { bool used_; // Protected by |lock_|. // This should not be modified after |used_|. MessageLoopForIO* io_loop_; // Protected by |lock_|. - ThreadChecker thread_checker_; + base::ThreadChecker thread_checker_; DISALLOW_COPY_AND_ASSIGN(OCSPIOLoop); }; diff --git a/net/proxy/multi_threaded_proxy_resolver_unittest.cc b/net/proxy/multi_threaded_proxy_resolver_unittest.cc index a18804f..8f787f4 100644 --- a/net/proxy/multi_threaded_proxy_resolver_unittest.cc +++ b/net/proxy/multi_threaded_proxy_resolver_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,7 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "base/waitable_event.h" #include "googleurl/src/gurl.h" @@ -40,7 +41,7 @@ class MockProxyResolver : public ProxyResolver { RequestHandle* request, const BoundNetLog& net_log) { if (resolve_latency_ms_) - PlatformThread::Sleep(resolve_latency_ms_); + base::PlatformThread::Sleep(resolve_latency_ms_); CheckIsOnWorkerThread(); diff --git a/net/socket/tcp_client_socket_pool_unittest.cc b/net/socket/tcp_client_socket_pool_unittest.cc index 454f5b8..bd1b8bd 100644 --- a/net/socket/tcp_client_socket_pool_unittest.cc +++ b/net/socket/tcp_client_socket_pool_unittest.cc @@ -7,6 +7,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/message_loop.h" +#include "base/threading/platform_thread.h" #include "net/base/mock_host_resolver.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -758,7 +759,8 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketConnect) { MessageLoop::current()->RunAllPending(); // Wait for the backup socket timer to fire. - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs * 2); + base::PlatformThread::Sleep( + ClientSocketPool::kMaxConnectRetryIntervalMs * 2); // Let the appropriate socket connect. MessageLoop::current()->RunAllPending(); @@ -800,7 +802,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketCancel) { if (index == CANCEL_AFTER_WAIT) { // Wait for the backup socket timer to fire. - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); + base::PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); } // Let the appropriate socket connect. @@ -843,7 +845,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketFailAfterStall) { MessageLoop::current()->RunAllPending(); // Wait for the backup socket timer to fire. - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); + base::PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); // Let the second connect be synchronous. Otherwise, the emulated // host resolution takes an extra trip through the message loop. @@ -888,7 +890,7 @@ TEST_F(TCPClientSocketPoolTest, BackupSocketFailAfterDelay) { MessageLoop::current()->RunAllPending(); // Wait for the backup socket timer to fire. - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); + base::PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs); // Let the second connect be synchronous. Otherwise, the emulated // host resolution takes an extra trip through the message loop. |