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

Side by Side Diff: net/proxy/proxy_service_unittest.cc

Issue 2423713002: Remove usage of FOR_EACH_OBSERVER macro in net (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/proxy/proxy_config_service_mac.cc ('k') | net/ssl/ssl_config_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <cstdarg> 7 #include <cstdarg>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 ConfigAvailability GetLatestProxyConfig(ProxyConfig* results) override { 153 ConfigAvailability GetLatestProxyConfig(ProxyConfig* results) override {
154 if (availability_ == CONFIG_VALID) 154 if (availability_ == CONFIG_VALID)
155 *results = config_; 155 *results = config_;
156 return availability_; 156 return availability_;
157 } 157 }
158 158
159 void SetConfig(const ProxyConfig& config) { 159 void SetConfig(const ProxyConfig& config) {
160 availability_ = CONFIG_VALID; 160 availability_ = CONFIG_VALID;
161 config_ = config; 161 config_ = config;
162 FOR_EACH_OBSERVER(Observer, observers_, 162 for (auto& observer : observers_)
163 OnProxyConfigChanged(config_, availability_)); 163 observer.OnProxyConfigChanged(config_, availability_);
164 } 164 }
165 165
166 private: 166 private:
167 ConfigAvailability availability_; 167 ConfigAvailability availability_;
168 ProxyConfig config_; 168 ProxyConfig config_;
169 base::ObserverList<Observer, true> observers_; 169 base::ObserverList<Observer, true> observers_;
170 }; 170 };
171 171
172 // A test network delegate that exercises the OnResolveProxy callback. 172 // A test network delegate that exercises the OnResolveProxy callback.
173 class TestResolveProxyDelegate : public ProxyDelegate { 173 class TestResolveProxyDelegate : public ProxyDelegate {
(...skipping 3488 matching lines...) Expand 10 before | Expand all | Expand 10 after
3662 GURL(test.sanitized_url_unstripped), 3662 GURL(test.sanitized_url_unstripped),
3663 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE)); 3663 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::UNSAFE));
3664 3664
3665 EXPECT_EQ( 3665 EXPECT_EQ(
3666 GURL(test.sanitized_url), 3666 GURL(test.sanitized_url),
3667 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE)); 3667 helper.SanitizeUrl(raw_url, ProxyService::SanitizeUrlPolicy::SAFE));
3668 } 3668 }
3669 } 3669 }
3670 3670
3671 } // namespace net 3671 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_mac.cc ('k') | net/ssl/ssl_config_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698