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

Side by Side Diff: google_apis/gaia/fake_gaia.cc

Issue 2070283002: Use container::back() and container::pop_back(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « google_apis/drive/time_util.cc ('k') | gpu/command_buffer/client/program_info_manager.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/fake_gaia.h" 5 #include "google_apis/gaia/fake_gaia.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (iter != request.headers.end()) { 78 if (iter != request.headers.end()) {
79 for (const std::string& cookie_line : 79 for (const std::string& cookie_line :
80 base::SplitString(iter->second, " ", base::TRIM_WHITESPACE, 80 base::SplitString(iter->second, " ", base::TRIM_WHITESPACE,
81 base::SPLIT_WANT_ALL)) { 81 base::SPLIT_WANT_ALL)) {
82 std::vector<std::string> name_value = base::SplitString( 82 std::vector<std::string> name_value = base::SplitString(
83 cookie_line, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 83 cookie_line, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
84 if (name_value.size() != 2) 84 if (name_value.size() != 2)
85 continue; 85 continue;
86 86
87 std::string value = name_value[1]; 87 std::string value = name_value[1];
88 if (value.size() && value[value.size() - 1] == ';') 88 if (value.size() && value.back() == ';')
89 value = value.substr(0, value.size() -1); 89 value = value.substr(0, value.size() -1);
90 90
91 result.insert(std::make_pair(name_value[0], value)); 91 result.insert(std::make_pair(name_value[0], value));
92 } 92 }
93 } 93 }
94 return result; 94 return result;
95 } 95 }
96 96
97 // Extracts the |access_token| from authorization header of |request|. 97 // Extracts the |access_token| from authorization header of |request|.
98 bool GetAccessToken(const HttpRequest& request, 98 bool GetAccessToken(const HttpRequest& request,
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 url = net::AppendQueryParameter(url, "RelayState", 833 url = net::AppendQueryParameter(url, "RelayState",
834 GaiaUrls::GetInstance() 834 GaiaUrls::GetInstance()
835 ->gaia_url() 835 ->gaia_url()
836 .Resolve(kDummySAMLContinuePath) 836 .Resolve(kDummySAMLContinuePath)
837 .spec()); 837 .spec());
838 std::string redirect_url = url.spec(); 838 std::string redirect_url = url.spec();
839 http_response->set_code(net::HTTP_TEMPORARY_REDIRECT); 839 http_response->set_code(net::HTTP_TEMPORARY_REDIRECT);
840 http_response->AddCustomHeader("Google-Accounts-SAML", "Start"); 840 http_response->AddCustomHeader("Google-Accounts-SAML", "Start");
841 http_response->AddCustomHeader("Location", redirect_url); 841 http_response->AddCustomHeader("Location", redirect_url);
842 } 842 }
OLDNEW
« no previous file with comments | « google_apis/drive/time_util.cc ('k') | gpu/command_buffer/client/program_info_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698