summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_flash_file_proxy.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 18:00:49 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 18:00:49 +0000
commit92bf906d13ba00204d3f2fc338340ccc670ed545 (patch)
tree28a8803d9a9a0810d2f9d93576d20d1cdf4d63b6 /ppapi/proxy/ppb_flash_file_proxy.cc
parent68a008e82da08b0bf7d421049f0a292b99b88048 (diff)
downloadchromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.zip
chromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.tar.gz
chromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.tar.bz2
Switch IPC::ChannelProxy to use MessageLoopProxy instead of MessageLoop. This allows us to remove usage of the IOThread object, and generally makes IPC::ChannelProxy more robust for future uses.
Review URL: http://codereview.chromium.org/6901146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_flash_file_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_flash_file_proxy.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/ppapi/proxy/ppb_flash_file_proxy.cc b/ppapi/proxy/ppb_flash_file_proxy.cc
index 8b55b4a..9e2aab66 100644
--- a/ppapi/proxy/ppb_flash_file_proxy.cc
+++ b/ppapi/proxy/ppb_flash_file_proxy.cc
@@ -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 @@ class ModuleLocalThreadAdapter
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 @@ bool ModuleLocalThreadAdapter::Filter::OnMessageReceived(
}
ModuleLocalThreadAdapter::ModuleLocalThreadAdapter()
- : main_thread_(MessageLoop::current()),
- io_thread_(NULL) {
+ : main_thread_(base::MessageLoopProxy::CreateForCurrentThread()) {
}
void ModuleLocalThreadAdapter::AddInstanceRouting(PP_Instance instance,
@@ -197,8 +196,8 @@ void ModuleLocalThreadAdapter::AddInstanceRouting(PP_Instance instance,
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 @@ bool ModuleLocalThreadAdapter::Send(PP_Instance instance, IPC::Message* msg) {
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