| 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 "chrome/common/render_messages.h" | 16 #include "chrome/common/render_messages.h" |
| 17 #include "webkit/fileapi/file_system_operation.h" | 17 #include "webkit/fileapi/file_system_operation.h" |
| 18 | 18 |
| 19 namespace base { |
| 20 class Time; |
| 21 } |
| 22 |
| 19 class FileSystemHostContext; | 23 class FileSystemHostContext; |
| 20 class HostContentSettingsMap; | 24 class HostContentSettingsMap; |
| 21 class Receiver; | 25 class Receiver; |
| 22 class ResourceMessageFilter; | 26 class ResourceMessageFilter; |
| 23 | 27 |
| 24 class FileSystemDispatcherHost | 28 class FileSystemDispatcherHost |
| 25 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { | 29 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { |
| 26 public: | 30 public: |
| 27 FileSystemDispatcherHost(IPC::Message::Sender* sender, | 31 FileSystemDispatcherHost(IPC::Message::Sender* sender, |
| 28 FileSystemHostContext* file_system_host_context, | 32 FileSystemHostContext* file_system_host_context, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 42 const FilePath& dest_path); | 46 const FilePath& dest_path); |
| 43 void OnRemove(int request_id, const FilePath& path); | 47 void OnRemove(int request_id, const FilePath& path); |
| 44 void OnReadMetadata(int request_id, const FilePath& path); | 48 void OnReadMetadata(int request_id, const FilePath& path); |
| 45 void OnCreate(int request_id, | 49 void OnCreate(int request_id, |
| 46 const FilePath& path, | 50 const FilePath& path, |
| 47 bool exclusive, | 51 bool exclusive, |
| 48 bool is_directory, | 52 bool is_directory, |
| 49 bool recursive); | 53 bool recursive); |
| 50 void OnExists(int request_id, const FilePath& path, bool is_directory); | 54 void OnExists(int request_id, const FilePath& path, bool is_directory); |
| 51 void OnReadDirectory(int request_id, const FilePath& path); | 55 void OnReadDirectory(int request_id, const FilePath& path); |
| 56 void OnTouchFile(int request_id, |
| 57 const FilePath& path, |
| 58 const base::Time& last_access_time, |
| 59 const base::Time& last_modified_time); |
| 52 void Send(IPC::Message* message); | 60 void Send(IPC::Message* message); |
| 53 void RemoveCompletedOperation(int request_id); | 61 void RemoveCompletedOperation(int request_id); |
| 54 | 62 |
| 55 private: | 63 private: |
| 56 // Creates a new FileSystemOperation. | 64 // Creates a new FileSystemOperation. |
| 57 fileapi::FileSystemOperation* GetNewOperation(int request_id); | 65 fileapi::FileSystemOperation* GetNewOperation(int request_id); |
| 58 | 66 |
| 59 // Checks the validity of a given |path|. Returns true if the given |path| | 67 // Checks the validity of a given |path|. Returns true if the given |path| |
| 60 // is valid as a path for FileSystem API. Otherwise it sends back a | 68 // is valid as a path for FileSystem API. Otherwise it sends back a |
| 61 // security error code to the dispatcher and returns false. | 69 // security error code to the dispatcher and returns false. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 75 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 83 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 76 | 84 |
| 77 // Keeps ongoing file system operations. | 85 // Keeps ongoing file system operations. |
| 78 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; | 86 typedef IDMap<fileapi::FileSystemOperation, IDMapOwnPointer> OperationsMap; |
| 79 OperationsMap operations_; | 87 OperationsMap operations_; |
| 80 | 88 |
| 81 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); | 89 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); |
| 82 }; | 90 }; |
| 83 | 91 |
| 84 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 92 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| OLD | NEW |