diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 22:30:12 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 22:30:12 +0000 |
commit | cd920c2ab434ec474f456f186996c9ace362bf79 (patch) | |
tree | 21ff915da298c6a567cf2a05b674a49c27f6b61b /chrome | |
parent | f7578f5d14dbd1c2931b7f574ead27cc978ab73a (diff) | |
download | chromium_src-cd920c2ab434ec474f456f186996c9ace362bf79.zip chromium_src-cd920c2ab434ec474f456f186996c9ace362bf79.tar.gz chromium_src-cd920c2ab434ec474f456f186996c9ace362bf79.tar.bz2 |
Revert 57915 - Add final part of IPC plumbing for FileSystem API.
BUG=32277
TEST=none; to be added when we have complete implementation.
Review URL: http://codereview.chromium.org/3208007
TBR=kinuko@chromium.org,phajdan-jr
Review URL: http://codereview.chromium.org/3245010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/file_system/file_system_dispatcher_host.cc | 60 | ||||
-rw-r--r-- | chrome/browser/file_system/file_system_dispatcher_host.h | 25 | ||||
-rw-r--r-- | chrome/common/common_param_traits.cc | 31 | ||||
-rw-r--r-- | chrome/common/common_param_traits.h | 9 | ||||
-rw-r--r-- | chrome/common/file_system/file_system_dispatcher.cc | 87 | ||||
-rw-r--r-- | chrome/common/file_system/file_system_dispatcher.h | 45 | ||||
-rw-r--r-- | chrome/common/file_system/webfilesystem_impl.cc | 32 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 49 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 56 | ||||
-rw-r--r-- | chrome/common/render_messages_params.h | 37 | ||||
-rw-r--r-- | chrome/common/webkit_param_traits.h | 6 |
12 files changed, 25 insertions, 413 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc index 50a7a3e..d876808 100644 --- a/chrome/browser/file_system/file_system_dispatcher_host.cc +++ b/chrome/browser/file_system/file_system_dispatcher_host.cc @@ -50,12 +50,7 @@ bool FileSystemDispatcherHost::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP_EX(FileSystemDispatcherHost, message, *message_was_ok) IPC_MESSAGE_HANDLER(ViewHostMsg_OpenFileSystemRequest, OnOpenFileSystem) IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Move, OnMove) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Copy, OnCopy) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Remove, OnRemove) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_ReadMetadata, OnReadMetadata) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Create, OnCreate) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_Exists, OnExists) - IPC_MESSAGE_HANDLER(ViewHostMsg_FileSystem_ReadDirectory, OnReadDirectory) + // TODO(kinuko): add more. IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() return handled; @@ -104,59 +99,8 @@ void FileSystemDispatcherHost::OnMove( } // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} - -void FileSystemDispatcherHost::OnCopy( - int request_id, - const string16& src_path, - const string16& dest_path) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} -void FileSystemDispatcherHost::OnRemove( - int request_id, - const string16& path) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} - -void FileSystemDispatcherHost::OnReadMetadata( - int request_id, - const string16& path) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} - -void FileSystemDispatcherHost::OnCreate( - int request_id, - const string16& path, - bool exclusive, - bool is_directory) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} - -void FileSystemDispatcherHost::OnExists( - int request_id, - const string16& path, - bool is_directory) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( - request_id, WebKit::WebFileErrorAbort)); -} - -void FileSystemDispatcherHost::OnReadDirectory( - int request_id, - const string16& path) { - // TODO(kinuko): not implemented yet. - Send(new ViewMsg_FileSystem_DidFail( + Send(new ViewMsg_FileSystem_Failed( request_id, WebKit::WebFileErrorAbort)); } diff --git a/chrome/browser/file_system/file_system_dispatcher_host.h b/chrome/browser/file_system/file_system_dispatcher_host.h index 320e56a..0f8b63a 100644 --- a/chrome/browser/file_system/file_system_dispatcher_host.h +++ b/chrome/browser/file_system/file_system_dispatcher_host.h @@ -32,28 +32,9 @@ class FileSystemDispatcherHost int request_id, const string16& src_path, const string16& dest_path); - void OnCopy( - int request_id, - const string16& src_path, - const string16& dest_path); - void OnRemove( - int request_id, - const string16& path); - void OnReadMetadata( - int request_id, - const string16& path); - void OnCreate( - int request_id, - const string16& path, - bool exclusive, - bool is_directory); - void OnExists( - int request_id, - const string16& path, - bool is_directory); - void OnReadDirectory( - int request_id, - const string16& path); + + // TODO(kinuko): add more methods. + void Send(IPC::Message* message); private: diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index 0cb91a0..f3c44c1 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.cc @@ -4,7 +4,6 @@ #include "chrome/common/common_param_traits.h" -#include "base/time.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/content_settings.h" #include "chrome/common/geoposition.h" @@ -688,34 +687,4 @@ void ParamTraits<printing::NativeMetafile>::Log( l->append("<printing::NativeMetafile>"); } -void ParamTraits<file_util::FileInfo>::Write( - Message* m, const param_type& p) { - WriteParam(m, p.size); - WriteParam(m, p.is_directory); - WriteParam(m, p.last_modified.ToDoubleT()); -} - -bool ParamTraits<file_util::FileInfo>::Read( - const Message* m, void** iter, param_type* p) { - double last_modified; - bool result = - ReadParam(m, iter, &p->size) && - ReadParam(m, iter, &p->is_directory) && - ReadParam(m, iter, &last_modified); - if (result) - p->last_modified = base::Time::FromDoubleT(last_modified); - return result; -} - -void ParamTraits<file_util::FileInfo>::Log( - const param_type& p, std::string* l) { - l->append("("); - LogParam(p.size, l); - l->append(","); - LogParam(p.is_directory, l); - l->append(","); - LogParam(p.last_modified.ToDoubleT(), l); - l->append(")"); -} - } // namespace IPC diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index 0a4d819..d77f15c 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -15,7 +15,6 @@ #include <vector> #include "app/surface/transport_dib.h" -#include "base/file_util.h" #include "base/ref_counted.h" #include "chrome/common/content_settings.h" #include "chrome/common/page_zoom.h" @@ -326,14 +325,6 @@ struct ParamTraits<printing::NativeMetafile> { static void Log(const param_type& p, std::string* l); }; -template <> -struct ParamTraits<file_util::FileInfo> { - typedef file_util::FileInfo param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* r); - static void Log(const param_type& p, std::string* l); -}; - } // namespace IPC #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ diff --git a/chrome/common/file_system/file_system_dispatcher.cc b/chrome/common/file_system/file_system_dispatcher.cc index f7022e1..81361d5 100644 --- a/chrome/common/file_system/file_system_dispatcher.cc +++ b/chrome/common/file_system/file_system_dispatcher.cc @@ -4,21 +4,14 @@ #include "chrome/common/file_system/file_system_dispatcher.h" -#include "base/file_util.h" #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() { } @@ -39,10 +32,8 @@ FileSystemDispatcher::~FileSystemDispatcher() { bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(FileSystemDispatcher, msg) - IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidSucceed, DidSucceed) - IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidReadDirectory, DidReadDirectory) - IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidReadMetadata, DidReadMetadata) - IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_DidFail, DidFail) + IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_Succeeded, DidSucceed) + IPC_MESSAGE_HANDLER(ViewMsg_FileSystem_Failed, DidFail) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; @@ -56,52 +47,6 @@ void FileSystemDispatcher::Move( new ViewHostMsg_FileSystem_Move(request_id, src_path, dest_path)); } -void FileSystemDispatcher::Copy( - const string16& src_path, const string16& dest_path, - WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Copy(request_id, src_path, dest_path)); -} - -void FileSystemDispatcher::Remove( - const string16& path, WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Remove(request_id, path)); -} - -void FileSystemDispatcher::ReadMetadata( - const string16& path, WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_ReadMetadata(request_id, path)); -} - -void FileSystemDispatcher::Create( - const string16& path, bool exclusive, bool is_directory, - WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Create(request_id, path, exclusive, - is_directory)); -} - -void FileSystemDispatcher::Exists( - const string16& path, bool is_directory, - WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_Exists(request_id, path, is_directory)); -} - -void FileSystemDispatcher::ReadDirectory( - const string16& path, WebFileSystemCallbacks* callbacks) { - int request_id = callbacks_.Add(callbacks); - ChildThread::current()->Send( - new ViewHostMsg_FileSystem_ReadDirectory(request_id, path)); -} - void FileSystemDispatcher::DidSucceed(int request_id) { WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); DCHECK(callbacks); @@ -109,33 +54,9 @@ void FileSystemDispatcher::DidSucceed(int request_id) { callbacks->didSucceed(); } -void FileSystemDispatcher::DidReadMetadata(int request_id, - const file_util::FileInfo& 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::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::FilePathToWebString(params.entries[i].name); - entries[i].isDirectory = params.entries[i].is_directory; - } - callbacks->didReadDirectory(entries, params.has_more); -} - -void FileSystemDispatcher::DidFail(int request_id, WebFileError code) { +void FileSystemDispatcher::DidFail(int request_id, int code) { WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); DCHECK(callbacks); callbacks_.Remove(request_id); - callbacks->didFail(code); + callbacks->didFail(static_cast<WebFileError>(code)); } diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h index 70855d1..5c854c2 100644 --- a/chrome/common/file_system/file_system_dispatcher.h +++ b/chrome/common/file_system/file_system_dispatcher.h @@ -13,20 +13,11 @@ #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; } -namespace file_util { -struct FileInfo; -} - -struct ViewMsg_FileSystem_DidReadDirectory_Params; - // Dispatches and sends file system related messages sent to/from a child // process from/to the main browser process. There is one instance // per child process. Messages are dispatched on the main child thread. @@ -41,39 +32,13 @@ class FileSystemDispatcher { 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); + + // TODO(kinuko): add more implementation. private: - void DidSucceed(int request_id); - void DidReadMetadata( - int request_id, - const file_util::FileInfo& file_info); - void DidReadDirectory( - const ViewMsg_FileSystem_DidReadDirectory_Params& params); - void DidFail( - int request_id, - WebKit::WebFileError); + void DidSucceed(int32 callbacks_id); + void DidFail(int32 callbacks_id, int code); + // TODO(kinuko): add more callbacks. IDMap<WebKit::WebFileSystemCallbacks> callbacks_; diff --git a/chrome/common/file_system/webfilesystem_impl.cc b/chrome/common/file_system/webfilesystem_impl.cc index 49a07d6..a9aa346 100644 --- a/chrome/common/file_system/webfilesystem_impl.cc +++ b/chrome/common/file_system/webfilesystem_impl.cc @@ -23,56 +23,40 @@ void WebFileSystemImpl::move(const WebString& src_path, void WebFileSystemImpl::copy(const WebKit::WebString& src_path, const WebKit::WebString& dest_path, WebKit::WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Copy(src_path, dest_path, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::remove(const WebString& path, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Remove(path, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::readMetadata(const WebString& path, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadMetadata(path, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::createFile(const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(path, exclusive, false, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::createDirectory(const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Create(path, exclusive, true, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::fileExists(const WebString& path, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(path, false, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::directoryExists(const WebString& path, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->Exists(path, true, callbacks); + // TODO(kinuko): not implemented yet. } void WebFileSystemImpl::readDirectory(const WebString& path, WebFileSystemCallbacks* callbacks) { - FileSystemDispatcher* dispatcher = - ChildThread::current()->file_system_dispatcher(); - dispatcher->ReadDirectory(path, callbacks); + // TODO(kinuko): not implemented yet. } diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 466eafa..c5113d6 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -108,7 +108,6 @@ struct ViewMsg_ExtensionsUpdated_Params; struct ViewMsg_DeviceOrientationUpdated_Params; struct ViewHostMsg_DomMessage_Params; struct ViewHostMsg_OpenFileSystemRequest_Params; -struct ViewMsg_FileSystem_DidReadDirectory_Params; // Values that may be OR'd together to form the 'flags' parameter of the // ViewMsg_EnablePreferredSizeChangedMode message. diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 9d4fa57..1c65934 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -55,10 +55,6 @@ namespace webkit_blob { class BlobData; } -namespace file_util { -struct FileInfo; -} - //----------------------------------------------------------------------------- // RenderView messages // These are messages sent from the browser to the renderer process. @@ -1018,16 +1014,11 @@ IPC_BEGIN_MESSAGES(View) string16 /* root_path */) // WebFileSystem response messages. - IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidSucceed, + IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_Succeeded, int /* request_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidReadMetadata, - int /* request_id */, - file_util::FileInfo) - IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidReadDirectory, - ViewMsg_FileSystem_DidReadDirectory_Params) - IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidFail, + IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_Failed, int /* request_id */, - WebKit::WebFileError /* error_code */) + int /* error_code */) IPC_END_MESSAGES(View) @@ -2724,40 +2715,6 @@ IPC_BEGIN_MESSAGES(ViewHost) string16 /* src path */, string16 /* dest path */) - // WebFileSystem::copy() message. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Copy, - int /* request_id */, - string16 /* src path */, - string16 /* dest path */) - - // WebFileSystem::remove() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_Remove, - int /* request_id */, - string16 /* path */) - - // WebFileSystem::readMetadata() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadMetadata, - int /* request_id */, - string16 /* path */) - - // WebFileSystem::create() message. - IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_Create, - int /* request_id */, - string16 /* path */, - bool /* exclusive */, - bool /* is_directory */) - - // WebFileSystem::exists() messages. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Exists, - int /* request_id */, - string16 /* path */, - bool /* is_directory */) - - // WebFileSystem::readDirectory() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadDirectory, - int /* request_id */, - string16 /* path */) - //--------------------------------------------------------------------------- // Blob messages: diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 56aaeda..5ad995e 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -1423,60 +1423,4 @@ 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<ViewMsg_FileSystem_DidReadDirectory_Params::Entry>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.name); - WriteParam(m, p.is_directory); -} - -bool ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params::Entry>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->name) && - ReadParam(m, iter, &p->is_directory); -} - -void ParamTraits<ViewMsg_FileSystem_DidReadDirectory_Params::Entry>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.name, l); - l->append(", "); - LogParam(p.is_directory, l); - l->append(")"); -} - } // namespace IPC diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index e5efd3c..141e7f9 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -845,27 +845,6 @@ struct ViewHostMsg_OpenFileSystemRequest_Params { int64 requested_size; }; -struct ViewMsg_FileSystem_DidReadDirectory_Params { - // The response should have this id. - int request_id; - - // TODO(kinuko): replace this with file_util_proxy's entry structure - // once it's defined. - struct Entry { - // Name of the entry. - FilePath name; - - // Indicates if the entry is directory or not. - bool is_directory; - }; - - // A vector of directory entries. - std::vector<Entry> entries; - - // Indicates if there will be more entries. - bool has_more; -}; - namespace IPC { class Message; @@ -1119,22 +1098,6 @@ struct ParamTraits<ViewHostMsg_OpenFileSystemRequest_Params> { static void Log(const param_type& p, std::string* l); }; -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<ViewMsg_FileSystem_DidReadDirectory_Params::Entry> { - typedef ViewMsg_FileSystem_DidReadDirectory_Params::Entry 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); -}; - } // namespace IPC #endif // CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ diff --git a/chrome/common/webkit_param_traits.h b/chrome/common/webkit_param_traits.h index 6cb83e5..b45655f 100644 --- a/chrome/common/webkit_param_traits.h +++ b/chrome/common/webkit_param_traits.h @@ -29,7 +29,6 @@ #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" #include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileSystem.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h" @@ -334,11 +333,6 @@ struct SimilarTypeTraits<WebKit::WebFileSystem::Type> { typedef int Type; }; -template <> -struct SimilarTypeTraits<WebKit::WebFileError> { - typedef int Type; -}; - } // namespace IPC #endif // CHROME_COMMON_WEBKIT_PARAM_TRAITS_H_ |