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

Unified Diff: components/storage_monitor/media_transfer_protocol_device_observer_linux.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes 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 side-by-side diff with in-line comments
Download patch
Index: components/storage_monitor/media_transfer_protocol_device_observer_linux.cc
diff --git a/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc b/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc
index e44fe0919e3eb837e4e63800fc631abe7748f6ff..7d093d97e9650a3607e061f0e048d95ab6bc9c75 100644
--- a/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc
+++ b/components/storage_monitor/media_transfer_protocol_device_observer_linux.cc
@@ -36,9 +36,9 @@ std::string GetDeviceLocationFromStorageName(const std::string& storage_name) {
// E.g. If the |storage_name| is "usb:2,2:65537", the storage identifier is
// "65537".
std::string GetStorageIdFromStorageName(const std::string& storage_name) {
- std::vector<std::string> name_parts;
- base::SplitString(storage_name, ':', &name_parts);
- return name_parts.size() == 3 ? name_parts[2] : std::string();
+ std::vector<base::StringPiece> name_parts = base::SplitStringPiece(
+ storage_name, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ return name_parts.size() == 3 ? name_parts[2].as_string() : std::string();
}
// Returns a unique device id from the given |storage_info|.

Powered by Google App Engine
This is Rietveld 408576698