Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: net/proxy/proxy_resolver_v8_tracing.h

Issue 939503004: Add LoadState reporting to the mojo proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-resolver-mojo
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Constructs a ProxyResolver that will issue DNS requests through
46 // |host_resolver|, forward Javascript errors through |error_observer|, and
47 // log Javascript errors and alerts to |net_log|. When the LoadState for a
48 // request changes, |on_load_state_changed| will be invoked with the
49 // RequestHandle for that request with the new LoadState.
50 //
51 // Note that the constructor takes ownership of |error_observer|, whereas
52 // |host_resolver| and |net_log| are expected to outlive |this|.
53 ProxyResolverV8Tracing(
54 HostResolver* host_resolver,
55 ProxyResolverErrorObserver* error_observer,
56 NetLog* net_log,
57 const LoadStateChangedCallback<RequestHandle>& on_load_state_changed);
58
45 ~ProxyResolverV8Tracing() override; 59 ~ProxyResolverV8Tracing() override;
46 60
47 // ProxyResolver implementation: 61 // ProxyResolver implementation:
48 int GetProxyForURL(const GURL& url, 62 int GetProxyForURL(const GURL& url,
49 ProxyInfo* results, 63 ProxyInfo* results,
50 const CompletionCallback& callback, 64 const CompletionCallback& callback,
51 RequestHandle* request, 65 RequestHandle* request,
52 const BoundNetLog& net_log) override; 66 const BoundNetLog& net_log) override;
53 void CancelRequest(RequestHandle request) override; 67 void CancelRequest(RequestHandle request) override;
54 LoadState GetLoadState(RequestHandle request) const override; 68 LoadState GetLoadState(RequestHandle request) const override;
(...skipping 13 matching lines...) Expand all
68 82
69 scoped_ptr<ProxyResolverErrorObserver> error_observer_; 83 scoped_ptr<ProxyResolverErrorObserver> error_observer_;
70 NetLog* net_log_; 84 NetLog* net_log_;
71 85
72 // The outstanding SetPacScript operation, or NULL. 86 // The outstanding SetPacScript operation, or NULL.
73 scoped_refptr<Job> set_pac_script_job_; 87 scoped_refptr<Job> set_pac_script_job_;
74 88
75 // The number of outstanding (non-cancelled) jobs. 89 // The number of outstanding (non-cancelled) jobs.
76 int num_outstanding_callbacks_; 90 int num_outstanding_callbacks_;
77 91
92 // Invoked when the load state for a request changes.
93 const LoadStateChangedCallback<RequestHandle> on_load_state_changed_;
94
78 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Tracing); 95 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8Tracing);
79 }; 96 };
80 97
81 } // namespace net 98 } // namespace net
82 99
83 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ 100 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698