Skip to content
  • weinig@apple.com's avatar
    Wean ContentSecurityPolicy from the Document · 76f3d931
    weinig@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=69387
    
    Reviewed by Adam Barth.
    
    * bindings/js/WorkerScriptController.cpp:
    (WebCore::WorkerScriptController::disableEval):
    * bindings/js/WorkerScriptController.h:
    * dom/Document.cpp:
    (WebCore::Document::disableEval):
    * dom/Document.h:
    * workers/WorkerContext.cpp:
    (WebCore::WorkerContext::disableEval):
    * workers/WorkerContext.h:
    * dom/ScriptExecutionContext.h:
    Add pure virtual disableEval to ScriptExecutionContext, so that ContentSecurityPolicy
    can call it for both Documents and WorkerContexts.
    
    * page/ContentSecurityPolicy.cpp:
    (WebCore::ContentSecurityPolicy::didReceiveHeader):
    Call the new ScriptExecutionContext::disableEval() function.
    
    (WebCore::ContentSecurityPolicy::reportViolation):
    Use ScriptExecutionContext::addMessage() instead of going directly to the DOMWindow.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    76f3d931