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

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

Issue 1108083002: Create blobs from Disk Cache entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "net/disk_cache/disk_cache.h"
15 #include "storage/browser/blob/blob_data_item.h" 16 #include "storage/browser/blob/blob_data_item.h"
16 #include "storage/browser/blob/blob_data_snapshot.h" 17 #include "storage/browser/blob/blob_data_snapshot.h"
17 #include "storage/browser/storage_browser_export.h" 18 #include "storage/browser/storage_browser_export.h"
18 19
19 namespace storage { 20 namespace storage {
20 class BlobStorageContext; 21 class BlobStorageContext;
21 22
22 class STORAGE_EXPORT BlobDataBuilder { 23 class STORAGE_EXPORT BlobDataBuilder {
23 public: 24 public:
24 explicit BlobDataBuilder(const std::string& uuid); 25 explicit BlobDataBuilder(const std::string& uuid);
(...skipping 17 matching lines...) Expand all
42 43
43 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length); 44 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length);
44 45
45 void AppendBlob(const std::string& uuid); 46 void AppendBlob(const std::string& uuid);
46 47
47 void AppendFileSystemFile(const GURL& url, 48 void AppendFileSystemFile(const GURL& url,
48 uint64_t offset, 49 uint64_t offset,
49 uint64_t length, 50 uint64_t length,
50 const base::Time& expected_modification_time); 51 const base::Time& expected_modification_time);
51 52
53 void AppendDiskCacheEntry(disk_cache::ScopedEntryPtr entry, int index);
54
52 void set_content_type(const std::string& content_type) { 55 void set_content_type(const std::string& content_type) {
53 content_type_ = content_type; 56 content_type_ = content_type;
54 } 57 }
55 58
56 void set_content_disposition(const std::string& content_disposition) { 59 void set_content_disposition(const std::string& content_disposition) {
57 content_disposition_ = content_disposition; 60 content_disposition_ = content_disposition;
58 } 61 }
59 62
60 private: 63 private:
61 friend class BlobStorageContext; 64 friend class BlobStorageContext;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return !(a == b); 109 return !(a == b);
107 } 110 }
108 111
109 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) { 112 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) {
110 return !(a == b); 113 return !(a == b);
111 } 114 }
112 #endif // defined(UNIT_TEST) 115 #endif // defined(UNIT_TEST)
113 116
114 } // namespace storage 117 } // namespace storage
115 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ 118 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698