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 79f874be12cb18dd5c068cc2bd3d92a70a61585e..d05ec3d4bb55812189e7a024a0d728c0f04caae3 100644 |
--- a/components/image_fetcher/image_data_fetcher.h |
+++ b/components/image_fetcher/image_data_fetcher.h |
@@ -14,6 +14,7 @@ |
#include "base/memory/ref_counted.h" |
#include "components/data_use_measurement/core/data_use_user_data.h" |
#include "components/image_fetcher/request_metadata.h" |
+#include "net/url_request/url_fetcher.h" |
#include "net/url_request/url_fetcher_delegate.h" |
#include "net/url_request/url_request.h" |
#include "url/gurl.h" |
@@ -27,6 +28,14 @@ namespace image_fetcher { |
class ImageDataFetcher : public net::URLFetcherDelegate { |
public: |
+ // Impossible http response code. Used to signal that no http response code |
+ // was received. |
+ enum ResponseCode { |
+ RESPONSE_CODE_INVALID = net::URLFetcher::RESPONSE_CODE_INVALID |
+ }; |
+ |
+ // Callback with the |image_data|. If an error prevented a http response, |
+ // |request_metadata.response_code| will be RESPONSE_CODE_INVALID. |
using ImageDataFetcherCallback = |
base::Callback<void(const std::string& image_data, |
const RequestMetadata& request_metadata)>; |