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

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

Issue 7019015: Revert 85646 - 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: 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 DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory() {
17 // TODO(joi): Change this default, and the comment on |set_enabled()|,
18 // when the time is right.
19 set_enabled(false);
20 }
21
22 DhcpProxyScriptFetcher* DhcpProxyScriptFetcherFactory::Create(
23 URLRequestContext* context) {
24 if (!feature_enabled_) {
25 return new DoNothingDhcpProxyScriptFetcher();
26 } else {
27 DCHECK(IsSupported());
28 DhcpProxyScriptFetcher* ret = NULL;
29 #if defined(OS_WIN)
30 ret = new DhcpProxyScriptFetcherWin(context);
31 #endif
32 DCHECK(ret);
33 return ret;
34 }
35 }
36
37 void DhcpProxyScriptFetcherFactory::set_enabled(bool enabled) {
38 if (IsSupported()) {
39 feature_enabled_ = enabled;
40 }
41 }
42
43 bool DhcpProxyScriptFetcherFactory::enabled() const {
44 return feature_enabled_;
45 }
46
47 // static
48 bool DhcpProxyScriptFetcherFactory::IsSupported() {
49 #if defined(OS_WIN)
50 return true;
51 #else
52 return false;
53 #endif
54 }
55
56 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher_factory.h ('k') | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698