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

Side by Side Diff: google_apis/gaia/gaia_auth_fetcher.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 unified diff | Download patch
« no previous file with comments | « google_apis/gaia/fake_gaia.cc ('k') | google_apis/gaia/gaia_auth_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gaia/gaia_auth_fetcher.h" 5 #include "google_apis/gaia/gaia_auth_fetcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 for (iter = cookies.begin(); iter != cookies.end(); ++iter) { 501 for (iter = cookies.begin(); iter != cookies.end(); ++iter) {
502 if (ParseClientLoginToOAuth2Cookie(*iter, auth_code)) 502 if (ParseClientLoginToOAuth2Cookie(*iter, auth_code))
503 return true; 503 return true;
504 } 504 }
505 return false; 505 return false;
506 } 506 }
507 507
508 // static 508 // static
509 bool GaiaAuthFetcher::ParseClientLoginToOAuth2Cookie(const std::string& cookie, 509 bool GaiaAuthFetcher::ParseClientLoginToOAuth2Cookie(const std::string& cookie,
510 std::string* auth_code) { 510 std::string* auth_code) {
511 std::vector<std::string> parts; 511 std::vector<std::string> parts = base::SplitString(
512 base::SplitString(cookie, ';', &parts); 512 cookie, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
513 // Per documentation, the cookie should have Secure and HttpOnly. 513 // Per documentation, the cookie should have Secure and HttpOnly.
514 if (!CookiePartsContains(parts, kClientLoginToOAuth2CookiePartSecure) || 514 if (!CookiePartsContains(parts, kClientLoginToOAuth2CookiePartSecure) ||
515 !CookiePartsContains(parts, kClientLoginToOAuth2CookiePartHttpOnly)) { 515 !CookiePartsContains(parts, kClientLoginToOAuth2CookiePartHttpOnly)) {
516 return false; 516 return false;
517 } 517 }
518 518
519 std::vector<std::string>::const_iterator iter; 519 std::vector<std::string>::const_iterator iter;
520 for (iter = parts.begin(); iter != parts.end(); ++iter) { 520 for (iter = parts.begin(); iter != parts.end(); ++iter) {
521 const std::string& part = *iter; 521 const std::string& part = *iter;
522 if (base::StartsWith(part, kClientLoginToOAuth2CookiePartCodePrefix, 522 if (base::StartsWith(part, kClientLoginToOAuth2CookiePartCodePrefix,
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 return alleged_error.find(kSecondFactor) != 1091 return alleged_error.find(kSecondFactor) !=
1092 std::string::npos; 1092 std::string::npos;
1093 } 1093 }
1094 1094
1095 // static 1095 // static
1096 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess( 1096 bool GaiaAuthFetcher::IsWebLoginRequiredSuccess(
1097 const std::string& alleged_error) { 1097 const std::string& alleged_error) {
1098 return alleged_error.find(kWebLoginRequired) != 1098 return alleged_error.find(kWebLoginRequired) !=
1099 std::string::npos; 1099 std::string::npos;
1100 } 1100 }
OLDNEW
« no previous file with comments | « google_apis/gaia/fake_gaia.cc ('k') | google_apis/gaia/gaia_auth_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698