diff options
author | nhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 17:33:21 +0000 |
---|---|---|
committer | nhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-13 17:33:21 +0000 |
commit | e83ae9b5d2bfd9985a7631520631b2d97665c9fa (patch) | |
tree | 07b755c519fec0be212811ed0242e15c2f3bd073 /webkit/browser/fileapi/plugin_private_file_system_backend.cc | |
parent | cb563fc32f3cc084d4454f95b6e6ab9281af5ad2 (diff) | |
download | chromium_src-e83ae9b5d2bfd9985a7631520631b2d97665c9fa.zip chromium_src-e83ae9b5d2bfd9985a7631520631b2d97665c9fa.tar.gz chromium_src-e83ae9b5d2bfd9985a7631520631b2d97665c9fa.tar.bz2 |
FileAPI: Modify PluginPrivateFileSystemBackend
This modifies PluginPrivateFileSystemBackend to adapt to Pepper side change [*].
- Does not call RegisterFileSystem in the backend side. That will be called from
PepperIsolatedFileSystemMessageFilter instead.
- Changing callback signature for the OpenPluginPrivateFileSystem since the
caller does not need origin_url and filesystem_id.
[*] https://codereview.chromium.org/26803004/
BUG=286240
TEST=content_unittests --gtest_filter=PluginPrivateFileSystemBackendTest.*
TBR=kinuko@chromium.org
Review URL: https://codereview.chromium.org/68513011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/browser/fileapi/plugin_private_file_system_backend.cc')
-rw-r--r-- | webkit/browser/fileapi/plugin_private_file_system_backend.cc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/webkit/browser/fileapi/plugin_private_file_system_backend.cc b/webkit/browser/fileapi/plugin_private_file_system_backend.cc index e701ce9..0426bd2 100644 --- a/webkit/browser/fileapi/plugin_private_file_system_backend.cc +++ b/webkit/browser/fileapi/plugin_private_file_system_backend.cc @@ -43,8 +43,8 @@ class PluginPrivateFileSystemBackend::FileSystemIDToPluginMap { void RegisterFileSystem(const std::string& filesystem_id, const std::string& plugin_id) { DCHECK(task_runner_->RunsTasksOnCurrentThread()); - DCHECK(!filesystem_id.empty() && - !ContainsKey(map_, filesystem_id)) << filesystem_id; + DCHECK(!filesystem_id.empty()); + DCHECK(!ContainsKey(map_, filesystem_id)) << filesystem_id; map_[filesystem_id] = plugin_id; } @@ -77,9 +77,7 @@ base::PlatformFileError OpenFileSystemOnFileThread( const bool create = (mode == OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT); file_util->GetDirectoryForOriginAndType( origin_url, plugin_id, create, &error); - if (error != base::PLATFORM_FILE_OK) - IsolatedContext::GetInstance()->RevokeFileSystem(filesystem_id); - else + if (error == base::PLATFORM_FILE_OK) plugin_map->RegisterFileSystem(filesystem_id, plugin_id); return error; } @@ -119,32 +117,23 @@ PluginPrivateFileSystemBackend::~PluginPrivateFileSystemBackend() { void PluginPrivateFileSystemBackend::OpenPrivateFileSystem( const GURL& origin_url, FileSystemType type, + const std::string& filesystem_id, const std::string& plugin_id, OpenFileSystemMode mode, - const OpenPrivateFileSystemCallback& callback) { + const StatusCallback& callback) { if (!CanHandleType(type) || file_system_options_.is_incognito()) { base::MessageLoopProxy::current()->PostTask( - FROM_HERE, base::Bind(callback, GURL(), std::string(), - base::PLATFORM_FILE_ERROR_SECURITY)); + FROM_HERE, base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY)); return; } - // TODO(nhiroki,kinuko): This constant should be somehow shared. - const std::string name("PluginPrivate"); - std::string filesystem_id = - IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath( - type, name, base::FilePath()); - PostTaskAndReplyWithResult( file_task_runner_.get(), FROM_HERE, base::Bind(&OpenFileSystemOnFileThread, obfuscated_file_util(), plugin_map_, origin_url, filesystem_id, plugin_id, mode), - base::Bind(callback, - GURL(GetIsolatedFileSystemRootURIString( - origin_url, filesystem_id, name)), - filesystem_id)); + callback); } bool PluginPrivateFileSystemBackend::CanHandleType(FileSystemType type) const { |