| Index: Source/core/html/canvas/CanvasRenderingContext.cpp
|
| diff --git a/Source/core/html/canvas/CanvasRenderingContext.cpp b/Source/core/html/canvas/CanvasRenderingContext.cpp
|
| index a6fa5d710652f1163fb576c1a49ef7f2293862e9..b2cb6faf378fba6f750699a91da7950620099134 100644
|
| --- a/Source/core/html/canvas/CanvasRenderingContext.cpp
|
| +++ b/Source/core/html/canvas/CanvasRenderingContext.cpp
|
| @@ -26,10 +26,6 @@
|
| #include "config.h"
|
| #include "core/html/canvas/CanvasRenderingContext.h"
|
|
|
| -#include "core/fetch/ImageResource.h"
|
| -#include "core/html/HTMLImageElement.h"
|
| -#include "core/html/HTMLVideoElement.h"
|
| -#include "core/html/canvas/CanvasPattern.h"
|
| #include "platform/weborigin/SecurityOrigin.h"
|
|
|
| namespace WebCore {
|
| @@ -40,69 +36,4 @@ CanvasRenderingContext::CanvasRenderingContext(HTMLCanvasElement* canvas)
|
|
|
| }
|
|
|
| -bool CanvasRenderingContext::wouldTaintOrigin(const CanvasPattern* pattern)
|
| -{
|
| - if (canvas()->originClean() && pattern && !pattern->originClean())
|
| - return true;
|
| - return false;
|
| -}
|
| -
|
| -bool CanvasRenderingContext::wouldTaintOrigin(const HTMLCanvasElement* sourceCanvas)
|
| -{
|
| - if (canvas()->originClean() && sourceCanvas && !sourceCanvas->originClean())
|
| - return true;
|
| - return false;
|
| -}
|
| -
|
| -bool CanvasRenderingContext::wouldTaintOrigin(const HTMLImageElement* image)
|
| -{
|
| - if (!image || !canvas()->originClean())
|
| - return false;
|
| -
|
| - ImageResource* cachedImage = image->cachedImage();
|
| - if (!cachedImage->image()->currentFrameHasSingleSecurityOrigin())
|
| - return true;
|
| -
|
| - return wouldTaintOrigin(cachedImage->response().url()) && !cachedImage->passesAccessControlCheck(canvas()->securityOrigin());
|
| -}
|
| -
|
| -bool CanvasRenderingContext::wouldTaintOrigin(const HTMLVideoElement* video)
|
| -{
|
| - // FIXME: This check is likely wrong when a redirect is involved. We need
|
| - // to test the finalURL. Please be careful when fixing this issue not to
|
| - // make currentSrc be the final URL because then the
|
| - // HTMLMediaElement.currentSrc DOM API would leak redirect destinations!
|
| - if (!video || !canvas()->originClean())
|
| - return false;
|
| -
|
| - if (!video->hasSingleSecurityOrigin())
|
| - return true;
|
| -
|
| - if (!(video->player() && video->player()->didPassCORSAccessCheck()) && wouldTaintOrigin(video->currentSrc()))
|
| - return true;
|
| -
|
| - return false;
|
| -}
|
| -
|
| -bool CanvasRenderingContext::wouldTaintOrigin(const KURL& url)
|
| -{
|
| - if (!canvas()->originClean() || m_cleanURLs.contains(url.string()))
|
| - return false;
|
| -
|
| - if (canvas()->securityOrigin()->taintsCanvas(url))
|
| - return true;
|
| -
|
| - if (url.protocolIsData())
|
| - return false;
|
| -
|
| - m_cleanURLs.add(url.string());
|
| - return false;
|
| -}
|
| -
|
| -void CanvasRenderingContext::checkOrigin(const KURL& url)
|
| -{
|
| - if (wouldTaintOrigin(url))
|
| - canvas()->setOriginTainted();
|
| -}
|
| -
|
| } // namespace WebCore
|
|
|