Changeset 66815 in webkit


Ignore:
Timestamp:
Sep 6, 2010 12:59:30 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-09-06 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Rename SecurityOrigin::canLoad to canDisplay
https://bugs.webkit.org/show_bug.cgi?id=45214

canLoad is a pretty opaque name. This function is really about whether
you can display the contents of the URL in an iframe, an image, or a
plugin.

  • WebCore.exp.in:
  • html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isSafeToLoadURL):
  • loader/Cache.cpp: (WebCore::Cache::requestResource):
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::loadFrameRequest):
  • loader/PingLoader.cpp: (WebCore::PingLoader::loadImage):
  • loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin): (WebCore::SubframeLoader::createJavaAppletWidget): (WebCore::SubframeLoader::loadSubframe): (WebCore::SubframeLoader::loadPlugin):
  • loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create):
  • page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::canDisplay):
  • page/SecurityOrigin.h:
  • plugins/PluginView.cpp: (WebCore::PluginView::load):

2010-09-06 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Rename SecurityOrigin::canLoad to canDisplay
https://bugs.webkit.org/show_bug.cgi?id=45214

Propagate name change.

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::loadRequest):
  • Plugins/WebNetscapePluginStream.mm: (WebNetscapePluginStream::WebNetscapePluginStream):
  • Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
  • Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _isForbiddenFileLoad]):
  • WebView/WebFrame.mm: (-[WebFrame _allowsFollowingLink:]):

2010-09-06 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Rename SecurityOrigin::canLoad to canDisplay
https://bugs.webkit.org/show_bug.cgi?id=45214

Propagate name change.

  • WebFrame.cpp: (WebFrame::allowsFollowingLink):

2010-09-06 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

Rename SecurityOrigin::canLoad to canDisplay
https://bugs.webkit.org/show_bug.cgi?id=45214

Propagate name change.

  • WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performFrameLoadURLRequest):
Location:
trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66813 r66815  
     12010-09-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Rename SecurityOrigin::canLoad to canDisplay
     6        https://bugs.webkit.org/show_bug.cgi?id=45214
     7
     8        canLoad is a pretty opaque name.  This function is really about whether
     9        you can display the contents of the URL in an iframe, an image, or a
     10        plugin.
     11
     12        * WebCore.exp.in:
     13        * html/HTMLMediaElement.cpp:
     14        (WebCore::HTMLMediaElement::isSafeToLoadURL):
     15        * loader/Cache.cpp:
     16        (WebCore::Cache::requestResource):
     17        * loader/FrameLoader.cpp:
     18        (WebCore::FrameLoader::loadFrameRequest):
     19        * loader/PingLoader.cpp:
     20        (WebCore::PingLoader::loadImage):
     21        * loader/SubframeLoader.cpp:
     22        (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
     23        (WebCore::SubframeLoader::createJavaAppletWidget):
     24        (WebCore::SubframeLoader::loadSubframe):
     25        (WebCore::SubframeLoader::loadPlugin):
     26        * loader/SubresourceLoader.cpp:
     27        (WebCore::SubresourceLoader::create):
     28        * page/SecurityOrigin.cpp:
     29        (WebCore::SecurityOrigin::canDisplay):
     30        * page/SecurityOrigin.h:
     31        * plugins/PluginView.cpp:
     32        (WebCore::PluginView::load):
     33
    1342010-08-31  Yury Semikhatsky  <yurys@chromium.org>
    235
  • trunk/WebCore/WebCore.exp.in

    r66794 r66815  
    315315__ZN7WebCore14SchemeRegistry25registerURLSchemeAsSecureERKN3WTF6StringE
    316316__ZN7WebCore14SchemeRegistry32registerURLSchemeAsEmptyDocumentERKN3WTF6StringE
     317__ZN7WebCore14SecurityOrigin10canDisplayERKNS_4KURLERKN3WTF6StringEPNS_8DocumentE
    317318__ZN7WebCore14SecurityOrigin16createFromStringERKN3WTF6StringE
    318319__ZN7WebCore14SecurityOrigin18setLocalLoadPolicyENS0_15LocalLoadPolicyE
     
    323324__ZN7WebCore14SecurityOrigin40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE
    324325__ZN7WebCore14SecurityOrigin6createERKNS_4KURLEi
    325 __ZN7WebCore14SecurityOrigin7canLoadERKNS_4KURLERKN3WTF6StringEPNS_8DocumentE
    326326__ZN7WebCore15ArchiveResource6createEN3WTF10PassRefPtrINS_12SharedBufferEEERKNS_4KURLERKNS1_6StringESA_SA_RKNS_16ResourceResponseE
    327327__ZN7WebCore15DOMWrapperWorld15unregisterWorldEv
  • trunk/WebCore/html/HTMLMediaElement.cpp

    r66710 r66815  
    700700
    701701    // don't allow remote to local urls, and check with the frame loader client.
    702     if (!loader || !SecurityOrigin::canLoad(url, String(), document())) {
     702    if (!loader || !SecurityOrigin::canDisplay(url, String(), document())) {
    703703        if (actionIfInvalid == Complain)
    704704            FrameLoader::reportLocalLoadFailed(frame, url.string());
  • trunk/WebCore/loader/Cache.cpp

    r66037 r66815  
    107107        return 0;
    108108   
    109     if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canLoad(url, String(), docLoader->doc())) {
     109    if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), docLoader->doc())) {
    110110        Document* doc = docLoader->doc();
    111111        if (doc && !requestIsPreload)
  • trunk/WebCore/loader/FrameLoader.cpp

    r66794 r66815  
    12621262    ASSERT(frame()->document());
    12631263    if (SchemeRegistry::shouldTreatURLAsLocal(url.string()) && !isFeedWithNestedProtocolInHTTPFamily(url)) {
    1264         if (!SecurityOrigin::canLoad(url, String(), frame()->document()) && !SecurityOrigin::canLoad(url, referrer, 0)) {
     1264        if (!SecurityOrigin::canDisplay(url, String(), frame()->document()) && !SecurityOrigin::canDisplay(url, referrer, 0)) {
    12651265            FrameLoader::reportLocalLoadFailed(m_frame, url.string());
    12661266            return;
  • trunk/WebCore/loader/PingLoader.cpp

    r66083 r66815  
    4343void PingLoader::loadImage(Frame* frame, const KURL& url)
    4444{
    45     if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canLoad(url, String(), frame->document())) {
     45    if (SecurityOrigin::restrictAccessToLocal() && !SecurityOrigin::canDisplay(url, String(), frame->document())) {
    4646        FrameLoader::reportLocalLoadFailed(frame, url);
    4747        return;
  • trunk/WebCore/loader/SubframeLoader.cpp

    r66657 r66815  
    148148        completedURL = completeURL(url);
    149149
    150     if (!SecurityOrigin::canLoad(completedURL, String(), m_frame->document())) {
     150    if (!SecurityOrigin::canDisplay(completedURL, String(), m_frame->document())) {
    151151        FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
    152152        return 0;
     
    206206    if (!codeBaseURLString.isEmpty()) {
    207207        KURL codeBaseURL = completeURL(codeBaseURLString);
    208         if (!SecurityOrigin::canLoad(codeBaseURL, String(), element->document())) {
     208        if (!SecurityOrigin::canDisplay(codeBaseURL, String(), element->document())) {
    209209            FrameLoader::reportLocalLoadFailed(m_frame, codeBaseURL.string());
    210210            return 0;
     
    248248    }
    249249
    250     if (!SecurityOrigin::canLoad(url, String(), ownerElement->document())) {
     250    if (!SecurityOrigin::canDisplay(url, String(), ownerElement->document())) {
    251251        FrameLoader::reportLocalLoadFailed(m_frame, url.string());
    252252        return 0;
     
    337337        return false;
    338338
    339     if (!SecurityOrigin::canLoad(url, String(), document())) {
     339    if (!SecurityOrigin::canDisplay(url, String(), document())) {
    340340        FrameLoader::reportLocalLoadFailed(m_frame, url.string());
    341341        return false;
  • trunk/WebCore/loader/SubresourceLoader.cpp

    r63766 r66815  
    7474    if (securityCheck == DoSecurityCheck
    7575            && SecurityOrigin::restrictAccessToLocal()
    76             && !SecurityOrigin::canLoad(request.url(), String(), frame->document())) {
     76            && !SecurityOrigin::canDisplay(request.url(), String(), frame->document())) {
    7777        FrameLoader::reportLocalLoadFailed(frame, request.url().string());
    7878        return 0;
  • trunk/WebCore/page/SecurityOrigin.cpp

    r66537 r66815  
    285285}
    286286 
    287 bool SecurityOrigin::canLoad(const KURL& url, const String& referrer, Document* document)
     287bool SecurityOrigin::canDisplay(const KURL& url, const String& referrer, Document* document)
    288288{
    289289#if ENABLE(BLOB)
  • trunk/WebCore/page/SecurityOrigin.h

    r65077 r66815  
    8585    bool taintsCanvas(const KURL&) const;
    8686
    87     // Returns true for any non-local URL. If document parameter is supplied,
    88     // its local load policy dictates, otherwise if referrer is non-empty and
    89     // represents a local file, then the local load is allowed.
    90     static bool canLoad(const KURL&, const String& referrer, Document* document);
     87    // Returns true if |document| can display content from the given URL (e.g.,
     88    // in an iframe or as an image). For example, web sites generally cannot
     89    // display content from the user's files system. If |document| is 0,
     90    // |referrer| is used to make this determination.
     91    static bool canDisplay(const KURL&, const String& referrer, Document* document);
    9192
    9293    // Returns true if this SecurityOrigin can load local resources, such
  • trunk/WebCore/plugins/PluginView.cpp

    r65707 r66815  
    538538        if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
    539539            return NPERR_INVALID_PARAM;
    540     } else if (!SecurityOrigin::canLoad(url, String(), m_parentFrame->document()))
     540    } else if (!SecurityOrigin::canDisplay(url, String(), m_parentFrame->document()))
    541541            return NPERR_GENERIC_ERROR;
    542542
  • trunk/WebKit/mac/ChangeLog

    r66794 r66815  
     12010-09-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Rename SecurityOrigin::canLoad to canDisplay
     6        https://bugs.webkit.org/show_bug.cgi?id=45214
     7
     8        Propagate name change.
     9
     10        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
     11        (WebKit::NetscapePluginInstanceProxy::loadRequest):
     12        * Plugins/WebNetscapePluginStream.mm:
     13        (WebNetscapePluginStream::WebNetscapePluginStream):
     14        * Plugins/WebNetscapePluginView.mm:
     15        (-[WebNetscapePluginView loadRequest:inTarget:withNotifyData:sendNotification:]):
     16        * Plugins/WebPluginContainerCheck.mm:
     17        (-[WebPluginContainerCheck _isForbiddenFileLoad]):
     18        * WebView/WebFrame.mm:
     19        (-[WebFrame _allowsFollowingLink:]):
     20
    1212010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    222
  • trunk/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm

    r65697 r66815  
    763763        }
    764764    } else {
    765         if (!SecurityOrigin::canLoad(URL, String(), core([m_pluginView webFrame])->document()))
     765        if (!SecurityOrigin::canDisplay(URL, String(), core([m_pluginView webFrame])->document()))
    766766            return NPERR_GENERIC_ERROR;
    767767    }
  • trunk/WebKit/mac/Plugins/WebNetscapePluginStream.mm

    r62679 r66815  
    162162   
    163163    // This check has already been done by the plug-in view.
    164     ASSERT(SecurityOrigin::canLoad([request URL], String(), core([view webFrame])->document()));
     164    ASSERT(SecurityOrigin::canDisplay([request URL], String(), core([view webFrame])->document()));
    165165   
    166166    ASSERT([request URL]);
  • trunk/WebKit/mac/Plugins/WebNetscapePluginView.mm

    r66633 r66815  
    17291729        }
    17301730    } else {
    1731         if (!SecurityOrigin::canLoad(URL, String(), core([self webFrame])->document()))
     1731        if (!SecurityOrigin::canDisplay(URL, String(), core([self webFrame])->document()))
    17321732            return NPERR_GENERIC_ERROR;
    17331733    }
  • trunk/WebKit/mac/Plugins/WebPluginContainerCheck.mm

    r49212 r66815  
    100100   Frame* coreFrame = core([_controller webFrame]);
    101101   ASSERT(coreFrame);
    102    if (!SecurityOrigin::canLoad([_request URL], String(), coreFrame->document())) {
     102   if (!SecurityOrigin::canDisplay([_request URL], String(), coreFrame->document())) {
    103103       [self _continueWithPolicy:PolicyIgnore];
    104104       return YES;
  • trunk/WebKit/mac/WebView/WebFrame.mm

    r66721 r66815  
    12831283    if (!_private->coreFrame)
    12841284        return YES;
    1285     return SecurityOrigin::canLoad(URL, String(), _private->coreFrame->document());
     1285    return SecurityOrigin::canDisplay(URL, String(), _private->coreFrame->document());
    12861286}
    12871287
  • trunk/WebKit/win/ChangeLog

    r66794 r66815  
     12010-09-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Rename SecurityOrigin::canLoad to canDisplay
     6        https://bugs.webkit.org/show_bug.cgi?id=45214
     7
     8        Propagate name change.
     9
     10        * WebFrame.cpp:
     11        (WebFrame::allowsFollowingLink):
     12
    1132010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    214
  • trunk/WebKit/win/WebFrame.cpp

    r66794 r66815  
    13541354        return E_FAIL;
    13551355
    1356     *result = SecurityOrigin::canLoad(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
     1356    *result = SecurityOrigin::canDisplay(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
    13571357    return S_OK;
    13581358}
  • trunk/WebKit2/ChangeLog

    r66799 r66815  
     12010-09-06  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Rename SecurityOrigin::canLoad to canDisplay
     6        https://bugs.webkit.org/show_bug.cgi?id=45214
     7
     8        Propagate name change.
     9
     10        * WebProcess/Plugins/PluginView.cpp:
     11        (WebKit::PluginView::performFrameLoadURLRequest):
     12
    1132010-09-04  Sam Weinig  <sam@webkit.org>
    214
  • trunk/WebKit2/WebProcess/Plugins/PluginView.cpp

    r65817 r66815  
    516516
    517517    // Check if this is URL can be loaded.
    518     if (!SecurityOrigin::canLoad(request->request().url(), String(), m_pluginElement->document())) {
     518    if (!SecurityOrigin::canDisplay(request->request().url(), String(), m_pluginElement->document())) {
    519519        // We can't load the request, send back a reply to the plug-in.
    520520        m_plugin->frameDidFail(request->requestID(), false);
Note: See TracChangeset for help on using the changeset viewer.