OLD | NEW |
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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 if (!canRequest(resource->type(), resource->response().url(), resource->opti
ons(), false)) | 446 if (!canRequest(resource->type(), resource->response().url(), resource->opti
ons(), false)) |
447 return false; | 447 return false; |
448 | 448 |
449 String error; | 449 String error; |
450 switch (resource->type()) { | 450 switch (resource->type()) { |
451 case Resource::Script: | 451 case Resource::Script: |
452 case Resource::ImportResource: | 452 case Resource::ImportResource: |
453 if (resource->options().requestOriginPolicy == PotentiallyCrossOriginEna
bled | 453 if (resource->options().requestOriginPolicy == PotentiallyCrossOriginEna
bled |
454 && !m_document->securityOrigin()->canRequest(resource->response().ur
l()) | 454 && !m_document->securityOrigin()->canRequest(resource->response().ur
l()) |
455 && !resource->passesAccessControlCheck(m_document->securityOrigin(),
error)) { | 455 && !resource->passesAccessControlCheck(m_document->securityOrigin(),
error)) { |
456 m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "S
cript from origin '" + SecurityOrigin::create(resource->response().url())->toStr
ing() + "' has been blocked from loading by Cross-Origin Resource Sharing policy
: " + error); | 456 frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessage
Level, "Script from origin '" + SecurityOrigin::create(resource->response().url(
))->toString() + "' has been blocked from loading by Cross-Origin Resource Shari
ng policy: " + error); |
457 return false; | 457 return false; |
458 } | 458 } |
459 | 459 |
460 break; | 460 break; |
461 default: | 461 default: |
462 ASSERT_NOT_REACHED(); // FIXME: generalize to non-script resources | 462 ASSERT_NOT_REACHED(); // FIXME: generalize to non-script resources |
463 return false; | 463 return false; |
464 } | 464 } |
465 | 465 |
466 return true; | 466 return true; |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 } | 1285 } |
1286 #endif | 1286 #endif |
1287 | 1287 |
1288 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() | 1288 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() |
1289 { | 1289 { |
1290 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul
tOriginRestrictionsForType, DocumentContext)); | 1290 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon
tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF
orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul
tOriginRestrictionsForType, DocumentContext)); |
1291 return options; | 1291 return options; |
1292 } | 1292 } |
1293 | 1293 |
1294 } | 1294 } |
OLD | NEW |