OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_NETWORK_DELEGATE_ERROR_OBSERVER_H_ | 5 #ifndef NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_ |
6 #define NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_ | 6 #define NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 #include "net/proxy/proxy_resolver_error_observer.h" | 11 #include "net/proxy/proxy_resolver_error_observer.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
14 } | 15 } |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 class NetworkDelegate; | 19 class NetworkDelegate; |
19 | 20 |
20 // An implementation of ProxyResolverErrorObserver that forwards PAC script | 21 // An implementation of ProxyResolverErrorObserver that forwards PAC script |
21 // errors to a NetworkDelegate object on the thread it lives on. | 22 // errors to a NetworkDelegate object on the thread it lives on. |
22 class NET_EXPORT_PRIVATE NetworkDelegateErrorObserver | 23 class NET_EXPORT_PRIVATE NetworkDelegateErrorObserver |
23 : public ProxyResolverErrorObserver { | 24 : public ProxyResolverErrorObserver { |
24 public: | 25 public: |
25 NetworkDelegateErrorObserver(NetworkDelegate* network_delegate, | 26 NetworkDelegateErrorObserver(NetworkDelegate* network_delegate, |
26 base::SingleThreadTaskRunner* origin_runner); | 27 base::SingleThreadTaskRunner* origin_runner); |
27 ~NetworkDelegateErrorObserver() override; | 28 ~NetworkDelegateErrorObserver() override; |
28 | 29 |
| 30 static scoped_ptr<ProxyResolverErrorObserver> Create( |
| 31 NetworkDelegate* network_delegate, |
| 32 const scoped_refptr<base::SingleThreadTaskRunner>& origin_runner); |
| 33 |
29 // ProxyResolverErrorObserver implementation. | 34 // ProxyResolverErrorObserver implementation. |
30 void OnPACScriptError(int line_number, const base::string16& error) override; | 35 void OnPACScriptError(int line_number, const base::string16& error) override; |
31 | 36 |
32 private: | 37 private: |
33 class Core; | 38 class Core; |
34 | 39 |
35 scoped_refptr<Core> core_; | 40 scoped_refptr<Core> core_; |
36 | 41 |
37 DISALLOW_COPY_AND_ASSIGN(NetworkDelegateErrorObserver); | 42 DISALLOW_COPY_AND_ASSIGN(NetworkDelegateErrorObserver); |
38 }; | 43 }; |
39 | 44 |
40 } // namespace net | 45 } // namespace net |
41 | 46 |
42 #endif // NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_ | 47 #endif // NET_PROXY_NETWORK_DELEGATE_ERROR_OBSERVER_H_ |
OLD | NEW |