summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:17:15 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-28 22:17:15 +0000
commit95caad2e61b35b02db3aa2cb8c3b2d58c49a8e37 (patch)
tree1655b1aecb32691f939ed83f35e4cb9c61c81f2e /ppapi/proxy
parentd58ff1d5cb29625e031c15f57512bba18a9a46c8 (diff)
downloadchromium_src-95caad2e61b35b02db3aa2cb8c3b2d58c49a8e37.zip
chromium_src-95caad2e61b35b02db3aa2cb8c3b2d58c49a8e37.tar.gz
chromium_src-95caad2e61b35b02db3aa2cb8c3b2d58c49a8e37.tar.bz2
Don't allow multiple opens for Pepper FileSystem.
BUG=73667 TEST=test_file_system.{h,cc} Review URL: http://codereview.chromium.org/6596026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r--ppapi/proxy/ppb_file_system_proxy.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/ppapi/proxy/ppb_file_system_proxy.cc b/ppapi/proxy/ppb_file_system_proxy.cc
index 36a36f1..74c8bcc 100644
--- a/ppapi/proxy/ppb_file_system_proxy.cc
+++ b/ppapi/proxy/ppb_file_system_proxy.cc
@@ -28,7 +28,7 @@ class FileSystem : public PluginResource {
virtual FileSystem* AsFileSystem();
PP_FileSystemType_Dev type_;
- bool opened_;
+ bool called_open_;
PP_CompletionCallback current_open_callback_;
private:
@@ -39,7 +39,7 @@ FileSystem::FileSystem(const HostResource& host_resource,
PP_FileSystemType_Dev type)
: PluginResource(host_resource),
type_(type),
- opened_(false),
+ called_open_(false),
current_open_callback_(PP_MakeCompletionCallback(NULL, NULL)) {
}
@@ -89,8 +89,6 @@ int32_t Open(PP_Resource file_system,
FileSystem* object = PluginResource::GetAs<FileSystem>(file_system);
if (!object)
return PP_ERROR_BADRESOURCE;
- if (object->opened_)
- return PP_OK;
Dispatcher* dispatcher = PluginDispatcher::GetForInstance(object->instance());
if (!dispatcher)
@@ -98,7 +96,11 @@ int32_t Open(PP_Resource file_system,
if (object->current_open_callback_.func)
return PP_ERROR_INPROGRESS;
+ else if (object->called_open_)
+ return PP_ERROR_FAILED;
+
object->current_open_callback_ = callback;
+ object->called_open_ = true;
dispatcher->Send(new PpapiHostMsg_PPBFileSystem_Open(
INTERFACE_ID_PPB_FILE_SYSTEM, object->host_resource(), expected_size));