| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 5 #ifndef CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 6 #define CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 6 #define CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| 11 #include "base/nullable_string16.h" | 11 #include "base/nullable_string16.h" |
| 12 #include "base/process.h" | 12 #include "base/process.h" |
| 13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "base/scoped_callback_factory.h" | 14 #include "base/scoped_callback_factory.h" |
| 15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
| 17 #include "webkit/fileapi/file_system_operation.h" | 17 #include "webkit/fileapi/file_system_operation.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 Time; | 21 class Time; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class ChromeFileSystemOperation; | |
| 25 class FileSystemHostContext; | 24 class FileSystemHostContext; |
| 26 class GURL; | 25 class GURL; |
| 27 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
| 28 class Receiver; | 27 class Receiver; |
| 29 class ResourceMessageFilter; | 28 class ResourceMessageFilter; |
| 30 | 29 |
| 31 class FileSystemDispatcherHost | 30 class FileSystemDispatcherHost |
| 32 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { | 31 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { |
| 33 public: | 32 public: |
| 34 FileSystemDispatcherHost(IPC::Message::Sender* sender, | 33 FileSystemDispatcherHost(IPC::Message::Sender* sender, |
| 35 FileSystemHostContext* file_system_host_context, | 34 FileSystemHostContext* file_system_host_context, |
| 36 HostContentSettingsMap* host_content_settings_map); | 35 HostContentSettingsMap* host_content_settings_map); |
| 37 ~FileSystemDispatcherHost(); | 36 ~FileSystemDispatcherHost(); |
| 38 void Init(base::ProcessHandle process_handle); | 37 void Init(base::ProcessHandle process_handle); |
| 39 void Shutdown(); | 38 void Shutdown(); |
| 40 | 39 |
| 41 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); | 40 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); |
| 42 | 41 |
| 43 void OnOpenFileSystem(int request_id, | 42 void OnOpenFileSystem(int request_id, |
| 44 const GURL& origin_url, | 43 const GURL& origin_url, |
| 45 fileapi::FileSystemType type, | 44 fileapi::FileSystemType type, |
| 46 int64 requested_size); | 45 int64 requested_size); |
| 47 void OnMove(int request_id, | 46 void OnMove(int request_id, |
| 48 const FilePath& src_path, | 47 const FilePath& src_path, |
| 49 const FilePath& dest_path); | 48 const FilePath& dest_path); |
| 50 void OnCopy(int request_id, | 49 void OnCopy(int request_id, |
| 51 const FilePath& src_path, | 50 const FilePath& src_path, |
| 52 const FilePath& dest_path); | 51 const FilePath& dest_path); |
| 53 void OnRemove(int request_id, const FilePath& path); | 52 void OnRemove(int request_id, const FilePath& path, bool recursive); |
| 54 void OnReadMetadata(int request_id, const FilePath& path); | 53 void OnReadMetadata(int request_id, const FilePath& path); |
| 55 void OnCreate(int request_id, | 54 void OnCreate(int request_id, |
| 56 const FilePath& path, | 55 const FilePath& path, |
| 57 bool exclusive, | 56 bool exclusive, |
| 58 bool is_directory, | 57 bool is_directory, |
| 59 bool recursive); | 58 bool recursive); |
| 60 void OnExists(int request_id, const FilePath& path, bool is_directory); | 59 void OnExists(int request_id, const FilePath& path, bool is_directory); |
| 61 void OnReadDirectory(int request_id, const FilePath& path); | 60 void OnReadDirectory(int request_id, const FilePath& path); |
| 62 void OnWrite(int request_id, | 61 void OnWrite(int request_id, |
| 63 const FilePath& path, | 62 const FilePath& path, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 94 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 96 | 95 |
| 97 // Keeps ongoing file system operations. | 96 // Keeps ongoing file system operations. |
| 98 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; | 97 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; |
| 99 OperationsMap operations_; | 98 OperationsMap operations_; |
| 100 | 99 |
| 101 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); | 100 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 103 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| OLD | NEW |