diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 20:54:48 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 20:54:48 +0000 |
commit | 22833a78efba4b33b76c63e5961e1d9583bde0dc (patch) | |
tree | d88b85835ac4531b627d5d10181ac64982b28687 /ppapi/thunk | |
parent | 606ae2f6d2fda1287c250896bed430195f43852a (diff) | |
download | chromium_src-22833a78efba4b33b76c63e5961e1d9583bde0dc.zip chromium_src-22833a78efba4b33b76c63e5961e1d9583bde0dc.tar.gz chromium_src-22833a78efba4b33b76c63e5961e1d9583bde0dc.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
Review URL: https://chromiumcodereview.appspot.com/21966004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/interfaces_ppb_private.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/interfaces_ppb_public_stable.h | 5 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_ref_api.h | 20 | ||||
-rw-r--r-- | ppapi/thunk/ppb_file_ref_thunk.cc | 8 | ||||
-rw-r--r-- | ppapi/thunk/resource_creation_api.h | 12 |
5 files changed, 16 insertions, 31 deletions
diff --git a/ppapi/thunk/interfaces_ppb_private.h b/ppapi/thunk/interfaces_ppb_private.h index 3e0289c..391904d3 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 b0918a3..eac850e 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) // interface string. // Note: Core is special and is registered manually. PROXIED_IFACE(PPB_Audio, PPB_AUDIO_INTERFACE_1_0, PPB_Audio_1_0) -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..8910faf 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,12 @@ 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.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 082f1cc..bab3bb9 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 CreateIsolatedFileSystem(PP_Instance instance, |