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

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_auth_request_handler.cc

Issue 762723003: Prefix CommandLine usage with base namespace (Part 8: components) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 30 matching lines...) Expand all
41 switch (client) { 41 switch (client) {
42 CLIENT_ENUMS_LIST 42 CLIENT_ENUMS_LIST
43 } 43 }
44 NOTREACHED(); 44 NOTREACHED();
45 return ""; 45 return "";
46 } 46 }
47 #undef CLIENT_ENUM 47 #undef CLIENT_ENUM
48 48
49 // static 49 // static
50 bool DataReductionProxyAuthRequestHandler::IsKeySetOnCommandLine() { 50 bool DataReductionProxyAuthRequestHandler::IsKeySetOnCommandLine() {
51 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 51 const base::CommandLine& command_line =
52 *base::CommandLine::ForCurrentProcess();
52 return command_line.HasSwitch( 53 return command_line.HasSwitch(
53 data_reduction_proxy::switches::kDataReductionProxyKey); 54 data_reduction_proxy::switches::kDataReductionProxyKey);
54 } 55 }
55 56
56 DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler( 57 DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler(
57 Client client, 58 Client client,
58 DataReductionProxyParams* params, 59 DataReductionProxyParams* params,
59 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) 60 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
60 : client_(GetString(client)), 61 : client_(GetString(client)),
61 data_reduction_proxy_params_(params), 62 data_reduction_proxy_params_(params),
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 208
208 if (key.empty()) 209 if (key.empty())
209 return; 210 return;
210 211
211 key_ = key; 212 key_ = key;
212 last_update_time_ = Now(); 213 last_update_time_ = Now();
213 ComputeCredentials(last_update_time_, &session_, &credentials_); 214 ComputeCredentials(last_update_time_, &session_, &credentials_);
214 } 215 }
215 216
216 std::string DataReductionProxyAuthRequestHandler::GetDefaultKey() const { 217 std::string DataReductionProxyAuthRequestHandler::GetDefaultKey() const {
217 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 218 const base::CommandLine& command_line =
219 *base::CommandLine::ForCurrentProcess();
218 std::string key = 220 std::string key =
219 command_line.GetSwitchValueASCII(switches::kDataReductionProxyKey); 221 command_line.GetSwitchValueASCII(switches::kDataReductionProxyKey);
220 // Android and iOS get the default key from a preprocessor constant. All other 222 // Android and iOS get the default key from a preprocessor constant. All other
221 // platforms get the key from google_apis 223 // platforms get the key from google_apis
222 #if defined(OS_ANDROID) || defined(OS_IOS) 224 #if defined(OS_ANDROID) || defined(OS_IOS)
223 #if defined(SPDY_PROXY_AUTH_VALUE) 225 #if defined(SPDY_PROXY_AUTH_VALUE)
224 if (key.empty()) 226 if (key.empty())
225 key = SPDY_PROXY_AUTH_VALUE; 227 key = SPDY_PROXY_AUTH_VALUE;
226 #endif 228 #endif
227 #else 229 #else
(...skipping 13 matching lines...) Expand all
241 if (data_reduction_proxy_params_ && 243 if (data_reduction_proxy_params_ &&
242 data_reduction_proxy_params_->IsDataReductionProxy(proxy_server, NULL) && 244 data_reduction_proxy_params_->IsDataReductionProxy(proxy_server, NULL) &&
243 net::HostPortPair::FromURL( 245 net::HostPortPair::FromURL(
244 data_reduction_proxy_params_->ssl_origin()).Equals( 246 data_reduction_proxy_params_->ssl_origin()).Equals(
245 proxy_server) == expect_ssl) { 247 proxy_server) == expect_ssl) {
246 AddAuthorizationHeader(request_headers); 248 AddAuthorizationHeader(request_headers);
247 } 249 }
248 } 250 }
249 251
250 } // namespace data_reduction_proxy 252 } // namespace data_reduction_proxy
OLDNEW
« no previous file with comments | « components/crash/tools/crash_service.cc ('k') | components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698