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

Side by Side Diff: remoting/client/plugin/pepper_main_thread_task_runner.cc

Issue 1410923004: Replace PluginThreadTaskRunner with a simpler MainPluginThreadTaskRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_mac_test
Patch Set: Created 5 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "remoting/client/plugin/pepper_main_thread_task_runner.h"
6
7 #include "base/bind.h"
8 #include "ppapi/cpp/core.h"
9
10 namespace remoting {
11
12 PepperMainThreadTaskRunner::PepperMainThreadTaskRunner()
13 : core_(pp::Module::Get()->core()), callback_factory_(this) {}
14
15 bool PepperMainThreadTaskRunner::PostDelayedTask(
16 const tracked_objects::Location& from_here,
17 const base::Closure& task,
18 base::TimeDelta delay) {
19 core_->CallOnMainThread(delay.InMillisecondsRoundedUp(),
20 callback_factory_.NewCallback(
21 &PepperMainThreadTaskRunner::RunTask, task));
22 return true;
23 }
24
25 bool PepperMainThreadTaskRunner::PostNonNestableDelayedTask(
26 const tracked_objects::Location& from_here,
27 const base::Closure& task,
28 base::TimeDelta delay) {
29 return PostDelayedTask(from_here, task, delay);
30 }
31
32 bool PepperMainThreadTaskRunner::RunsTasksOnCurrentThread() const {
33 return core_->IsMainThread();
34 }
35
36 PepperMainThreadTaskRunner::~PepperMainThreadTaskRunner() {}
37
38 void PepperMainThreadTaskRunner::RunTask(int32_t result,
39 const base::Closure& task) {
40 task.Run();
41 }
42
43 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_main_thread_task_runner.h ('k') | remoting/client/plugin/pepper_plugin_thread_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698