| 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 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Constructs a ProxyResolver that will issue DNS requests through | 35 // Constructs a ProxyResolver that will issue DNS requests through |
| 36 // |host_resolver|, forward Javascript errors through |error_observer|, and | 36 // |host_resolver|, forward Javascript errors through |error_observer|, and |
| 37 // log Javascript errors and alerts to |net_log|. | 37 // log Javascript errors and alerts to |net_log|. |
| 38 // | 38 // |
| 39 // Note that the constructor takes ownership of |error_observer|, whereas | 39 // Note that the constructor takes ownership of |error_observer|, whereas |
| 40 // |host_resolver| and |net_log| are expected to outlive |this|. | 40 // |host_resolver| and |net_log| are expected to outlive |this|. |
| 41 ProxyResolverV8Tracing(HostResolver* host_resolver, | 41 ProxyResolverV8Tracing(HostResolver* host_resolver, |
| 42 ProxyResolverErrorObserver* error_observer, | 42 ProxyResolverErrorObserver* error_observer, |
| 43 NetLog* net_log); | 43 NetLog* net_log); |
| 44 | 44 |
| 45 virtual ~ProxyResolverV8Tracing(); | 45 ~ProxyResolverV8Tracing() override; |
| 46 | 46 |
| 47 // ProxyResolver implementation: | 47 // ProxyResolver implementation: |
| 48 virtual int GetProxyForURL(const GURL& url, | 48 int GetProxyForURL(const GURL& url, |
| 49 ProxyInfo* results, | 49 ProxyInfo* results, |
| 50 const CompletionCallback& callback, | 50 const CompletionCallback& callback, |
| 51 RequestHandle* request, | 51 RequestHandle* request, |
| 52 const BoundNetLog& net_log) override; | 52 const BoundNetLog& net_log) override; |
| 53 virtual void CancelRequest(RequestHandle request) override; | 53 void CancelRequest(RequestHandle request) override; |
| 54 virtual LoadState GetLoadState(RequestHandle request) const override; | 54 LoadState GetLoadState(RequestHandle request) const override; |
| 55 virtual void CancelSetPacScript() override; | 55 void CancelSetPacScript() override; |
| 56 virtual int SetPacScript( | 56 int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 57 const scoped_refptr<ProxyResolverScriptData>& script_data, | 57 const CompletionCallback& callback) override; |
| 58 const CompletionCallback& callback) override; | |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 class Job; | 60 class Job; |
| 62 | 61 |
| 63 // The worker thread on which the ProxyResolverV8 will be run. | 62 // The worker thread on which the ProxyResolverV8 will be run. |
| 64 scoped_ptr<base::Thread> thread_; | 63 scoped_ptr<base::Thread> thread_; |
| 65 scoped_ptr<ProxyResolverV8> v8_resolver_; | 64 scoped_ptr<ProxyResolverV8> v8_resolver_; |
| 66 | 65 |
| 67 // Non-owned host resolver, which is to be operated on the origin thread. | 66 // Non-owned host resolver, which is to be operated on the origin thread. |
| 68 HostResolver* host_resolver_; | 67 HostResolver* host_resolver_; |
| 69 | 68 |
| 70 scoped_ptr<ProxyResolverErrorObserver> error_observer_; | 69 scoped_ptr<ProxyResolverErrorObserver> error_observer_; |
| 71 NetLog* net_log_; | 70 NetLog* net_log_; |
| 72 | 71 |
| 73 // The outstanding SetPacScript operation, or NULL. | 72 // The outstanding SetPacScript operation, or NULL. |
| 74 scoped_refptr<Job> set_pac_script_job_; | 73 scoped_refptr<Job> set_pac_script_job_; |
| 75 | 74 |
| 76 // The number of outstanding (non-cancelled) jobs. | 75 // The number of outstanding (non-cancelled) jobs. |
| 77 int num_outstanding_callbacks_; | 76 int num_outstanding_callbacks_; |
| 78 | 77 |
| 79 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Tracing); | 78 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Tracing); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 } // namespace net | 81 } // namespace net |
| 83 | 82 |
| 84 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ | 83 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ |
| OLD | NEW |