summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 06:31:11 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 06:31:11 +0000
commit4359457426b44936559c4aff30e52756f9356310 (patch)
treecd2f3930e6375a9dc04ed7e6e1c639d860ff450f /ppapi/thunk
parent9e29120223794db9e151127256ff2c8c2e0a79f3 (diff)
downloadchromium_src-4359457426b44936559c4aff30e52756f9356310.zip
chromium_src-4359457426b44936559c4aff30e52756f9356310.tar.gz
chromium_src-4359457426b44936559c4aff30e52756f9356310.tar.bz2
PPAPI: Generalize PPB_Ext_CrxFileSystem as PPB_IsolatedFileSystem
This change generalizes PPB_Ext_CrxFileSystem_Private, built on the isolated filesystem, so that we can easily reuse its components when introducing new isolated filesystem in PPAPI. This adds PPB_IsolatedFileSystem_Private API and enum indicating isolated filesystem type. PPB_Ext_CrxFileSystem_Private API is still remaining since some plugins may use the API. Both API share pepper resource and host implementations. BUG=286242 TEST=manual (see [1] and [2]) TBR=cpu@chromium.org [1] https://code.google.com/p/chromium/issues/detail?id=271126#c7 [2] https://codereview.chromium.org/59203002/ Review URL: https://codereview.chromium.org/51653004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_private_no_permissions.h2
-rw-r--r--ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc16
-rw-r--r--ppapi/thunk/ppb_isolated_file_system_private_api.h (renamed from ppapi/thunk/ppb_ext_crx_file_system_private_api.h)16
-rw-r--r--ppapi/thunk/ppb_isolated_file_system_private_thunk.cc51
4 files changed, 70 insertions, 15 deletions
diff --git a/ppapi/thunk/interfaces_ppb_private_no_permissions.h b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
index 15e8043..8fe92f1 100644
--- a/ppapi/thunk/interfaces_ppb_private_no_permissions.h
+++ b/ppapi/thunk/interfaces_ppb_private_no_permissions.h
@@ -40,6 +40,8 @@ PROXIED_IFACE(NoAPIName, PPB_EXT_CRXFILESYSTEM_PRIVATE_INTERFACE_0_1,
PPB_Ext_CrxFileSystem_Private_0_1)
PROXIED_IFACE(NoAPIName, PPB_FILEIO_PRIVATE_INTERFACE_0_1,
PPB_FileIO_Private_0_1)
+PROXIED_IFACE(NoAPIName, PPB_ISOLATEDFILESYSTEM_PRIVATE_INTERFACE_0_1,
+ PPB_IsolatedFileSystem_Private_0_1)
PROXIED_IFACE(NoAPIName, PPB_VIDEODESTINATION_PRIVATE_INTERFACE_0_1,
PPB_VideoDestination_Private_0_1)
diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
index 7e18ba9..67f0ec8 100644
--- a/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
+++ b/ppapi/thunk/ppb_ext_crx_file_system_private_thunk.cc
@@ -2,16 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// From private/ppb_ext_crx_file_system_private.idl,
-// modified Fri May 3 09:24:58 2013.
-
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_ext_crx_file_system_private.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
-#include "ppapi/thunk/ppb_ext_crx_file_system_private_api.h"
#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/ppb_isolated_file_system_private_api.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
@@ -24,12 +21,15 @@ int32_t Open(PP_Instance instance,
PP_Resource* file_system,
struct PP_CompletionCallback callback) {
VLOG(4) << "PPB_Ext_CrxFileSystem_Private::Open()";
- EnterInstanceAPI<PPB_Ext_CrxFileSystem_Private_API> enter(instance, callback);
+ EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance,
+ callback);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.functions()->Open(instance,
- file_system,
- enter.callback()));
+ return enter.SetResult(enter.functions()->Open(
+ instance,
+ PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX,
+ file_system,
+ enter.callback()));
}
const PPB_Ext_CrxFileSystem_Private_0_1
diff --git a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h b/ppapi/thunk/ppb_isolated_file_system_private_api.h
index 9af926d..bca2332 100644
--- a/ppapi/thunk/ppb_ext_crx_file_system_private_api.h
+++ b/ppapi/thunk/ppb_isolated_file_system_private_api.h
@@ -1,11 +1,12 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
-#define PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
+#ifndef PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
+#define PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
#include "base/memory/ref_counted.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
#include "ppapi/shared_impl/singleton_resource_id.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
@@ -16,19 +17,20 @@ class TrackedCallback;
namespace thunk {
-class PPAPI_THUNK_EXPORT PPB_Ext_CrxFileSystem_Private_API {
+class PPAPI_THUNK_EXPORT PPB_IsolatedFileSystem_Private_API {
public:
- virtual ~PPB_Ext_CrxFileSystem_Private_API() {}
+ virtual ~PPB_IsolatedFileSystem_Private_API() {}
virtual int32_t Open(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
PP_Resource* file_system,
scoped_refptr<TrackedCallback> callback) = 0;
static const SingletonResourceID kSingletonResourceID =
- CRX_FILESYSTEM_SINGLETON_ID;
+ ISOLATED_FILESYSTEM_SINGLETON_ID;
};
} // namespace thunk
} // namespace ppapi
-#endif // PPAPI_THUNK_PPB_EXT_CRX_FILE_SYSTEM_API_H_
+#endif // PPAPI_THUNK_PPB_ISOLATED_FILE_SYSTEM_PRIVATE_API_H_
diff --git a/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc
new file mode 100644
index 0000000..04b1bab
--- /dev/null
+++ b/ppapi/thunk/ppb_isolated_file_system_private_thunk.cc
@@ -0,0 +1,51 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// From private/ppb_isolated_file_system_private.idl,
+// modified Thu Oct 31 20:52:54 2013.
+
+#include "ppapi/c/pp_completion_callback.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/private/ppb_isolated_file_system_private.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/ppb_instance_api.h"
+#include "ppapi/thunk/ppb_isolated_file_system_private_api.h"
+#include "ppapi/thunk/resource_creation_api.h"
+#include "ppapi/thunk/thunk.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+int32_t Open(PP_Instance instance,
+ PP_IsolatedFileSystemType_Private type,
+ PP_Resource* file_system,
+ struct PP_CompletionCallback callback) {
+ VLOG(4) << "PPB_IsolatedFileSystem_Private::Open()";
+ EnterInstanceAPI<PPB_IsolatedFileSystem_Private_API> enter(instance,
+ callback);
+ if (enter.failed())
+ return enter.retval();
+ return enter.SetResult(enter.functions()->Open(instance,
+ type,
+ file_system,
+ enter.callback()));
+}
+
+const PPB_IsolatedFileSystem_Private_0_1
+ g_ppb_isolatedfilesystem_private_thunk_0_1 = {
+ &Open
+};
+
+} // namespace
+
+const PPB_IsolatedFileSystem_Private_0_1*
+ GetPPB_IsolatedFileSystem_Private_0_1_Thunk() {
+ return &g_ppb_isolatedfilesystem_private_thunk_0_1;
+}
+
+} // namespace thunk
+} // namespace ppapi