Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1553)

Unified Diff: content/test/test_browser_thread.cc

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix official build, avoid DCHECK in official Linux/ChromeOS builds. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/test_browser_thread.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_browser_thread.cc
diff --git a/content/test/test_browser_thread.cc b/content/test/test_browser_thread.cc
index bd3191947a37015052b2b1920c60d5d116bd0077..9224726dcc8f231e7009240e2265b29f2b9caa84 100644
--- a/content/test/test_browser_thread.cc
+++ b/content/test/test_browser_thread.cc
@@ -10,13 +10,37 @@
namespace content {
+// This gives access to set_message_loop().
+class TestBrowserThreadImpl : public BrowserThreadImpl {
+ public:
+ explicit TestBrowserThreadImpl(BrowserThread::ID identifier)
+ : BrowserThreadImpl(identifier) {
+ }
+
+ TestBrowserThreadImpl(BrowserThread::ID identifier,
+ MessageLoop* message_loop)
+ : BrowserThreadImpl(identifier, message_loop) {
+ }
+
+ virtual ~TestBrowserThreadImpl() {
+ Stop();
+ }
+
+ void set_message_loop(MessageLoop* loop) {
+ Thread::set_message_loop(loop);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestBrowserThreadImpl);
+};
+
TestBrowserThread::TestBrowserThread(BrowserThread::ID identifier)
- : impl_(new BrowserThreadImpl(identifier)) {
+ : impl_(new TestBrowserThreadImpl(identifier)) {
}
TestBrowserThread::TestBrowserThread(BrowserThread::ID identifier,
MessageLoop* message_loop)
- : impl_(new BrowserThreadImpl(identifier, message_loop)) {
+ : impl_(new TestBrowserThreadImpl(identifier, message_loop)) {
}
TestBrowserThread::~TestBrowserThread() {
@@ -45,4 +69,8 @@ base::Thread* TestBrowserThread::DeprecatedGetThreadObject() {
return impl_.get();
}
+void TestBrowserThread::DeprecatedSetMessageLoop(MessageLoop* loop) {
+ impl_->set_message_loop(loop);
+}
+
} // namespace content
« no previous file with comments | « content/test/test_browser_thread.h ('k') | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698