OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_resolver_v8_tracing.h" | 5 #include "net/proxy/proxy_resolver_v8_tracing.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/synchronization/cancellation_flag.h" | 16 #include "base/synchronization/cancellation_flag.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
20 #include "base/threading/thread_restrictions.h" | 20 #include "base/threading/thread_restrictions.h" |
| 21 #include "base/trace_event/trace_event.h" |
21 #include "net/base/address_list.h" | 22 #include "net/base/address_list.h" |
22 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
23 #include "net/base/network_interfaces.h" | 24 #include "net/base/network_interfaces.h" |
24 #include "net/dns/host_resolver.h" | 25 #include "net/dns/host_resolver.h" |
25 #include "net/proxy/proxy_info.h" | 26 #include "net/proxy/proxy_info.h" |
26 #include "net/proxy/proxy_resolver_error_observer.h" | 27 #include "net/proxy/proxy_resolver_error_observer.h" |
27 #include "net/proxy/proxy_resolver_v8.h" | 28 #include "net/proxy/proxy_resolver_v8.h" |
28 | 29 |
29 // The intent of this class is explained in the design document: | 30 // The intent of this class is explained in the design document: |
30 // https://docs.google.com/a/chromium.org/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPo
MJdaBn9rKreAmGOdE/edit | 31 // https://docs.google.com/a/chromium.org/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPo
MJdaBn9rKreAmGOdE/edit |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 return; | 542 return; |
542 } | 543 } |
543 | 544 |
544 if (abandoned_) | 545 if (abandoned_) |
545 return; | 546 return; |
546 | 547 |
547 NotifyCaller(result); | 548 NotifyCaller(result); |
548 } | 549 } |
549 | 550 |
550 int Job::ExecuteProxyResolver() { | 551 int Job::ExecuteProxyResolver() { |
| 552 TRACE_EVENT0("net", "net::Job::ExecuteProxyResolver"); |
551 int result = ERR_UNEXPECTED; // Initialized to silence warnings. | 553 int result = ERR_UNEXPECTED; // Initialized to silence warnings. |
552 | 554 |
553 switch (operation_) { | 555 switch (operation_) { |
554 case CREATE_V8_RESOLVER: { | 556 case CREATE_V8_RESOLVER: { |
555 scoped_ptr<ProxyResolverV8> resolver; | 557 scoped_ptr<ProxyResolverV8> resolver; |
556 result = ProxyResolverV8::Create(script_data_, this, &resolver); | 558 result = ProxyResolverV8::Create(script_data_, this, &resolver); |
557 if (result == OK) | 559 if (result == OK) |
558 *resolver_out_ = std::move(resolver); | 560 *resolver_out_ = std::move(resolver); |
559 break; | 561 break; |
560 } | 562 } |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 | 1095 |
1094 } // namespace | 1096 } // namespace |
1095 | 1097 |
1096 // static | 1098 // static |
1097 scoped_ptr<ProxyResolverV8TracingFactory> | 1099 scoped_ptr<ProxyResolverV8TracingFactory> |
1098 ProxyResolverV8TracingFactory::Create() { | 1100 ProxyResolverV8TracingFactory::Create() { |
1099 return make_scoped_ptr(new ProxyResolverV8TracingFactoryImpl()); | 1101 return make_scoped_ptr(new ProxyResolverV8TracingFactoryImpl()); |
1100 } | 1102 } |
1101 | 1103 |
1102 } // namespace net | 1104 } // namespace net |
OLD | NEW |