| 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/public/browser/browser_message_filter.h" | 12 #include "content/public/browser/browser_message_filter.h" |
| 13 #include "webkit/fileapi/file_system_types.h" | 13 #include "webkit/fileapi/file_system_types.h" |
| 14 | 14 |
| 15 class FilePath; | 15 class FilePath; |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class Time; | 19 class Time; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace fileapi { | 22 namespace fileapi { |
| 23 class FileSystemContext; | 23 class FileSystemContext; |
| 24 class FileSystemOperation; | 24 class FileSystemOperationInterface; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace net { | 27 namespace net { |
| 28 class URLRequestContext; | 28 class URLRequestContext; |
| 29 class URLRequestContextGetter; | 29 class URLRequestContextGetter; |
| 30 } // namespace net | 30 } // namespace net |
| 31 | 31 |
| 32 class FileSystemDispatcherHost : public content::BrowserMessageFilter { | 32 class FileSystemDispatcherHost : public content::BrowserMessageFilter { |
| 33 public: | 33 public: |
| 34 // Used by the renderer process host on the UI thread. | 34 // Used by the renderer process host on the UI thread. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const GURL& path, | 81 const GURL& path, |
| 82 const base::Time& last_access_time, | 82 const base::Time& last_access_time, |
| 83 const base::Time& last_modified_time); | 83 const base::Time& last_modified_time); |
| 84 void OnCancel(int request_id, int request_to_cancel); | 84 void OnCancel(int request_id, int request_to_cancel); |
| 85 void OnOpenFile(int request_id, const GURL& path, int file_flags); | 85 void OnOpenFile(int request_id, const GURL& path, int file_flags); |
| 86 void OnWillUpdate(const GURL& path); | 86 void OnWillUpdate(const GURL& path); |
| 87 void OnDidUpdate(const GURL& path, int64 delta); | 87 void OnDidUpdate(const GURL& path, int64 delta); |
| 88 void OnSyncGetPlatformPath(const GURL& path, | 88 void OnSyncGetPlatformPath(const GURL& path, |
| 89 FilePath* platform_path); | 89 FilePath* platform_path); |
| 90 | 90 |
| 91 // Creates a new FileSystemOperation. | 91 // Creates a new FileSystemOperationInterface based on |target_path|. |
| 92 fileapi::FileSystemOperation* GetNewOperation(int request_id); | 92 fileapi::FileSystemOperationInterface* GetNewOperation( |
| 93 const GURL& target_path, |
| 94 int request_id); |
| 93 | 95 |
| 94 fileapi::FileSystemContext* context_; | 96 fileapi::FileSystemContext* context_; |
| 95 | 97 |
| 96 // Keeps ongoing file system operations. | 98 // Keeps ongoing file system operations. |
| 97 typedef IDMap<fileapi::FileSystemOperation> OperationsMap; | 99 typedef IDMap<fileapi::FileSystemOperationInterface> OperationsMap; |
| 98 OperationsMap operations_; | 100 OperationsMap operations_; |
| 99 | 101 |
| 100 // The getter holds the context until Init() can be called from the | 102 // The getter holds the context until Init() can be called from the |
| 101 // IO thread, which will extract the net::URLRequestContext from it. | 103 // IO thread, which will extract the net::URLRequestContext from it. |
| 102 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 104 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 103 net::URLRequestContext* request_context_; | 105 net::URLRequestContext* request_context_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); | 107 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 110 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| OLD | NEW |