Chromium Code Reviews| Index: Source/core/css/CSSFontFaceSrcValue.cpp |
| diff --git a/Source/core/css/CSSFontFaceSrcValue.cpp b/Source/core/css/CSSFontFaceSrcValue.cpp |
| index 5ccf7547707efc0f79d2e69841d9ace072da92cb..00321c7d8b7c72ef3245d342103acb60d5ea949a 100644 |
| --- a/Source/core/css/CSSFontFaceSrcValue.cpp |
| +++ b/Source/core/css/CSSFontFaceSrcValue.cpp |
| @@ -88,10 +88,21 @@ bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const |
| return m_fetched->loadFailedOrCanceled(); |
| } |
| +static bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin* securityOrigin) |
| +{ |
| + if (resource.isLocalFile() || resource.protocolIsData()) |
| + return false; |
| + return !securityOrigin->canRequest(resource); |
|
Kunihiko Sakamoto
2014/04/09 10:24:18
I'm not familiar with this, but doesn't this retur
bashi
2014/04/10 03:40:56
In short, canRequest() returns true when |resource
Kunihiko Sakamoto
2014/04/10 05:49:24
Oh, I missed the ! operator. So we add Origin head
Kunihiko Sakamoto
2014/04/10 06:53:09
Nevermind - FireFox does not add Origin header for
|
| +} |
| + |
| FontResource* CSSFontFaceSrcValue::fetch(Document* document) |
| { |
| if (!m_fetched) { |
| FetchRequest request(ResourceRequest(document->completeURL(m_resource)), FetchInitiatorTypeNames::css); |
| + SecurityOrigin* securityOrigin = document->securityOrigin(); |
| + if (shouldSetCrossOriginAccessControl(request.url(), securityOrigin)) { |
| + request.setCrossOriginAccessControl(securityOrigin, DoNotAllowStoredCredentials); |
| + } |
| m_fetched = document->fetcher()->fetchFont(request); |
| } |
| return m_fetched.get(); |