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

Unified Diff: components/image_fetcher/image_data_fetcher.h

Issue 2687873002: Use mime type for image extension (Closed)
Patch Set: Use const ref Created 3 years, 10 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: components/image_fetcher/image_data_fetcher.h
diff --git a/components/image_fetcher/image_data_fetcher.h b/components/image_fetcher/image_data_fetcher.h
index 5383086a519b2aa37324ab4335a5df99ef229d1e..ac32aa04c63f0be0e6540e0a653546c43cd7451a 100644
--- a/components/image_fetcher/image_data_fetcher.h
+++ b/components/image_fetcher/image_data_fetcher.h
@@ -24,10 +24,21 @@ class URLRequestContextGetter;
namespace image_fetcher {
+struct RequestMetadata {
gambard 2017/02/09 13:44:12 I don't know if this should be inside the class?
Marc Treib 2017/02/09 13:49:48 That's mostly a matter of taste IMO. I tend to sli
sdefresne 2017/02/09 13:55:28 drive-by: having the class separate make it easier
gambard 2017/02/09 15:10:32 Actually, I have moved it to its own class.
gambard 2017/02/09 15:10:32 Ok, I think I will let it outside the class as it
+ std::string mime_type;
+
+ bool operator==(const RequestMetadata& rhs) const {
Marc Treib 2017/02/09 13:49:48 Are the equality operators required?
sdefresne 2017/02/09 13:55:28 Even if they are required, they generally do not n
gambard 2017/02/09 15:10:32 They are mainly here for testing (verifying that t
+ return mime_type == rhs.mime_type;
+ }
+
+ bool operator!=(const RequestMetadata& rhs) const { return !operator==(rhs); }
+};
+
class ImageDataFetcher : public net::URLFetcherDelegate {
public:
using ImageDataFetcherCallback =
- base::Callback<void(const std::string& image_data)>;
+ base::Callback<void(const std::string& image_data,
+ const RequestMetadata& request_metadata)>;
using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName;
« no previous file with comments | « no previous file | components/image_fetcher/image_data_fetcher.cc » ('j') | components/image_fetcher/image_data_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698