OLD | NEW |
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 #include "chrome/common/child_process_logging.h" | 5 #include "chrome/common/child_process_logging.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 void SetClientId(const std::string& client_id) { | 67 void SetClientId(const std::string& client_id) { |
68 std::string str(client_id); | 68 std::string str(client_id); |
69 ReplaceSubstringsAfterOffset(&str, 0, "-", ""); | 69 ReplaceSubstringsAfterOffset(&str, 0, "-", ""); |
70 | 70 |
71 if (str.empty()) | 71 if (str.empty()) |
72 return; | 72 return; |
73 | 73 |
74 base::strlcpy(g_client_id, str.c_str(), kClientIdSize); | 74 base::strlcpy(g_client_id, str.c_str(), kClientIdSize); |
75 std::wstring wstr = ASCIIToWide(str); | 75 std::wstring wstr = base::ASCIIToWide(str); |
76 GoogleUpdateSettings::SetMetricsId(wstr); | 76 GoogleUpdateSettings::SetMetricsId(wstr); |
77 } | 77 } |
78 | 78 |
79 std::string GetClientId() { | 79 std::string GetClientId() { |
80 return std::string(g_client_id); | 80 return std::string(g_client_id); |
81 } | 81 } |
82 | 82 |
83 void SetActiveExtensions(const std::set<std::string>& extension_ids) { | 83 void SetActiveExtensions(const std::set<std::string>& extension_ids) { |
84 snprintf(g_num_extensions, arraysize(g_num_extensions), "%" PRIuS, | 84 snprintf(g_num_extensions, arraysize(g_num_extensions), "%" PRIuS, |
85 extension_ids.size()); | 85 extension_ids.size()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // simultaneously. | 169 // simultaneously. |
170 snprintf(g_num_variations, arraysize(g_num_variations), "%" PRIuS, | 170 snprintf(g_num_variations, arraysize(g_num_variations), "%" PRIuS, |
171 experiments.size()); | 171 experiments.size()); |
172 } | 172 } |
173 | 173 |
174 void SetChannel(const std::string& channel) { | 174 void SetChannel(const std::string& channel) { |
175 base::strlcpy(g_channel, channel.c_str(), arraysize(g_channel)); | 175 base::strlcpy(g_channel, channel.c_str(), arraysize(g_channel)); |
176 } | 176 } |
177 | 177 |
178 } // namespace child_process_logging | 178 } // namespace child_process_logging |
OLD | NEW |