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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/test/perf_time_logger.h" | 10 #include "base/test/perf_time_logger.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 void OnError(int line_number, const base::string16& message) override { | 222 void OnError(int line_number, const base::string16& message) override { |
223 CHECK(false); | 223 CHECK(false); |
224 } | 224 } |
225 }; | 225 }; |
226 | 226 |
227 class ProxyResolverV8Wrapper : public ProxyResolver { | 227 class ProxyResolverV8Wrapper : public ProxyResolver { |
228 public: | 228 public: |
229 ProxyResolverV8Wrapper(scoped_ptr<ProxyResolverV8> resolver, | 229 ProxyResolverV8Wrapper(scoped_ptr<ProxyResolverV8> resolver, |
230 scoped_ptr<MockJSBindings> bindings) | 230 scoped_ptr<MockJSBindings> bindings) |
231 : ProxyResolver(true), | 231 : resolver_(resolver.Pass()), bindings_(bindings.Pass()) {} |
232 resolver_(resolver.Pass()), | |
233 bindings_(bindings.Pass()) {} | |
234 | 232 |
235 int GetProxyForURL(const GURL& url, | 233 int GetProxyForURL(const GURL& url, |
236 ProxyInfo* results, | 234 ProxyInfo* results, |
237 const CompletionCallback& /*callback*/, | 235 const CompletionCallback& /*callback*/, |
238 RequestHandle* /*request*/, | 236 RequestHandle* /*request*/, |
239 const BoundNetLog& net_log) override { | 237 const BoundNetLog& net_log) override { |
240 return resolver_->GetProxyForURL(url, results, bindings_.get()); | 238 return resolver_->GetProxyForURL(url, results, bindings_.get()); |
241 } | 239 } |
242 | 240 |
243 void CancelRequest(RequestHandle request) override { NOTREACHED(); } | 241 void CancelRequest(RequestHandle request) override { NOTREACHED(); } |
244 | 242 |
245 LoadState GetLoadState(RequestHandle request) const override { | 243 LoadState GetLoadState(RequestHandle request) const override { |
246 NOTREACHED(); | 244 NOTREACHED(); |
247 return LOAD_STATE_IDLE; | 245 return LOAD_STATE_IDLE; |
248 } | 246 } |
249 | 247 |
250 void CancelSetPacScript() override { NOTREACHED(); } | |
251 | |
252 int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data, | |
253 const CompletionCallback& /*callback*/) override { | |
254 NOTREACHED(); | |
255 return ERR_NOT_IMPLEMENTED; | |
256 } | |
257 | |
258 private: | 248 private: |
259 scoped_ptr<ProxyResolverV8> resolver_; | 249 scoped_ptr<ProxyResolverV8> resolver_; |
260 scoped_ptr<MockJSBindings> bindings_; | 250 scoped_ptr<MockJSBindings> bindings_; |
261 | 251 |
262 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Wrapper); | 252 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Wrapper); |
263 }; | 253 }; |
264 | 254 |
265 class ProxyResolverV8Factory : public ProxyResolverFactory { | 255 class ProxyResolverV8Factory : public ProxyResolverFactory { |
266 public: | 256 public: |
267 ProxyResolverV8Factory() : ProxyResolverFactory(true) {} | 257 ProxyResolverV8Factory() : ProxyResolverFactory(true) {} |
(...skipping 20 matching lines...) Expand all Loading... |
288 TEST(ProxyResolverPerfTest, ProxyResolverV8) { | 278 TEST(ProxyResolverPerfTest, ProxyResolverV8) { |
289 base::MessageLoop message_loop; | 279 base::MessageLoop message_loop; |
290 ProxyResolverV8Factory factory; | 280 ProxyResolverV8Factory factory; |
291 PacPerfSuiteRunner runner(&factory, "ProxyResolverV8"); | 281 PacPerfSuiteRunner runner(&factory, "ProxyResolverV8"); |
292 runner.RunAllTests(); | 282 runner.RunAllTests(); |
293 } | 283 } |
294 | 284 |
295 } // namespace | 285 } // namespace |
296 | 286 |
297 } // namespace net | 287 } // namespace net |
OLD | NEW |