| OLD | NEW |
| 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 "chrome/service/net/service_url_request_context_getter.h" | 5 #include "chrome/service/net/service_url_request_context_getter.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 8 #include <sys/utsname.h> | 8 #include <sys/utsname.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 #endif | 73 #endif |
| 74 ); // NOLINT | 74 ); // NOLINT |
| 75 | 75 |
| 76 return os_cpu; | 76 return os_cpu; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Returns the default user agent. | 79 // Returns the default user agent. |
| 80 std::string MakeUserAgentForServiceProcess() { | 80 std::string MakeUserAgentForServiceProcess() { |
| 81 std::string user_agent; | 81 std::string user_agent; |
| 82 chrome::VersionInfo version_info; | 82 chrome::VersionInfo version_info; |
| 83 if (!version_info.is_valid()) { | |
| 84 DLOG(ERROR) << "Unable to create chrome::VersionInfo object"; | |
| 85 } | |
| 86 std::string extra_version_info; | 83 std::string extra_version_info; |
| 87 if (!version_info.IsOfficialBuild()) | 84 if (!version_info.IsOfficialBuild()) |
| 88 extra_version_info = "-devel"; | 85 extra_version_info = "-devel"; |
| 89 base::StringAppendF(&user_agent, | 86 base::StringAppendF(&user_agent, |
| 90 "Chrome Service %s(%s)%s %s ", | 87 "Chrome Service %s(%s)%s %s ", |
| 91 version_info.Version().c_str(), | 88 version_info.Version().c_str(), |
| 92 version_info.LastChange().c_str(), | 89 version_info.LastChange().c_str(), |
| 93 extra_version_info.c_str(), | 90 extra_version_info.c_str(), |
| 94 BuildOSCpuInfo().c_str()); | 91 BuildOSCpuInfo().c_str()); |
| 95 return user_agent; | 92 return user_agent; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 121 } | 118 } |
| 122 return url_request_context_.get(); | 119 return url_request_context_.get(); |
| 123 } | 120 } |
| 124 | 121 |
| 125 scoped_refptr<base::SingleThreadTaskRunner> | 122 scoped_refptr<base::SingleThreadTaskRunner> |
| 126 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { | 123 ServiceURLRequestContextGetter::GetNetworkTaskRunner() const { |
| 127 return network_task_runner_; | 124 return network_task_runner_; |
| 128 } | 125 } |
| 129 | 126 |
| 130 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 127 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
| OLD | NEW |