| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 5 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
| 6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/files/file_util_proxy.h" | 12 #include "base/files/file_util_proxy.h" |
| 13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
| 14 #include "base/process.h" | 14 #include "base/process.h" |
| 15 #include "ipc/ipc_listener.h" | 15 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_platform_file.h" | 16 #include "ipc/ipc_platform_file.h" |
| 17 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 17 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 18 #include "webkit/fileapi/file_system_types.h" | 18 #include "webkit/fileapi/file_system_types.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 class FilePath; |
| 21 struct PlatformFileInfo; | 22 struct PlatformFileInfo; |
| 22 } | 23 } |
| 23 | 24 |
| 24 class FilePath; | |
| 25 class GURL; | 25 class GURL; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 // Dispatches and sends file system related messages sent to/from a child | 29 // Dispatches and sends file system related messages sent to/from a child |
| 30 // process from/to the main browser process. There is one instance | 30 // process from/to the main browser process. There is one instance |
| 31 // per child process. Messages are dispatched on the main child thread. | 31 // per child process. Messages are dispatched on the main child thread. |
| 32 class FileSystemDispatcher : public IPC::Listener { | 32 class FileSystemDispatcher : public IPC::Listener { |
| 33 public: | 33 public: |
| 34 FileSystemDispatcher(); | 34 FileSystemDispatcher(); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 const GURL& file_path, | 95 const GURL& file_path, |
| 96 fileapi::FileSystemCallbackDispatcher* dispatcher); | 96 fileapi::FileSystemCallbackDispatcher* dispatcher); |
| 97 private: | 97 private: |
| 98 // Message handlers. | 98 // Message handlers. |
| 99 void OnDidOpenFileSystem(int request_id, | 99 void OnDidOpenFileSystem(int request_id, |
| 100 const std::string& name, | 100 const std::string& name, |
| 101 const GURL& root); | 101 const GURL& root); |
| 102 void OnDidSucceed(int request_id); | 102 void OnDidSucceed(int request_id); |
| 103 void OnDidReadMetadata(int request_id, | 103 void OnDidReadMetadata(int request_id, |
| 104 const base::PlatformFileInfo& file_info, | 104 const base::PlatformFileInfo& file_info, |
| 105 const FilePath& platform_path); | 105 const base::FilePath& platform_path); |
| 106 void OnDidReadDirectory( | 106 void OnDidReadDirectory( |
| 107 int request_id, | 107 int request_id, |
| 108 const std::vector<base::FileUtilProxy::Entry>& entries, | 108 const std::vector<base::FileUtilProxy::Entry>& entries, |
| 109 bool has_more); | 109 bool has_more); |
| 110 void OnDidFail(int request_id, base::PlatformFileError error_code); | 110 void OnDidFail(int request_id, base::PlatformFileError error_code); |
| 111 void OnDidWrite(int request_id, int64 bytes, bool complete); | 111 void OnDidWrite(int request_id, int64 bytes, bool complete); |
| 112 void OnDidOpenFile( | 112 void OnDidOpenFile( |
| 113 int request_id, | 113 int request_id, |
| 114 IPC::PlatformFileForTransit file); | 114 IPC::PlatformFileForTransit file); |
| 115 | 115 |
| 116 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; | 116 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); | 118 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace content | 121 } // namespace content |
| 122 | 122 |
| 123 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 123 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |