diff options
Diffstat (limited to 'ppapi/proxy')
-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. |