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

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

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « net/log/net_log_unittest.cc ('k') | net/proxy/mock_proxy_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" 5 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/proxy/dhcp_proxy_script_fetcher.h" 9 #include "net/proxy/dhcp_proxy_script_fetcher.h"
10 10
11 #if defined(OS_WIN) 11 #if defined(OS_WIN)
12 #include "net/proxy/dhcp_proxy_script_fetcher_win.h" 12 #include "net/proxy/dhcp_proxy_script_fetcher_win.h"
13 #endif 13 #endif
14 14
15 namespace net { 15 namespace net {
16 16
17 DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory() 17 DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory()
18 : feature_enabled_(false) { 18 : feature_enabled_(false) {
19 set_enabled(true); 19 set_enabled(true);
20 } 20 }
21 21
22 std::unique_ptr<DhcpProxyScriptFetcher> DhcpProxyScriptFetcherFactory::Create( 22 std::unique_ptr<DhcpProxyScriptFetcher> DhcpProxyScriptFetcherFactory::Create(
23 URLRequestContext* context) { 23 URLRequestContext* context) {
24 if (!feature_enabled_) { 24 if (!feature_enabled_) {
25 return base::WrapUnique(new DoNothingDhcpProxyScriptFetcher()); 25 return base::MakeUnique<DoNothingDhcpProxyScriptFetcher>();
26 } else { 26 } else {
27 DCHECK(IsSupported()); 27 DCHECK(IsSupported());
28 std::unique_ptr<DhcpProxyScriptFetcher> ret; 28 std::unique_ptr<DhcpProxyScriptFetcher> ret;
29 #if defined(OS_WIN) 29 #if defined(OS_WIN)
30 ret.reset(new DhcpProxyScriptFetcherWin(context)); 30 ret.reset(new DhcpProxyScriptFetcherWin(context));
31 #endif 31 #endif
32 DCHECK(ret); 32 DCHECK(ret);
33 return ret; 33 return ret;
34 } 34 }
35 } 35 }
(...skipping 11 matching lines...) Expand all
47 // static 47 // static
48 bool DhcpProxyScriptFetcherFactory::IsSupported() { 48 bool DhcpProxyScriptFetcherFactory::IsSupported() {
49 #if defined(OS_WIN) 49 #if defined(OS_WIN)
50 return true; 50 return true;
51 #else 51 #else
52 return false; 52 return false;
53 #endif 53 #endif
54 } 54 }
55 55
56 } // namespace net 56 } // namespace net
OLDNEW
« no previous file with comments | « net/log/net_log_unittest.cc ('k') | net/proxy/mock_proxy_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698