Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1175)

Unified Diff: storage/common/data_element.h

Issue 1292523002: [BlobAsync] Patch 3: Renderer Classes & Logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async2
Patch Set: comments and test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « storage/common/blob_storage/blob_item_bytes_response.cc ('k') | storage/common/data_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/common/data_element.h
diff --git a/storage/common/data_element.h b/storage/common/data_element.h
index 4cd686307d4ee92005eac21b1ec4fc4935cc0c7e..01453088312e88386d4587a5324ad5cb209fed1d 100644
--- a/storage/common/data_element.h
+++ b/storage/common/data_element.h
@@ -144,39 +144,10 @@ class STORAGE_COMMON_EXPORT DataElement {
base::Time expected_modification_time_;
};
-#if defined(UNIT_TEST)
-inline bool operator==(const DataElement& a, const DataElement& b) {
- if (a.type() != b.type() ||
- a.offset() != b.offset() ||
- a.length() != b.length())
- return false;
- switch (a.type()) {
- case DataElement::TYPE_BYTES:
- return memcmp(a.bytes(), b.bytes(), b.length()) == 0;
- case DataElement::TYPE_FILE:
- return a.path() == b.path() &&
- a.expected_modification_time() == b.expected_modification_time();
- case DataElement::TYPE_BLOB:
- return a.blob_uuid() == b.blob_uuid();
- case DataElement::TYPE_FILE_FILESYSTEM:
- return a.filesystem_url() == b.filesystem_url();
- case DataElement::TYPE_DISK_CACHE_ENTRY:
- // We compare only length and offset; we trust the entry itself was
- // compared at some higher level such as in BlobDataItem.
- return true;
- case DataElement::TYPE_BYTES_DESCRIPTION:
- return true;
- case DataElement::TYPE_UNKNOWN:
- NOTREACHED();
- return false;
- }
- return false;
-}
-
-inline bool operator!=(const DataElement& a, const DataElement& b) {
- return !(a == b);
-}
-#endif // defined(UNIT_TEST)
+STORAGE_COMMON_EXPORT bool operator==(const DataElement& a,
+ const DataElement& b);
+STORAGE_COMMON_EXPORT bool operator!=(const DataElement& a,
+ const DataElement& b);
} // namespace storage
« no previous file with comments | « storage/common/blob_storage/blob_item_bytes_response.cc ('k') | storage/common/data_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698