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

Unified Diff: chrome/browser/ui/webui/cookies_tree_model_util.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/cookies_tree_model_util.cc
diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc
index 72bb7a923666163bcd62ea6f19e8f939c7258374..3a15aca604de235932bd483ce061668b9b130357 100644
--- a/chrome/browser/ui/webui/cookies_tree_model_util.cc
+++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc
@@ -317,17 +317,15 @@ void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent,
const CookieTreeNode* CookiesTreeModelUtil::GetTreeNodeFromPath(
const CookieTreeNode* root,
const std::string& path) {
- std::vector<std::string> node_ids;
- base::SplitString(path, ',', &node_ids);
-
const CookieTreeNode* child = NULL;
const CookieTreeNode* parent = root;
int child_index = -1;
// Validate the tree path and get the node pointer.
- for (size_t i = 0; i < node_ids.size(); ++i) {
+ for (const base::StringPiece& cur_node : base::SplitStringPiece(
+ path, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
int32 node_id = 0;
- if (!base::StringToInt(node_ids[i], &node_id))
+ if (!base::StringToInt(cur_node, &node_id))
break;
child = id_map_.Lookup(node_id);

Powered by Google App Engine
This is Rietveld 408576698