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

Unified Diff: ppapi/proxy/enter_proxy.h

Issue 7740038: Use macros to define pepper interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review 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
Index: ppapi/proxy/enter_proxy.h
diff --git a/ppapi/proxy/enter_proxy.h b/ppapi/proxy/enter_proxy.h
index 68527806f4acc7bf42fdb61c1815debe02616c46..d7bf7c2e9a058a6ddd66c0353d8bdd2feb995867 100644
--- a/ppapi/proxy/enter_proxy.h
+++ b/ppapi/proxy/enter_proxy.h
@@ -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 @@ class EnterHostFromHostResourceForceCallback
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 "

Powered by Google App Engine
This is Rietveld 408576698