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

Unified Diff: chrome/browser/chromeos/file_manager/file_tasks.cc

Issue 1197243004: Replace some Tokenize calls with SplitString. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android Created 5 years, 6 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: chrome/browser/chromeos/file_manager/file_tasks.cc
diff --git a/chrome/browser/chromeos/file_manager/file_tasks.cc b/chrome/browser/chromeos/file_manager/file_tasks.cc
index b70c7b7d0c0d5c066db4977af9e81cbe960769c5..4f07a6ad02f0f70a7c85e5b1ef15da58b10c0276 100644
--- a/chrome/browser/chromeos/file_manager/file_tasks.cc
+++ b/chrome/browser/chromeos/file_manager/file_tasks.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
+#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/file_task_executor.h"
@@ -221,13 +222,13 @@ std::string TaskDescriptorToId(const TaskDescriptor& task_descriptor) {
bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) {
DCHECK(task);
- std::vector<std::string> result;
- int count = Tokenize(task_id, std::string("|"), &result);
+ std::vector<std::string> result = base::SplitString(
+ task_id, "|", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
// Parse a legacy task ID that only contain two parts. Drive tasks are
// identified by a prefix "drive-app:" on the extension ID. The legacy task
// IDs can be stored in preferences.
- if (count == 2) {
+ if (result.size() == 2) {
if (base::StartsWithASCII(result[0], kDriveTaskExtensionPrefix, true)) {
task->task_type = TASK_TYPE_DRIVE_APP;
task->app_id = result[0].substr(kDriveTaskExtensionPrefixLength);
@@ -241,7 +242,7 @@ bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) {
return true;
}
- if (count != 3)
+ if (result.size() != 3)
return false;
TaskType task_type = StringToTaskType(result[1]);
« no previous file with comments | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | chrome/browser/chromeos/input_method/input_method_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698