summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authortzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 15:34:02 +0000
committertzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 15:34:02 +0000
commit97cf41e273aeede02620e37617db1244230761df (patch)
treeb28f4102767922cdce0ae836b1d7e45d5902c325 /content
parent6fc1347d761dbe312abca2dd2e461fea4aec2841 (diff)
downloadchromium_src-97cf41e273aeede02620e37617db1244230761df.zip
chromium_src-97cf41e273aeede02620e37617db1244230761df.tar.gz
chromium_src-97cf41e273aeede02620e37617db1244230761df.tar.bz2
Replace OpenComplete with DidOpenFileSystem and DidFail for FileSystem.
BUG=None TEST="existing tests" Review URL: http://codereview.chromium.org/8921001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/file_system/file_system_dispatcher_host.cc6
-rw-r--r--content/common/file_system/file_system_dispatcher.cc16
-rw-r--r--content/common/file_system/file_system_dispatcher.h11
-rw-r--r--content/common/file_system_messages.h5
4 files changed, 17 insertions, 21 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 */)