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

Side by Side Diff: components/signin/core/browser/signin_header_helper.cc

Issue 2321573003: Check if response headers are empty in signin code (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/signin/core/browser/signin_header_helper.h" 5 #include "components/signin/core/browser/signin_header_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 ManageAccountsParams BuildManageAccountsParamsIfExists(net::URLRequest* request, 210 ManageAccountsParams BuildManageAccountsParamsIfExists(net::URLRequest* request,
211 bool is_off_the_record) { 211 bool is_off_the_record) {
212 ManageAccountsParams empty_params; 212 ManageAccountsParams empty_params;
213 empty_params.service_type = GAIA_SERVICE_TYPE_NONE; 213 empty_params.service_type = GAIA_SERVICE_TYPE_NONE;
214 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) 214 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin()))
215 return empty_params; 215 return empty_params;
216 216
217 std::string header_value; 217 std::string header_value;
218 if (!request->response_headers()->GetNormalizedHeader( 218 net::HttpResponseHeaders* response_headers = request->response_headers();
219 if (!response_headers ||
220 !response_headers->GetNormalizedHeader(
219 kChromeManageAccountsHeader, &header_value)) { 221 kChromeManageAccountsHeader, &header_value)) {
220 return empty_params; 222 return empty_params;
221 } 223 }
222 224
223 DCHECK(switches::IsEnableAccountConsistency() && !is_off_the_record); 225 DCHECK(switches::IsEnableAccountConsistency() && !is_off_the_record);
224 return BuildManageAccountsParams(header_value); 226 return BuildManageAccountsParams(header_value);
225 } 227 }
226 228
227 } // namespace signin 229 } // namespace signin
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698