| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void SetConfig(const ProxyConfig& config) { | 149 void SetConfig(const ProxyConfig& config) { |
| 150 availability_ = CONFIG_VALID; | 150 availability_ = CONFIG_VALID; |
| 151 config_ = config; | 151 config_ = config; |
| 152 FOR_EACH_OBSERVER(Observer, observers_, | 152 FOR_EACH_OBSERVER(Observer, observers_, |
| 153 OnProxyConfigChanged(config_, availability_)); | 153 OnProxyConfigChanged(config_, availability_)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 ConfigAvailability availability_; | 157 ConfigAvailability availability_; |
| 158 ProxyConfig config_; | 158 ProxyConfig config_; |
| 159 ObserverList<Observer, true> observers_; | 159 base::ObserverList<Observer, true> observers_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 // A test network delegate that exercises the OnResolveProxy callback. | 162 // A test network delegate that exercises the OnResolveProxy callback. |
| 163 class TestResolveProxyNetworkDelegate : public NetworkDelegateImpl { | 163 class TestResolveProxyNetworkDelegate : public NetworkDelegateImpl { |
| 164 public: | 164 public: |
| 165 TestResolveProxyNetworkDelegate() | 165 TestResolveProxyNetworkDelegate() |
| 166 : on_resolve_proxy_called_(false), | 166 : on_resolve_proxy_called_(false), |
| 167 add_proxy_(false), | 167 add_proxy_(false), |
| 168 remove_proxy_(false), | 168 remove_proxy_(false), |
| 169 proxy_service_(NULL) { | 169 proxy_service_(NULL) { |
| (...skipping 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3273 url, LOAD_NORMAL, &info, NULL, log.bound()); | 3273 url, LOAD_NORMAL, &info, NULL, log.bound()); |
| 3274 EXPECT_TRUE(synchronous_success); | 3274 EXPECT_TRUE(synchronous_success); |
| 3275 EXPECT_FALSE(info.is_direct()); | 3275 EXPECT_FALSE(info.is_direct()); |
| 3276 EXPECT_EQ("foopy1", info.proxy_server().host_port_pair().host()); | 3276 EXPECT_EQ("foopy1", info.proxy_server().host_port_pair().host()); |
| 3277 | 3277 |
| 3278 // No request should have been queued. | 3278 // No request should have been queued. |
| 3279 EXPECT_EQ(0u, factory->pending_requests().size()); | 3279 EXPECT_EQ(0u, factory->pending_requests().size()); |
| 3280 } | 3280 } |
| 3281 | 3281 |
| 3282 } // namespace net | 3282 } // namespace net |
| OLD | NEW |