| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ | 6 #define CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Creates a URLLoaderFactory interface pointer for serving blob requests. | 36 // Creates a URLLoaderFactory interface pointer for serving blob requests. |
| 37 // Called on the UI thread. | 37 // Called on the UI thread. |
| 38 void HandleRequest(mojom::URLLoaderFactoryRequest request); | 38 void HandleRequest(mojom::URLLoaderFactoryRequest request); |
| 39 | 39 |
| 40 // mojom::URLLoaderFactory implementation: | 40 // mojom::URLLoaderFactory implementation: |
| 41 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader, | 41 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader, |
| 42 int32_t routing_id, | 42 int32_t routing_id, |
| 43 int32_t request_id, | 43 int32_t request_id, |
| 44 uint32_t options, | 44 uint32_t options, |
| 45 const ResourceRequest& request, | 45 const ResourceRequest& request, |
| 46 mojom::URLLoaderClientPtr client) override; | 46 mojom::URLLoaderClientPtr client, |
| 47 const net::MutableNetworkTrafficAnnotationTag& |
| 48 traffic_annotation) override; |
| 47 void SyncLoad(int32_t routing_id, | 49 void SyncLoad(int32_t routing_id, |
| 48 int32_t request_id, | 50 int32_t request_id, |
| 49 const ResourceRequest& request, | 51 const ResourceRequest& request, |
| 50 SyncLoadCallback callback) override; | 52 SyncLoadCallback callback) override; |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 friend class base::DeleteHelper<BlobURLLoaderFactory>; | 55 friend class base::DeleteHelper<BlobURLLoaderFactory>; |
| 54 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 56 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 55 | 57 |
| 56 ~BlobURLLoaderFactory() override; | 58 ~BlobURLLoaderFactory() override; |
| 57 | 59 |
| 58 void InitializeOnIO(BlobContextGetter blob_storage_context_getter); | 60 void InitializeOnIO(BlobContextGetter blob_storage_context_getter); |
| 59 void BindOnIO(mojom::URLLoaderFactoryRequest request); | 61 void BindOnIO(mojom::URLLoaderFactoryRequest request); |
| 60 | 62 |
| 61 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 63 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
| 62 scoped_refptr<storage::FileSystemContext> file_system_context_; | 64 scoped_refptr<storage::FileSystemContext> file_system_context_; |
| 63 | 65 |
| 64 // Used on the IO thread. | 66 // Used on the IO thread. |
| 65 mojo::BindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; | 67 mojo::BindingSet<mojom::URLLoaderFactory> loader_factory_bindings_; |
| 66 | 68 |
| 67 DISALLOW_COPY_AND_ASSIGN(BlobURLLoaderFactory); | 69 DISALLOW_COPY_AND_ASSIGN(BlobURLLoaderFactory); |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace content | 72 } // namespace content |
| 71 | 73 |
| 72 #endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ | 74 #endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_ |
| OLD | NEW |