Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Unified Diff: webkit/plugins/ppapi/ppb_file_system_impl.cc

Issue 6596026: Don't allow multiple opens for Pepper FileSystem. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_system_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_file_system_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_file_system_impl.cc b/webkit/plugins/ppapi/ppb_file_system_impl.cc
index 04fc1ae501f16bc3295046bc1e2c40af0ecc0449..4abd269f63578164e9f1561796a6a9f6c2d46240 100644
--- a/webkit/plugins/ppapi/ppb_file_system_impl.cc
+++ b/webkit/plugins/ppapi/ppb_file_system_impl.cc
@@ -56,8 +56,10 @@ int32_t Open(PP_Resource file_system_id,
if (!file_system)
return PP_ERROR_BADRESOURCE;
- if (file_system->opened())
- return PP_OK;
+ // Should not allow multiple opens.
+ if (file_system->called_open())
+ return PP_ERROR_FAILED;
+ file_system->set_called_open();
if ((file_system->type() != PP_FILESYSTEMTYPE_LOCALPERSISTENT) &&
(file_system->type() != PP_FILESYSTEMTYPE_LOCALTEMPORARY))
@@ -100,7 +102,8 @@ PPB_FileSystem_Impl::PPB_FileSystem_Impl(PluginInstance* instance,
: Resource(instance),
instance_(instance),
type_(type),
- opened_(false) {
+ opened_(false),
+ called_open_(false) {
DCHECK(type_ != PP_FILESYSTEMTYPE_INVALID);
}
« no previous file with comments | « webkit/plugins/ppapi/ppb_file_system_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698