diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 02:42:36 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 02:42:36 +0000 |
commit | 8107004fbfe9f7ea4be59f6620273c1206c12f42 (patch) | |
tree | f86046c0bb77f471f60d088626ad291360b356ff /net | |
parent | 766f613f1c7022941e2e182543d0208a61210a16 (diff) | |
download | chromium_src-8107004fbfe9f7ea4be59f6620273c1206c12f42.zip chromium_src-8107004fbfe9f7ea4be59f6620273c1206c12f42.tar.gz chromium_src-8107004fbfe9f7ea4be59f6620273c1206c12f42.tar.bz2 |
Support handling blob URL and resolve blob references in upload data.
BUG=none
TEST=unittest
Review URL: http://codereview.chromium.org/3282003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/upload_data.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/base/upload_data.h b/net/base/upload_data.h index ac80ceb..53c5498 100644 --- a/net/base/upload_data.h +++ b/net/base/upload_data.h @@ -172,6 +172,31 @@ class UploadData : public base::RefCounted<UploadData> { 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_ |