Changeset 125714 in webkit


Ignore:
Timestamp:
Aug 15, 2012 3:07:46 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Upstream FrameLoaderClientBlackBerry::securityOriginForNewDocument()
https://bugs.webkit.org/show_bug.cgi?id=94139

Patch by Yong Li <yoli@rim.com> on 2012-08-15
Reviewed by Antonio Gomes.

Keep same security origin when a file URL automatically redirects to its child folder.
This patch will be reverted when we finish the better solution.
PR# 172333 and PR# 180590.

  • WebCoreSupport/FrameLoaderClientBlackBerry.cpp:

(WebCore::FrameLoaderClientBlackBerry::FrameLoaderClientBlackBerry):
(WebCore::FrameLoaderClientBlackBerry::dispatchDidStartProvisionalLoad):
(WebCore::FrameLoaderClientBlackBerry::securityOriginForNewDocument):
(WebCore):

  • WebCoreSupport/FrameLoaderClientBlackBerry.h:

(FrameLoaderClientBlackBerry):

Location:
trunk/Source/WebKit/blackberry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r125705 r125714  
     12012-08-15  Yong Li  <yoli@rim.com>
     2
     3        [BlackBerry] Upstream FrameLoaderClientBlackBerry::securityOriginForNewDocument()
     4        https://bugs.webkit.org/show_bug.cgi?id=94139
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Keep same security origin when a file URL automatically redirects to its child folder.
     9        This patch will be reverted when we finish the better solution.
     10        PR# 172333 and PR# 180590.
     11
     12        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
     13        (WebCore::FrameLoaderClientBlackBerry::FrameLoaderClientBlackBerry):
     14        (WebCore::FrameLoaderClientBlackBerry::dispatchDidStartProvisionalLoad):
     15        (WebCore::FrameLoaderClientBlackBerry::securityOriginForNewDocument):
     16        (WebCore):
     17        * WebCoreSupport/FrameLoaderClientBlackBerry.h:
     18        (FrameLoaderClientBlackBerry):
     19
    1202012-08-15  Yong Li  <yoli@rim.com>
    221
  • trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp

    r125611 r125714  
    109109    , m_hasSentResponseToPlugin(false)
    110110    , m_cancelLoadOnNextData(false)
     111    , m_wasProvisionalLoadTriggeredByUserGesture(true) // To avoid affecting the first load.
    111112{
    112113}
     
    505506    if (m_webPagePrivate->m_dumpRenderTree)
    506507        m_webPagePrivate->m_dumpRenderTree->didStartProvisionalLoadForFrame(m_frame);
     508
     509    m_wasProvisionalLoadTriggeredByUserGesture = ScriptController::processingUserGesture();
    507510}
    508511
     
    12531256}
    12541257
     1258PassRefPtr<SecurityOrigin> FrameLoaderClientBlackBerry::securityOriginForNewDocument(const KURL& url)
     1259{
     1260    // What we are trying to do here is to keep using the old path as origin when a file-based html page
     1261    // changes its location to some html in a subfolder. This will allow some file-based html packages
     1262    // to work smoothly even with security checks enabled.
     1263
     1264    RefPtr<SecurityOrigin> newSecurityOrigin = SecurityOrigin::create(url);
     1265
     1266    if (m_wasProvisionalLoadTriggeredByUserGesture || !url.isLocalFile())
     1267        return newSecurityOrigin;
     1268
     1269    RefPtr<SecurityOrigin> currentSecurityOrigin = m_frame->document()->securityOrigin();
     1270    if (currentSecurityOrigin && currentSecurityOrigin->containsInFolder(newSecurityOrigin.get()))
     1271        return currentSecurityOrigin;
     1272
     1273    return newSecurityOrigin;
     1274}
     1275
    12551276} // WebCore
  • trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h

    r115926 r125714  
    171171    virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext();
    172172
     173    virtual PassRefPtr<SecurityOrigin> securityOriginForNewDocument(const KURL&);
     174
    173175    void readyToRender(bool pageIsVisuallyNonEmpty);
    174176
     
    216218    // Used to stop media files from loading because we don't need to have the entire file loaded by WebKit.
    217219    bool m_cancelLoadOnNextData;
     220
     221    bool m_wasProvisionalLoadTriggeredByUserGesture;
    218222};
    219223
Note: See TracChangeset for help on using the changeset viewer.