OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "chrome/service/net/service_url_request_context.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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 cputype.c_str() // e.g. i686 | 78 cputype.c_str() // e.g. i686 |
79 #endif | 79 #endif |
80 ); // NOLINT | 80 ); // NOLINT |
81 | 81 |
82 return os_cpu; | 82 return os_cpu; |
83 } | 83 } |
84 | 84 |
85 std::string MakeUserAgentForServiceProcess() { | 85 std::string MakeUserAgentForServiceProcess() { |
86 std::string user_agent; | 86 std::string user_agent; |
87 chrome::VersionInfo version_info; | 87 chrome::VersionInfo version_info; |
88 if (!version_info.is_valid()) { | |
89 DLOG(ERROR) << "Unable to create chrome::VersionInfo object"; | |
90 } | |
91 std::string extra_version_info; | 88 std::string extra_version_info; |
92 if (!version_info.IsOfficialBuild()) | 89 if (!version_info.IsOfficialBuild()) |
93 extra_version_info = "-devel"; | 90 extra_version_info = "-devel"; |
94 base::StringAppendF(&user_agent, | 91 base::StringAppendF(&user_agent, |
95 "Chrome Service %s(%s)%s %s ", | 92 "Chrome Service %s(%s)%s %s ", |
96 version_info.Version().c_str(), | 93 version_info.Version().c_str(), |
97 version_info.LastChange().c_str(), | 94 version_info.LastChange().c_str(), |
98 extra_version_info.c_str(), | 95 extra_version_info.c_str(), |
99 BuildOSCpuInfo().c_str()); | 96 BuildOSCpuInfo().c_str()); |
100 return user_agent; | 97 return user_agent; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 url_request_context_ = new ServiceURLRequestContext(user_agent_); | 164 url_request_context_ = new ServiceURLRequestContext(user_agent_); |
168 return url_request_context_; | 165 return url_request_context_; |
169 } | 166 } |
170 | 167 |
171 scoped_refptr<base::MessageLoopProxy> | 168 scoped_refptr<base::MessageLoopProxy> |
172 ServiceURLRequestContextGetter::GetIOMessageLoopProxy() const { | 169 ServiceURLRequestContextGetter::GetIOMessageLoopProxy() const { |
173 return io_message_loop_proxy_; | 170 return io_message_loop_proxy_; |
174 } | 171 } |
175 | 172 |
176 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} | 173 ServiceURLRequestContextGetter::~ServiceURLRequestContextGetter() {} |
OLD | NEW |