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

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

Issue 230383003: Webfont CORS-enabled fetching with fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & reverse the enum values Created 6 years, 8 months 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/FontResource.cpp ('k') | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/fetch/FontResource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698