| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/crash_keys.h" | 5 #include "chrome/common/crash_keys.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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (it == extensions.end()) { | 427 if (it == extensions.end()) { |
| 428 base::debug::ClearCrashKey(key); | 428 base::debug::ClearCrashKey(key); |
| 429 } else { | 429 } else { |
| 430 base::debug::SetCrashKeyValue(key, *it); | 430 base::debug::SetCrashKeyValue(key, *it); |
| 431 ++it; | 431 ++it; |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 | 435 |
| 436 ScopedPrinterInfo::ScopedPrinterInfo(const base::StringPiece& data) { | 436 ScopedPrinterInfo::ScopedPrinterInfo(const base::StringPiece& data) { |
| 437 std::vector<std::string> info; | 437 std::vector<std::string> info = base::SplitString( |
| 438 base::SplitString(data.as_string(), ';', &info); | 438 data.as_string(), ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 439 for (size_t i = 0; i < kPrinterInfoCount; ++i) { | 439 for (size_t i = 0; i < kPrinterInfoCount; ++i) { |
| 440 std::string key = base::StringPrintf(kPrinterInfo, i + 1); | 440 std::string key = base::StringPrintf(kPrinterInfo, i + 1); |
| 441 std::string value; | 441 std::string value; |
| 442 if (i < info.size()) | 442 if (i < info.size()) |
| 443 value = info[i]; | 443 value = info[i]; |
| 444 base::debug::SetCrashKeyValue(key, value); | 444 base::debug::SetCrashKeyValue(key, value); |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 ScopedPrinterInfo::~ScopedPrinterInfo() { | 448 ScopedPrinterInfo::~ScopedPrinterInfo() { |
| 449 for (size_t i = 0; i < kPrinterInfoCount; ++i) { | 449 for (size_t i = 0; i < kPrinterInfoCount; ++i) { |
| 450 std::string key = base::StringPrintf(kPrinterInfo, i + 1); | 450 std::string key = base::StringPrintf(kPrinterInfo, i + 1); |
| 451 base::debug::ClearCrashKey(key); | 451 base::debug::ClearCrashKey(key); |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 | 454 |
| 455 } // namespace crash_keys | 455 } // namespace crash_keys |
| OLD | NEW |