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

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

Issue 1439053002: Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore scoped_ptr to mock and nits Created 4 years, 10 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_resolver_mac.cc ('k') | net/proxy/proxy_resolver_v8_tracing.h » ('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 <utility> 5 #include <utility>
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 class ProxyResolverV8Wrapper : public ProxyResolver { 228 class ProxyResolverV8Wrapper : public ProxyResolver {
229 public: 229 public:
230 ProxyResolverV8Wrapper(scoped_ptr<ProxyResolverV8> resolver, 230 ProxyResolverV8Wrapper(scoped_ptr<ProxyResolverV8> resolver,
231 scoped_ptr<MockJSBindings> bindings) 231 scoped_ptr<MockJSBindings> bindings)
232 : resolver_(std::move(resolver)), bindings_(std::move(bindings)) {} 232 : resolver_(std::move(resolver)), bindings_(std::move(bindings)) {}
233 233
234 int GetProxyForURL(const GURL& url, 234 int GetProxyForURL(const GURL& url,
235 ProxyInfo* results, 235 ProxyInfo* results,
236 const CompletionCallback& /*callback*/, 236 const CompletionCallback& /*callback*/,
237 RequestHandle* /*request*/, 237 scoped_ptr<Request>* /*request*/,
238 const BoundNetLog& net_log) override { 238 const BoundNetLog& net_log) override {
239 return resolver_->GetProxyForURL(url, results, bindings_.get()); 239 return resolver_->GetProxyForURL(url, results, bindings_.get());
240 } 240 }
241 241
242 void CancelRequest(RequestHandle request) override { NOTREACHED(); }
243
244 LoadState GetLoadState(RequestHandle request) const override {
245 NOTREACHED();
246 return LOAD_STATE_IDLE;
247 }
248
249 private: 242 private:
250 scoped_ptr<ProxyResolverV8> resolver_; 243 scoped_ptr<ProxyResolverV8> resolver_;
251 scoped_ptr<MockJSBindings> bindings_; 244 scoped_ptr<MockJSBindings> bindings_;
252 245
253 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Wrapper); 246 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Wrapper);
254 }; 247 };
255 248
256 class ProxyResolverV8Factory : public ProxyResolverFactory { 249 class ProxyResolverV8Factory : public ProxyResolverFactory {
257 public: 250 public:
258 ProxyResolverV8Factory() : ProxyResolverFactory(true) {} 251 ProxyResolverV8Factory() : ProxyResolverFactory(true) {}
(...skipping 20 matching lines...) Expand all
279 TEST(ProxyResolverPerfTest, ProxyResolverV8) { 272 TEST(ProxyResolverPerfTest, ProxyResolverV8) {
280 base::MessageLoop message_loop; 273 base::MessageLoop message_loop;
281 ProxyResolverV8Factory factory; 274 ProxyResolverV8Factory factory;
282 PacPerfSuiteRunner runner(&factory, "ProxyResolverV8"); 275 PacPerfSuiteRunner runner(&factory, "ProxyResolverV8");
283 runner.RunAllTests(); 276 runner.RunAllTests();
284 } 277 }
285 278
286 } // namespace 279 } // namespace
287 280
288 } // namespace net 281 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_mac.cc ('k') | net/proxy/proxy_resolver_v8_tracing.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698