Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: chrome/common/crash_keys.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/extensions/command.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/extensions/command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698