| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
| 12 #include "content/browser/browser_message_filter.h" | 12 #include "content/browser/browser_message_filter.h" |
| 13 #include "webkit/fileapi/file_system_types.h" | 13 #include "webkit/fileapi/file_system_types.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class Time; | 16 class Time; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class ChromeURLRequestContext; | 19 class ChromeURLRequestContext; |
| 20 class FilePath; | |
| 21 class GURL; | 20 class GURL; |
| 22 class HostContentSettingsMap; | 21 class HostContentSettingsMap; |
| 23 class Profile; | 22 class Profile; |
| 24 class Receiver; | 23 class Receiver; |
| 25 class RenderMessageFilter; | 24 class RenderMessageFilter; |
| 26 class URLRequestContextGetter; | 25 class URLRequestContextGetter; |
| 27 | 26 |
| 28 namespace net { | 27 namespace net { |
| 29 class URLRequestContext; | 28 class URLRequestContext; |
| 30 } // namespace net | 29 } // namespace net |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 | 48 |
| 50 void UnregisterOperation(int request_id); | 49 void UnregisterOperation(int request_id); |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 void OnOpen(int request_id, | 52 void OnOpen(int request_id, |
| 54 const GURL& origin_url, | 53 const GURL& origin_url, |
| 55 fileapi::FileSystemType type, | 54 fileapi::FileSystemType type, |
| 56 int64 requested_size, | 55 int64 requested_size, |
| 57 bool create); | 56 bool create); |
| 58 void OnMove(int request_id, | 57 void OnMove(int request_id, |
| 59 const FilePath& src_path, | 58 const GURL& src_path, |
| 60 const FilePath& dest_path); | 59 const GURL& dest_path); |
| 61 void OnCopy(int request_id, | 60 void OnCopy(int request_id, |
| 62 const FilePath& src_path, | 61 const GURL& src_path, |
| 63 const FilePath& dest_path); | 62 const GURL& dest_path); |
| 64 void OnRemove(int request_id, const FilePath& path, bool recursive); | 63 void OnRemove(int request_id, const GURL& path, bool recursive); |
| 65 void OnReadMetadata(int request_id, const FilePath& path); | 64 void OnReadMetadata(int request_id, const GURL& path); |
| 66 void OnCreate(int request_id, | 65 void OnCreate(int request_id, |
| 67 const FilePath& path, | 66 const GURL& path, |
| 68 bool exclusive, | 67 bool exclusive, |
| 69 bool is_directory, | 68 bool is_directory, |
| 70 bool recursive); | 69 bool recursive); |
| 71 void OnExists(int request_id, const FilePath& path, bool is_directory); | 70 void OnExists(int request_id, const GURL& path, bool is_directory); |
| 72 void OnReadDirectory(int request_id, const FilePath& path); | 71 void OnReadDirectory(int request_id, const GURL& path); |
| 73 void OnWrite(int request_id, | 72 void OnWrite(int request_id, |
| 74 const FilePath& path, | 73 const GURL& path, |
| 75 const GURL& blob_url, | 74 const GURL& blob_url, |
| 76 int64 offset); | 75 int64 offset); |
| 77 void OnTruncate(int request_id, const FilePath& path, int64 length); | 76 void OnTruncate(int request_id, const GURL& path, int64 length); |
| 78 void OnTouchFile(int request_id, | 77 void OnTouchFile(int request_id, |
| 79 const FilePath& path, | 78 const GURL& path, |
| 80 const base::Time& last_access_time, | 79 const base::Time& last_access_time, |
| 81 const base::Time& last_modified_time); | 80 const base::Time& last_modified_time); |
| 82 void OnCancel(int request_id, int request_to_cancel); | 81 void OnCancel(int request_id, int request_to_cancel); |
| 83 | 82 |
| 84 // Creates a new FileSystemOperation. | 83 // Creates a new FileSystemOperation. |
| 85 fileapi::FileSystemOperation* GetNewOperation(int request_id); | 84 fileapi::FileSystemOperation* GetNewOperation(int request_id); |
| 86 | 85 |
| 87 scoped_refptr<fileapi::FileSystemContext> context_; | 86 scoped_refptr<fileapi::FileSystemContext> context_; |
| 88 | 87 |
| 89 // Used to look up permissions. | 88 // Used to look up permissions. |
| 90 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 89 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 91 | 90 |
| 92 // Keeps ongoing file system operations. | 91 // Keeps ongoing file system operations. |
| 93 typedef IDMap<fileapi::FileSystemOperation> OperationsMap; | 92 typedef IDMap<fileapi::FileSystemOperation> OperationsMap; |
| 94 OperationsMap operations_; | 93 OperationsMap operations_; |
| 95 | 94 |
| 96 // This holds the URLRequestContextGetter until Init() can be called from the | 95 // This holds the URLRequestContextGetter until Init() can be called from the |
| 97 // IO thread, which will extract the net::URLRequestContext from it. | 96 // IO thread, which will extract the net::URLRequestContext from it. |
| 98 scoped_refptr<URLRequestContextGetter> request_context_getter_; | 97 scoped_refptr<URLRequestContextGetter> request_context_getter_; |
| 99 scoped_refptr<net::URLRequestContext> request_context_; | 98 scoped_refptr<net::URLRequestContext> request_context_; |
| 100 | 99 |
| 101 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); | 100 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); |
| 102 }; | 101 }; |
| 103 | 102 |
| 104 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 103 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| OLD | NEW |