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

Unified Diff: chrome/browser/web_resource/resource_request_allowed_notifier.cc

Issue 16841020: ResourceRequestAllowedNotifier didn't work as expected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: one more fix Created 7 years, 6 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: chrome/browser/web_resource/resource_request_allowed_notifier.cc
diff --git a/chrome/browser/web_resource/resource_request_allowed_notifier.cc b/chrome/browser/web_resource/resource_request_allowed_notifier.cc
index 3650944119631f4ff52470192a41c16e3121ea8c..8700836f4a7e60105bbbd53610bd85e7f5fa6f2d 100644
--- a/chrome/browser/web_resource/resource_request_allowed_notifier.cc
+++ b/chrome/browser/web_resource/resource_request_allowed_notifier.cc
@@ -45,8 +45,9 @@ bool ResourceRequestAllowedNotifier::ResourceRequestsAllowed() {
// The observer requested permission. Return the current criteria state and
// set a flag to remind this class to notify the observer once the criteria
// is met.
- observer_requested_permission_ = true;
- return !waiting_for_user_to_accept_eula_ && !waiting_for_network_;
+ observer_requested_permission_ = waiting_for_user_to_accept_eula_ ||
+ waiting_for_network_;
+ return !observer_requested_permission_;
}
void ResourceRequestAllowedNotifier::SetWaitingForNetworkForTesting(
@@ -96,5 +97,9 @@ void ResourceRequestAllowedNotifier::OnConnectionTypeChanged(
waiting_for_network_ = false;
DVLOG(1) << "Network came back online.";
MaybeNotifyObserver();
+ } else if (!waiting_for_network_ &&
+ type == net::NetworkChangeNotifier::CONNECTION_NONE) {
+ waiting_for_network_ = true;
+ DVLOG(1) << "Network went offline.";
}
}

Powered by Google App Engine
This is Rietveld 408576698