diff options
author | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 04:04:50 +0000 |
---|---|---|
committer | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-27 04:04:50 +0000 |
commit | ef374d57e4970532733eb73def09c8d4b8fca6d5 (patch) | |
tree | 7adc6edb0518ad734a4faab8dd6b467eb1e29840 /ppapi | |
parent | 8d640daef072c200c855bcd5a2003a04856f8b20 (diff) | |
download | chromium_src-ef374d57e4970532733eb73def09c8d4b8fca6d5.zip chromium_src-ef374d57e4970532733eb73def09c8d4b8fca6d5.tar.gz chromium_src-ef374d57e4970532733eb73def09c8d4b8fca6d5.tar.bz2 |
[PPAPI] File system resources can be attached to an existing host.
This adds a new FileSystemResource constructor, allowing the creation of
a new plugin-side resource that will be automatically attached to a
renderer and browser pending resource host.
BUG=177017
Review URL: https://codereview.chromium.org/24476003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/proxy/file_system_resource.cc | 15 | ||||
-rw-r--r-- | ppapi/proxy/file_system_resource.h | 10 |
2 files changed, 23 insertions, 2 deletions
diff --git a/ppapi/proxy/file_system_resource.cc b/ppapi/proxy/file_system_resource.cc index bab7719..af1928b 100644 --- a/ppapi/proxy/file_system_resource.cc +++ b/ppapi/proxy/file_system_resource.cc @@ -23,12 +23,23 @@ FileSystemResource::FileSystemResource(Connection connection, called_open_(false), callback_count_(0) { DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); - // TODO(teravest): Temporarily create hosts in both the browser and renderer - // while we move file related hosts to the browser. SendCreate(RENDERER, PpapiHostMsg_FileSystem_Create(type_)); SendCreate(BROWSER, PpapiHostMsg_FileSystem_Create(type_)); } +FileSystemResource::FileSystemResource(Connection connection, + PP_Instance instance, + int pending_renderer_id, + int pending_browser_id, + PP_FileSystemType type) + : PluginResource(connection, instance), + type_(type), + called_open_(true) { + DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID); + AttachToPendingHost(RENDERER, pending_renderer_id); + AttachToPendingHost(BROWSER, pending_browser_id); +} + FileSystemResource::~FileSystemResource() { } diff --git a/ppapi/proxy/file_system_resource.h b/ppapi/proxy/file_system_resource.h index 74677f7..a716434 100644 --- a/ppapi/proxy/file_system_resource.h +++ b/ppapi/proxy/file_system_resource.h @@ -25,9 +25,19 @@ class PPAPI_PROXY_EXPORT FileSystemResource : public PluginResource, public NON_EXPORTED_BASE(thunk::PPB_FileSystem_API) { public: + // Creates a new FileSystemResource. The resource must be subsequently opened + // via Open() before use. FileSystemResource(Connection connection, PP_Instance instance, PP_FileSystemType type); + // Creates a FileSystemResource, attached to an existing pending host + // resource. The |pending_renderer_id| and |pending_browser_id| must be + // already-opened file systems. + FileSystemResource(Connection connection, + PP_Instance instance, + int pending_renderer_id, + int pending_browser_id, + PP_FileSystemType type); virtual ~FileSystemResource(); // Resource overrides. |