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

Side by Side Diff: net/proxy/dhcp_proxy_script_fetcher_factory.cc

Issue 6831025: Adds support for the DHCP portion of the WPAD (proxy auto-discovery) protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add timeout on Win32 DHCP API. Created 9 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
6
7 #include "net/base/net_errors.h"
8 #include "net/proxy/dhcp_proxy_script_fetcher.h"
9
10 #if defined(OS_WIN)
11 #include "net/proxy/dhcp_proxy_script_fetcher_win.h"
12 #endif
13
14 namespace net {
15
16 DhcpProxyScriptFetcherFactory* DhcpProxyScriptFetcherFactory::GetInstance() {
17 return Singleton<DhcpProxyScriptFetcherFactory>::get();
18 }
19
20 DhcpProxyScriptFetcher* DhcpProxyScriptFetcherFactory::Create(
21 URLRequestContext* context) const {
22 if (!feature_enabled_) {
23 return new DoNothingDhcpProxyScriptFetcher();
24 } else {
25 DCHECK(IsSupported());
26 DhcpProxyScriptFetcher* ret = NULL;
27 #if defined(OS_WIN)
28 ret = new WindowsDhcpProxyScriptFetcher(context);
29 #endif
30 DCHECK(ret);
31 return ret;
32 }
33 }
34
35 void DhcpProxyScriptFetcherFactory::SetEnabled(bool enabled) {
36 if (IsSupported()) {
37 feature_enabled_ = enabled;
38 }
39 }
40
41 bool DhcpProxyScriptFetcherFactory::IsEnabled() const {
42 return feature_enabled_;
43 }
44
45 bool DhcpProxyScriptFetcherFactory::IsSupported() {
46 #if defined(OS_WIN)
47 return true;
48 #else
49 return false;
50 #endif
51 }
52
53 DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory()
54 : feature_enabled_(false) {
55 }
56
57 DhcpProxyScriptFetcherFactory::~DhcpProxyScriptFetcherFactory() {}
58
59 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698