| 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_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 kMaxVariationChunkSize * kMaxReportedVariationChunks + 1; | 59 kMaxVariationChunkSize * kMaxReportedVariationChunks + 1; |
| 60 char g_variation_chunks[kMaxVariationChunksSize] = ""; | 60 char g_variation_chunks[kMaxVariationChunksSize] = ""; |
| 61 | 61 |
| 62 void SetActiveURL(const GURL& url) { | 62 void SetActiveURL(const GURL& url) { |
| 63 base::strlcpy(g_active_url, url.possibly_invalid_spec().c_str(), | 63 base::strlcpy(g_active_url, url.possibly_invalid_spec().c_str(), |
| 64 arraysize(g_active_url)); | 64 arraysize(g_active_url)); |
| 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, "-", std::string()); |
| 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 = ASCIIToWide(str); |
| 76 GoogleUpdateSettings::SetMetricsId(wstr); | 76 GoogleUpdateSettings::SetMetricsId(wstr); |
| 77 } | 77 } |
| 78 | 78 |
| 79 std::string GetClientId() { | 79 std::string GetClientId() { |
| (...skipping 89 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 |