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

Unified Diff: mojo/services/network/url_loader_impl.cc

Issue 1241553003: Update implementation following changes to URLRequest cache mode. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/url_loader_impl.cc
diff --git a/mojo/services/network/url_loader_impl.cc b/mojo/services/network/url_loader_impl.cc
index 955a49c2e958484272fd7896de24912b26b723d1..1f372f3895b62945537f056f9cd41e22354da121 100644
--- a/mojo/services/network/url_loader_impl.cc
+++ b/mojo/services/network/url_loader_impl.cc
@@ -537,10 +537,15 @@ void URLLoaderImpl::StartInternal(URLRequestPtr request) {
new net::ElementsUploadDataStream(element_readers.Pass(), 0)));
}
int load_flags = 0;
- if (request->bypass_cache)
- load_flags |= net::LOAD_BYPASS_CACHE;
- if (request->only_from_cache)
- load_flags |= net::LOAD_ONLY_FROM_CACHE;
+ switch (request->cache_mode) {
+ case URLRequest::CACHE_MODE_DEFAULT:
+ break;
+ case URLRequest::CACHE_MODE_BYPASS_CACHE:
+ load_flags |= net::LOAD_BYPASS_CACHE;
+ case URLRequest::CACHE_MODE_ONLY_FROM_CACHE:
+ load_flags |= net::LOAD_ONLY_FROM_CACHE;
+ break;
+ }
viettrungluu 2015/07/20 17:00:28 Since we don't validate enums, you should have a d
qsr 2015/07/20 18:30:50 Hum... I'm kind of torn here. If I don't do this,
if (load_flags)
url_request_->SetLoadFlags(load_flags);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698