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

Unified Diff: components/autofill/content/renderer/autofill_agent.cc

Issue 2695883003: Change uses of base::JoinString to pass StringPieces where possible. (Closed)
Patch Set: Remove dependency CL. Created 3 years, 9 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
« no previous file with comments | « chromeos/network/onc/onc_validator.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index a0e275a98b78d2ec95e7177d25233c59cd00bb6b..70d0b1fdd97ae526683ff2e198848c960abf0e0c 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -15,6 +15,7 @@
#include "base/location.h"
#include "base/metrics/field_trial.h"
#include "base/single_thread_task_runner.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -434,13 +435,13 @@ void AutofillAgent::DoAcceptDataListSuggestion(
// If this element takes multiple values then replace the last part with
// the suggestion.
if (input_element->isMultiple() && input_element->isEmailField()) {
- std::vector<base::string16> parts = base::SplitString(
+ std::vector<base::StringPiece16> parts = base::SplitStringPiece(
input_element->editingValue().utf16(), base::ASCIIToUTF16(","),
base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
if (parts.size() == 0)
- parts.push_back(base::string16());
+ parts.push_back(base::StringPiece16());
- base::string16 last_part = parts.back();
+ base::string16 last_part = parts.back().as_string();
// We want to keep just the leading whitespace.
for (size_t i = 0; i < last_part.size(); ++i) {
if (!base::IsUnicodeWhitespace(last_part[i])) {
« no previous file with comments | « chromeos/network/onc/onc_validator.cc ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698