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

Unified Diff: ppapi/proxy/ppb_message_loop_proxy.cc

Issue 1174543002: ppapi: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix V8VarConverterTest. Created 5 years, 6 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/ppb_message_loop_proxy.h ('k') | ppapi/proxy/resource_reply_thread_registrar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_message_loop_proxy.cc
diff --git a/ppapi/proxy/ppb_message_loop_proxy.cc b/ppapi/proxy/ppb_message_loop_proxy.cc
index 555c008d523209eacd8535323d54f62b1bb6b8a1..3d29a7b9a89201f1e700bda0d28a194d39117f24 100644
--- a/ppapi/proxy/ppb_message_loop_proxy.cc
+++ b/ppapi/proxy/ppb_message_loop_proxy.cc
@@ -8,8 +8,8 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
-#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/location.h"
+#include "base/thread_task_runner_handle.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_message_loop.h"
#include "ppapi/proxy/plugin_dispatcher.h"
@@ -55,7 +55,7 @@ MessageLoopResource::MessageLoopResource(ForMainThread for_main_thread)
slot->Set(this);
- loop_proxy_ = base::MessageLoopProxy::current();
+ task_runner_ = base::ThreadTaskRunnerHandle::Get();
}
@@ -89,7 +89,7 @@ int32_t MessageLoopResource::AttachToCurrentThread() {
slot->Set(this);
loop_.reset(new base::MessageLoop);
- loop_proxy_ = base::MessageLoopProxy::current();
+ task_runner_ = base::ThreadTaskRunnerHandle::Get();
// Post all pending work to the message loop.
for (size_t i = 0; i < pending_tasks_.size(); i++) {
@@ -113,7 +113,7 @@ int32_t MessageLoopResource::Run() {
nested_invocations_--;
if (should_destroy_ && nested_invocations_ == 0) {
- loop_proxy_ = NULL;
+ task_runner_ = NULL;
loop_.reset();
destroyed_ = true;
}
@@ -159,7 +159,7 @@ MessageLoopResource* MessageLoopResource::GetCurrent() {
void MessageLoopResource::DetachFromThread() {
// Note that the message loop must be destroyed on the thread it was created
// on.
- loop_proxy_ = NULL;
+ task_runner_ = NULL;
loop_.reset();
// Cancel out the AddRef in AttachToCurrentThread().
@@ -179,9 +179,9 @@ void MessageLoopResource::PostClosure(
const tracked_objects::Location& from_here,
const base::Closure& closure,
int64 delay_ms) {
- if (loop_proxy_.get()) {
- loop_proxy_->PostDelayedTask(
- from_here, closure, base::TimeDelta::FromMilliseconds(delay_ms));
+ if (task_runner_.get()) {
+ task_runner_->PostDelayedTask(from_here, closure,
+ base::TimeDelta::FromMilliseconds(delay_ms));
} else {
TaskInfo info;
info.from_here = FROM_HERE;
@@ -191,8 +191,8 @@ void MessageLoopResource::PostClosure(
}
}
-base::MessageLoopProxy* MessageLoopResource::GetMessageLoopProxy() {
- return loop_proxy_.get();
+base::SingleThreadTaskRunner* MessageLoopResource::GetTaskRunner() {
+ return task_runner_.get();
}
bool MessageLoopResource::CurrentlyHandlingBlockingMessage() {
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.h ('k') | ppapi/proxy/resource_reply_thread_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698