| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 using DataHandle = BlobDataItem::DataHandle; | 37 using DataHandle = BlobDataItem::DataHandle; |
| 38 // Visible for testing. | 38 // Visible for testing. |
| 39 static base::FilePath GetFutureFileItemPath(uint64_t file_id); | 39 static base::FilePath GetFutureFileItemPath(uint64_t file_id); |
| 40 | 40 |
| 41 // Returns if the given item was created by AppendFutureFile. | 41 // Returns if the given item was created by AppendFutureFile. |
| 42 static bool IsFutureFileItem(const DataElement& element); | 42 static bool IsFutureFileItem(const DataElement& element); |
| 43 // Returns |file_id| given to AppendFutureFile. | 43 // Returns |file_id| given to AppendFutureFile. |
| 44 static uint64_t GetFutureFileID(const DataElement& element); | 44 static uint64_t GetFutureFileID(const DataElement& element); |
| 45 | 45 |
| 46 explicit BlobDataBuilder(const std::string& uuid); | 46 explicit BlobDataBuilder(const std::string& uuid); |
| 47 BlobDataBuilder(BlobDataBuilder&&); |
| 48 BlobDataBuilder& operator=(BlobDataBuilder&&); |
| 47 ~BlobDataBuilder(); | 49 ~BlobDataBuilder(); |
| 48 | 50 |
| 49 const std::string& uuid() const { return uuid_; } | 51 const std::string& uuid() const { return uuid_; } |
| 50 | 52 |
| 51 // Validates the data element that was sent over IPC, and copies the data if | 53 // Validates the data element that was sent over IPC, and copies the data if |
| 52 // it's a 'bytes' element. Data elements of BYTES_DESCRIPTION or | 54 // it's a 'bytes' element. Data elements of BYTES_DESCRIPTION or |
| 53 // DISK_CACHE_ENTRY types are not valid IPC data element types, and cannot be | 55 // DISK_CACHE_ENTRY types are not valid IPC data element types, and cannot be |
| 54 // given to this method. | 56 // given to this method. |
| 55 void AppendIPCDataElement(const DataElement& ipc_data); | 57 void AppendIPCDataElement(const DataElement& ipc_data); |
| 56 | 58 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 201 } |
| 200 | 202 |
| 201 inline bool operator!=(const BlobDataBuilder& a, const BlobDataSnapshot& b) { | 203 inline bool operator!=(const BlobDataBuilder& a, const BlobDataSnapshot& b) { |
| 202 return b != a; | 204 return b != a; |
| 203 } | 205 } |
| 204 | 206 |
| 205 #endif // defined(UNIT_TEST) | 207 #endif // defined(UNIT_TEST) |
| 206 | 208 |
| 207 } // namespace storage | 209 } // namespace storage |
| 208 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ | 210 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_ |
| OLD | NEW |