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

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

Issue 883073003: Mojo's network service should use a disk cache on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/network_context.cc
diff --git a/mojo/services/network/network_context.cc b/mojo/services/network/network_context.cc
index b2a965fa5ab65220fc1837d5800f7f1631cfd4d8..004554fe24922f325d5eaafc0296774c7318fb07 100644
--- a/mojo/services/network/network_context.cc
+++ b/mojo/services/network/network_context.cc
@@ -36,15 +36,20 @@ scoped_ptr<net::URLRequestContext> NetworkContext::MakeURLRequestContext(
builder.set_transport_security_persister_path(base_path);
net::URLRequestContextBuilder::HttpCacheParams cache_params;
+#if defined(OS_ANDROID)
+ // On Android, we store the cache on disk becase we can run only a single
+ // instance of the shell at a time.
+ cache_params.type = net::URLRequestContextBuilder::HttpCacheParams::DISK;
cache_params.path = base_path.Append(FILE_PATH_LITERAL("Cache"));
- // TODO(esprehn): For now store the cache in memory so we can run many shells
+#else
+ // On desktop, we store the cache in memory so we can run many shells
// in parallel when running tests, otherwise the network services in each
// shell will corrupt the disk cache.
cache_params.type = net::URLRequestContextBuilder::HttpCacheParams::IN_MEMORY;
- builder.EnableHttpCache(cache_params);
+#endif
+ builder.EnableHttpCache(cache_params);
builder.set_file_enabled(true);
-
return make_scoped_ptr(builder.Build());
}
« 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