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/auto_reset.h" | 12 #include "base/auto_reset.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/synchronization/cancellation_flag.h" | 18 #include "base/synchronization/cancellation_flag.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
| 23 #include "base/trace_event/trace_event.h" |
23 #include "net/base/address_list.h" | 24 #include "net/base/address_list.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
25 #include "net/base/network_interfaces.h" | 26 #include "net/base/network_interfaces.h" |
26 #include "net/dns/host_resolver.h" | 27 #include "net/dns/host_resolver.h" |
27 #include "net/proxy/proxy_info.h" | 28 #include "net/proxy/proxy_info.h" |
28 #include "net/proxy/proxy_resolver_error_observer.h" | 29 #include "net/proxy/proxy_resolver_error_observer.h" |
29 #include "net/proxy/proxy_resolver_v8.h" | 30 #include "net/proxy/proxy_resolver_v8.h" |
30 #include "url/url_canon.h" | 31 #include "url/url_canon.h" |
31 | 32 |
32 // The intent of this class is explained in the design document: | 33 // The intent of this class is explained in the design document: |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 return; | 572 return; |
572 } | 573 } |
573 | 574 |
574 if (abandoned_) | 575 if (abandoned_) |
575 return; | 576 return; |
576 | 577 |
577 NotifyCaller(result); | 578 NotifyCaller(result); |
578 } | 579 } |
579 | 580 |
580 int Job::ExecuteProxyResolver() { | 581 int Job::ExecuteProxyResolver() { |
| 582 TRACE_EVENT0("net", "Job::ExecuteProxyResolver"); |
581 int result = ERR_UNEXPECTED; // Initialized to silence warnings. | 583 int result = ERR_UNEXPECTED; // Initialized to silence warnings. |
582 | 584 |
583 switch (operation_) { | 585 switch (operation_) { |
584 case CREATE_V8_RESOLVER: { | 586 case CREATE_V8_RESOLVER: { |
585 scoped_ptr<ProxyResolverV8> resolver; | 587 scoped_ptr<ProxyResolverV8> resolver; |
586 result = ProxyResolverV8::Create(script_data_, this, &resolver); | 588 result = ProxyResolverV8::Create(script_data_, this, &resolver); |
587 if (result == OK) | 589 if (result == OK) |
588 *resolver_out_ = std::move(resolver); | 590 *resolver_out_ = std::move(resolver); |
589 break; | 591 break; |
590 } | 592 } |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 | 1237 |
1236 // static | 1238 // static |
1237 scoped_ptr<ProxyResolverV8TracingFactory> | 1239 scoped_ptr<ProxyResolverV8TracingFactory> |
1238 ProxyResolverV8TracingFactory::Create() { | 1240 ProxyResolverV8TracingFactory::Create() { |
1239 return make_scoped_ptr(new ProxyResolverV8TracingFactoryImpl()); | 1241 return make_scoped_ptr(new ProxyResolverV8TracingFactoryImpl()); |
1240 } | 1242 } |
1241 | 1243 |
1242 const char kHistogramPacResultForStrippedUrl[] = "Net.PacResultForStrippedUrl"; | 1244 const char kHistogramPacResultForStrippedUrl[] = "Net.PacResultForStrippedUrl"; |
1243 | 1245 |
1244 } // namespace net | 1246 } // namespace net |
OLD | NEW |