| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 NET_BASE_UPLOAD_DATA_H_ | 5 #ifndef NET_BASE_UPLOAD_DATA_H_ |
| 6 #define NET_BASE_UPLOAD_DATA_H_ | 6 #define NET_BASE_UPLOAD_DATA_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 friend class base::RefCounted<UploadData>; | 167 friend class base::RefCounted<UploadData>; |
| 168 | 168 |
| 169 ~UploadData() {} | 169 ~UploadData() {} |
| 170 | 170 |
| 171 std::vector<Element> elements_; | 171 std::vector<Element> elements_; |
| 172 int64 identifier_; | 172 int64 identifier_; |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 #if defined(UNIT_TEST) |
| 176 inline bool operator==(const UploadData::Element& a, |
| 177 const UploadData::Element& b) { |
| 178 if (a.type() != b.type()) |
| 179 return false; |
| 180 if (a.type() == UploadData::TYPE_BYTES) |
| 181 return a.bytes() == b.bytes(); |
| 182 if (a.type() == UploadData::TYPE_FILE) { |
| 183 return a.file_path() == b.file_path() && |
| 184 a.file_range_offset() == b.file_range_offset() && |
| 185 a.file_range_length() == b.file_range_length() && |
| 186 a.expected_file_modification_time() == |
| 187 b.expected_file_modification_time(); |
| 188 } |
| 189 if (a.type() == UploadData::TYPE_BLOB) |
| 190 return a.blob_url() == b.blob_url(); |
| 191 return false; |
| 192 } |
| 193 |
| 194 inline bool operator!=(const UploadData::Element& a, |
| 195 const UploadData::Element& b) { |
| 196 return !(a == b); |
| 197 } |
| 198 #endif // defined(UNIT_TEST) |
| 199 |
| 175 } // namespace net | 200 } // namespace net |
| 176 | 201 |
| 177 #endif // NET_BASE_UPLOAD_DATA_H_ | 202 #endif // NET_BASE_UPLOAD_DATA_H_ |
| OLD | NEW |