Changeset 147165 in webkit


Ignore:
Timestamp:
Mar 28, 2013 2:58:19 PM (11 years ago)
Author:
Nate Chapin
Message:

Source/WebCore: Don't grant local content permissions for appcache loads.
https://bugs.webkit.org/show_bug.cgi?id=112542

Reviewed by Antti Koivisto.

No new tests, fixing http/tests/appcache/local-content.html

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::commitData): Don't grant local load permissions

to all SubstituteData loads, only give them to loads that were SubstituteData
loads at the time of DocumentLoader construction. This constitutes all
SubstituteData loads except those triggered by appcache.

  • loader/DocumentLoader.h:
  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::didBeginDocument): Move granting local load

permissions for SubstituteData loads to DocumentLoader::commitData().

LayoutTests: Remove expected failure for https://bugs.webkit.org/show_bug.cgi?id=112542

Reviewed by Antti Koivisto.

  • platform/qt-5.0-wk1/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147164 r147165  
     12013-03-28  Nate Chapin  <japhet@chromium.org>
     2
     3        Remove expected failure for https://bugs.webkit.org/show_bug.cgi?id=112542
     4
     5        Reviewed by Antti Koivisto.
     6
     7        * platform/qt-5.0-wk1/TestExpectations:
     8
    192013-03-28  Mike West  <mkwst@chromium.org>
    210
  • trunk/LayoutTests/platform/qt-5.0-wk1/TestExpectations

    r146194 r147165  
    161161webkit.org/b/112333 css3/compositing/should-have-compositing-layer.html [ Skip ]
    162162webkit.org/b/112333 transitions/blendmode-transitions.html  [ Skip ]
    163 
    164 # [Qt][WK1] REGRESSION(r145973): http/tests/appcache/local-content.html fails
    165 webkit.org/b/112542 http/tests/appcache/local-content.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r147164 r147165  
     12013-03-28  Nate Chapin  <japhet@chromium.org>
     2
     3        Don't grant local content permissions for appcache loads.
     4        https://bugs.webkit.org/show_bug.cgi?id=112542
     5
     6        Reviewed by Antti Koivisto.
     7
     8        No new tests, fixing http/tests/appcache/local-content.html
     9
     10        * loader/DocumentLoader.cpp:
     11        (WebCore::DocumentLoader::DocumentLoader):
     12        (WebCore::DocumentLoader::commitData): Don't grant local load permissions
     13            to all SubstituteData loads, only give them to loads that were SubstituteData
     14            loads at the time of DocumentLoader construction. This constitutes all
     15            SubstituteData loads except those triggered by appcache.
     16        * loader/DocumentLoader.h:
     17        * loader/FrameLoader.cpp:
     18        (WebCore::FrameLoader::didBeginDocument): Move granting local load
     19            permissions for SubstituteData loads to DocumentLoader::commitData().
     20
    1212013-03-28  Mike West  <mkwst@chromium.org>
    222
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r147164 r147165  
    5555#include "ResourceBuffer.h"
    5656#include "SchemeRegistry.h"
     57#include "SecurityPolicy.h"
    5758#include "Settings.h"
    5859#include "SubresourceLoader.h"
     
    104105    , m_originalRequestCopy(req)
    105106    , m_request(req)
     107    , m_originalSubstituteDataWasValid(substituteData.isValid())
    106108    , m_committed(false)
    107109    , m_isStopping(false)
     
    760762        m_writer.begin(documentURL(), false);
    761763        m_writer.setDocumentWasLoadedAsPartOfNavigation();
     764
     765        if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_originalSubstituteDataWasValid) {
     766            // If this document was loaded with substituteData, then the document can
     767            // load local resources. See https://bugs.webkit.org/show_bug.cgi?id=16756
     768            // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further
     769            // discussion.
     770            m_frame->document()->securityOrigin()->grantLoadLocalResources();
     771        }
    762772
    763773        if (frameLoader()->stateMachine()->creatingInitialEmptyDocument())
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r146449 r147165  
    344344        ResourceError m_mainDocumentError;   
    345345
     346        bool m_originalSubstituteDataWasValid;
    346347        bool m_committed;
    347348        bool m_isStopping;
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r147086 r147165  
    684684                m_frame->document()->setContentLanguage(headerContentLanguage);
    685685        }
    686 
    687         if (SecurityPolicy::allowSubstituteDataAccessToLocal() && m_documentLoader->substituteData().isValid()) {
    688             // If this document was loaded with substituteData, then the document can
    689             // load local resources. See https://bugs.webkit.org/show_bug.cgi?id=16756
    690             // and https://bugs.webkit.org/show_bug.cgi?id=19760 for further
    691             // discussion.
    692             m_frame->document()->securityOrigin()->grantLoadLocalResources();
    693         }
    694686    }
    695687
Note: See TracChangeset for help on using the changeset viewer.