OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/web_resource/resource_request_allowed_notifier.h" | 5 #include "chrome/browser/web_resource/resource_request_allowed_notifier.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 | 9 |
10 ResourceRequestAllowedNotifier::ResourceRequestAllowedNotifier() | 10 ResourceRequestAllowedNotifier::ResourceRequestAllowedNotifier() |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // network to reconnect, and new network state is actually available. This | 89 // network to reconnect, and new network state is actually available. This |
90 // prevents the notifier from notifying the observer if the notifier was never | 90 // prevents the notifier from notifying the observer if the notifier was never |
91 // waiting on the network, or if the network changes from one online state | 91 // waiting on the network, or if the network changes from one online state |
92 // to another (for example, Wifi to 3G, or Wifi to Wifi, if the network were | 92 // to another (for example, Wifi to 3G, or Wifi to Wifi, if the network were |
93 // flaky). | 93 // flaky). |
94 if (waiting_for_network_ && | 94 if (waiting_for_network_ && |
95 type != net::NetworkChangeNotifier::CONNECTION_NONE) { | 95 type != net::NetworkChangeNotifier::CONNECTION_NONE) { |
96 waiting_for_network_ = false; | 96 waiting_for_network_ = false; |
97 DVLOG(1) << "Network came back online."; | 97 DVLOG(1) << "Network came back online."; |
98 MaybeNotifyObserver(); | 98 MaybeNotifyObserver(); |
| 99 } else if (!waiting_for_network_ && |
| 100 type == net::NetworkChangeNotifier::CONNECTION_NONE) { |
| 101 waiting_for_network_ = true; |
| 102 DVLOG(1) << "Network went offline."; |
99 } | 103 } |
100 } | 104 } |
OLD | NEW |