diff options
-rw-r--r-- | content/browser/file_system/file_system_dispatcher_host.cc | 6 | ||||
-rw-r--r-- | content/common/file_system/file_system_dispatcher.cc | 16 | ||||
-rw-r--r-- | content/common/file_system/file_system_dispatcher.h | 11 | ||||
-rw-r--r-- | content/common/file_system_messages.h | 5 | ||||
-rw-r--r-- | webkit/fileapi/file_system_operation.cc | 5 |
5 files changed, 21 insertions, 22 deletions
diff --git a/content/browser/file_system/file_system_dispatcher_host.cc b/content/browser/file_system/file_system_dispatcher_host.cc index 7034be2..e7f1a5f 100644 --- a/content/browser/file_system/file_system_dispatcher_host.cc +++ b/content/browser/file_system/file_system_dispatcher_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -65,9 +65,9 @@ class BrowserFileSystemCallbackDispatcher virtual void DidOpenFileSystem(const std::string& name, const GURL& root) { + DCHECK(root.is_valid()); dispatcher_host_->Send( - new FileSystemMsg_OpenComplete( - request_id_, root.is_valid(), name, root)); + new FileSystemMsg_DidOpenFileSystem(request_id_, name, root)); } virtual void DidFail(base::PlatformFileError error_code) { diff --git a/content/common/file_system/file_system_dispatcher.cc b/content/common/file_system/file_system_dispatcher.cc index eed8f10..b2ae11e 100644 --- a/content/common/file_system/file_system_dispatcher.cc +++ b/content/common/file_system/file_system_dispatcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -27,7 +27,7 @@ FileSystemDispatcher::~FileSystemDispatcher() { bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(FileSystemDispatcher, msg) - IPC_MESSAGE_HANDLER(FileSystemMsg_OpenComplete, OnOpenComplete) + IPC_MESSAGE_HANDLER(FileSystemMsg_DidOpenFileSystem, OnDidOpenFileSystem) IPC_MESSAGE_HANDLER(FileSystemMsg_DidSucceed, OnDidSucceed) IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadDirectory, OnDidReadDirectory) IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadMetadata, OnDidReadMetadata) @@ -230,16 +230,14 @@ bool FileSystemDispatcher::OpenFile( return true; } -void FileSystemDispatcher::OnOpenComplete( - int request_id, bool accepted, const std::string& name, - const GURL& root) { +void FileSystemDispatcher::OnDidOpenFileSystem(int request_id, + const std::string& name, + const GURL& root) { + DCHECK(root.is_valid()); fileapi::FileSystemCallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); DCHECK(dispatcher); - if (accepted) - dispatcher->DidOpenFileSystem(name, root); - else - dispatcher->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); + dispatcher->DidOpenFileSystem(name, root); dispatchers_.Remove(request_id); } diff --git a/content/common/file_system/file_system_dispatcher.h b/content/common/file_system/file_system_dispatcher.h index ee436d1..bf0d789 100644 --- a/content/common/file_system/file_system_dispatcher.h +++ b/content/common/file_system/file_system_dispatcher.h @@ -1,10 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ #define CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ +#include <string> #include <vector> #include "base/basictypes.h" @@ -84,11 +85,9 @@ class FileSystemDispatcher : public IPC::Channel::Listener { fileapi::FileSystemCallbackDispatcher* dispatcher); private: // Message handlers. - void OnOpenComplete( - int request_id, - bool accepted, - const std::string& name, - const GURL& root); + void OnDidOpenFileSystem(int request_id, + const std::string& name, + const GURL& root); void OnDidSucceed(int request_id); void OnDidReadMetadata(int request_id, const base::PlatformFileInfo& file_info, diff --git a/content/common/file_system_messages.h b/content/common/file_system_messages.h index b248558..6a34d37 100644 --- a/content/common/file_system_messages.h +++ b/content/common/file_system_messages.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,9 +23,8 @@ IPC_ENUM_TRAITS(fileapi::FileSystemType) // File system messages sent from the browser to the child process. // WebFrameClient::openFileSystem response messages. -IPC_MESSAGE_CONTROL4(FileSystemMsg_OpenComplete, +IPC_MESSAGE_CONTROL3(FileSystemMsg_DidOpenFileSystem, int /* request_id */, - bool /* accepted */, std::string /* name */, GURL /* root_url */) diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc index 693499a..e70d9b8 100644 --- a/webkit/fileapi/file_system_operation.cc +++ b/webkit/fileapi/file_system_operation.cc @@ -605,8 +605,11 @@ void FileSystemOperation::DidGetRootPath( result = GetFileSystemRootURI( operation_context_.src_origin_url(), operation_context_.src_type()); + DCHECK(result.is_valid()); + dispatcher_->DidOpenFileSystem(name, result); + } else { + dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); } - dispatcher_->DidOpenFileSystem(name, result); } void FileSystemOperation::DidEnsureFileExistsExclusive( |