Index: chrome/browser/devtools/device/adb/adb_device_provider.cc |
diff --git a/chrome/browser/devtools/device/adb/adb_device_provider.cc b/chrome/browser/devtools/device/adb/adb_device_provider.cc |
index 9f5b33a916da3f6f050293f4721f05f7a87d0898..fda0496597c7bb75cc4e7e3814f1a38de91819f4 100644 |
--- a/chrome/browser/devtools/device/adb/adb_device_provider.cc |
+++ b/chrome/browser/devtools/device/adb/adb_device_provider.cc |
@@ -4,7 +4,7 @@ |
#include "chrome/browser/devtools/device/adb/adb_device_provider.h" |
-#include "base/strings/string_util.h" |
+#include "base/strings/string_split.h" |
#include "base/strings/stringprintf.h" |
#include "chrome/browser/devtools/device/adb/adb_client_socket.h" |
@@ -33,12 +33,13 @@ static void ReceivedAdbDevices( |
callback.Run(result); |
return; |
} |
- std::vector<std::string> serials; |
- Tokenize(response, "\n", &serials); |
- for (size_t i = 0; i < serials.size(); ++i) { |
- std::vector<std::string> tokens; |
- Tokenize(serials[i], "\t ", &tokens); |
- result.push_back(tokens[0]); |
+ for (const base::StringPiece& line : |
+ base::SplitStringPiece(response, "\n", base::KEEP_WHITESPACE, |
+ base::SPLIT_WANT_NONEMPTY)) { |
+ std::vector<base::StringPiece> tokens = |
+ base::SplitStringPiece(line, "\t ", base::KEEP_WHITESPACE, |
+ base::SPLIT_WANT_NONEMPTY); |
+ result.push_back(tokens[0].as_string()); |
} |
callback.Run(result); |
} |