OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/proxy/proxy_service.h" | 5 #include "net/proxy/proxy_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "net/proxy/proxy_config_service_android.h" | 45 #include "net/proxy/proxy_config_service_android.h" |
46 #endif | 46 #endif |
47 | 47 |
48 using base::TimeDelta; | 48 using base::TimeDelta; |
49 using base::TimeTicks; | 49 using base::TimeTicks; |
50 | 50 |
51 namespace net { | 51 namespace net { |
52 | 52 |
53 namespace { | 53 namespace { |
54 | 54 |
55 const size_t kMaxNumNetLogEntries = 100; | |
56 | |
57 // When the IP address changes we don't immediately re-run proxy auto-config. | 55 // When the IP address changes we don't immediately re-run proxy auto-config. |
58 // Instead, we wait for |kDelayAfterNetworkChangesMs| before | 56 // Instead, we wait for |kDelayAfterNetworkChangesMs| before |
59 // attempting to re-valuate proxy auto-config. | 57 // attempting to re-valuate proxy auto-config. |
60 // | 58 // |
61 // During this time window, any resolve requests sent to the ProxyService will | 59 // During this time window, any resolve requests sent to the ProxyService will |
62 // be queued. Once we have waited the required amount of them, the proxy | 60 // be queued. Once we have waited the required amount of them, the proxy |
63 // auto-config step will be run, and the queued requests resumed. | 61 // auto-config step will be run, and the queued requests resumed. |
64 // | 62 // |
65 // The reason we play this game is that our signal for detecting network | 63 // The reason we play this game is that our signal for detecting network |
66 // changes (NetworkChangeNotifier) may fire *before* the system's networking | 64 // changes (NetworkChangeNotifier) may fire *before* the system's networking |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 OnCompletion(result_); | 1565 OnCompletion(result_); |
1568 } | 1566 } |
1569 } | 1567 } |
1570 | 1568 |
1571 void SyncProxyServiceHelper::OnCompletion(int rv) { | 1569 void SyncProxyServiceHelper::OnCompletion(int rv) { |
1572 result_ = rv; | 1570 result_ = rv; |
1573 event_.Signal(); | 1571 event_.Signal(); |
1574 } | 1572 } |
1575 | 1573 |
1576 } // namespace net | 1574 } // namespace net |
OLD | NEW |