diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 02:17:08 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 02:17:08 +0000 |
commit | f214f8797150f49e1233110c1dafe4e8b601d9ea (patch) | |
tree | 191f4f5b9ee1d9c20fc02dd4f1c940ad4d04267c /net | |
parent | 34b9963c187a733bef76535521f3de688fffd34f (diff) | |
download | chromium_src-f214f8797150f49e1233110c1dafe4e8b601d9ea.zip chromium_src-f214f8797150f49e1233110c1dafe4e8b601d9ea.tar.gz chromium_src-f214f8797150f49e1233110c1dafe4e8b601d9ea.tar.bz2 |
Remove base/platform_thread.h stub and fix up all callers to use the new location and namespace.
TEST=none
BUG=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/cookie_monster_unittest.cc | 6 | ||||
-rw-r--r-- | net/base/directory_lister.cc | 14 | ||||
-rw-r--r-- | net/base/directory_lister.h | 6 | ||||
-rw-r--r-- | net/base/mock_host_resolver.cc | 4 | ||||
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 14 | ||||
-rw-r--r-- | net/disk_cache/entry_unittest.cc | 12 | ||||
-rw-r--r-- | net/disk_cache/stress_cache.cc | 4 | ||||
-rw-r--r-- | net/socket/client_socket_pool_base_unittest.cc | 19 | ||||
-rw-r--r-- | net/url_request/url_request_job_manager.h | 8 |
9 files changed, 45 insertions, 42 deletions
diff --git a/net/base/cookie_monster_unittest.cc b/net/base/cookie_monster_unittest.cc index a0c16ea..f431674 100644 --- a/net/base/cookie_monster_unittest.cc +++ b/net/base/cookie_monster_unittest.cc @@ -7,11 +7,11 @@ #include <string> #include "base/basictypes.h" -#include "base/platform_thread.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "googleurl/src/gurl.h" #include "net/base/cookie_monster.h" @@ -1023,7 +1023,7 @@ TEST(CookieMonsterTest, TestLastAccess) { EXPECT_TRUE(last_access_date == GetFirstCookieAccessDate(cm)); // Reading after a short wait should update the access date. - PlatformThread::Sleep(kLastAccessThresholdMilliseconds + 20); + base::PlatformThread::Sleep(kLastAccessThresholdMilliseconds + 20); EXPECT_EQ("A=B", cm->GetCookies(url_google)); EXPECT_FALSE(last_access_date == GetFirstCookieAccessDate(cm)); } @@ -1201,7 +1201,7 @@ TEST(CookieMonsterTest, GetAllCookiesForURL) { const Time last_access_date(GetFirstCookieAccessDate(cm)); - PlatformThread::Sleep(kLastAccessThresholdMilliseconds + 20); + base::PlatformThread::Sleep(kLastAccessThresholdMilliseconds + 20); // Check cookies for url. net::CookieList cookies = cm->GetAllCookiesForURL(url_google); diff --git a/net/base/directory_lister.cc b/net/base/directory_lister.cc index fd36132..a0f6317 100644 --- a/net/base/directory_lister.cc +++ b/net/base/directory_lister.cc @@ -10,7 +10,7 @@ #include "base/file_util.h" #include "base/i18n/file_util_icu.h" #include "base/message_loop.h" -#include "base/platform_thread.h" +#include "base/threading/platform_thread.h" #include "base/threading/thread_restrictions.h" #include "net/base/net_errors.h" @@ -104,7 +104,7 @@ DirectoryLister::DirectoryLister(const FilePath& dir, delegate_(delegate), sort_(ALPHA_DIRS_FIRST), message_loop_(NULL), - thread_(kNullThreadHandle) { + thread_(base::kNullThreadHandle) { DCHECK(!dir.value().empty()); } @@ -117,7 +117,7 @@ DirectoryLister::DirectoryLister(const FilePath& dir, delegate_(delegate), sort_(sort), message_loop_(NULL), - thread_(kNullThreadHandle) { + thread_(base::kNullThreadHandle) { DCHECK(!dir.value().empty()); } @@ -126,7 +126,7 @@ DirectoryLister::~DirectoryLister() { // This is a bug and we should stop joining this thread. // http://crbug.com/65331 base::ThreadRestrictions::ScopedAllowIO allow_io; - PlatformThread::Join(thread_); + base::PlatformThread::Join(thread_); } } @@ -139,7 +139,7 @@ bool DirectoryLister::Start() { AddRef(); // the thread will release us when it is done - if (!PlatformThread::Create(0, this, &thread_)) { + if (!base::PlatformThread::Create(0, this, &thread_)) { Release(); return false; } @@ -154,8 +154,8 @@ void DirectoryLister::Cancel() { // This is a bug and we should stop joining this thread. // http://crbug.com/65331 base::ThreadRestrictions::ScopedAllowIO allow_io; - PlatformThread::Join(thread_); - thread_ = kNullThreadHandle; + base::PlatformThread::Join(thread_); + thread_ = base::kNullThreadHandle; } } diff --git a/net/base/directory_lister.h b/net/base/directory_lister.h index b531880..3419daa 100644 --- a/net/base/directory_lister.h +++ b/net/base/directory_lister.h @@ -11,9 +11,9 @@ #include "base/cancellation_flag.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/platform_thread.h" #include "base/ref_counted.h" #include "base/task.h" +#include "base/threading/platform_thread.h" class MessageLoop; @@ -27,7 +27,7 @@ namespace net { // is insulated from any of the multi-threading details. // class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>, - public PlatformThread::Delegate { + public base::PlatformThread::Delegate { public: // Represents one file found. struct DirectoryListerData { @@ -106,7 +106,7 @@ class DirectoryLister : public base::RefCountedThreadSafe<DirectoryLister>, DirectoryListerDelegate* delegate_; SORT_TYPE sort_; MessageLoop* message_loop_; - PlatformThreadHandle thread_; + base::PlatformThreadHandle thread_; base::CancellationFlag canceled_; }; diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index 9ee5c53..a1817a2 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -5,8 +5,8 @@ #include "net/base/mock_host_resolver.h" #include "base/string_util.h" -#include "base/platform_thread.h" #include "base/ref_counted.h" +#include "base/threading/platform_thread.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" #include "net/base/sys_addrinfo.h" @@ -231,7 +231,7 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, if (matches_flags && matches_address_family && MatchPattern(host, r->host_pattern)) { if (r->latency_ms != 0) - PlatformThread::Sleep(r->latency_ms); + base::PlatformThread::Sleep(r->latency_ms); // Remap to a new host. const std::string& effective_host = diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index d3e79a1..4703460 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -4,10 +4,10 @@ #include "base/basictypes.h" #include "base/file_util.h" -#include "base/platform_thread.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/third_party/dynamic_annotations/dynamic_annotations.h" +#include "base/threading/platform_thread.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -877,7 +877,7 @@ void DiskCacheBackendTest::BackendEnumerations2() { entry2->Close(); // Make sure that the timestamp is not the same. - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); ASSERT_EQ(net::OK, OpenEntry(second, &entry1)); void* iter = NULL; ASSERT_EQ(net::OK, OpenNextEntry(&iter, &entry2)); @@ -1053,7 +1053,7 @@ void DiskCacheBackendTest::BackendDoomRecent() { ASSERT_EQ(net::OK, CreateEntry("second", &entry)); entry->Close(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time middle = Time::Now(); ASSERT_EQ(net::OK, CreateEntry("third", &entry)); @@ -1061,7 +1061,7 @@ void DiskCacheBackendTest::BackendDoomRecent() { ASSERT_EQ(net::OK, CreateEntry("fourth", &entry)); entry->Close(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time final = Time::Now(); ASSERT_EQ(4, cache_->GetEntryCount()); @@ -1097,7 +1097,7 @@ void DiskCacheBackendTest::BackendDoomBetween() { ASSERT_EQ(net::OK, CreateEntry("first", &entry)); entry->Close(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time middle_start = Time::Now(); ASSERT_EQ(net::OK, CreateEntry("second", &entry)); @@ -1105,7 +1105,7 @@ void DiskCacheBackendTest::BackendDoomBetween() { ASSERT_EQ(net::OK, CreateEntry("third", &entry)); entry->Close(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time middle_end = Time::Now(); ASSERT_EQ(net::OK, CreateEntry("fourth", &entry)); @@ -1113,7 +1113,7 @@ void DiskCacheBackendTest::BackendDoomBetween() { ASSERT_EQ(net::OK, OpenEntry("fourth", &entry)); entry->Close(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time final = Time::Now(); ASSERT_EQ(4, cache_->GetEntryCount()); diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index cb7f680..21d5839 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -1,9 +1,9 @@ -// Copyright (c) 2006-2010 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. #include "base/basictypes.h" -#include "base/platform_thread.h" +#include "base/threading/platform_thread.h" #include "base/timer.h" #include "base/string_util.h" #include "net/base/io_buffer.h" @@ -634,7 +634,7 @@ void DiskCacheEntryTest::GetTimes() { EXPECT_TRUE(entry->GetLastModified() >= t1); EXPECT_TRUE(entry->GetLastModified() == entry->GetLastUsed()); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time t2 = Time::Now(); EXPECT_TRUE(t2 > t1); EXPECT_EQ(0, WriteData(entry, 0, 200, NULL, 0, false)); @@ -645,7 +645,7 @@ void DiskCacheEntryTest::GetTimes() { } EXPECT_TRUE(entry->GetLastModified() == entry->GetLastUsed()); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); Time t3 = Time::Now(); EXPECT_TRUE(t3 > t2); const int kSize = 200; @@ -1286,7 +1286,7 @@ void DiskCacheEntryTest::DoomedEntry() { FlushQueueForTest(); EXPECT_EQ(0, cache_->GetEntryCount()); Time initial = Time::Now(); - PlatformThread::Sleep(20); + base::PlatformThread::Sleep(20); const int kSize1 = 2000; const int kSize2 = 2000; @@ -1746,7 +1746,7 @@ void DiskCacheEntryTest::DoomSparseEntry() { // Most likely we are waiting for the result of reading the sparse info // (it's always async on Posix so it is easy to miss). Unfortunately we // don't have any signal to watch for so we can only wait. - PlatformThread::Sleep(500); + base::PlatformThread::Sleep(500); MessageLoop::current()->RunAllPending(); } EXPECT_EQ(0, cache_->GetEntryCount()); diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index 6658dc8..41a98c9 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -32,10 +32,10 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/process_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "base/threading/thread.h" #include "base/utf_string_conversions.h" #include "net/base/net_errors.h" @@ -228,7 +228,7 @@ int main(int argc, const char* argv[]) { logging::SetLogAssertHandler(CrashHandler); // Some time for the memory manager to flush stuff. - PlatformThread::Sleep(3000); + base::PlatformThread::Sleep(3000); MessageLoop message_loop(MessageLoop::TYPE_IO); char* end; diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 7c0e2e1..c6092d7 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -7,11 +7,11 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/message_loop.h" -#include "base/platform_thread.h" #include "base/ref_counted.h" #include "base/scoped_vector.h" #include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "net/base/net_errors.h" #include "net/base/net_log.h" #include "net/base/net_log_unittest.h" @@ -618,7 +618,7 @@ TEST_F(ClientSocketPoolBaseTest, ConnectJob_TimedOut) { &client_socket_factory_, &log); ASSERT_EQ(ERR_IO_PENDING, job->Connect()); - PlatformThread::Sleep(1); + base::PlatformThread::Sleep(1); EXPECT_EQ(ERR_TIMED_OUT, delegate.WaitForResult()); net::CapturingNetLog::EntryList entries; @@ -872,7 +872,7 @@ TEST_F(ClientSocketPoolBaseTest, TotalLimitCountsConnectingSockets) { // actually become pending until 2ms after they have been created. In order // to flush all tasks, we need to wait so that we know there are no // soon-to-be-pending tasks waiting. - PlatformThread::Sleep(10); + base::PlatformThread::Sleep(10); MessageLoop::current()->RunAllPending(); // The next synchronous request should wait for its turn. @@ -1315,7 +1315,7 @@ class RequestSocketCallback : public CallbackRunner< Tuple1<int> > { { MessageLoop::ScopedNestableTaskAllower nestable( MessageLoop::current()); - PlatformThread::Sleep(10); + base::PlatformThread::Sleep(10); EXPECT_EQ(OK, next_job_callback.WaitForResult()); } break; @@ -1890,7 +1890,7 @@ TEST_F(ClientSocketPoolBaseTest, CleanupTimedOutIdleSockets) { // actually become pending until 2ms after they have been created. In order // to flush all tasks, we need to wait so that we know there are no // soon-to-be-pending tasks waiting. - PlatformThread::Sleep(10); + base::PlatformThread::Sleep(10); MessageLoop::current()->RunAllPending(); ASSERT_EQ(2, pool_->IdleSocketCount()); @@ -2313,7 +2313,8 @@ TEST_F(ClientSocketPoolBaseTest, BackupSocketCancelAtMaxSockets) { handle.Reset(); // Wait for the backup timer to fire (add some slop to ensure it fires) - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); + base::PlatformThread::Sleep( + ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); MessageLoop::current()->RunAllPending(); EXPECT_EQ(kDefaultMaxSockets, client_socket_factory_.allocation_count()); @@ -2341,7 +2342,8 @@ TEST_F(ClientSocketPoolBaseTest, CancelBackupSocketAfterCancelingAllRequests) { // the backup time to see if it indeed got canceled. handle.Reset(); // Wait for the backup timer to fire (add some slop to ensure it fires) - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); + base::PlatformThread::Sleep( + ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); MessageLoop::current()->RunAllPending(); ASSERT_TRUE(pool_->HasGroup("bar")); EXPECT_EQ(1, pool_->NumConnectJobsInGroup("bar")); @@ -2379,7 +2381,8 @@ TEST_F(ClientSocketPoolBaseTest, CancelBackupSocketAfterFinishingAllRequests) { handle.Reset(); EXPECT_EQ(OK, callback2.WaitForResult()); // Wait for the backup timer to fire (add some slop to ensure it fires) - PlatformThread::Sleep(ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); + base::PlatformThread::Sleep( + ClientSocketPool::kMaxConnectRetryIntervalMs / 2 * 3); MessageLoop::current()->RunAllPending(); } diff --git a/net/url_request/url_request_job_manager.h b/net/url_request/url_request_job_manager.h index a0d3c87..34e3a58 100644 --- a/net/url_request/url_request_job_manager.h +++ b/net/url_request/url_request_job_manager.h @@ -11,7 +11,7 @@ #include <vector> #include "base/lock.h" -#include "base/platform_thread.h" +#include "base/threading/platform_thread.h" #include "net/url_request/url_request.h" template <typename T> struct DefaultSingletonTraits; @@ -84,7 +84,7 @@ class URLRequestJobManager { #ifndef NDEBUG // We use this to assert that CreateJob and the registration functions all // run on the same thread. - mutable PlatformThreadId allowed_thread_; + mutable base::PlatformThreadId allowed_thread_; mutable bool allowed_thread_initialized_; // The first guy to call this function sets the allowed thread. This way we @@ -94,10 +94,10 @@ class URLRequestJobManager { bool IsAllowedThread() const { #if 0 if (!allowed_thread_initialized_) { - allowed_thread_ = PlatformThread::CurrentId(); + allowed_thread_ = base::PlatformThread::CurrentId(); allowed_thread_initialized_ = true; } - return allowed_thread_ == PlatformThread::CurrentId(); + return allowed_thread_ == base::PlatformThread::CurrentId(); #else // The previous version of this check used GetCurrentThread on Windows to // get thread handles to compare. Unfortunately, GetCurrentThread returns |