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

Unified Diff: components/image_fetcher/image_data_fetcher.cc

Issue 2749283002: components/image_fetcher: Add a from_http_cache flag to RequestMetadata (Closed)
Patch Set: test Created 3 years, 9 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.cc
diff --git a/components/image_fetcher/image_data_fetcher.cc b/components/image_fetcher/image_data_fetcher.cc
index 204fa95d7e80df557d859271fbe6674c3df7b2bc..f06667366ce87170445c78950b0251fdd454afed 100644
--- a/components/image_fetcher/image_data_fetcher.cc
+++ b/components/image_fetcher/image_data_fetcher.cc
@@ -8,7 +8,6 @@
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
-#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
#include "url/gurl.h"
@@ -82,12 +81,12 @@ void ImageDataFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
bool success = source->GetStatus().status() == net::URLRequestStatus::SUCCESS;
RequestMetadata metadata;
- metadata.response_code = RESPONSE_CODE_INVALID;
if (success && source->GetResponseHeaders()) {
source->GetResponseHeaders()->GetMimeType(&metadata.mime_type);
- metadata.response_code = source->GetResponseHeaders()->response_code();
- success &= (metadata.response_code == net::HTTP_OK);
+ metadata.http_response_code = source->GetResponseHeaders()->response_code();
+ success &= (metadata.http_response_code == net::HTTP_OK);
}
+ metadata.from_http_cache = source->WasCached();
std::string image_data;
if (success) {
« no previous file with comments | « components/image_fetcher/image_data_fetcher.h ('k') | components/image_fetcher/image_data_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698