Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 | 932 |
| 933 ProxyResolverV8Tracing::ProxyResolverV8Tracing( | 933 ProxyResolverV8Tracing::ProxyResolverV8Tracing( |
| 934 HostResolver* host_resolver, | 934 HostResolver* host_resolver, |
| 935 ProxyResolverErrorObserver* error_observer, | 935 ProxyResolverErrorObserver* error_observer, |
| 936 NetLog* net_log) | 936 NetLog* net_log) |
| 937 : ProxyResolver(true /*expects_pac_bytes*/), | 937 : ProxyResolver(true /*expects_pac_bytes*/), |
| 938 host_resolver_(host_resolver), | 938 host_resolver_(host_resolver), |
| 939 error_observer_(error_observer), | 939 error_observer_(error_observer), |
| 940 net_log_(net_log), | 940 net_log_(net_log), |
| 941 num_outstanding_callbacks_(0) { | 941 num_outstanding_callbacks_(0) { |
| 942 // TODO(eroman): Remove once crbug.com/454983 is fixed. | |
| 943 tracked_objects::ScopedTracker tracking_profile( | |
| 944 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 945 "454983 ProxyResolverV8Tracing::ProxyResolverV8Tracing")); | |
| 946 | |
| 942 DCHECK(host_resolver); | 947 DCHECK(host_resolver); |
| 943 // Start up the thread. | 948 // Start up the thread. |
| 944 thread_.reset(new base::Thread("Proxy resolver")); | 949 thread_.reset(new base::Thread("Proxy resolver")); |
| 945 base::Thread::Options options; | 950 base::Thread::Options options; |
| 946 options.timer_slack = base::TIMER_SLACK_MAXIMUM; | 951 options.timer_slack = base::TIMER_SLACK_MAXIMUM; |
| 947 CHECK(thread_->StartWithOptions(options)); | 952 CHECK(thread_->StartWithOptions(options)); |
|
eroman
2015/03/06 22:22:43
My working theory is that starting the thread is t
mmenke
2015/03/06 22:56:44
SGTM
| |
| 948 | 953 |
| 949 v8_resolver_.reset(new ProxyResolverV8); | 954 v8_resolver_.reset(new ProxyResolverV8); |
| 950 } | 955 } |
| 951 | 956 |
| 952 ProxyResolverV8Tracing::~ProxyResolverV8Tracing() { | 957 ProxyResolverV8Tracing::~ProxyResolverV8Tracing() { |
| 953 // Note, all requests should have been cancelled. | 958 // Note, all requests should have been cancelled. |
| 954 CHECK(!set_pac_script_job_.get()); | 959 CHECK(!set_pac_script_job_.get()); |
| 955 CHECK_EQ(0, num_outstanding_callbacks_); | 960 CHECK_EQ(0, num_outstanding_callbacks_); |
| 956 | 961 |
| 957 // Join the worker thread. See http://crbug.com/69710. Note that we call | 962 // Join the worker thread. See http://crbug.com/69710. Note that we call |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1007 DCHECK(!set_pac_script_job_.get()); | 1012 DCHECK(!set_pac_script_job_.get()); |
| 1008 CHECK_EQ(0, num_outstanding_callbacks_); | 1013 CHECK_EQ(0, num_outstanding_callbacks_); |
| 1009 | 1014 |
| 1010 set_pac_script_job_ = new Job(this); | 1015 set_pac_script_job_ = new Job(this); |
| 1011 set_pac_script_job_->StartSetPacScript(script_data, callback); | 1016 set_pac_script_job_->StartSetPacScript(script_data, callback); |
| 1012 | 1017 |
| 1013 return ERR_IO_PENDING; | 1018 return ERR_IO_PENDING; |
| 1014 } | 1019 } |
| 1015 | 1020 |
| 1016 } // namespace net | 1021 } // namespace net |
| OLD | NEW |