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

Unified Diff: ppapi/proxy/ppb_flash_file_proxy.cc

Issue 6901146: Switch IPC::ChannelProxy to use MessageLoopProxy instead of MessageLoop. This allows us to remov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months 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 | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/proxy_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_file_proxy.cc
===================================================================
--- ppapi/proxy/ppb_flash_file_proxy.cc (revision 83679)
+++ ppapi/proxy/ppb_flash_file_proxy.cc (working copy)
@@ -9,7 +9,7 @@
#include <vector>
#include "base/logging.h"
-#include "base/message_loop.h"
+#include "base/message_loop_proxy.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "build/build_config.h"
@@ -111,10 +111,10 @@
base::Lock lock_;
- MessageLoop* main_thread_;
+ scoped_refptr<base::MessageLoopProxy> main_thread_;
// Will be NULL before an instance routing is added.
- MessageLoop* io_thread_;
+ scoped_refptr<base::MessageLoopProxy> io_thread_;
typedef std::map<PP_Instance, Dispatcher*> InstanceToDispatcher;
InstanceToDispatcher instance_to_dispatcher_;
@@ -188,8 +188,7 @@
}
ModuleLocalThreadAdapter::ModuleLocalThreadAdapter()
- : main_thread_(MessageLoop::current()),
- io_thread_(NULL) {
+ : main_thread_(base::MessageLoopProxy::CreateForCurrentThread()) {
}
void ModuleLocalThreadAdapter::AddInstanceRouting(PP_Instance instance,
@@ -197,8 +196,8 @@
base::AutoLock lock(lock_);
// Now that we've had contact with a dispatcher, we can set up the IO thread.
- DCHECK(MessageLoop::current() == main_thread_);
- if (!io_thread_)
+ DCHECK(main_thread_->BelongsToCurrentThread());
+ if (!io_thread_.get())
io_thread_ = dispatcher->GetIPCMessageLoop();
// Set up the instance -> dispatcher routing.
@@ -275,7 +274,7 @@
dispatcher = found->second;
}
- if (MessageLoop::current() == main_thread_) {
+ if (main_thread_->BelongsToCurrentThread()) {
// Easy case: We're on the same thread as the dispatcher, so we don't need
// a lock to access it, and we can just use the normal sync channel stuff
// to handle the message. Actually, we MUST use the normal sync channel
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/proxy_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698