Changeset 106810 in webkit
- Timestamp:
- Feb 6, 2012 8:39:23 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106809 r106810 1 2012-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 1 20 2012-02-06 Alexander Pavlov <apavlov@chromium.org> 2 21 -
trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
r106802 r106810 158 158 } 159 159 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 160 void NetworkJob::loadAboutURL() 161 { 182 162 m_loadAboutTimer.startOneShot(0); 183 return true;184 163 } 185 164 … … 980 959 } 981 960 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 } 989 973 } 990 974 -
trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h
r106307 r106810 61 61 bool clientIsOk() const { return !m_cancelled && m_handle && m_handle->client(); } 62 62 void loadDataURL() { m_loadDataTimer.startOneShot(0); } 63 boolloadAboutURL();63 void loadAboutURL(); 64 64 int cancelJob(); 65 65 bool isDeferringLoading() const { return m_deferLoadingCount > 0; } -
trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
r106307 r106810 151 151 152 152 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 153 // If the protocol matches "about", loadAboutURL should recognize and handle it. 154 networkJob->loadAboutURL(); 155 return true; 156 156 } 157 157
Note: See TracChangeset
for help on using the changeset viewer.