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

Unified Diff: src/trusted/plugin/service_runtime.h

Issue 7216027: typesafe call-on-main-thread interface. no cast to/from void* required. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 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 | « no previous file | src/trusted/plugin/service_runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/plugin/service_runtime.h
===================================================================
--- src/trusted/plugin/service_runtime.h (revision 5730)
+++ src/trusted/plugin/service_runtime.h (working copy)
@@ -18,11 +18,6 @@
#include "native_client/src/trusted/desc/nacl_desc_wrapper.h"
#include "native_client/src/trusted/weak_ref/weak_ref.h"
-#include "ppapi/c/pp_errors.h" // for PP_OK
-#include "ppapi/cpp/completion_callback.h" // for pp::CompletionCallback
-#include "ppapi/cpp/core.h" // for pp::
-#include "ppapi/cpp/module.h" // for pp::Module
-
namespace nacl {
class DescWrapper;
struct SelLdrLauncher;
@@ -38,27 +33,6 @@
class ScriptableHandle;
class ServiceRuntime;
-// a typesafe utility to schedule a completion callback using weak
-// references
-template <typename R> bool WeakRefCompletionCallback(
- nacl::WeakRefAnchor* anchor,
- int32_t delay_in_milliseconds,
- void callback_fn(nacl::WeakRef<R>* weak_data, int32_t err),
- R* raw_data) {
- nacl::WeakRef<R>* wp = anchor->MakeWeakRef<R>(raw_data);
- if (wp == NULL) {
- return false;
- }
- pp::CompletionCallback cc(reinterpret_cast<void (*)(void*, int32_t)>(
- callback_fn),
- reinterpret_cast<void*>(wp));
- pp::Module::Get()->core()->CallOnMainThread(
- delay_in_milliseconds,
- cc,
- PP_OK);
- return true;
-}
-
class PluginReverseInterface: public nacl::ReverseInterface {
public:
PluginReverseInterface(nacl::WeakRefAnchor* anchor,
« no previous file with comments | « no previous file | src/trusted/plugin/service_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698