diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:29:14 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:29:14 +0000 |
commit | 5746640f419fe2b493ed4e97aa473e96f73c8d73 (patch) | |
tree | 63b222962eb9c5ea5d230d8add24fe72e6281386 /chrome/common | |
parent | ae236193f7b64659caf81ba2a009f8ff4e947693 (diff) | |
download | chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.zip chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.tar.gz chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.tar.bz2 |
Refactor some file_system classes to use chromium types instead of
WebKit API types.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3406008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/file_system/file_system_dispatcher.cc | 177 | ||||
-rw-r--r-- | chrome/common/file_system/file_system_dispatcher.h | 70 | ||||
-rw-r--r-- | chrome/common/file_system/webfilesystem_impl.cc | 133 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 20 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 40 | ||||
-rw-r--r-- | chrome/common/render_messages_params.h | 22 |
7 files changed, 238 insertions, 225 deletions
diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc index 89a2de4..8ae0c16 100644 --- a/chrome/common/file_system/file_system_dispatcher.cc +++ b/chrome/common/file_system/file_system_dispatcher.cc @@ -8,31 +8,20 @@ #include "chrome/common/child_thread.h" #include "chrome/common/render_messages.h" #include "chrome/common/render_messages_params.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFileSystemEntry.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" -#include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "webkit/glue/webkit_glue.h" -using WebKit::WebFileError; -using WebKit::WebFileInfo; -using WebKit::WebFileSystemCallbacks; -using WebKit::WebFileSystemEntry; -using WebKit::WebVector; - FileSystemDispatcher::FileSystemDispatcher() { } FileSystemDispatcher::~FileSystemDispatcher() { // Make sure we fire all the remaining callbacks. - for (IDMap<WebFileSystemCallbacks>::iterator iter(&callbacks_); - !iter.IsAtEnd(); - iter.Advance()) { - int callbacks_id = iter.GetCurrentKey(); - WebFileSystemCallbacks* callbacks = iter.GetCurrentValue(); - DCHECK(callbacks); - callbacks_.Remove(callbacks_id); - callbacks->didFail(WebKit::WebFileErrorAbort); + for (IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer>::iterator + iter(&dispatchers_); !iter.IsAtEnd(); iter.Advance()) { + int request_id = iter.GetCurrentKey(); + fileapi::FileSystemCallbackDispatcher* dispatcher = iter.GetCurrentValue(); + DCHECK(dispatcher); + dispatcher->DidFail(base::PLATFORM_FILE_ERROR_ABORT); + dispatchers_.Remove(request_id); } } @@ -48,103 +37,101 @@ bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) { return handled; } -void FileSystemDispatcher::Move( - const string16& src_path, const string16& dest_path, - WebFileSystemCallbacks* callbacks) { - FilePath src_file_path = webkit_glue::WebStringToFilePath(src_path); - FilePath dest_file_path = webkit_glue::WebStringToFilePath(dest_path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send(new ViewHostMsg_FileSystem_Move( - request_id, src_file_path, dest_file_path)); +bool FileSystemDispatcher::Move( + const FilePath& src_path, + const FilePath& dest_path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Move( + request_id, src_path, dest_path)); } -void FileSystemDispatcher::Copy( - const string16& src_path, const string16& dest_path, - WebFileSystemCallbacks* callbacks) { - FilePath src_file_path = webkit_glue::WebStringToFilePath(src_path); - FilePath dest_file_path = webkit_glue::WebStringToFilePath(dest_path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy( - request_id, src_file_path, dest_file_path)); +bool FileSystemDispatcher::Copy( + const FilePath& src_path, + const FilePath& dest_path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Copy( + request_id, src_path, dest_path)); } -void FileSystemDispatcher::Remove( - const string16& path, WebFileSystemCallbacks* callbacks) { - FilePath file_path = webkit_glue::WebStringToFilePath(path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Remove(request_id, file_path)); +bool FileSystemDispatcher::Remove( + const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send( + new ViewHostMsg_FileSystem_Remove(request_id, path)); } -void FileSystemDispatcher::ReadMetadata( - const string16& path, WebFileSystemCallbacks* callbacks) { - FilePath file_path = webkit_glue::WebStringToFilePath(path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_ReadMetadata(request_id, file_path)); +bool FileSystemDispatcher::ReadMetadata( + const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send( + new ViewHostMsg_FileSystem_ReadMetadata(request_id, path)); } -void FileSystemDispatcher::Create( - const string16& path, bool exclusive, bool is_directory, - WebFileSystemCallbacks* callbacks) { - FilePath file_path = webkit_glue::WebStringToFilePath(path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send(new ViewHostMsg_FileSystem_Create( - request_id, file_path, exclusive, is_directory)); +bool FileSystemDispatcher::Create( + const FilePath& path, + bool exclusive, + bool is_directory, + bool recursive, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send(new ViewHostMsg_FileSystem_Create( + request_id, path, exclusive, is_directory, recursive)); } -void FileSystemDispatcher::Exists( - const string16& path, bool is_directory, - WebFileSystemCallbacks* callbacks) { - FilePath file_path = webkit_glue::WebStringToFilePath(path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Exists(request_id, file_path, is_directory)); +bool FileSystemDispatcher::Exists( + const FilePath& path, + bool is_directory, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send( + new ViewHostMsg_FileSystem_Exists(request_id, path, is_directory)); } -void FileSystemDispatcher::ReadDirectory( - const string16& path, WebFileSystemCallbacks* callbacks) { - FilePath file_path = webkit_glue::WebStringToFilePath(path); - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_ReadDirectory(request_id, file_path)); +bool FileSystemDispatcher::ReadDirectory( + const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher) { + int request_id = dispatchers_.Add(dispatcher); + return ChildThread::current()->Send( + new ViewHostMsg_FileSystem_ReadDirectory(request_id, path)); } void FileSystemDispatcher::DidSucceed(int request_id) { - WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); - DCHECK(callbacks); - callbacks_.Remove(request_id); - callbacks->didSucceed(); + fileapi::FileSystemCallbackDispatcher* dispatcher = + dispatchers_.Lookup(request_id); + DCHECK(dispatcher); + dispatcher->DidSucceed(); + dispatchers_.Remove(request_id); } -void FileSystemDispatcher::DidReadMetadata(int request_id, - const base::PlatformFileInfo& file_info) { - WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); - DCHECK(callbacks); - callbacks_.Remove(request_id); - WebFileInfo web_file_info; - web_file_info.modificationTime = file_info.last_modified.ToDoubleT(); - callbacks->didReadMetadata(web_file_info); +void FileSystemDispatcher::DidReadMetadata( + int request_id, const base::PlatformFileInfo& file_info) { + fileapi::FileSystemCallbackDispatcher* dispatcher = + dispatchers_.Lookup(request_id); + DCHECK(dispatcher); + dispatcher->DidReadMetadata(file_info); + dispatchers_.Remove(request_id); } void FileSystemDispatcher::DidReadDirectory( - const ViewMsg_FileSystem_DidReadDirectory_Params& params) { - WebFileSystemCallbacks* callbacks = callbacks_.Lookup(params.request_id); - DCHECK(callbacks); - if (!params.has_more) - callbacks_.Remove(params.request_id); - WebVector<WebFileSystemEntry> entries(params.entries.size()); - for (size_t i = 0; i < params.entries.size(); ++i) { - entries[i].name = webkit_glue::FilePathStringToWebString( - params.entries[i].name); - entries[i].isDirectory = params.entries[i].is_directory; - } - callbacks->didReadDirectory(entries, params.has_more); + int request_id, + const std::vector<base::file_util_proxy::Entry>& entries, + bool has_more) { + fileapi::FileSystemCallbackDispatcher* dispatcher = + dispatchers_.Lookup(request_id); + DCHECK(dispatcher); + dispatcher->DidReadDirectory(entries, has_more); + dispatchers_.Remove(request_id); } -void FileSystemDispatcher::DidFail(int request_id, WebFileError code) { - WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); - DCHECK(callbacks); - callbacks_.Remove(request_id); - callbacks->didFail(code); +void FileSystemDispatcher::DidFail( + int request_id, base::PlatformFileError error_code) { + fileapi::FileSystemCallbackDispatcher* dispatcher = + dispatchers_.Lookup(request_id); + DCHECK(dispatcher); + dispatcher->DidFail(error_code); + dispatchers_.Remove(request_id); } diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h index 6fb9db5..8214b1c 100644 --- a/chrome/common/file_system/file_system_dispatcher.h +++ b/chrome/common/file_system/file_system_dispatcher.h @@ -8,24 +8,19 @@ #include <vector> #include "base/basictypes.h" +#include "base/file_util_proxy.h" #include "base/id_map.h" #include "base/nullable_string16.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" - -namespace WebKit { -struct WebFileInfo; -class WebFileSystemCallbacks; -struct WebFileSystemEntry; -} +#include "webkit/fileapi/file_system_callback_dispatcher.h" namespace base { struct PlatformFileInfo; } -struct ViewMsg_FileSystem_DidReadDirectory_Params; +class FilePath; // Dispatches and sends file system related messages sent to/from a child // process from/to the main browser process. There is one instance @@ -37,45 +32,38 @@ class FileSystemDispatcher { bool OnMessageReceived(const IPC::Message& msg); - void Move( - const string16& src_path, - const string16& dest_path, - WebKit::WebFileSystemCallbacks* callbacks); - void Copy( - const string16& src_path, - const string16& dest_path, - WebKit::WebFileSystemCallbacks* callbacks); - void Remove( - const string16& path, - WebKit::WebFileSystemCallbacks* callbacks); - void ReadMetadata( - const string16& path, - WebKit::WebFileSystemCallbacks* callbacks); - void Create( - const string16& path, - bool exclusive, - bool for_directory, - WebKit::WebFileSystemCallbacks* callbacks); - void Exists( - const string16& path, - bool for_directory, - WebKit::WebFileSystemCallbacks* callbacks); - void ReadDirectory( - const string16& path, - WebKit::WebFileSystemCallbacks* callbacks); + bool Move(const FilePath& src_path, + const FilePath& dest_path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool Copy(const FilePath& src_path, + const FilePath& dest_path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool Remove(const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool ReadMetadata(const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool Create(const FilePath& path, + bool exclusive, + bool is_directory, + bool recursive, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool Exists(const FilePath& path, + bool for_directory, + fileapi::FileSystemCallbackDispatcher* dispatcher); + bool ReadDirectory(const FilePath& path, + fileapi::FileSystemCallbackDispatcher* dispatcher); private: void DidSucceed(int request_id); - void DidReadMetadata( - int request_id, - const base::PlatformFileInfo& file_info); + void DidReadMetadata(int request_id, + const base::PlatformFileInfo& file_info); void DidReadDirectory( - const ViewMsg_FileSystem_DidReadDirectory_Params& params); - void DidFail( int request_id, - WebKit::WebFileError); + const std::vector<base::file_util_proxy::Entry>& entries, + bool has_more); + void DidFail(int request_id, base::PlatformFileError error_code); - IDMap<WebKit::WebFileSystemCallbacks> callbacks_; + IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); }; diff --git a/chrome/common/file_system/webfilesystem_impl.cc b/chrome/common/file_system/webfilesystem_impl.cc index 49a07d6..546ed25 100644 --- a/chrome/common/file_system/webfilesystem_impl.cc +++ b/chrome/common/file_system/webfilesystem_impl.cc @@ -6,73 +6,164 @@ #include "chrome/common/file_system/file_system_dispatcher.h" #include "chrome/common/child_thread.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" +#include "third_party/WebKit/WebKit/chromium/public/WebString.h" +#include "webkit/glue/webkit_glue.h" -using WebKit::WebString; +using WebKit::WebFileInfo; using WebKit::WebFileSystemCallbacks; +using WebKit::WebFileSystemEntry; +using WebKit::WebString; +using WebKit::WebVector; + +namespace { + +WebKit::WebFileError PlatformFileErrorToWebFileError( + base::PlatformFileError error_code) { + switch (error_code) { + case base::PLATFORM_FILE_ERROR_NOT_FOUND: + return WebKit::WebFileErrorNotFound; + case base::PLATFORM_FILE_ERROR_INVALID_OPERATION: + case base::PLATFORM_FILE_ERROR_EXISTS: + case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY: + return WebKit::WebFileErrorInvalidModification; + case base::PLATFORM_FILE_ERROR_ACCESS_DENIED: + return WebKit::WebFileErrorNoModificationAllowed; + case base::PLATFORM_FILE_ERROR_FAILED: + return WebKit::WebFileErrorInvalidState; + case base::PLATFORM_FILE_ERROR_ABORT: + return WebKit::WebFileErrorAbort; + default: + return WebKit::WebFileErrorInvalidModification; + } +} + +class WebFileSystemCallbackDispatcherImpl + : public fileapi::FileSystemCallbackDispatcher { + public: + explicit WebFileSystemCallbackDispatcherImpl( + WebFileSystemCallbacks* callbacks) + : callbacks_(callbacks) { + DCHECK(callbacks_); + } + + virtual ~WebFileSystemCallbackDispatcherImpl() { + } + + // FileSystemCallbackDispatcher implementation + virtual void DidSucceed() { + callbacks_->didSucceed(); + } + + virtual void DidReadMetadata(const base::PlatformFileInfo& file_info) { + WebFileInfo web_file_info; + web_file_info.modificationTime = file_info.last_modified.ToDoubleT(); + callbacks_->didReadMetadata(web_file_info); + } + + virtual void DidReadDirectory( + const std::vector<base::file_util_proxy::Entry>& entries, bool has_more) { + WebVector<WebFileSystemEntry> file_system_entries(entries.size()); + for (size_t i = 0; i < entries.size(); i++) { + file_system_entries[i].name = + webkit_glue::FilePathStringToWebString(entries[i].name); + file_system_entries[i].isDirectory = entries[i].is_directory; + } + callbacks_->didReadDirectory(file_system_entries, has_more); + } + + virtual void DidOpenFileSystem(const string16&, const FilePath&) { + NOTREACHED(); + } + + virtual void DidFail(base::PlatformFileError error_code) { + callbacks_->didFail(PlatformFileErrorToWebFileError(error_code)); + } + + private: + WebFileSystemCallbacks* callbacks_; +}; + +} // namespace WebFileSystemImpl::WebFileSystemImpl() { } void WebFileSystemImpl::move(const WebString& src_path, - const WebString& dest_path, WebFileSystemCallbacks* callbacks) { + const WebString& dest_path, + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Move(src_path, dest_path, callbacks); + dispatcher->Move(webkit_glue::WebStringToFilePath(src_path), + webkit_glue::WebStringToFilePath(dest_path), + new WebFileSystemCallbackDispatcherImpl(callbacks)); } -void WebFileSystemImpl::copy(const WebKit::WebString& src_path, - const WebKit::WebString& dest_path, - WebKit::WebFileSystemCallbacks* callbacks) { +void WebFileSystemImpl::copy(const WebString& src_path, + const WebString& dest_path, + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Copy(src_path, dest_path, callbacks); + dispatcher->Copy(webkit_glue::WebStringToFilePath(src_path), + webkit_glue::WebStringToFilePath(dest_path), + new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::remove(const WebString& path, - WebFileSystemCallbacks* callbacks) { + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Remove(path, callbacks); + dispatcher->Remove(webkit_glue::WebStringToFilePath(path), + new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::readMetadata(const WebString& path, - WebFileSystemCallbacks* callbacks) { + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadMetadata(path, callbacks); + dispatcher->ReadMetadata(webkit_glue::WebStringToFilePath(path), + new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::createFile(const WebString& path, - bool exclusive, WebFileSystemCallbacks* callbacks) { + bool exclusive, + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(path, exclusive, false, callbacks); + dispatcher->Create(webkit_glue::WebStringToFilePath(path), exclusive, false, + false, new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::createDirectory(const WebString& path, - bool exclusive, WebFileSystemCallbacks* callbacks) { + bool exclusive, + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(path, exclusive, true, callbacks); + dispatcher->Create(webkit_glue::WebStringToFilePath(path), exclusive, true, + false, new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::fileExists(const WebString& path, - WebFileSystemCallbacks* callbacks) { + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(path, false, callbacks); + dispatcher->Exists(webkit_glue::WebStringToFilePath(path), false, + new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::directoryExists(const WebString& path, - WebFileSystemCallbacks* callbacks) { + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(path, true, callbacks); + dispatcher->Exists(webkit_glue::WebStringToFilePath(path), true, + new WebFileSystemCallbackDispatcherImpl(callbacks)); } void WebFileSystemImpl::readDirectory(const WebString& path, - WebFileSystemCallbacks* callbacks) { + WebFileSystemCallbacks* callbacks) { FileSystemDispatcher* dispatcher = ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadDirectory(path, callbacks); + dispatcher->ReadDirectory(webkit_glue::WebStringToFilePath(path), + new WebFileSystemCallbackDispatcherImpl(callbacks)); } diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 8d7a973..4fcb1e5 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -106,7 +106,6 @@ struct ViewMsg_ExtensionsUpdated_Params; struct ViewMsg_DeviceOrientationUpdated_Params; struct ViewHostMsg_DomMessage_Params; struct ViewHostMsg_OpenFileSystemRequest_Params; -struct ViewMsg_FileSystem_DidReadDirectory_Params; struct ViewHostMsg_AccessibilityNotification_Params; // Values that may be OR'd together to form the 'flags' parameter of the diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 070123d..f391223 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -47,6 +47,12 @@ class SkBitmap; struct ThumbnailScore; class WebCursor; +namespace base { +namespace file_util_proxy { +struct Entry; +} +} + namespace IPC { struct ChannelHandle; class Message; @@ -1035,11 +1041,14 @@ IPC_BEGIN_MESSAGES(View) IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidReadMetadata, int /* request_id */, base::PlatformFileInfo) - IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidReadDirectory, - ViewMsg_FileSystem_DidReadDirectory_Params) + IPC_MESSAGE_CONTROL3(ViewMsg_FileSystem_DidReadDirectory, + int /* request_id */, + std::vector<base::file_util_proxy::Entry> /* entries */, + bool /* has_more */) + IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidFail, int /* request_id */, - WebKit::WebFileError /* error_code */) + base::PlatformFileError /* error_code */) // The response to ViewHostMsg_AsyncOpenFile. IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, @@ -2816,11 +2825,12 @@ IPC_BEGIN_MESSAGES(ViewHost) FilePath /* path */) // WebFileSystem::create() message. - IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_Create, + IPC_MESSAGE_CONTROL5(ViewHostMsg_FileSystem_Create, int /* request_id */, FilePath /* path */, bool /* exclusive */, - bool /* is_directory */) + bool /* is_directory */, + bool /* recursive */) // WebFileSystem::exists() messages. IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Exists, diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 325de2f..4fd83a3 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -325,16 +325,6 @@ ViewHostMsg_OpenFileSystemRequest_Params:: ~ViewHostMsg_OpenFileSystemRequest_Params() { } -ViewMsg_FileSystem_DidReadDirectory_Params:: - ViewMsg_FileSystem_DidReadDirectory_Params() - : request_id(0), - has_more(false) { -} - -ViewMsg_FileSystem_DidReadDirectory_Params:: - ~ViewMsg_FileSystem_DidReadDirectory_Params() { -} - namespace IPC { // Self contained templates which are only used inside serializing Params @@ -1809,36 +1799,6 @@ void ParamTraits<ViewHostMsg_OpenFileSystemRequest_Params>::Log( l->append(")"); } -void ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.request_id); - WriteParam(m, p.entries); - WriteParam(m, p.has_more); -} - -bool ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->request_id) && - ReadParam(m, iter, &p->entries) && - ReadParam(m, iter, &p->has_more); -} - -void ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.request_id, l); - l->append(", "); - LogParam(p.entries, l); - l->append(", "); - LogParam(p.has_more, l); - l->append(")"); -} - void ParamTraits<base::file_util_proxy::Entry>::Write( Message* m, const param_type& p) { diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index 4847695..70f9825 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -964,20 +964,6 @@ struct ViewHostMsg_OpenFileSystemRequest_Params { int64 requested_size; }; -struct ViewMsg_FileSystem_DidReadDirectory_Params { - ViewMsg_FileSystem_DidReadDirectory_Params(); - ~ViewMsg_FileSystem_DidReadDirectory_Params(); - - // The response should have this id. - int request_id; - - // A vector of directory entries. - std::vector<base::file_util_proxy::Entry> entries; - - // Indicates if there will be more entries. - bool has_more; -}; - struct ViewHostMsg_AccessibilityNotification_Params { enum NotificationType { // The node checked state has changed. @@ -1259,14 +1245,6 @@ struct ParamTraits<ViewHostMsg_OpenFileSystemRequest_Params> { }; template <> -struct ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params> { - typedef ViewMsg_FileSystem_DidReadDirectory_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> struct ParamTraits<base::file_util_proxy::Entry> { typedef base::file_util_proxy::Entry param_type; static void Write(Message* m, const param_type& p); |