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

Unified Diff: google_apis/gaia/fake_gaia.cc

Issue 1274123003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no media changes Created 5 years, 4 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 | « google_apis/drive/test_util.cc ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/fake_gaia.cc
diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc
index 6749393faa85d08bf7d20421cc1446c1dd285f8a..d24158c40ae4984e3ed2bfb7d50a06bc875f91fd 100644
--- a/google_apis/gaia/fake_gaia.cc
+++ b/google_apis/gaia/fake_gaia.cc
@@ -71,17 +71,13 @@ typedef std::map<std::string, std::string> CookieMap;
// Parses cookie name-value map our of |request|.
CookieMap GetRequestCookies(const HttpRequest& request) {
CookieMap result;
- std::map<std::string, std::string>::const_iterator iter =
- request.headers.find("Cookie");
+ auto iter = request.headers.find("Cookie");
if (iter != request.headers.end()) {
- std::vector<std::string> cookie_nv_pairs;
- base::SplitString(iter->second, ' ', &cookie_nv_pairs);
- for(std::vector<std::string>::const_iterator cookie_line =
- cookie_nv_pairs.begin();
- cookie_line != cookie_nv_pairs.end();
- ++cookie_line) {
- std::vector<std::string> name_value;
- base::SplitString(*cookie_line, '=', &name_value);
+ for (const std::string& cookie_line :
+ base::SplitString(iter->second, " ", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL)) {
+ std::vector<std::string> name_value = base::SplitString(
+ cookie_line, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (name_value.size() != 2)
continue;
@@ -441,8 +437,8 @@ const FakeGaia::AccessTokenInfo* FakeGaia::FindAccessTokenInfo(
if (auth_token.empty() || client_id.empty())
return NULL;
- std::vector<std::string> scope_list;
- base::SplitString(scope_string, ' ', &scope_list);
+ std::vector<std::string> scope_list = base::SplitString(
+ scope_string, " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
ScopeSet scopes(scope_list.begin(), scope_list.end());
for (AccessTokenInfoMap::const_iterator entry(
« no previous file with comments | « google_apis/drive/test_util.cc ('k') | google_apis/gaia/gaia_auth_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698