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_CHROME_BLOB_STORAGE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
| 12 #include <vector> |
12 | 13 |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/sequenced_task_runner_helpers.h" | 16 #include "base/sequenced_task_runner_helpers.h" |
16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
17 #include "services/service_manager/public/cpp/bind_source_info.h" | 18 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 19 #include "storage/browser/blob/blob_data_handle.h" |
18 #include "storage/public/interfaces/blobs.mojom.h" | 20 #include "storage/public/interfaces/blobs.mojom.h" |
19 | 21 |
20 namespace base { | 22 namespace base { |
21 class FilePath; | 23 class FilePath; |
22 class TaskRunner; | 24 class TaskRunner; |
23 class Time; | 25 class Time; |
24 } | 26 } |
25 | 27 |
26 namespace storage { | 28 namespace storage { |
27 class BlobStorageContext; | 29 class BlobStorageContext; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 static void Destruct(const ChromeBlobStorageContext* context) { | 91 static void Destruct(const ChromeBlobStorageContext* context) { |
90 context->DeleteOnCorrectThread(); | 92 context->DeleteOnCorrectThread(); |
91 } | 93 } |
92 }; | 94 }; |
93 | 95 |
94 // Returns the BlobStorageContext associated with the | 96 // Returns the BlobStorageContext associated with the |
95 // ChromeBlobStorageContext instance passed in. | 97 // ChromeBlobStorageContext instance passed in. |
96 storage::BlobStorageContext* GetBlobStorageContext( | 98 storage::BlobStorageContext* GetBlobStorageContext( |
97 ChromeBlobStorageContext* blob_storage_context); | 99 ChromeBlobStorageContext* blob_storage_context); |
98 | 100 |
99 // Attaches blob data handles to the ResourceRequestBodyImpl body passed in. | 101 using BlobHandles = std::vector<std::unique_ptr<storage::BlobDataHandle>>; |
100 // This is used for POST and PUT requests. | 102 |
101 bool AttachRequestBodyBlobDataHandles(ResourceRequestBodyImpl* body, | 103 // Attempts to create a vector of BlobDataHandles that ensure any blob data |
102 ResourceContext* resource_context); | 104 // associated with |body| isn't cleaned up until the handles are destroyed. |
| 105 // Returns false on failure. This is used for POST and PUT requests. |
| 106 bool GetBodyBlobDataHandles(ResourceRequestBodyImpl* body, |
| 107 ResourceContext* resource_context, |
| 108 BlobHandles* blob_handles); |
103 | 109 |
104 } // namespace content | 110 } // namespace content |
105 | 111 |
106 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ | 112 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ |
OLD | NEW |