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

Unified Diff: ppapi/proxy/enter_proxy.h

Issue 7874002: This patch tries to remove most of the manual registration for Pepper interfaces, and replaces it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/enter_proxy.h
===================================================================
--- ppapi/proxy/enter_proxy.h (revision 100758)
+++ ppapi/proxy/enter_proxy.h (working copy)
@@ -13,6 +13,11 @@
#include "ppapi/thunk/enter.h"
namespace ppapi {
+
+namespace thunk {
+class ResourceCreationAPI;
+}
+
namespace proxy {
// Wrapper around EnterResourceNoLock that takes a host resource. This is used
@@ -115,6 +120,21 @@
RunCallback(PP_ERROR_BADRESOURCE);
}
+ // For callbacks that take two extra parameters as a closure.
+ template<class CallbackFactory, typename Method, typename A, typename B>
+ EnterHostFromHostResourceForceCallback(
+ const HostResource& host_resource,
+ CallbackFactory& factory,
+ Method method,
+ const A& a,
+ const B& b)
+ : EnterHostFromHostResource<ResourceT>(host_resource),
+ needs_running_(true),
+ callback_(factory.NewOptionalCallback(method, a, b)) {
+ if (this->failed())
+ RunCallback(PP_ERROR_BADRESOURCE);
+ }
+
~EnterHostFromHostResourceForceCallback() {
if (needs_running_) {
NOTREACHED() << "Should always call SetResult except in the "
« no previous file with comments | « ppapi/proxy/dispatcher.cc ('k') | ppapi/proxy/host_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698