Bug 1268147 - Remove nsScriptLoader::ShouldLoadScript (r=sicking)
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Fri, 06 May 2016 15:31:48 +0200
changeset 296405 a3c193dd2a9c2e6968fd23a7083ee0a233122283
parent 296404 5a110cddee4db7d80632ab07649f76e1d38fcbb1
child 296406 c2fa32f6f29c4a881f015f837d4e646878707c06
push id76314
push usermozilla@christophkerschbaumer.com
push dateFri, 06 May 2016 13:52:06 +0000
treeherdermozilla-inbound@09de5ebe553f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1268147
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1268147 - Remove nsScriptLoader::ShouldLoadScript (r=sicking)
dom/base/nsScriptLoader.cpp
dom/base/nsScriptLoader.h
--- a/dom/base/nsScriptLoader.cpp
+++ b/dom/base/nsScriptLoader.cpp
@@ -231,39 +231,16 @@ nsScriptLoader::CheckContentPolicy(nsIDo
     }
     return NS_ERROR_CONTENT_BLOCKED_SHOW_ALT;
   }
 
   return NS_OK;
 }
 
 nsresult
-nsScriptLoader::ShouldLoadScript(nsIDocument* aDocument,
-                                 nsISupports* aContext,
-                                 nsIURI* aURI,
-                                 const nsAString &aType,
-                                 bool aIsPreLoad)
-{
-  // Check that the containing page is allowed to load this URI.
-  nsresult rv = nsContentUtils::GetSecurityManager()->
-    CheckLoadURIWithPrincipal(aDocument->NodePrincipal(), aURI,
-                              nsIScriptSecurityManager::ALLOW_CHROME);
-
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // After the security manager, the content-policy stuff gets a veto
-  rv = CheckContentPolicy(aDocument, aContext, aURI, aType, aIsPreLoad);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  return NS_OK;
-}
-
-nsresult
 nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType,
                           bool aScriptFromHead)
 {
   // If this document is sandboxed without 'allow-scripts', abort.
   if (mDocument->GetSandboxFlags() & SANDBOXED_SCRIPTS) {
     return NS_OK;
   }
 
--- a/dom/base/nsScriptLoader.h
+++ b/dom/base/nsScriptLoader.h
@@ -358,26 +358,16 @@ public:
                             mozilla::dom::SRICheckDataVerifier* aSRIDataVerifier);
 
   /**
    * Processes any pending requests that are ready for processing.
    */
   void ProcessPendingRequests();
 
   /**
-   * Check whether it's OK to load a script from aURI in
-   * aDocument.
-   */
-  static nsresult ShouldLoadScript(nsIDocument* aDocument,
-                                   nsISupports* aContext,
-                                   nsIURI* aURI,
-                                   const nsAString &aType,
-                                   bool aIsPreLoad);
-
-  /**
    * Starts deferring deferred scripts and puts them in the mDeferredRequests
    * queue instead.
    */
   void BeginDeferringScripts()
   {
     mDeferEnabled = true;
     if (mDocument) {
       mDocument->BlockOnload();