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_ITEM_H_ | 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ |
6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ | 6 #define STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ |
7 | 7 |
8 #include <ostream> | 8 #include <ostream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 scoped_ptr<DataElement> item_; | 76 scoped_ptr<DataElement> item_; |
77 scoped_refptr<DataHandle> data_handle_; | 77 scoped_refptr<DataHandle> data_handle_; |
78 | 78 |
79 // This naked pointer is safe because the scope is protected by the DataHandle | 79 // This naked pointer is safe because the scope is protected by the DataHandle |
80 // instance for disk cache entries during the lifetime of this BlobDataItem. | 80 // instance for disk cache entries during the lifetime of this BlobDataItem. |
81 disk_cache::Entry* disk_cache_entry_; | 81 disk_cache::Entry* disk_cache_entry_; |
82 int disk_cache_stream_index_; // For TYPE_DISK_CACHE_ENTRY. | 82 int disk_cache_stream_index_; // For TYPE_DISK_CACHE_ENTRY. |
83 }; | 83 }; |
84 | 84 |
85 #if defined(UNIT_TEST) | 85 STORAGE_EXPORT bool operator==(const BlobDataItem& a, const BlobDataItem& b); |
86 inline bool operator==(const BlobDataItem& a, const BlobDataItem& b) { | 86 STORAGE_EXPORT bool operator!=(const BlobDataItem& a, const BlobDataItem& b); |
87 return a.disk_cache_entry() == b.disk_cache_entry() && | |
88 a.disk_cache_stream_index() == b.disk_cache_stream_index() && | |
89 a.data_element() == b.data_element(); | |
90 } | |
91 | |
92 inline bool operator!=(const BlobDataItem& a, const BlobDataItem& b) { | |
93 return !(a == b); | |
94 } | |
95 #endif // defined(UNIT_TEST) | |
96 | 87 |
97 } // namespace storage | 88 } // namespace storage |
98 | 89 |
99 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ | 90 #endif // STORAGE_BROWSER_BLOB_BLOB_DATA_ITEM_H_ |
OLD | NEW |