Commit cad9c02c authored by Justin Lebar's avatar Justin Lebar
Browse files

Back out changesets 6a2c57fa8edf, 34526f45d863 (bug 737307) due to web-facing...

Back out changesets 6a2c57fa8edf, 34526f45d863 (bug 737307) due to web-facing regressions (e.g. bug 739478). r=bz

--HG--
extra : rebase_source : 4b595ee4ef7ab60a1d831bf50f1c973161e3187c
parent 1d3521bb
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
@@ -8348,13 +8348,6 @@ nsDocShell::InternalLoad(nsIURI * aURI,
           sameExceptHashes && !newHash.IsEmpty());

        if (doShortCircuitedLoad) {
            // If our load group contains a LOAD_DOCUMENT_URI request with a
            // channel which doesn't match our document's channel, cancel it.
            //
            // That is, a short-circuited load will cancel a non-short-circuited
            // load of a different document.
            StopOutstandingOtherDocumentLoad();

            // Save the current URI; we need it if we fire a hashchange later.
            nsCOMPtr<nsIURI> oldURI = mCurrentURI;

@@ -8654,47 +8647,6 @@ nsDocShell::InternalLoad(nsIURI * aURI,
    return rv;
}

// If our load group contains a LOAD_DOCUMENT_URI channel that's not our
// document's channel, cancel it.
void
nsDocShell::StopOutstandingOtherDocumentLoad()
{
    nsCOMPtr<nsIChannel> docChannel = GetCurrentDocChannel();
    if (!docChannel || !mLoadGroup) {
        return;
    }

    nsCOMPtr<nsISimpleEnumerator> requests;
    mLoadGroup->GetRequests(getter_AddRefs(requests));
    if (!requests) {
        return;
    }

    while (true) {
        bool hasMoreElements = false;
        requests->HasMoreElements(&hasMoreElements);
        if (!hasMoreElements) {
            break;
        }

        nsCOMPtr<nsISupports> next;
        requests->GetNext(getter_AddRefs(next));

        nsCOMPtr<nsIChannel> channel = do_QueryInterface(next);
        if (!channel) {
            continue;
        }

        nsLoadFlags flags;
        channel->GetLoadFlags(&flags);

        // As promised, cancel the channel if it's loading a different document.
        if ((flags & nsIChannel::LOAD_DOCUMENT_URI) && channel != docChannel) {
            channel->Cancel(NS_BINDING_ABORTED);
        }
    }
}

nsIPrincipal*
nsDocShell::GetInheritedPrincipal(bool aConsiderCurrentDocument)
{
+0 −5
Original line number Diff line number Diff line
@@ -672,11 +672,6 @@ protected:
    nsresult EnsureCommandHandler();

    nsIChannel* GetCurrentDocChannel();

    // If our load group contains a LOAD_DOCUMENT_URI channel that's not our
    // document's channel, cancel it.
    void StopOutstandingOtherDocumentLoad();

protected:
    // Override the parent setter from nsDocLoader
    virtual nsresult SetDocLoaderParent(nsDocLoader * aLoader);
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ function runAJAXTest() {

  var test = AJAXtests.shift();
  var testframe = document.getElementById("testframe");
  setTimeout(function() { testframe.src = test; }, 0);
  testframe.src = test;
}

function onManifestLoad(manifest) {