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

Unified Diff: net/base/upload_data.h

Issue 3282003: Support handling blob URL and resolve blob references in upload data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
Index: net/base/upload_data.h
===================================================================
--- net/base/upload_data.h (revision 57912)
+++ net/base/upload_data.h (working copy)
@@ -172,6 +172,31 @@
int64 identifier_;
};
+#if defined(UNIT_TEST)
+inline bool operator==(const UploadData::Element& a,
+ const UploadData::Element& b) {
+ if (a.type() != b.type())
+ return false;
+ if (a.type() == UploadData::TYPE_BYTES)
+ return a.bytes() == b.bytes();
+ if (a.type() == UploadData::TYPE_FILE) {
+ return a.file_path() == b.file_path() &&
+ a.file_range_offset() == b.file_range_offset() &&
+ a.file_range_length() == b.file_range_length() &&
+ a.expected_file_modification_time() ==
+ b.expected_file_modification_time();
+ }
+ if (a.type() == UploadData::TYPE_BLOB)
+ return a.blob_url() == b.blob_url();
+ return false;
+}
+
+inline bool operator!=(const UploadData::Element& a,
+ const UploadData::Element& b) {
+ return !(a == b);
+}
+#endif // defined(UNIT_TEST)
+
} // namespace net
#endif // NET_BASE_UPLOAD_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698