Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_DATA_ELEMENT_H_ | 5 #ifndef STORAGE_COMMON_DATA_ELEMENT_H_ |
| 6 #define STORAGE_COMMON_DATA_ELEMENT_H_ | 6 #define STORAGE_COMMON_DATA_ELEMENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 TYPE_BLOB, | 35 TYPE_BLOB, |
| 36 TYPE_FILE_FILESYSTEM, | 36 TYPE_FILE_FILESYSTEM, |
| 37 TYPE_DISK_CACHE_ENTRY, | 37 TYPE_DISK_CACHE_ENTRY, |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 DataElement(); | 40 DataElement(); |
| 41 DataElement(const DataElement& other); | 41 DataElement(const DataElement& other); |
| 42 ~DataElement(); | 42 ~DataElement(); |
| 43 | 43 |
| 44 Type type() const { return type_; } | 44 Type type() const { return type_; } |
| 45 const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; } | 45 const char* bytes() const { return bytes_ ? bytes_ : buf_.data(); } |
|
Łukasz Anforowicz
2016/05/25 00:26:18
There are places in code where users of DataElemen
danakj
2016/05/25 22:13:46
Returning null lgtm
| |
| 46 const base::FilePath& path() const { return path_; } | 46 const base::FilePath& path() const { return path_; } |
| 47 const GURL& filesystem_url() const { return filesystem_url_; } | 47 const GURL& filesystem_url() const { return filesystem_url_; } |
| 48 const std::string& blob_uuid() const { return blob_uuid_; } | 48 const std::string& blob_uuid() const { return blob_uuid_; } |
| 49 uint64_t offset() const { return offset_; } | 49 uint64_t offset() const { return offset_; } |
| 50 uint64_t length() const { return length_; } | 50 uint64_t length() const { return length_; } |
| 51 const base::Time& expected_modification_time() const { | 51 const base::Time& expected_modification_time() const { |
| 52 return expected_modification_time_; | 52 return expected_modification_time_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // For use with SetToAllocatedBytes. Should only be used after calling | 55 // For use with SetToAllocatedBytes. Should only be used after calling |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a, | 157 STORAGE_COMMON_EXPORT bool operator==(const DataElement& a, |
| 158 const DataElement& b); | 158 const DataElement& b); |
| 159 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a, | 159 STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a, |
| 160 const DataElement& b); | 160 const DataElement& b); |
| 161 | 161 |
| 162 } // namespace storage | 162 } // namespace storage |
| 163 | 163 |
| 164 #endif // STORAGE_COMMON_DATA_ELEMENT_H_ | 164 #endif // STORAGE_COMMON_DATA_ELEMENT_H_ |
| OLD | NEW |