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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 479 } |
480 return true; | 480 return true; |
481 } | 481 } |
482 | 482 |
483 bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res
ourceLoaderOptions& options, bool forPreload, FetchRequest::OriginRestriction or
iginRestriction) const | 483 bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res
ourceLoaderOptions& options, bool forPreload, FetchRequest::OriginRestriction or
iginRestriction) const |
484 { | 484 { |
485 SecurityOrigin* securityOrigin = options.securityOrigin.get(); | 485 SecurityOrigin* securityOrigin = options.securityOrigin.get(); |
486 if (!securityOrigin && document()) | 486 if (!securityOrigin && document()) |
487 securityOrigin = document()->securityOrigin(); | 487 securityOrigin = document()->securityOrigin(); |
488 | 488 |
489 if (securityOrigin && !securityOrigin->canDisplay(url)) { | 489 if (originRestriction != FetchRequest::NoOriginRestriction && securityOrigin
&& !securityOrigin->canDisplay(url)) { |
490 if (!forPreload) | 490 if (!forPreload) |
491 context().reportLocalLoadFailed(url); | 491 context().reportLocalLoadFailed(url); |
492 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not a
llowed by SecurityOrigin::canDisplay"); | 492 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not a
llowed by SecurityOrigin::canDisplay"); |
493 return 0; | 493 return 0; |
494 } | 494 } |
495 | 495 |
496 // Some types of resources can be loaded only from the same origin. Other | 496 // Some types of resources can be loaded only from the same origin. Other |
497 // types of resources, like Images, Scripts, and CSS, can be loaded from | 497 // types of resources, like Images, Scripts, and CSS, can be loaded from |
498 // any URL. | 498 // any URL. |
499 switch (type) { | 499 switch (type) { |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 } | 1522 } |
1523 } | 1523 } |
1524 | 1524 |
1525 void ResourceFetcher::trace(Visitor* visitor) | 1525 void ResourceFetcher::trace(Visitor* visitor) |
1526 { | 1526 { |
1527 visitor->trace(m_document); | 1527 visitor->trace(m_document); |
1528 ResourceLoaderHost::trace(visitor); | 1528 ResourceLoaderHost::trace(visitor); |
1529 } | 1529 } |
1530 | 1530 |
1531 } | 1531 } |
OLD | NEW |