Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: storage/browser/blob/blob_data_builder.h

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ 6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <ostream> 10 #include <ostream>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "storage/browser/blob/blob_data_item.h" 17 #include "storage/browser/blob/blob_data_item.h"
18 #include "storage/browser/blob/blob_data_snapshot.h" 18 #include "storage/browser/blob/blob_data_snapshot.h"
19 #include "storage/browser/blob/shareable_file_reference.h"
19 #include "storage/browser/storage_browser_export.h" 20 #include "storage/browser/storage_browser_export.h"
20 21
21 namespace disk_cache { 22 namespace disk_cache {
22 class Entry; 23 class Entry;
23 } 24 }
24 25
25 namespace storage { 26 namespace storage {
26 class BlobStorageContext; 27 class BlobStorageContext;
27 class ShareableFileReference; 28 class ShareableFileReference;
28 29
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void AppendBlob(const std::string& uuid); 100 void AppendBlob(const std::string& uuid);
100 101
101 void AppendFileSystemFile(const GURL& url, 102 void AppendFileSystemFile(const GURL& url,
102 uint64_t offset, 103 uint64_t offset,
103 uint64_t length, 104 uint64_t length,
104 const base::Time& expected_modification_time); 105 const base::Time& expected_modification_time);
105 106
106 void AppendDiskCacheEntry(const scoped_refptr<DataHandle>& data_handle, 107 void AppendDiskCacheEntry(const scoped_refptr<DataHandle>& data_handle,
107 disk_cache::Entry* disk_cache_entry, 108 disk_cache::Entry* disk_cache_entry,
108 int disk_cache_stream_index); 109 int disk_cache_stream_index);
110
109 // The content of the side data is accessible with BlobReader::ReadSideData(). 111 // The content of the side data is accessible with BlobReader::ReadSideData().
110 void AppendDiskCacheEntryWithSideData( 112 void AppendDiskCacheEntryWithSideData(
111 const scoped_refptr<DataHandle>& data_handle, 113 const scoped_refptr<DataHandle>& data_handle,
112 disk_cache::Entry* disk_cache_entry, 114 disk_cache::Entry* disk_cache_entry,
113 int disk_cache_stream_index, 115 int disk_cache_stream_index,
114 int disk_cache_side_stream_index); 116 int disk_cache_side_stream_index);
115 117
116 void set_content_type(const std::string& content_type) { 118 void set_content_type(const std::string& content_type) {
117 content_type_ = content_type; 119 content_type_ = content_type;
118 } 120 }
119 121
120 void set_content_disposition(const std::string& content_disposition) { 122 void set_content_disposition(const std::string& content_disposition) {
121 content_disposition_ = content_disposition; 123 content_disposition_ = content_disposition;
122 } 124 }
123 125
124 void Clear(); 126 void Clear();
125 127
126 private: 128 private:
129 friend class BlobAsyncBuilderHostTest;
130 friend struct BlobFlattener;
127 friend class BlobStorageContext; 131 friend class BlobStorageContext;
128 friend class BlobAsyncBuilderHostTest; 132 FRIEND_TEST_ALL_PREFIXES(BlobStorageContextTest, BuildBlobFuzzish);
129 friend bool operator==(const BlobDataBuilder& a, const BlobDataBuilder& b); 133 friend bool operator==(const BlobDataBuilder& a, const BlobDataBuilder& b);
130 friend bool operator==(const BlobDataSnapshot& a, const BlobDataBuilder& b); 134 friend bool operator==(const BlobDataSnapshot& a, const BlobDataBuilder& b);
131 friend STORAGE_EXPORT void PrintTo(const BlobDataBuilder& x, 135 friend STORAGE_EXPORT void PrintTo(const BlobDataBuilder& x,
132 ::std::ostream* os); 136 ::std::ostream* os);
133 137
134 std::string uuid_; 138 std::string uuid_;
135 std::string content_type_; 139 std::string content_type_;
136 std::string content_disposition_; 140 std::string content_disposition_;
137 std::vector<scoped_refptr<BlobDataItem>> items_; 141 std::vector<scoped_refptr<BlobDataItem>> items_;
138 142
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 188 }
185 189
186 inline bool operator!=(const BlobDataBuilder& a, const BlobDataSnapshot& b) { 190 inline bool operator!=(const BlobDataBuilder& a, const BlobDataSnapshot& b) {
187 return b != a; 191 return b != a;
188 } 192 }
189 193
190 #endif // defined(UNIT_TEST) 194 #endif // defined(UNIT_TEST)
191 195
192 } // namespace storage 196 } // namespace storage
193 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ 197 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698