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_DHCP_SCRIPT_FETCHER_FACTORY_H_ | 5 #ifndef NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_ |
6 #define NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_ | 6 #define NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
12 #include "net/base/net_api.h" | |
12 #include "net/url_request/url_request_context.h" | 13 #include "net/url_request/url_request_context.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 | 16 |
16 class DhcpProxyScriptFetcher; | 17 class DhcpProxyScriptFetcher; |
17 | 18 |
18 // Factory object for creating the appropriate concrete base class of | 19 // Factory object for creating the appropriate concrete base class of |
19 // DhcpProxyScriptFetcher for your operating system and settings. | 20 // DhcpProxyScriptFetcher for your operating system and settings. |
20 // | 21 // |
21 // You might think we could just implement a DHCP client at the protocol | 22 // You might think we could just implement a DHCP client at the protocol |
22 // level and have cross-platform support for retrieving PAC configuration | 23 // level and have cross-platform support for retrieving PAC configuration |
23 // from DHCP, but unfortunately the DHCP protocol assumes there is a single | 24 // from DHCP, but unfortunately the DHCP protocol assumes there is a single |
24 // client per machine (specifically per network interface card), and there | 25 // client per machine (specifically per network interface card), and there |
25 // is an implicit state machine between the client and server, so adding a | 26 // is an implicit state machine between the client and server, so adding a |
26 // second client to the machine would not be advisable (see e.g. some | 27 // second client to the machine would not be advisable (see e.g. some |
27 // discussion of what can happen at this URL: | 28 // discussion of what can happen at this URL: |
28 // http://www.net.princeton.edu/multi-dhcp-one-interface-handling.html). | 29 // http://www.net.princeton.edu/multi-dhcp-one-interface-handling.html). |
29 // | 30 // |
30 // Therefore, we have platform-specific implementations, and so we use | 31 // Therefore, we have platform-specific implementations, and so we use |
31 // this factory to select the right one. | 32 // this factory to select the right one. |
32 class DhcpProxyScriptFetcherFactory { | 33 class NET_API DhcpProxyScriptFetcherFactory { |
wtc
2011/05/20 22:21:19
I am surprised that DhcpProxyScriptFetcherFactory
rvargas (doing something else)
2011/05/20 22:54:55
chrome/browser/net/connection_tester.cc and chrome
| |
33 public: | 34 public: |
34 // Creates a new factory object with default settings. | 35 // Creates a new factory object with default settings. |
35 DhcpProxyScriptFetcherFactory(); | 36 DhcpProxyScriptFetcherFactory(); |
36 | 37 |
37 // Ownership is transferred to the caller. url_request_context must be valid | 38 // Ownership is transferred to the caller. url_request_context must be valid |
38 // and its lifetime must exceed that of the returned DhcpProxyScriptFetcher. | 39 // and its lifetime must exceed that of the returned DhcpProxyScriptFetcher. |
39 // | 40 // |
40 // Note that while a request is in progress, the fetcher may be holding a | 41 // Note that while a request is in progress, the fetcher may be holding a |
41 // reference to |url_request_context|. Be careful not to create cycles | 42 // reference to |url_request_context|. Be careful not to create cycles |
42 // between the fetcher and the context; you can break such cycles by calling | 43 // between the fetcher and the context; you can break such cycles by calling |
(...skipping 16 matching lines...) Expand all Loading... | |
59 | 60 |
60 protected: | 61 protected: |
61 bool feature_enabled_; | 62 bool feature_enabled_; |
62 | 63 |
63 DISALLOW_COPY_AND_ASSIGN(DhcpProxyScriptFetcherFactory); | 64 DISALLOW_COPY_AND_ASSIGN(DhcpProxyScriptFetcherFactory); |
64 }; | 65 }; |
65 | 66 |
66 } // namespace net | 67 } // namespace net |
67 | 68 |
68 #endif // NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_ | 69 #endif // NET_PROXY_DHCP_SCRIPT_FETCHER_FACTORY_H_ |
OLD | NEW |