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

Unified Diff: chrome/browser/extensions/user_script_listener_unittest.cc

Issue 353015: Last patch in removing MessageLoop* caching. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
Index: chrome/browser/extensions/user_script_listener_unittest.cc
===================================================================
--- chrome/browser/extensions/user_script_listener_unittest.cc (revision 30863)
+++ chrome/browser/extensions/user_script_listener_unittest.cc (working copy)
@@ -65,11 +65,8 @@
public URLRequest::Interceptor,
public base::RefCountedThreadSafe<ResourceDispatcherHostTester> {
public:
- explicit ResourceDispatcherHostTester(MessageLoop* io_loop)
- : Receiver(ChildProcessInfo::RENDER_PROCESS, -1),
- host_(io_loop),
- ui_loop_(MessageLoop::current()),
- io_loop_(io_loop) {
+ explicit ResourceDispatcherHostTester()
+ : Receiver(ChildProcessInfo::RENDER_PROCESS, -1) {
URLRequest::RegisterRequestInterceptor(this);
}
virtual ~ResourceDispatcherHostTester() {
@@ -77,17 +74,20 @@
}
void MakeTestRequest(int request_id, const GURL& url) {
- io_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResourceDispatcherHostTester::MakeTestRequestOnIOThread,
- request_id, url));
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this, &ResourceDispatcherHostTester::MakeTestRequestOnIOThread,
+ request_id, url));
MessageLoop::current()->Run(); // wait for Quit from IO thread
}
void WaitForScan(MockUserScriptMaster* master) {
master->TestStartScan();
MessageLoop::current()->RunAllPending(); // run the scan
- io_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ResourceDispatcherHostTester::RunPending));
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(this, &ResourceDispatcherHostTester::RunPending));
MessageLoop::current()->Run(); // wait for Quit from IO thread
}
@@ -149,7 +149,8 @@
MessageLoop::current()->SetNestableTasksAllowed(false);
// return control to UI thread.
- ui_loop_->PostTask(FROM_HERE, new MessageLoop::QuitTask());
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE, new MessageLoop::QuitTask());
}
void MakeTestRequestOnIOThread(int request_id, const GURL& url) {
@@ -172,8 +173,6 @@
}
ResourceDispatcherHost host_;
- MessageLoop* ui_loop_;
- MessageLoop* io_loop_;
// Note: these variables are accessed on both threads, but since we only
// one thread executes at a time, they are safe.
@@ -195,8 +194,7 @@
FilePath install_dir = profile_.GetPath()
.AppendASCII(ExtensionsService::kInstallDirectoryName);
- resource_tester_ =
- new ResourceDispatcherHostTester(io_thread_->message_loop());
+ resource_tester_ = new ResourceDispatcherHostTester();
master_ = new MockUserScriptMaster(install_dir);
« no previous file with comments | « chrome/browser/download/download_request_manager_unittest.cc ('k') | chrome/browser/privacy_blacklist/blacklist_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698