Skip to content

Commit

Permalink
Remove base/platform_thread.h stub and fix up all callers to use the …
Browse files Browse the repository at this point in the history
…new location and namespace.

TEST=none
BUG=none

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70346 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@google.com committed Jan 1, 2011
1 parent 34b9963 commit f214f87
Show file tree
Hide file tree
Showing 72 changed files with 222 additions and 248 deletions.
24 changes: 0 additions & 24 deletions base/platform_thread.h

This file was deleted.

6 changes: 3 additions & 3 deletions base/test/test_file_util_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/platform_thread.h"
#include "base/scoped_handle.h"
#include "base/threading/platform_thread.h"

namespace file_util {

Expand All @@ -32,7 +32,7 @@ bool DieFileDie(const FilePath& file, bool recurse) {
for (int i = 0; i < 25; ++i) {
if (file_util::Delete(file, recurse))
return true;
PlatformThread::Sleep(kTimeoutMs / 25);
base::PlatformThread::Sleep(kTimeoutMs / 25);
}
return false;
}
Expand Down Expand Up @@ -203,7 +203,7 @@ bool HasInternetZoneIdentifier(const FilePath& full_path) {
// Windows does not guarantee that we will get the same contents even after
// the other process closes the handle, flushes the buffers, etc.
for (int i = 0; i < 20; i++) {
PlatformThread::Sleep(1000);
base::PlatformThread::Sleep(1000);

const DWORD kShare = FILE_SHARE_READ |
FILE_SHARE_WRITE |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "base/atomicops.h"
#include "base/lazy_instance.h"
#include "base/lock.h"
#include "base/platform_thread.h"
#include "ipc/ipc_channel_proxy.h"
#include "net/base/completion_callback.h"
#include "net/base/cookie_store.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/browser_about_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "base/metrics/histogram.h"
#include "base/metrics/stats_table.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/singleton.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/browser_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/threading/platform_thread.h"
#include "base/process_util.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
Expand Down Expand Up @@ -480,7 +480,7 @@ void BrowserMainParts::MainMessageLoopStart() {

void BrowserMainParts::InitializeMainThread() {
const char* kThreadName = "CrBrowserMain";
PlatformThread::SetName(kThreadName);
base::PlatformThread::SetName(kThreadName);
main_message_loop().set_thread_name(kThreadName);

// Register the main thread by instantiating it, but don't call any methods.
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/chromeos/cros/network_library.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include "base/gtest_prod_util.h"
#include "base/observer_list.h"
#include "base/platform_thread.h"
#include "base/scoped_vector.h"
#include "base/singleton.h"
#include "base/string16.h"
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/download/download_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "base/test/test_file_util.h"
#include "base/threading/platform_thread.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/net/url_request_mock_http_job.h"
Expand Down Expand Up @@ -154,7 +154,7 @@ TEST_F(DownloadTest, FLAKY_NoDownload) {
WaitUntilTabCount(1);

// Wait to see if the file will be downloaded.
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());

EXPECT_FALSE(file_util::PathExists(file_path));
if (file_util::PathExists(file_path))
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/download/save_page_uitest.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// 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.

#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "base/test/test_file_util.h"
#include "chrome/app/chrome_command_ids.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/ref_counted.h"
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
#include "base/stl_util-inl.h"
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/history/redirect_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// the case of redirects. It may also mean problems with the history system.

#include "base/file_util.h"
#include "base/platform_thread.h"
#include "base/scoped_ptr.h"
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
#include "base/string16.h"
#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/test/automation/browser_proxy.h"
Expand Down Expand Up @@ -210,7 +210,7 @@ TEST_F(RedirectTest, ClientServerServer) {
NavigateToURL(first_url);

for (int i = 0; i < 10; ++i) {
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects));
Expand Down Expand Up @@ -316,7 +316,7 @@ TEST_F(RedirectTest,
std::wstring final_url_title = UTF8ToWide("Title Of Awesomeness");
// Wait till the final page has been loaded.
for (int i = 0; i < 10; ++i) {
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
ASSERT_TRUE(tab_proxy->GetTabTitle(&tab_title));
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/images_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/platform_thread.h"
#include "base/threading/platform_thread.h"
#include "net/base/net_util.h"
#include "chrome/test/ui/ui_test.h"

Expand All @@ -16,7 +16,7 @@ TEST_F(ImagesTest, AnimatedGIFs) {
NavigateToURL(net::FilePathToFileURL(test_file));

// Let the GIFs fully animate.
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());

std::wstring page_title = L"animated gif test";
EXPECT_EQ(page_title, GetActiveTabTitle());
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/importer/importer_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <vector>

#include "base/basictypes.h"
#include "base/platform_thread.h"
#include "base/ref_counted.h"
#include "base/scoped_vector.h"
#include "build/build_config.h"
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/mach_broker_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/mach_ipc_mac.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/renderer_host/render_process_host.h"
Expand Down Expand Up @@ -54,7 +54,7 @@ class RegisterNotificationTask : public Task {
DISALLOW_COPY_AND_ASSIGN(RegisterNotificationTask);
};

class MachListenerThreadDelegate : public PlatformThread::Delegate {
class MachListenerThreadDelegate : public base::PlatformThread::Delegate {
public:
MachListenerThreadDelegate(MachBroker* broker) : broker_(broker) {
DCHECK(broker_);
Expand Down Expand Up @@ -136,7 +136,8 @@ void MachBroker::PrepareForFork() {
BrowserThread::UI, FROM_HERE, new RegisterNotificationTask(this));

// Intentional leak. This thread is never joined or reaped.
PlatformThread::CreateNonJoinable(0, new MachListenerThreadDelegate(this));
base::PlatformThread::CreateNonJoinable(
0, new MachListenerThreadDelegate(this));
}
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/media_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "app/gfx/gl/gl_implementation.h"
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "base/threading/platform_thread.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/test_launcher_utils.h"
#include "chrome/test/ui/ui_layout_test.h"
Expand Down Expand Up @@ -46,7 +46,7 @@ class MediaTest : public UITest {
const std::wstring kFailed = L"FAILED";
const std::wstring kError = L"ERROR";
for (int i = 0; i < 10; ++i) {
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());
const std::wstring& title = GetActiveTabTitle();
if (title == kPlaying || title == kFailed ||
StartsWith(title, kError, true))
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/metrics/metrics_service_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
#include "base/threading/platform_thread.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_service_mock_builder.h"
#include "chrome/browser/prefs/pref_value_store.h"
Expand Down Expand Up @@ -99,7 +99,7 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
}

// Give the browser a chance to notice the crashed tab.
PlatformThread::Sleep(sleep_timeout_ms());
base::PlatformThread::Sleep(sleep_timeout_ms());

QuitBrowser();

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/net/url_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <time.h>
#include <string>

#include "base/platform_thread.h"
#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "chrome/browser/net/url_info.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down Expand Up @@ -67,7 +67,7 @@ TEST(UrlHostInfoTest, StateChangeTest) {
info.SetAssignedState();
EXPECT_FALSE(info.NeedsDnsUpdate());
// Greater than minimal expected network latency on DNS lookup.
PlatformThread::Sleep(25);
base::PlatformThread::Sleep(25);
before_resolution_complete = TimeTicks::Now();
info.SetNoSuchNameState();
// "Immediately" check to see if we need an update yet (we shouldn't).
Expand All @@ -78,7 +78,7 @@ TEST(UrlHostInfoTest, StateChangeTest) {
return;
}
// Wait over 300ms, so it should definately be considered out of cache.
PlatformThread::Sleep(kMockExpirationTime + 20);
base::PlatformThread::Sleep(kMockExpirationTime + 20);
EXPECT_TRUE(info.NeedsDnsUpdate()) << "expiration time not honored";
}

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/net/url_request_slow_http_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "chrome/browser/net/url_request_slow_http_job.h"

#include "base/platform_thread.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "net/url_request/url_request_filter.h"
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/password_manager/password_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <vector>

#include "base/platform_thread.h"
#include "base/stl_util-inl.h"
#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/password_manager/password_form_manager.h"
Expand Down Expand Up @@ -35,8 +35,9 @@ void PasswordManager::RegisterUserPrefs(PrefService* prefs) {
// avoid needing to lock (a static boolean flag is then sufficient to
// guarantee running only once).
static void ReportMetrics(bool password_manager_enabled) {
static PlatformThreadId initial_thread_id = PlatformThread::CurrentId();
DCHECK(initial_thread_id == PlatformThread::CurrentId());
static base::PlatformThreadId initial_thread_id =
base::PlatformThread::CurrentId();
DCHECK(initial_thread_id == base::PlatformThread::CurrentId());

static bool ran_once = false;
if (ran_once)
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/process_singleton_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@
#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/rand_util.h"
#include "base/safe_strerror_posix.h"
#include "base/stl_util-inl.h"
#include "base/string_number_conversions.h"
#include "base/string_split.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "base/timer.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#if defined(TOOLKIT_GTK)
Expand Down Expand Up @@ -818,7 +818,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
return PROCESS_NONE;
}

PlatformThread::Sleep(1000 /* ms */);
base::PlatformThread::Sleep(1000 /* ms */);
}

timeval timeout = {timeout_seconds, 0};
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/sanity_uitest.cc
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -9,7 +9,6 @@

#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/platform_thread.h"
#include "chrome/common/chrome_switches.h"
#include "net/base/net_util.h"

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/session_history_uitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/platform_thread.h"
#include "base/string_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/automation/tab_proxy.h"
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/sync/engine/syncapi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "base/lock.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/platform_thread.h"
#include "base/scoped_ptr.h"
#include "base/sha1.h"
#include "base/string_util.h"
Expand Down
Loading

0 comments on commit f214f87

Please sign in to comment.