summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 02:17:08 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-01 02:17:08 +0000
commitf214f8797150f49e1233110c1dafe4e8b601d9ea (patch)
tree191f4f5b9ee1d9c20fc02dd4f1c940ad4d04267c /chrome/common
parent34b9963c187a733bef76535521f3de688fffd34f (diff)
downloadchromium_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 'chrome/common')
-rw-r--r--chrome/common/deprecated/event_sys_unittest.cc12
-rw-r--r--chrome/common/extensions/extension_resource.h1
-rw-r--r--chrome/common/notification_registrar.cc10
-rw-r--r--chrome/common/process_watcher_posix.cc10
-rw-r--r--chrome/common/worker_thread_ticker_unittest.cc4
5 files changed, 18 insertions, 19 deletions
diff --git a/chrome/common/deprecated/event_sys_unittest.cc b/chrome/common/deprecated/event_sys_unittest.cc
index 3e7957e..1d35d5f 100644
--- a/chrome/common/deprecated/event_sys_unittest.cc
+++ b/chrome/common/deprecated/event_sys_unittest.cc
@@ -9,8 +9,8 @@
#include "base/basictypes.h"
#include "base/message_loop.h"
-#include "base/platform_thread.h"
#include "base/port.h"
+#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#include "chrome/common/deprecated/event_sys-inl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -140,7 +140,7 @@ TEST(EventSys, Basic) {
// This goes pretty far beyond the normal use pattern, so don't use
// ThreadTester as an example of what to do.
class ThreadTester : public EventListener<TestEvent>,
- public PlatformThread::Delegate {
+ public base::PlatformThread::Delegate {
public:
explicit ThreadTester(Pair* pair)
: pair_(pair), remove_event_(&remove_event_mutex_),
@@ -150,12 +150,12 @@ class ThreadTester : public EventListener<TestEvent>,
~ThreadTester() {
pair_->event_channel()->RemoveListener(this);
for (size_t i = 0; i < threads_.size(); i++) {
- PlatformThread::Join(threads_[i].thread);
+ base::PlatformThread::Join(threads_[i].thread);
}
}
struct ThreadInfo {
- PlatformThreadHandle thread;
+ base::PlatformThreadHandle thread;
};
struct ThreadArgs {
@@ -173,7 +173,7 @@ class ThreadTester : public EventListener<TestEvent>,
args.thread_running_mutex = &(thread_running_mutex);
args.thread_running = false;
args_ = args;
- ASSERT_TRUE(PlatformThread::Create(0, this, &info.thread));
+ ASSERT_TRUE(base::PlatformThread::Create(0, this, &info.thread));
thread_running_mutex.Acquire();
while ((args_.thread_running) == false) {
thread_running_cond.Wait();
@@ -216,7 +216,7 @@ class ThreadTester : public EventListener<TestEvent>,
remove_event_.Broadcast();
remove_event_mutex_.Release();
- PlatformThread::YieldCurrentThread();
+ base::PlatformThread::YieldCurrentThread();
completed_mutex_.Acquire();
if (completed_)
diff --git a/chrome/common/extensions/extension_resource.h b/chrome/common/extensions/extension_resource.h
index c680345..86705a88 100644
--- a/chrome/common/extensions/extension_resource.h
+++ b/chrome/common/extensions/extension_resource.h
@@ -9,7 +9,6 @@
#include <string>
#include "base/file_path.h"
-#include "base/platform_thread.h"
// Represents a resource inside an extension. For example, an image, or a
// JavaScript file. This is more complicated than just a simple FilePath
diff --git a/chrome/common/notification_registrar.cc b/chrome/common/notification_registrar.cc
index d413585..841d5d7 100644
--- a/chrome/common/notification_registrar.cc
+++ b/chrome/common/notification_registrar.cc
@@ -7,13 +7,13 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/threading/platform_thread.h"
#include "chrome/common/notification_service.h"
-#include "base/platform_thread.h"
namespace {
-void CheckCalledOnValidThread(PlatformThreadId thread_id) {
- PlatformThreadId current_thread_id = PlatformThread::CurrentId();
+void CheckCalledOnValidThread(base::PlatformThreadId thread_id) {
+ base::PlatformThreadId current_thread_id = base::PlatformThread::CurrentId();
CHECK(current_thread_id == thread_id) << "called on invalid thread: "
<< thread_id << " vs. "
<< current_thread_id;
@@ -27,7 +27,7 @@ struct NotificationRegistrar::Record {
NotificationObserver* observer;
NotificationType type;
NotificationSource source;
- PlatformThreadId thread_id;
+ base::PlatformThreadId thread_id;
};
bool NotificationRegistrar::Record::operator==(const Record& other) const {
@@ -49,7 +49,7 @@ void NotificationRegistrar::Add(NotificationObserver* observer,
const NotificationSource& source) {
DCHECK(!IsRegistered(observer, type, source)) << "Duplicate registration.";
- Record record = { observer, type, source, PlatformThread::CurrentId() };
+ Record record = { observer, type, source, base::PlatformThread::CurrentId() };
registered_.push_back(record);
NotificationService::current()->AddObserver(observer, type, source);
diff --git a/chrome/common/process_watcher_posix.cc b/chrome/common/process_watcher_posix.cc
index 4b13c32..38a4e1b 100644
--- a/chrome/common/process_watcher_posix.cc
+++ b/chrome/common/process_watcher_posix.cc
@@ -11,7 +11,7 @@
#include "base/eintr_wrapper.h"
#include "base/logging.h"
-#include "base/platform_thread.h"
+#include "base/threading/platform_thread.h"
// Return true if the given child is dead. This will also reap the process.
// Doesn't block.
@@ -30,7 +30,7 @@ static bool IsChildDead(pid_t child) {
// A thread class which waits for the given child to exit and reaps it.
// If the child doesn't exit within a couple of seconds, kill it.
-class BackgroundReaper : public PlatformThread::Delegate {
+class BackgroundReaper : public base::PlatformThread::Delegate {
public:
explicit BackgroundReaper(pid_t child, unsigned timeout)
: child_(child),
@@ -58,7 +58,7 @@ class BackgroundReaper : public PlatformThread::Delegate {
// Wait for 2 * timeout_ 500 milliseconds intervals.
for (unsigned i = 0; i < 2 * timeout_; ++i) {
- PlatformThread::Sleep(500); // 0.5 seconds
+ base::PlatformThread::Sleep(500); // 0.5 seconds
if (IsChildDead(child_))
return;
}
@@ -91,7 +91,7 @@ void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle process) {
const unsigned timeout = 2; // seconds
BackgroundReaper* reaper = new BackgroundReaper(process, timeout);
- PlatformThread::CreateNonJoinable(0, reaper);
+ base::PlatformThread::CreateNonJoinable(0, reaper);
}
// static
@@ -101,5 +101,5 @@ void ProcessWatcher::EnsureProcessGetsReaped(base::ProcessHandle process) {
return;
BackgroundReaper* reaper = new BackgroundReaper(process, 0);
- PlatformThread::CreateNonJoinable(0, reaper);
+ base::PlatformThread::CreateNonJoinable(0, reaper);
}
diff --git a/chrome/common/worker_thread_ticker_unittest.cc b/chrome/common/worker_thread_ticker_unittest.cc
index 71b74c8..b3e1f08 100644
--- a/chrome/common/worker_thread_ticker_unittest.cc
+++ b/chrome/common/worker_thread_ticker_unittest.cc
@@ -5,7 +5,7 @@
#include "chrome/common/worker_thread_ticker.h"
#include "base/message_loop.h"
-#include "base/platform_thread.h"
+#include "base/threading/platform_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -32,7 +32,7 @@ class TestCallback : public WorkerThreadTicker::Callback {
class LongCallback : public WorkerThreadTicker::Callback {
public:
virtual void OnTick() {
- PlatformThread::Sleep(1500);
+ base::PlatformThread::Sleep(1500);
}
};