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

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: Responding to review comments. Created 9 years, 7 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 bool DhcpProxyScriptFetcherFactory::feature_enabled_ = false;
17
18 // static
19 DhcpProxyScriptFetcher* DhcpProxyScriptFetcherFactory::Create(
20 URLRequestContext* context) {
21 if (!feature_enabled_) {
22 return new DoNothingDhcpProxyScriptFetcher();
23 } else {
24 DCHECK(IsSupported());
25 DhcpProxyScriptFetcher* ret = NULL;
26 #if defined(OS_WIN)
27 ret = new WindowsDhcpProxyScriptFetcher(context);
28 #endif
29 DCHECK(ret);
30 return ret;
31 }
32 }
33
34 // static
35 void DhcpProxyScriptFetcherFactory::SetEnabled(bool enabled) {
36 if (IsSupported()) {
37 feature_enabled_ = enabled;
38 }
39 }
40
41 // static
42 bool DhcpProxyScriptFetcherFactory::IsEnabled() {
43 return feature_enabled_;
44 }
45
46 // static
47 bool DhcpProxyScriptFetcherFactory::IsSupported() {
48 #if defined(OS_WIN)
49 return true;
50 #else
51 return false;
52 #endif
53 }
54
55 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698