summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 22:42:41 +0000
committerteravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 22:42:41 +0000
commitc6420f0816e2f409ba2f0f161905a6f2a46ed80b (patch)
treee5ce4cbc98536450e5d049032f034dd5156afbde /ppapi/thunk
parent0e523c610f65d020ceef61c186502394830a120e (diff)
downloadchromium_src-c6420f0816e2f409ba2f0f161905a6f2a46ed80b.zip
chromium_src-c6420f0816e2f409ba2f0f161905a6f2a46ed80b.tar.gz
chromium_src-c6420f0816e2f409ba2f0f161905a6f2a46ed80b.tar.bz2
Pepper: Move FileRef to the "new" resource proxy.
This change moves the FileRef implementation from the previous one in the "old" resource model (ppb_file_ref_impl.cc) to the "new" resource model (pepper_file_ref_host.cc), and from the renderer to the browser. As many as possible of the supporting changes were split off to other changes to minimize the size of this change. Unfortunately, a lot of changes for URLLoader had to be rolled into this change. The data structures for CreateInfo have changed, and all users of FileRef have to be moved over, which is what causes this change to be so large. TBR=dmichael@chromium.org, jschuh@chromium.org, yzshen@chromium.org BUG=225441 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216744 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=218305 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219911 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=221284 Review URL: https://chromiumcodereview.appspot.com/21966004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_private.h2
-rw-r--r--ppapi/thunk/interfaces_ppb_public_stable.h5
-rw-r--r--ppapi/thunk/ppb_file_ref_api.h20
-rw-r--r--ppapi/thunk/ppb_file_ref_thunk.cc9
-rw-r--r--ppapi/thunk/resource_creation_api.h12
5 files changed, 17 insertions, 31 deletions
diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h
index 56caafb..84ca5e3 100644
--- a/ppapi/thunk/interfaces_ppb_private.h
+++ b/ppapi/thunk/interfaces_ppb_private.h
@@ -33,7 +33,7 @@ PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_TRUSTED_INTERFACE_0_5,
PPB_FileChooserTrusted_0_5)
PROXIED_IFACE(NoAPIName, PPB_FILECHOOSER_TRUSTED_INTERFACE_0_6,
PPB_FileChooserTrusted_0_6)
-PROXIED_IFACE(PPB_FileRef, PPB_FILEREFPRIVATE_INTERFACE_0_1,
+PROXIED_IFACE(NoAPIName, PPB_FILEREFPRIVATE_INTERFACE_0_1,
PPB_FileRefPrivate_0_1)
// TODO(xhwang): Move PPB_Flash_DeviceID back to interfaces_ppb_private_flash.h.
PROXIED_IFACE(NoAPIName, PPB_FLASH_DEVICEID_INTERFACE_1_0,
diff --git a/ppapi/thunk/interfaces_ppb_public_stable.h b/ppapi/thunk/interfaces_ppb_public_stable.h
index 1889cac..7747bfc 100644
--- a/ppapi/thunk/interfaces_ppb_public_stable.h
+++ b/ppapi/thunk/interfaces_ppb_public_stable.h
@@ -19,7 +19,6 @@
// that exist in the webkit/plugins/ppapi/*_impl.h, but not in the proxy.
PROXIED_API(PPB_Audio)
PROXIED_API(PPB_Core)
-PROXIED_API(PPB_FileRef)
PROXIED_API(PPB_Graphics3D)
PROXIED_API(PPB_ImageData)
PROXIED_API(PPB_Instance)
@@ -46,8 +45,8 @@ UNPROXIED_API(PPB_AudioConfig)
// Note: Core is special and is registered manually.
PROXIED_IFACE(PPB_Audio, PPB_AUDIO_INTERFACE_1_0, PPB_Audio_1_0)
PROXIED_IFACE(PPB_Audio, PPB_AUDIO_INTERFACE_1_1, PPB_Audio_1_1)
-PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_0, PPB_FileRef_1_0)
-PROXIED_IFACE(PPB_FileRef, PPB_FILEREF_INTERFACE_1_1, PPB_FileRef_1_1)
+PROXIED_IFACE(NoAPIName, PPB_FILEREF_INTERFACE_1_0, PPB_FileRef_1_0)
+PROXIED_IFACE(NoAPIName, PPB_FILEREF_INTERFACE_1_1, PPB_FileRef_1_1)
PROXIED_IFACE(NoAPIName, PPB_FILESYSTEM_INTERFACE_1_0, PPB_FileSystem_1_0)
PROXIED_IFACE(PPB_Graphics3D, PPB_GRAPHICS_3D_INTERFACE_1_0, PPB_Graphics3D_1_0)
PROXIED_IFACE(PPB_ImageData, PPB_IMAGEDATA_INTERFACE_1_0, PPB_ImageData_1_0)
diff --git a/ppapi/thunk/ppb_file_ref_api.h b/ppapi/thunk/ppb_file_ref_api.h
index ba92b63..b473ae2 100644
--- a/ppapi/thunk/ppb_file_ref_api.h
+++ b/ppapi/thunk/ppb_file_ref_api.h
@@ -10,11 +10,12 @@
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "ppapi/c/ppb_file_ref.h"
+#include "ppapi/shared_impl/file_ref_create_info.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
namespace ppapi {
-struct PPB_FileRef_CreateInfo;
+struct FileRefCreateInfo;
class TrackedCallback;
namespace thunk {
@@ -40,25 +41,10 @@ class PPAPI_THUNK_EXPORT PPB_FileRef_API {
virtual int32_t ReadDirectoryEntries(
const PP_ArrayOutput& output,
scoped_refptr<TrackedCallback> callback) = 0;
- // We define variants of Query and ReadDirectoryEntries because
- // 1. we need to take linked_ptr instead of raw pointers to avoid
- // use-after-free, and 2. we don't use PP_ArrayOutput for the
- // communication between renderers and the browser in
- // ReadDirectoryEntries. The *InHost functions must not be called in
- // plugins, and Query and ReadDirectoryEntries must not be called in
- // renderers.
- // TODO(hamaji): These functions must be removed when we move
- // FileRef to the new resource design. http://crbug.com/225441
- virtual int32_t QueryInHost(linked_ptr<PP_FileInfo> info,
- scoped_refptr<TrackedCallback> callback) = 0;
- virtual int32_t ReadDirectoryEntriesInHost(
- linked_ptr<std::vector<ppapi::PPB_FileRef_CreateInfo> > files,
- linked_ptr<std::vector<PP_FileType> > file_types,
- scoped_refptr<TrackedCallback> callback) = 0;
// Internal function for use in proxying. Returns the internal CreateInfo
// (the contained resource does not carry a ref on behalf of the caller).
- virtual const PPB_FileRef_CreateInfo& GetCreateInfo() const = 0;
+ virtual const FileRefCreateInfo& GetCreateInfo() const = 0;
// Private API
virtual PP_Var GetAbsolutePath() = 0;
diff --git a/ppapi/thunk/ppb_file_ref_thunk.cc b/ppapi/thunk/ppb_file_ref_thunk.cc
index beb0e41..64c90b5 100644
--- a/ppapi/thunk/ppb_file_ref_thunk.cc
+++ b/ppapi/thunk/ppb_file_ref_thunk.cc
@@ -7,6 +7,7 @@
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_file_ref_private.h"
+#include "ppapi/shared_impl/file_ref_create_info.h"
#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
@@ -32,7 +33,13 @@ PP_Resource Create(PP_Resource file_system, const char* path) {
EnterResourceCreationNoLock enter(instance);
if (enter.failed())
return 0;
- return enter.functions()->CreateFileRef(instance, file_system, path);
+ FileRefCreateInfo info;
+ info.file_system_type = enter_file_system.object()->GetType();
+ info.internal_path = std::string(path);
+ info.browser_pending_host_resource_id = 0;
+ info.renderer_pending_host_resource_id = 0;
+ info.file_system_plugin_resource = file_system;
+ return enter.functions()->CreateFileRef(instance, info);
}
PP_Bool IsFileRef(PP_Resource resource) {
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index be81aa6..ae080bb 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -33,7 +33,7 @@ struct PP_Size;
namespace ppapi {
-struct PPB_FileRef_CreateInfo;
+struct FileRefCreateInfo;
struct URLRequestInfoData;
struct URLResponseInfoData;
@@ -49,15 +49,9 @@ class ResourceCreationAPI {
virtual ~ResourceCreationAPI() {}
virtual PP_Resource CreateFileIO(PP_Instance instance) = 0;
- virtual PP_Resource CreateFileRef(PP_Instance instance,
- PP_Resource file_system,
- const char* path) = 0;
- // Like the above version but takes a serialized file ref. The resource
- // in the serialized file ref is passed into this, which takes ownership of
- // the reference. In the proxy, the return value will be a plugin resource.
- // In the impl, the return value will be the same resource ID.
virtual PP_Resource CreateFileRef(
- const PPB_FileRef_CreateInfo& serialized) = 0;
+ PP_Instance instance,
+ const FileRefCreateInfo& serialized) = 0;
virtual PP_Resource CreateFileSystem(PP_Instance instance,
PP_FileSystemType type) = 0;
virtual PP_Resource CreateIMEInputEvent(PP_Instance instance,