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

Side by Side Diff: net/url_request/url_request_context_builder.h

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/url_request/url_request.cc ('k') | net/url_request/url_request_context_builder.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This class is useful for building a simple URLRequestContext. Most creators 5 // This class is useful for building a simple URLRequestContext. Most creators
6 // of new URLRequestContexts should use this helper class to construct it. Call 6 // of new URLRequestContexts should use this helper class to construct it. Call
7 // any configuration params, and when done, invoke Build() to construct the 7 // any configuration params, and when done, invoke Build() to construct the
8 // URLRequestContext. This URLRequestContext will own all its own storage. 8 // URLRequestContext. This URLRequestContext will own all its own storage.
9 // 9 //
10 // URLRequestContextBuilder and its associated params classes are initially 10 // URLRequestContextBuilder and its associated params classes are initially
11 // populated with "sane" default values. Read through the comments to figure out 11 // populated with "sane" default values. Read through the comments to figure out
12 // what these are. 12 // what these are.
13 13
14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ 14 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ 15 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
16 16
17 #include <stdint.h> 17 #include <stdint.h>
18
19 #include <string> 18 #include <string>
19 #include <utility>
20 20
21 #include "base/files/file_path.h" 21 #include "base/files/file_path.h"
22 #include "base/macros.h" 22 #include "base/macros.h"
23 #include "base/memory/ref_counted.h" 23 #include "base/memory/ref_counted.h"
24 #include "base/memory/scoped_ptr.h" 24 #include "base/memory/scoped_ptr.h"
25 #include "build/build_config.h" 25 #include "build/build_config.h"
26 #include "net/base/net_export.h" 26 #include "net/base/net_export.h"
27 #include "net/base/network_delegate.h" 27 #include "net/base/network_delegate.h"
28 #include "net/dns/host_resolver.h" 28 #include "net/dns/host_resolver.h"
29 #include "net/http/http_network_session.h" 29 #include "net/http/http_network_session.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // should be used to ensure that a context and its associated 103 // should be used to ensure that a context and its associated
104 // HttpNetworkSession are consistent. 104 // HttpNetworkSession are consistent.
105 static void SetHttpNetworkSessionComponents( 105 static void SetHttpNetworkSessionComponents(
106 const URLRequestContext* context, 106 const URLRequestContext* context,
107 HttpNetworkSession::Params* params); 107 HttpNetworkSession::Params* params);
108 108
109 // These functions are mutually exclusive. The ProxyConfigService, if 109 // These functions are mutually exclusive. The ProxyConfigService, if
110 // set, will be used to construct a ProxyService. 110 // set, will be used to construct a ProxyService.
111 void set_proxy_config_service( 111 void set_proxy_config_service(
112 scoped_ptr<ProxyConfigService> proxy_config_service) { 112 scoped_ptr<ProxyConfigService> proxy_config_service) {
113 proxy_config_service_ = proxy_config_service.Pass(); 113 proxy_config_service_ = std::move(proxy_config_service);
114 } 114 }
115 void set_proxy_service(scoped_ptr<ProxyService> proxy_service) { 115 void set_proxy_service(scoped_ptr<ProxyService> proxy_service) {
116 proxy_service_ = proxy_service.Pass(); 116 proxy_service_ = std::move(proxy_service);
117 } 117 }
118 118
119 // Call these functions to specify hard-coded Accept-Language 119 // Call these functions to specify hard-coded Accept-Language
120 // or User-Agent header values for all requests that don't 120 // or User-Agent header values for all requests that don't
121 // have the headers already set. 121 // have the headers already set.
122 void set_accept_language(const std::string& accept_language) { 122 void set_accept_language(const std::string& accept_language) {
123 accept_language_ = accept_language; 123 accept_language_ = accept_language;
124 } 124 }
125 void set_user_agent(const std::string& user_agent) { 125 void set_user_agent(const std::string& user_agent) {
126 user_agent_ = user_agent; 126 user_agent_ = user_agent;
(...skipping 19 matching lines...) Expand all
146 #endif 146 #endif
147 147
148 // Unlike the other setters, the builder does not take ownership of the 148 // Unlike the other setters, the builder does not take ownership of the
149 // NetLog. 149 // NetLog.
150 // TODO(mmenke): Probably makes sense to get rid of this, and have consumers 150 // TODO(mmenke): Probably makes sense to get rid of this, and have consumers
151 // set their own NetLog::Observers instead. 151 // set their own NetLog::Observers instead.
152 void set_net_log(NetLog* net_log) { net_log_ = net_log; } 152 void set_net_log(NetLog* net_log) { net_log_ = net_log; }
153 153
154 // By default host_resolver is constructed with CreateDefaultResolver. 154 // By default host_resolver is constructed with CreateDefaultResolver.
155 void set_host_resolver(scoped_ptr<HostResolver> host_resolver) { 155 void set_host_resolver(scoped_ptr<HostResolver> host_resolver) {
156 host_resolver_ = host_resolver.Pass(); 156 host_resolver_ = std::move(host_resolver);
157 } 157 }
158 158
159 // Uses BasicNetworkDelegate by default. Note that calling Build will unset 159 // Uses BasicNetworkDelegate by default. Note that calling Build will unset
160 // any custom delegate in builder, so this must be called each time before 160 // any custom delegate in builder, so this must be called each time before
161 // Build is called. 161 // Build is called.
162 void set_network_delegate(scoped_ptr<NetworkDelegate> delegate) { 162 void set_network_delegate(scoped_ptr<NetworkDelegate> delegate) {
163 network_delegate_ = delegate.Pass(); 163 network_delegate_ = std::move(delegate);
164 } 164 }
165 165
166 // Sets a specific HttpAuthHandlerFactory to be used by the URLRequestContext 166 // Sets a specific HttpAuthHandlerFactory to be used by the URLRequestContext
167 // rather than the default |HttpAuthHandlerRegistryFactory|. The builder 167 // rather than the default |HttpAuthHandlerRegistryFactory|. The builder
168 // takes ownership of the factory and will eventually transfer it to the new 168 // takes ownership of the factory and will eventually transfer it to the new
169 // URLRequestContext. Note that since Build will transfer ownership, the 169 // URLRequestContext. Note that since Build will transfer ownership, the
170 // custom factory will be unset and this must be called before the next Build 170 // custom factory will be unset and this must be called before the next Build
171 // to set another custom one. 171 // to set another custom one.
172 void SetHttpAuthHandlerFactory(scoped_ptr<HttpAuthHandlerFactory> factory); 172 void SetHttpAuthHandlerFactory(scoped_ptr<HttpAuthHandlerFactory> factory);
173 173
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 scoped_ptr<CertVerifier> cert_verifier_; 300 scoped_ptr<CertVerifier> cert_verifier_;
301 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors_; 301 std::vector<scoped_ptr<URLRequestInterceptor>> url_request_interceptors_;
302 scoped_ptr<HttpServerProperties> http_server_properties_; 302 scoped_ptr<HttpServerProperties> http_server_properties_;
303 303
304 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder); 304 DISALLOW_COPY_AND_ASSIGN(URLRequestContextBuilder);
305 }; 305 };
306 306
307 } // namespace net 307 } // namespace net
308 308
309 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_ 309 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_BUILDER_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698