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

Side by Side Diff: remoting/client/plugin/pepper_plugin_thread_delegate.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
« no previous file with comments | « remoting/client/plugin/pepper_plugin_thread_delegate.h ('k') | remoting/remoting_srcs.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h"
6
7 #include "ppapi/cpp/completion_callback.h"
8 #include "ppapi/cpp/module.h"
9
10 namespace remoting {
11
12 PepperPluginThreadDelegate::PepperPluginThreadDelegate()
13 : core_(pp::Module::Get()->core()) {
14 }
15
16 PepperPluginThreadDelegate::~PepperPluginThreadDelegate() { }
17
18 bool PepperPluginThreadDelegate::RunOnPluginThread(
19 base::TimeDelta delay, void(CDECL function)(void*), void* data) {
20 // It is safe to cast |function| to PP_CompletionCallback_Func,
21 // which is defined as void(*)(void*, int). The callee will just
22 // ignore the last argument. The only case when it may be unsafe is
23 // with VS when default calling convention is set to __stdcall, but
24 // this code will not typecheck in that case.
25 core_->CallOnMainThread(
26 delay.InMilliseconds(), pp::CompletionCallback(
27 reinterpret_cast<PP_CompletionCallback_Func>(function), data), 0);
28 return true;
29 }
30
31 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_plugin_thread_delegate.h ('k') | remoting/remoting_srcs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698