| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 const std::string& uuid() const { return uuid_; } | 27 const std::string& uuid() const { return uuid_; } |
| 28 | 28 |
| 29 void AppendData(const std::string& data) { | 29 void AppendData(const std::string& data) { |
| 30 AppendData(data.c_str(), data.size()); | 30 AppendData(data.c_str(), data.size()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void AppendData(const char* data, size_t length); | 33 void AppendData(const char* data, size_t length); |
| 34 | 34 |
| 35 // You must know the length of the file, you cannot use kuint64max to specify | 35 // You must know the length of the file, you cannot use kuint64max to specify |
| 36 // the whole file. | 36 // the whole file. This method creates a ShareableFileReference to the given |
| 37 // file, which is stored in this builder. |
| 37 void AppendFile(const base::FilePath& file_path, | 38 void AppendFile(const base::FilePath& file_path, |
| 38 uint64_t offset, | 39 uint64_t offset, |
| 39 uint64_t length, | 40 uint64_t length, |
| 40 const base::Time& expected_modification_time); | 41 const base::Time& expected_modification_time); |
| 41 | 42 |
| 42 // You must know the length of the file, you cannot use kuint64max to specify | |
| 43 // the whole file. | |
| 44 void AppendFile(const base::FilePath& file_path, | |
| 45 uint64_t offset, | |
| 46 uint64_t length, | |
| 47 const base::Time& expected_modification_time, | |
| 48 scoped_refptr<ShareableFileReference> shareable_file); | |
| 49 | |
| 50 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length); | 43 void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length); |
| 51 | 44 |
| 52 void AppendBlob(const std::string& uuid); | 45 void AppendBlob(const std::string& uuid); |
| 53 | 46 |
| 54 void AppendFileSystemFile(const GURL& url, | 47 void AppendFileSystemFile(const GURL& url, |
| 55 uint64_t offset, | 48 uint64_t offset, |
| 56 uint64_t length, | 49 uint64_t length, |
| 57 const base::Time& expected_modification_time); | 50 const base::Time& expected_modification_time); |
| 58 | 51 |
| 59 void set_content_type(const std::string& content_type) { | 52 void set_content_type(const std::string& content_type) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return !(a == b); | 106 return !(a == b); |
| 114 } | 107 } |
| 115 | 108 |
| 116 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) { | 109 inline bool operator!=(const BlobDataBuilder& a, const BlobDataBuilder& b) { |
| 117 return !(a == b); | 110 return !(a == b); |
| 118 } | 111 } |
| 119 #endif // defined(UNIT_TEST) | 112 #endif // defined(UNIT_TEST) |
| 120 | 113 |
| 121 } // namespace storage | 114 } // namespace storage |
| 122 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ | 115 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ |
| OLD | NEW |