summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:45:48 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:45:48 +0000
commitacaac376d3d7eb6e5f667c97f96f4b90602d4748 (patch)
treeca61b4adb481419d81b641fbbbabb859ca6e98f8 /chrome
parent0f6646d8f0940a8b1c4ebfda247a4f062d3feb9e (diff)
downloadchromium_src-acaac376d3d7eb6e5f667c97f96f4b90602d4748.zip
chromium_src-acaac376d3d7eb6e5f667c97f96f4b90602d4748.tar.gz
chromium_src-acaac376d3d7eb6e5f667c97f96f4b90602d4748.tar.bz2
Revert 63153 - Update Pepper's FileSystem and FileRef implementations.
BUG=none TEST=test_file_ref, test_file_system, test_url_loader Review URL: http://codereview.chromium.org/3602008 TBR=dumi@chromium.org Review URL: http://codereview.chromium.org/3905002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/file_system/file_system_dispatcher.cc124
-rw-r--r--chrome/common/file_system/file_system_dispatcher.h2
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.cc11
-rw-r--r--chrome/renderer/pepper_plugin_delegate_impl.h5
4 files changed, 36 insertions, 106 deletions
diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc
index dfe23bf..bc52f3a 100644
--- a/chrome/common/file_system/file_system_dispatcher.cc
+++ b/chrome/common/file_system/file_system_dispatcher.cc
@@ -39,17 +39,12 @@ bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) {
return handled;
}
-bool FileSystemDispatcher::OpenFileSystem(
+void FileSystemDispatcher::OpenFileSystem(
const GURL& origin_url, fileapi::FileSystemType type,
long long size, fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(new ViewHostMsg_OpenFileSystemRequest(
- request_id, origin_url, type, size))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ ChildThread::current()->Send(new ViewHostMsg_OpenFileSystemRequest(
+ request_id, origin_url, type, size));
}
bool FileSystemDispatcher::Move(
@@ -57,13 +52,8 @@ bool FileSystemDispatcher::Move(
const FilePath& dest_path,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(new ViewHostMsg_FileSystem_Move(
- request_id, src_path, dest_path))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Move(
+ request_id, src_path, dest_path));
}
bool FileSystemDispatcher::Copy(
@@ -71,13 +61,8 @@ bool FileSystemDispatcher::Copy(
const FilePath& dest_path,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy(
- request_id, src_path, dest_path))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy(
+ request_id, src_path, dest_path));
}
bool FileSystemDispatcher::Remove(
@@ -85,26 +70,16 @@ bool FileSystemDispatcher::Remove(
bool recursive,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_Remove(request_id, path, recursive))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_Remove(request_id, path, recursive));
}
bool FileSystemDispatcher::ReadMetadata(
const FilePath& path,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_ReadMetadata(request_id, path))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_ReadMetadata(request_id, path));
}
bool FileSystemDispatcher::Create(
@@ -114,13 +89,8 @@ bool FileSystemDispatcher::Create(
bool recursive,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(new ViewHostMsg_FileSystem_Create(
- request_id, path, exclusive, is_directory, recursive))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Create(
+ request_id, path, exclusive, is_directory, recursive));
}
bool FileSystemDispatcher::Exists(
@@ -128,26 +98,16 @@ bool FileSystemDispatcher::Exists(
bool is_directory,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_Exists(request_id, path, is_directory))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_Exists(request_id, path, is_directory));
}
bool FileSystemDispatcher::ReadDirectory(
const FilePath& path,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_ReadDirectory(request_id, path))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_ReadDirectory(request_id, path));
}
bool FileSystemDispatcher::Truncate(
@@ -156,15 +116,13 @@ bool FileSystemDispatcher::Truncate(
int* request_id_out,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_Truncate(request_id, path, offset))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
+ if (ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_Truncate(request_id, path, offset))) {
+ if (request_id_out)
+ *request_id_out = request_id;
+ return true;
}
-
- if (request_id_out)
- *request_id_out = request_id;
- return true;
+ return false;
}
bool FileSystemDispatcher::Write(
@@ -174,29 +132,22 @@ bool FileSystemDispatcher::Write(
int* request_id_out,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_Write(
- request_id, path, blob_url, offset))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
+ if (ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_Write(
+ request_id, path, blob_url, offset))) {
+ if (request_id_out)
+ *request_id_out = request_id;
+ return true;
}
-
- if (request_id_out)
- *request_id_out = request_id;
- return true;
+ return false;
}
bool FileSystemDispatcher::Cancel(
int request_id_to_cancel,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(new ViewHostMsg_FileSystem_CancelWrite(
- request_id, request_id_to_cancel))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_CancelWrite(request_id, request_id_to_cancel));
}
bool FileSystemDispatcher::TouchFile(
@@ -205,14 +156,9 @@ bool FileSystemDispatcher::TouchFile(
const base::Time& last_modified_time,
fileapi::FileSystemCallbackDispatcher* dispatcher) {
int request_id = dispatchers_.Add(dispatcher);
- if (!ChildThread::current()->Send(
- new ViewHostMsg_FileSystem_TouchFile(
- request_id, path, last_access_time, last_modified_time))) {
- dispatchers_.Remove(request_id); // destroys |dispatcher|
- return false;
- }
-
- return true;
+ return ChildThread::current()->Send(
+ new ViewHostMsg_FileSystem_TouchFile(
+ request_id, path, last_access_time, last_modified_time));
}
void FileSystemDispatcher::OnOpenFileSystemRequestComplete(
diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h
index f256189..8802c1e 100644
--- a/chrome/common/file_system/file_system_dispatcher.h
+++ b/chrome/common/file_system/file_system_dispatcher.h
@@ -32,7 +32,7 @@ class FileSystemDispatcher {
bool OnMessageReceived(const IPC::Message& msg);
- bool OpenFileSystem(const GURL& origin_url,
+ void OpenFileSystem(const GURL& origin_url,
fileapi::FileSystemType type,
long long size,
fileapi::FileSystemCallbackDispatcher* dispatcher);
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc
index cb37c0b..ed0dccd 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.cc
+++ b/chrome/renderer/pepper_plugin_delegate_impl.cc
@@ -679,17 +679,6 @@ void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) {
(*i)->SetContentAreaFocus(has_focus);
}
-bool PepperPluginDelegateImpl::OpenFileSystem(
- const GURL& url,
- fileapi::FileSystemType type,
- long long size,
- fileapi::FileSystemCallbackDispatcher* dispatcher) {
- FileSystemDispatcher* file_system_dispatcher =
- ChildThread::current()->file_system_dispatcher();
- return file_system_dispatcher->OpenFileSystem(
- url, type, size, dispatcher);
-}
-
bool PepperPluginDelegateImpl::MakeDirectory(
const FilePath& path,
bool recursive,
diff --git a/chrome/renderer/pepper_plugin_delegate_impl.h b/chrome/renderer/pepper_plugin_delegate_impl.h
index fc1c5b8..fdaf1e9 100644
--- a/chrome/renderer/pepper_plugin_delegate_impl.h
+++ b/chrome/renderer/pepper_plugin_delegate_impl.h
@@ -85,11 +85,6 @@ class PepperPluginDelegateImpl
virtual bool AsyncOpenFile(const FilePath& path,
int flags,
AsyncOpenFileCallback* callback);
- virtual bool OpenFileSystem(
- const GURL& url,
- fileapi::FileSystemType type,
- long long size,
- fileapi::FileSystemCallbackDispatcher* dispatcher);
virtual bool MakeDirectory(const FilePath& path,
bool recursive,
fileapi::FileSystemCallbackDispatcher* dispatcher);