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

Unified Diff: shell/application_manager/network_fetcher.cc

Issue 1354623002: Force offline by default for warm benchmarks. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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 | « shell/application_manager/network_fetcher.h ('k') | shell/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/network_fetcher.cc
diff --git a/shell/application_manager/network_fetcher.cc b/shell/application_manager/network_fetcher.cc
index 039cbea3958a2b296dd967a14dc7aded73c513df..5b4ee2907a71977066665d4706ccf8a171689f31 100644
--- a/shell/application_manager/network_fetcher.cc
+++ b/shell/application_manager/network_fetcher.cc
@@ -124,12 +124,14 @@ void ApplicationUpdater::OnLoadComplete(mojo::URLResponsePtr response) {
NetworkFetcher::NetworkFetcher(
bool disable_cache,
+ bool force_offline_by_default,
const GURL& url,
mojo::URLResponseDiskCache* url_response_disk_cache,
mojo::NetworkService* network_service,
const FetchCallback& loader_callback)
: Fetcher(loader_callback),
disable_cache_(disable_cache),
+ force_offline_by_default_(force_offline_by_default),
url_(url),
url_response_disk_cache_(url_response_disk_cache),
network_service_(network_service),
@@ -198,6 +200,9 @@ bool NetworkFetcher::CanLoadDirectlyFromCache() {
if (disable_cache_)
return false;
+ if (force_offline_by_default_)
+ return true;
+
const std::string& host = url_.host();
return !(host == "localhost" || host == "127.0.0.1" || host == "[::1]");
}
« no previous file with comments | « shell/application_manager/network_fetcher.h ('k') | shell/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698