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

Side by Side Diff: Source/core/fetch/Resource.cpp

Issue 732323004: Add use counter for credentialed CORS access from null origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tweak spelling Created 6 years 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 | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 void Resource::finish() 268 void Resource::finish()
269 { 269 {
270 ASSERT(!m_resourceToRevalidate); 270 ASSERT(!m_resourceToRevalidate);
271 ASSERT(!errorOccurred()); 271 ASSERT(!errorOccurred());
272 finishOnePart(); 272 finishOnePart();
273 if (!errorOccurred()) 273 if (!errorOccurred())
274 m_status = Cached; 274 m_status = Cached;
275 } 275 }
276 276
277 bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin) 277 bool Resource::passesAccessControlCheck(ExecutionContext* context, SecurityOrigi n* securityOrigin)
278 { 278 {
279 String ignoredErrorDescription; 279 String ignoredErrorDescription;
280 return passesAccessControlCheck(securityOrigin, ignoredErrorDescription); 280 return passesAccessControlCheck(context, securityOrigin, ignoredErrorDescrip tion);
281 } 281 }
282 282
283 bool Resource::passesAccessControlCheck(SecurityOrigin* securityOrigin, String& errorDescription) 283 bool Resource::passesAccessControlCheck(ExecutionContext* context, SecurityOrigi n* securityOrigin, String& errorDescription)
284 { 284 {
285 return blink::passesAccessControlCheck(m_response, resourceRequest().allowSt oredCredentials() ? AllowStoredCredentials : DoNotAllowStoredCredentials, securi tyOrigin, errorDescription); 285 return blink::passesAccessControlCheck(context, m_response, resourceRequest( ).allowStoredCredentials() ? AllowStoredCredentials : DoNotAllowStoredCredential s, securityOrigin, errorDescription);
286 } 286 }
287 287
288 static double currentAge(const ResourceResponse& response, double responseTimest amp) 288 static double currentAge(const ResourceResponse& response, double responseTimest amp)
289 { 289 {
290 // RFC2616 13.2.3 290 // RFC2616 13.2.3
291 // No compensation for latency as that is not terribly important in practice 291 // No compensation for latency as that is not terribly important in practice
292 double dateValue = response.date(); 292 double dateValue = response.date();
293 double apparentAge = std::isfinite(dateValue) ? std::max(0., responseTimesta mp - dateValue) : 0; 293 double apparentAge = std::isfinite(dateValue) ? std::max(0., responseTimesta mp - dateValue) : 0;
294 double ageValue = response.age(); 294 double ageValue = response.age();
295 double correctedReceivedAge = std::isfinite(ageValue) ? std::max(apparentAge , ageValue) : apparentAge; 295 double correctedReceivedAge = std::isfinite(ageValue) ? std::max(apparentAge , ageValue) : apparentAge;
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 return "ImportResource"; 1006 return "ImportResource";
1007 case Resource::Media: 1007 case Resource::Media:
1008 return "Media"; 1008 return "Media";
1009 } 1009 }
1010 ASSERT_NOT_REACHED(); 1010 ASSERT_NOT_REACHED();
1011 return "Unknown"; 1011 return "Unknown";
1012 } 1012 }
1013 #endif // !LOG_DISABLED 1013 #endif // !LOG_DISABLED
1014 1014
1015 } 1015 }
OLDNEW
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698