Changeset 106810 in webkit


Ignore:
Timestamp:
Feb 6, 2012 8:39:23 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Blackberry] Non-supported about: operations never stops loading
https://bugs.webkit.org/show_bug.cgi?id=76366

Patch by Chris Guan <chris.guan@torchmobile.com.cn> on 2012-02-06
Reviewed by Rob Buis.

If user typed a non-supported "about:" scheme such as "about:nonsupport",
the loadAboutURL() function in NetworkManger should recognize and handle it as
an error of invalid url.

  • platform/network/blackberry/NetworkJob.cpp:

(WebCore::NetworkJob::loadAboutURL):
(WebCore::NetworkJob::handleAbout):

  • platform/network/blackberry/NetworkJob.h:

(NetworkJob):

  • platform/network/blackberry/NetworkManager.cpp:

(WebCore::NetworkManager::startJob):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106809 r106810  
     12012-02-06  Chris Guan  <chris.guan@torchmobile.com.cn>
     2
     3        [Blackberry] Non-supported about: operations never stops loading
     4        https://bugs.webkit.org/show_bug.cgi?id=76366
     5
     6        Reviewed by Rob Buis.
     7
     8        If user typed a non-supported "about:" scheme such as "about:nonsupport",
     9        the loadAboutURL() function in NetworkManger should recognize and handle it as
     10        an error of invalid url.
     11
     12        * platform/network/blackberry/NetworkJob.cpp:
     13        (WebCore::NetworkJob::loadAboutURL):
     14        (WebCore::NetworkJob::handleAbout):
     15        * platform/network/blackberry/NetworkJob.h:
     16        (NetworkJob):
     17        * platform/network/blackberry/NetworkManager.cpp:
     18        (WebCore::NetworkManager::startJob):
     19
    1202012-02-06  Alexander Pavlov  <apavlov@chromium.org>
    221
  • trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp

    r106802 r106810  
    158158}
    159159
    160 bool NetworkJob::loadAboutURL()
    161 {
    162     // First 6 chars are "about:".
    163     String aboutWhat(m_response.url().string().substring(6));
    164 
    165     if (!aboutWhat.isEmpty()
    166             && !equalIgnoringCase(aboutWhat, "blank")
    167             && !equalIgnoringCase(aboutWhat, "credits")
    168 #if !defined(PUBLIC_BUILD) || !PUBLIC_BUILD
    169             && !aboutWhat.startsWith("cache?query=", false)
    170             && !equalIgnoringCase(aboutWhat, "cache")
    171             && !equalIgnoringCase(aboutWhat, "cache/enable")
    172             && !equalIgnoringCase(aboutWhat, "cache/disable")
    173             && !equalIgnoringCase(aboutWhat, "version")
    174             && (!BlackBerry::Platform::debugSetting()
    175                 || (!equalIgnoringCase(aboutWhat, "config")
    176                     && !equalIgnoringCase(aboutWhat, "build")
    177                     && !equalIgnoringCase(aboutWhat, "memory")))
    178 #endif
    179             )
    180         return false;
    181 
     160void NetworkJob::loadAboutURL()
     161{
    182162    m_loadAboutTimer.startOneShot(0);
    183     return true;
    184163}
    185164
     
    980959    }
    981960
    982     CString resultString = result.utf8();
    983 
    984     notifyStatusReceived(handled ? 404 : 200, 0);
    985     notifyStringHeaderReceived("Content-Length", String::number(resultString.length()));
    986     notifyStringHeaderReceived("Content-Type", "text/html");
    987     notifyDataReceivedPlain(resultString.data(), resultString.length());
    988     notifyClose(BlackBerry::Platform::FilterStream::StatusSuccess);
     961    if (handled) {
     962        CString resultString = result.utf8();
     963        notifyStatusReceived(404, 0);
     964        notifyStringHeaderReceived("Content-Length", String::number(resultString.length()));
     965        notifyStringHeaderReceived("Content-Type", "text/html");
     966        notifyDataReceivedPlain(resultString.data(), resultString.length());
     967        notifyClose(BlackBerry::Platform::FilterStream::StatusSuccess);
     968    } else {
     969        // If we can not handle it, we take it as an error of invalid URL.
     970        notifyStatusReceived(BlackBerry::Platform::FilterStream::StatusErrorInvalidUrl, 0);
     971        notifyClose(BlackBerry::Platform::FilterStream::StatusErrorInvalidUrl);
     972    }
    989973}
    990974
  • trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h

    r106307 r106810  
    6161    bool clientIsOk() const { return !m_cancelled && m_handle && m_handle->client(); }
    6262    void loadDataURL() { m_loadDataTimer.startOneShot(0); }
    63     bool loadAboutURL();
     63    void loadAboutURL();
    6464    int cancelJob();
    6565    bool isDeferringLoading() const { return m_deferLoadingCount > 0; }
  • trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp

    r106307 r106810  
    151151
    152152    if (url.protocolIs("about")) {
    153         // Try to handle the url internally; if it isn't recognized, continue and pass it to the client.
    154         if (networkJob->loadAboutURL())
    155             return true;
     153        // If the protocol matches "about", loadAboutURL should recognize and handle it.
     154        networkJob->loadAboutURL();
     155        return true;
    156156    }
    157157
Note: See TracChangeset for help on using the changeset viewer.