| 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_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/files/file_util_proxy.h" | 14 #include "base/files/file_util_proxy.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/shared_memory.h" | 16 #include "base/memory/shared_memory.h" |
| 17 #include "content/browser/streams/stream.h" | 17 #include "content/browser/streams/stream.h" |
| 18 #include "content/browser/streams/stream_context.h" | 18 #include "content/browser/streams/stream_context.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/browser_message_filter.h" | 20 #include "content/public/browser/browser_message_filter.h" |
| 21 #include "storage/browser/fileapi/file_system_context.h" | 21 #include "storage/browser/fileapi/file_system_context.h" |
| 22 #include "storage/browser/fileapi/file_system_operation_runner.h" | 22 #include "storage/browser/fileapi/file_system_operation_runner.h" |
| 23 #include "storage/common/blob/blob_data.h" | |
| 24 #include "storage/common/fileapi/file_system_types.h" | 23 #include "storage/common/fileapi/file_system_types.h" |
| 25 #include "storage/common/quota/quota_types.h" | 24 #include "storage/common/quota/quota_types.h" |
| 26 | 25 |
| 27 class GURL; | 26 class GURL; |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| 30 class FilePath; | 29 class FilePath; |
| 31 class Time; | 30 class Time; |
| 32 } | 31 } |
| 33 | 32 |
| 34 namespace storage { | 33 namespace storage { |
| 35 class FileSystemURL; | 34 class FileSystemURL; |
| 36 class FileSystemOperationRunner; | 35 class FileSystemOperationRunner; |
| 37 struct DirectoryEntry; | 36 struct DirectoryEntry; |
| 38 struct FileSystemInfo; | 37 struct FileSystemInfo; |
| 39 } | 38 } |
| 40 | 39 |
| 41 namespace net { | 40 namespace net { |
| 42 class URLRequestContext; | 41 class URLRequestContext; |
| 43 class URLRequestContextGetter; | 42 class URLRequestContextGetter; |
| 44 } // namespace net | 43 } // namespace net |
| 45 | 44 |
| 46 namespace content { | 45 namespace content { |
| 47 class BlobStorageHost; | 46 class BlobStorageHost; |
| 48 } | 47 } |
| 49 | 48 |
| 50 namespace storage { | 49 namespace storage { |
| 51 class ShareableFileReference; | 50 class ShareableFileReference; |
| 51 class DataElement; |
| 52 } | 52 } |
| 53 | 53 |
| 54 namespace content { | 54 namespace content { |
| 55 class ChildProcessSecurityPolicyImpl; | 55 class ChildProcessSecurityPolicyImpl; |
| 56 class ChromeBlobStorageContext; | 56 class ChromeBlobStorageContext; |
| 57 | 57 |
| 58 // TODO(tyoshino): Factor out code except for IPC gluing from | 58 // TODO(tyoshino): Factor out code except for IPC gluing from |
| 59 // FileAPIMessageFilter into separate classes. See crbug.com/263741. | 59 // FileAPIMessageFilter into separate classes. See crbug.com/263741. |
| 60 class CONTENT_EXPORT FileAPIMessageFilter : public BrowserMessageFilter { | 60 class CONTENT_EXPORT FileAPIMessageFilter : public BrowserMessageFilter { |
| 61 public: | 61 public: |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void OnSyncGetPlatformPath(const GURL& path, | 123 void OnSyncGetPlatformPath(const GURL& path, |
| 124 base::FilePath* platform_path); | 124 base::FilePath* platform_path); |
| 125 void OnCreateSnapshotFile(int request_id, | 125 void OnCreateSnapshotFile(int request_id, |
| 126 const GURL& path); | 126 const GURL& path); |
| 127 void OnDidReceiveSnapshotFile(int request_id); | 127 void OnDidReceiveSnapshotFile(int request_id); |
| 128 | 128 |
| 129 // Handlers for BlobHostMsg_ family messages. | 129 // Handlers for BlobHostMsg_ family messages. |
| 130 | 130 |
| 131 void OnStartBuildingBlob(const std::string& uuid); | 131 void OnStartBuildingBlob(const std::string& uuid); |
| 132 void OnAppendBlobDataItemToBlob(const std::string& uuid, | 132 void OnAppendBlobDataItemToBlob(const std::string& uuid, |
| 133 const storage::BlobData::Item& item); | 133 const storage::DataElement& item); |
| 134 void OnAppendSharedMemoryToBlob(const std::string& uuid, | 134 void OnAppendSharedMemoryToBlob(const std::string& uuid, |
| 135 base::SharedMemoryHandle handle, | 135 base::SharedMemoryHandle handle, |
| 136 size_t buffer_size); | 136 size_t buffer_size); |
| 137 void OnFinishBuildingBlob(const std::string& uuid, | 137 void OnFinishBuildingBlob(const std::string& uuid, |
| 138 const std::string& content_type); | 138 const std::string& content_type); |
| 139 void OnIncrementBlobRefCount(const std::string& uuid); | 139 void OnIncrementBlobRefCount(const std::string& uuid); |
| 140 void OnDecrementBlobRefCount(const std::string& uuid); | 140 void OnDecrementBlobRefCount(const std::string& uuid); |
| 141 void OnRegisterPublicBlobURL(const GURL& public_url, const std::string& uuid); | 141 void OnRegisterPublicBlobURL(const GURL& public_url, const std::string& uuid); |
| 142 void OnRevokePublicBlobURL(const GURL& public_url); | 142 void OnRevokePublicBlobURL(const GURL& public_url); |
| 143 | 143 |
| 144 // Handlers for StreamHostMsg_ family messages. | 144 // Handlers for StreamHostMsg_ family messages. |
| 145 // | 145 // |
| 146 // TODO(tyoshino): Consider renaming BlobData to more generic one as it's now | 146 // TODO(tyoshino): Consider renaming BlobData to more generic one as it's now |
| 147 // used for Stream. | 147 // used for Stream. |
| 148 | 148 |
| 149 // Currently |content_type| is ignored. | 149 // Currently |content_type| is ignored. |
| 150 // | 150 // |
| 151 // TODO(tyoshino): Set |content_type| to the stream. | 151 // TODO(tyoshino): Set |content_type| to the stream. |
| 152 void OnStartBuildingStream(const GURL& url, const std::string& content_type); | 152 void OnStartBuildingStream(const GURL& url, const std::string& content_type); |
| 153 void OnAppendBlobDataItemToStream(const GURL& url, | 153 void OnAppendBlobDataItemToStream(const GURL& url, |
| 154 const storage::BlobData::Item& item); | 154 const storage::DataElement& item); |
| 155 void OnAppendSharedMemoryToStream( | 155 void OnAppendSharedMemoryToStream( |
| 156 const GURL& url, base::SharedMemoryHandle handle, size_t buffer_size); | 156 const GURL& url, base::SharedMemoryHandle handle, size_t buffer_size); |
| 157 void OnFlushStream(const GURL& url); | 157 void OnFlushStream(const GURL& url); |
| 158 void OnFinishBuildingStream(const GURL& url); | 158 void OnFinishBuildingStream(const GURL& url); |
| 159 void OnAbortBuildingStream(const GURL& url); | 159 void OnAbortBuildingStream(const GURL& url); |
| 160 void OnCloneStream(const GURL& url, const GURL& src_url); | 160 void OnCloneStream(const GURL& url, const GURL& src_url); |
| 161 void OnRemoveStream(const GURL& url); | 161 void OnRemoveStream(const GURL& url); |
| 162 | 162 |
| 163 // Callback functions to be used when each file operation is finished. | 163 // Callback functions to be used when each file operation is finished. |
| 164 void DidFinish(int request_id, base::File::Error result); | 164 void DidFinish(int request_id, base::File::Error result); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // is being sent to the renderer. | 239 // is being sent to the renderer. |
| 240 std::map<int, scoped_refptr<storage::ShareableFileReference> > | 240 std::map<int, scoped_refptr<storage::ShareableFileReference> > |
| 241 in_transit_snapshot_files_; | 241 in_transit_snapshot_files_; |
| 242 | 242 |
| 243 DISALLOW_COPY_AND_ASSIGN(FileAPIMessageFilter); | 243 DISALLOW_COPY_AND_ASSIGN(FileAPIMessageFilter); |
| 244 }; | 244 }; |
| 245 | 245 |
| 246 } // namespace content | 246 } // namespace content |
| 247 | 247 |
| 248 #endif // CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ | 248 #endif // CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ |
| OLD | NEW |