| OLD | NEW |
| 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 <ostream> | 9 #include <ostream> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "storage/browser/blob/blob_data_item.h" | 16 #include "storage/browser/blob/blob_data_item.h" |
| 17 #include "storage/browser/blob/blob_data_snapshot.h" | 17 #include "storage/browser/blob/blob_data_snapshot.h" |
| 18 #include "storage/browser/blob/shareable_file_reference.h" |
| 18 #include "storage/browser/storage_browser_export.h" | 19 #include "storage/browser/storage_browser_export.h" |
| 19 | 20 |
| 21 namespace base { |
| 22 class TaskRunner; |
| 23 } |
| 24 |
| 20 namespace disk_cache { | 25 namespace disk_cache { |
| 21 class Entry; | 26 class Entry; |
| 22 } | 27 } |
| 23 | 28 |
| 24 namespace storage { | 29 namespace storage { |
| 25 class BlobStorageContext; | 30 class BlobStorageContext; |
| 26 class ShareableFileReference; | 31 class ShareableFileReference; |
| 27 | 32 |
| 28 class STORAGE_EXPORT BlobDataBuilder { | 33 class STORAGE_EXPORT BlobDataBuilder { |
| 29 public: | 34 public: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const base::Time& expected_modification_time); | 91 const base::Time& expected_modification_time); |
| 87 | 92 |
| 88 // You must know the length of the file, you cannot use kuint64max to specify | 93 // You must know the length of the file, you cannot use kuint64max to specify |
| 89 // the whole file. This method creates a ShareableFileReference to the given | 94 // the whole file. This method creates a ShareableFileReference to the given |
| 90 // file, which is stored in this builder. | 95 // file, which is stored in this builder. |
| 91 void AppendFile(const base::FilePath& file_path, | 96 void AppendFile(const base::FilePath& file_path, |
| 92 uint64_t offset, | 97 uint64_t offset, |
| 93 uint64_t length, | 98 uint64_t length, |
| 94 const base::Time& expected_modification_time); | 99 const base::Time& expected_modification_time); |
| 95 | 100 |
| 101 // You must know the length of the file, you cannot use kuint64max to specify |
| 102 // the whole file. |
| 103 void AppendShareableFileReference( |
| 104 const scoped_refptr<ShareableFileReference> file, |
| 105 uint64_t offset, |
| 106 uint64_t length, |
| 107 const base::Time& expected_modification_time); |
| 108 |
| 96 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length); | 109 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length); |
| 97 | 110 |
| 98 void AppendBlob(const std::string& uuid); | 111 void AppendBlob(const std::string& uuid); |
| 99 | 112 |
| 100 void AppendFileSystemFile(const GURL& url, | 113 void AppendFileSystemFile(const GURL& url, |
| 101 uint64_t offset, | 114 uint64_t offset, |
| 102 uint64_t length, | 115 uint64_t length, |
| 103 const base::Time& expected_modification_time); | 116 const base::Time& expected_modification_time); |
| 104 | 117 |
| 105 void AppendDiskCacheEntry(const scoped_refptr<DataHandle>& data_handle, | 118 void AppendDiskCacheEntry(const scoped_refptr<DataHandle>& data_handle, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 182 } |
| 170 | 183 |
| 171 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) { | 184 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) { |
| 172 return !(a == b); | 185 return !(a == b); |
| 173 } | 186 } |
| 174 | 187 |
| 175 #endif // defined(UNIT_TEST) | 188 #endif // defined(UNIT_TEST) |
| 176 | 189 |
| 177 } // namespace storage | 190 } // namespace storage |
| 178 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ | 191 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ |
| OLD | NEW |