| 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> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void OnWillUpdate(const GURL& path); | 130 void OnWillUpdate(const GURL& path); |
| 131 void OnDidUpdate(const GURL& path, int64 delta); | 131 void OnDidUpdate(const GURL& path, int64 delta); |
| 132 void OnSyncGetPlatformPath(const GURL& path, | 132 void OnSyncGetPlatformPath(const GURL& path, |
| 133 base::FilePath* platform_path); | 133 base::FilePath* platform_path); |
| 134 void OnCreateSnapshotFile(int request_id, | 134 void OnCreateSnapshotFile(int request_id, |
| 135 const GURL& path); | 135 const GURL& path); |
| 136 void OnDidReceiveSnapshotFile(int request_id); | 136 void OnDidReceiveSnapshotFile(int request_id); |
| 137 | 137 |
| 138 // Handlers for BlobHostMsg_ family messages. | 138 // Handlers for BlobHostMsg_ family messages. |
| 139 | 139 |
| 140 public: // TODO(ericu): put this back to private. |
| 140 void OnStartBuildingBlob(const std::string& uuid); | 141 void OnStartBuildingBlob(const std::string& uuid); |
| 141 void OnAppendBlobDataItemToBlob(const std::string& uuid, | 142 void OnAppendBlobDataItemToBlob(const std::string& uuid, |
| 142 const webkit_blob::BlobData::Item& item); | 143 const webkit_blob::BlobData::Item& item); |
| 143 void OnAppendSharedMemoryToBlob(const std::string& uuid, | 144 void OnAppendSharedMemoryToBlob(const std::string& uuid, |
| 144 base::SharedMemoryHandle handle, | 145 base::SharedMemoryHandle handle, |
| 145 size_t buffer_size); | 146 size_t buffer_size); |
| 146 void OnFinishBuildingBlob(const std::string& uuid, | 147 void OnFinishBuildingBlob(const std::string& uuid, |
| 147 const std::string& content_type); | 148 const std::string& content_type); |
| 149 private: // TODO(ericu): End temporary public section. |
| 148 void OnCancelBuildingBlob(const std::string& uuid); | 150 void OnCancelBuildingBlob(const std::string& uuid); |
| 149 void OnIncrementBlobRefCount(const std::string& uuid); | 151 void OnIncrementBlobRefCount(const std::string& uuid); |
| 150 void OnDecrementBlobRefCount(const std::string& uuid); | 152 void OnDecrementBlobRefCount(const std::string& uuid); |
| 151 void OnRegisterPublicBlobURL(const GURL& public_url, const std::string& uuid); | 153 void OnRegisterPublicBlobURL(const GURL& public_url, const std::string& uuid); |
| 152 void OnRevokePublicBlobURL(const GURL& public_url); | 154 void OnRevokePublicBlobURL(const GURL& public_url); |
| 153 | 155 |
| 156 public: // TODO(ericu): put this back to private. |
| 154 // Extra methods to establish a mapping from old-style blobURLs to uuids, | 157 // Extra methods to establish a mapping from old-style blobURLs to uuids, |
| 155 // and to clone them. These won't be here for long, just during a | 158 // and to clone them. These won't be here for long, just during a |
| 156 // transition period. See crbug/174200 | 159 // transition period. See crbug/174200 |
| 157 void OnDeprecatedRegisterBlobURL(const GURL& url, const std::string& uuid); | 160 void OnDeprecatedRegisterBlobURL(const GURL& url, const std::string& uuid); |
| 158 void OnDeprecatedCloneBlobURL(const GURL& url, const GURL& existing_url); | 161 void OnDeprecatedCloneBlobURL(const GURL& url, const GURL& existing_url); |
| 159 void OnDeprecatedRevokeBlobURL(const GURL& url); | 162 void OnDeprecatedRevokeBlobURL(const GURL& url); |
| 163 private: // TODO(ericu): End temporary public section. |
| 160 | 164 |
| 161 // Handlers for StreamHostMsg_ family messages. | 165 // Handlers for StreamHostMsg_ family messages. |
| 162 // | 166 // |
| 163 // TODO(tyoshino): Consider renaming BlobData to more generic one as it's now | 167 // TODO(tyoshino): Consider renaming BlobData to more generic one as it's now |
| 164 // used for Stream. | 168 // used for Stream. |
| 165 | 169 |
| 166 // Currently |content_type| is ignored. | 170 // Currently |content_type| is ignored. |
| 167 // | 171 // |
| 168 // TODO(tyoshino): Set |content_type| to the stream. | 172 // TODO(tyoshino): Set |content_type| to the stream. |
| 169 void OnStartBuildingStream(const GURL& url, const std::string& content_type); | 173 void OnStartBuildingStream(const GURL& url, const std::string& content_type); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 230 |
| 227 int process_id_; | 231 int process_id_; |
| 228 | 232 |
| 229 fileapi::FileSystemContext* context_; | 233 fileapi::FileSystemContext* context_; |
| 230 | 234 |
| 231 // Keeps map from request_id to OperationID for ongoing operations. | 235 // Keeps map from request_id to OperationID for ongoing operations. |
| 232 // (Primarily for Cancel operation) | 236 // (Primarily for Cancel operation) |
| 233 typedef std::map<int, OperationID> OperationsMap; | 237 typedef std::map<int, OperationID> OperationsMap; |
| 234 OperationsMap operations_; | 238 OperationsMap operations_; |
| 235 | 239 |
| 236 // The getter holds the context until Init() can be called from the | 240 // The getter holds the context until OnChannelConnected() can be called from |
| 237 // IO thread, which will extract the net::URLRequestContext from it. | 241 // the IO thread, which will extract the net::URLRequestContext from it. |
| 238 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 242 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 239 net::URLRequestContext* request_context_; | 243 net::URLRequestContext* request_context_; |
| 240 | 244 |
| 241 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 245 scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 242 scoped_refptr<StreamContext> stream_context_; | 246 scoped_refptr<StreamContext> stream_context_; |
| 243 | 247 |
| 244 scoped_ptr<fileapi::FileSystemOperationRunner> operation_runner_; | 248 scoped_ptr<fileapi::FileSystemOperationRunner> operation_runner_; |
| 245 | 249 |
| 246 // Keeps track of blobs used in this process and cleans up | 250 // Keeps track of blobs used in this process and cleans up |
| 247 // when the renderer process dies. | 251 // when the renderer process dies. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 260 // Need to close all of them when the renderer process dies. | 264 // Need to close all of them when the renderer process dies. |
| 261 typedef IDMap<base::Closure, IDMapOwnPointer> OnCloseCallbackMap; | 265 typedef IDMap<base::Closure, IDMapOwnPointer> OnCloseCallbackMap; |
| 262 OnCloseCallbackMap on_close_callbacks_; | 266 OnCloseCallbackMap on_close_callbacks_; |
| 263 | 267 |
| 264 DISALLOW_COPY_AND_ASSIGN(FileAPIMessageFilter); | 268 DISALLOW_COPY_AND_ASSIGN(FileAPIMessageFilter); |
| 265 }; | 269 }; |
| 266 | 270 |
| 267 } // namespace content | 271 } // namespace content |
| 268 | 272 |
| 269 #endif // CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ | 273 #endif // CONTENT_BROWSER_FILEAPI_FILEAPI_MESSAGE_FILTER_H_ |
| OLD | NEW |