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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 581 |
582 if (sourceOrigin->canRequest(url)) | 582 if (sourceOrigin->canRequest(url)) |
583 return true; | 583 return true; |
584 | 584 |
585 String errorDescription; | 585 String errorDescription; |
586 if (!resource->passesAccessControlCheck(sourceOrigin, errorDescription)) { | 586 if (!resource->passesAccessControlCheck(sourceOrigin, errorDescription)) { |
587 if (frame() && frame()->document()) { | 587 if (frame() && frame()->document()) { |
588 String resourceType = Resource::resourceTypeToString(resource->type(
), resource->options().initiatorInfo); | 588 String resourceType = Resource::resourceTypeToString(resource->type(
), resource->options().initiatorInfo); |
589 frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessage
Level, resourceType + " from origin '" + SecurityOrigin::create(url)->toString()
+ "' has been blocked from loading by Cross-Origin Resource Sharing policy: " +
errorDescription); | 589 frame()->document()->addConsoleMessage(JSMessageSource, ErrorMessage
Level, resourceType + " from origin '" + SecurityOrigin::create(url)->toString()
+ "' has been blocked from loading by Cross-Origin Resource Sharing policy: " +
errorDescription); |
590 } | 590 } |
| 591 |
| 592 // FIXME: Remove later, http://crbug.com/286681 |
| 593 if (resource->type() == Resource::Font) { |
| 594 FontResource* fontResource = toFontResource(resource); |
| 595 fontResource->setCORSFailed(); |
| 596 } |
591 return false; | 597 return false; |
592 } | 598 } |
593 return true; | 599 return true; |
594 } | 600 } |
595 | 601 |
596 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const | 602 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const |
597 { | 603 { |
598 if (!frame()) | 604 if (!frame()) |
599 return false; | 605 return false; |
600 if (!m_documentLoader) | 606 if (!m_documentLoader) |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 case Revalidate: | 1427 case Revalidate: |
1422 ++m_revalidateCount; | 1428 ++m_revalidateCount; |
1423 return; | 1429 return; |
1424 case Use: | 1430 case Use: |
1425 ++m_useCount; | 1431 ++m_useCount; |
1426 return; | 1432 return; |
1427 } | 1433 } |
1428 } | 1434 } |
1429 | 1435 |
1430 } | 1436 } |
OLD | NEW |