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

Side by Side Diff: components/image_fetcher/core/request_metadata.cc

Issue 2793983002: [ImageFetcher] Return http response headers (Closed)
Patch Set: Fix unit-tests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "components/image_fetcher/core/request_metadata.h" 5 #include "components/image_fetcher/core/request_metadata.h"
6 6
7 namespace image_fetcher { 7 namespace image_fetcher {
8 8
9 RequestMetadata::RequestMetadata() 9 RequestMetadata::RequestMetadata()
10 : http_response_code(RESPONSE_CODE_INVALID), from_http_cache(false) {} 10 : http_response_code(RESPONSE_CODE_INVALID),
11 from_http_cache(false),
12 http_response_headers(nullptr) {}
11 13
12 bool operator==(const RequestMetadata& lhs, const RequestMetadata& rhs) { 14 bool operator==(const RequestMetadata& lhs, const RequestMetadata& rhs) {
15 // Do not compare |http_response_headers| as this is solely used in
markusheintz_ 2017/04/04 13:33:36 I don't understand this comment. Do we really only
jkrcal 2017/04/04 16:42:02 I rephrased the comment.
markusheintz_ 2017/04/06 08:52:03 Oh so the equals operator is only used in test! I
jkrcal 2017/04/06 14:18:23 Okay, I added the check also for the headers.
16 // unit-tests. The pointer to headers cannot be expected, easily.
13 return lhs.mime_type == rhs.mime_type && 17 return lhs.mime_type == rhs.mime_type &&
14 lhs.http_response_code == rhs.http_response_code && 18 lhs.http_response_code == rhs.http_response_code &&
15 lhs.from_http_cache == rhs.from_http_cache; 19 lhs.from_http_cache == rhs.from_http_cache;
16 } 20 }
17 21
18 bool operator!=(const RequestMetadata& lhs, const RequestMetadata& rhs) { 22 bool operator!=(const RequestMetadata& lhs, const RequestMetadata& rhs) {
19 return !(lhs == rhs); 23 return !(lhs == rhs);
20 } 24 }
21 25
22 } // namespace image_fetcher 26 } // namespace image_fetcher
OLDNEW
« no previous file with comments | « components/image_fetcher/core/request_metadata.h ('k') | components/image_fetcher/core/request_metadata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698