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

Side by Side Diff: ppapi/proxy/plugin_globals.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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/network_monitor_resource.h ('k') | ppapi/proxy/plugin_message_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/plugin_globals.h" 5 #include "ppapi/proxy/plugin_globals.h"
6 6
7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h"
7 #include "base/task_runner.h" 9 #include "base/task_runner.h"
8 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
9 #include "ipc/ipc_message.h" 11 #include "ipc/ipc_message.h"
10 #include "ipc/ipc_sender.h" 12 #include "ipc/ipc_sender.h"
11 #include "ppapi/proxy/plugin_dispatcher.h" 13 #include "ppapi/proxy/plugin_dispatcher.h"
12 #include "ppapi/proxy/plugin_message_filter.h" 14 #include "ppapi/proxy/plugin_message_filter.h"
13 #include "ppapi/proxy/plugin_proxy_delegate.h" 15 #include "ppapi/proxy/plugin_proxy_delegate.h"
14 #include "ppapi/proxy/ppapi_messages.h" 16 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/ppb_message_loop_proxy.h" 17 #include "ppapi/proxy/ppb_message_loop_proxy.h"
16 #include "ppapi/proxy/resource_reply_thread_registrar.h" 18 #include "ppapi/proxy/resource_reply_thread_registrar.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return MessageLoopResource::GetCurrent(); 175 return MessageLoopResource::GetCurrent();
174 } 176 }
175 177
176 base::TaskRunner* PluginGlobals::GetFileTaskRunner() { 178 base::TaskRunner* PluginGlobals::GetFileTaskRunner() {
177 if (!file_thread_.get()) { 179 if (!file_thread_.get()) {
178 file_thread_.reset(new base::Thread("Plugin::File")); 180 file_thread_.reset(new base::Thread("Plugin::File"));
179 base::Thread::Options options; 181 base::Thread::Options options;
180 options.message_loop_type = base::MessageLoop::TYPE_IO; 182 options.message_loop_type = base::MessageLoop::TYPE_IO;
181 file_thread_->StartWithOptions(options); 183 file_thread_->StartWithOptions(options);
182 } 184 }
183 return file_thread_->message_loop_proxy().get(); 185 return file_thread_->task_runner().get();
184 } 186 }
185 187
186 void PluginGlobals::MarkPluginIsActive() { 188 void PluginGlobals::MarkPluginIsActive() {
187 if (!plugin_recently_active_) { 189 if (!plugin_recently_active_) {
188 plugin_recently_active_ = true; 190 plugin_recently_active_ = true;
189 if (!GetBrowserSender() || !base::MessageLoop::current()) 191 if (!GetBrowserSender() || !base::MessageLoop::current())
190 return; 192 return;
191 GetBrowserSender()->Send(new PpapiHostMsg_Keepalive()); 193 GetBrowserSender()->Send(new PpapiHostMsg_Keepalive());
192 DCHECK(keepalive_throttle_interval_milliseconds_); 194 DCHECK(keepalive_throttle_interval_milliseconds_);
193 GetMainThreadMessageLoop()->PostDelayedTask( 195 GetMainThreadMessageLoop()->PostDelayedTask(
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 return true; 259 return true;
258 } 260 }
259 261
260 void PluginGlobals::OnReleaseKeepaliveThrottle() { 262 void PluginGlobals::OnReleaseKeepaliveThrottle() {
261 ppapi::ProxyLock::AssertAcquiredDebugOnly(); 263 ppapi::ProxyLock::AssertAcquiredDebugOnly();
262 plugin_recently_active_ = false; 264 plugin_recently_active_ = false;
263 } 265 }
264 266
265 } // namespace proxy 267 } // namespace proxy
266 } // namespace ppapi 268 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/network_monitor_resource.h ('k') | ppapi/proxy/plugin_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698