summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/enter_proxy.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 22:21:59 +0000
commit11f515acdda3473200ff0cc4106a0020a7d4dc74 (patch)
treecdfd9713928d6f0fa73b5cd7bedbd965fc93e329 /ppapi/proxy/enter_proxy.h
parentf60d96e82acd547ac834b93cd68865b66ab5b4da (diff)
downloadchromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.zip
chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.gz
chromium_src-11f515acdda3473200ff0cc4106a0020a7d4dc74.tar.bz2
New file chooser interface that uses the new PP_ArrayOutput feature. This also changes PP_ArrayOutput to be pass-by-value.
This keeps backwards compat for the old interface. It fixes some bugs in the callback system that I found when working on the patch and adds some new machinery for doing array output in the proxy. It also re-enables the file chooser feature which was recently broken. BUG=118857 Review URL: https://chromiumcodereview.appspot.com/9728001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/enter_proxy.h')
-rw-r--r--ppapi/proxy/enter_proxy.h46
1 files changed, 12 insertions, 34 deletions
diff --git a/ppapi/proxy/enter_proxy.h b/ppapi/proxy/enter_proxy.h
index 5306a80..86ee7a0 100644
--- a/ppapi/proxy/enter_proxy.h
+++ b/ppapi/proxy/enter_proxy.h
@@ -89,6 +89,14 @@ template<typename ResourceT>
class EnterHostFromHostResourceForceCallback
: public EnterHostFromHostResource<ResourceT> {
public:
+ EnterHostFromHostResourceForceCallback(
+ const HostResource& host_resource,
+ const pp::CompletionCallback& callback)
+ : EnterHostFromHostResource<ResourceT>(host_resource),
+ needs_running_(true),
+ callback_(callback) {
+ }
+
// For callbacks that take no parameters except the "int32_t result". Most
// implementations will use the 1-extra-argument constructor below.
template<class CallbackFactory, typename Method>
@@ -168,42 +176,12 @@ template<typename FunctionT>
class EnterHostFunctionForceCallback
: public thunk::EnterFunctionNoLock<FunctionT> {
public:
- // For callbacks that take no parameters except the "int32_t result". Most
- // implementations will use the 1-extra-argument constructor below.
- template<class CallbackFactory, typename Method>
- EnterHostFunctionForceCallback(PP_Instance instance,
- CallbackFactory& factory,
- Method method)
+ EnterHostFunctionForceCallback(
+ PP_Instance instance,
+ const pp::CompletionCallback& callback)
: thunk::EnterFunctionNoLock<FunctionT>(instance, false),
needs_running_(true),
- callback_(factory.NewOptionalCallback(method)) {
- if (this->failed())
- RunCallback(PP_ERROR_BADARGUMENT);
- }
-
- // For callbacks that take an extra parameter as a closure.
- template<class CallbackFactory, typename Method, typename A>
- EnterHostFunctionForceCallback(PP_Instance instance,
- CallbackFactory& factory,
- Method method,
- const A& a)
- : thunk::EnterFunctionNoLock<FunctionT>(instance, false),
- needs_running_(true),
- callback_(factory.NewOptionalCallback(method, a)) {
- if (this->failed())
- RunCallback(PP_ERROR_BADARGUMENT);
- }
-
- // For callbacks that take two extra parameters as a closure.
- template<class CallbackFactory, typename Method, typename A, typename B>
- EnterHostFunctionForceCallback(PP_Instance instance,
- CallbackFactory& factory,
- Method method,
- const A& a,
- const B& b)
- : thunk::EnterFunctionNoLock<FunctionT>(instance),
- needs_running_(true),
- callback_(factory.NewOptionalCallback(method, a, b)) {
+ callback_(callback) {
if (this->failed())
RunCallback(PP_ERROR_BADARGUMENT);
}