+2012-03-31 Jason Liu <jason.liu@torchmobile.com.cn>
+
+ [BlackBerry] Refactor : NetworkJob::handleNotifyHeaderReceived.
+ https://bugs.webkit.org/show_bug.cgi?id=82825
+
+ We should use "else if" to decrease string's compare.
+
+ Reviewed by Rob Buis.
+
+ No new tests. Refactor.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::handleNotifyHeaderReceived):
+
2012-03-31 Charles Wei <charles.wei@torchmobile.com.cn>
[BlackBerry] Upstream local change of PlatformKeyboardEventBlackBerry.cpp
String lowerKey = key.lower();
if (lowerKey == "content-type")
m_contentType = value.lower();
-
- if (lowerKey == "content-disposition")
+ else if (lowerKey == "content-disposition")
m_contentDisposition = value;
-
- if (lowerKey == "set-cookie") {
+ else if (lowerKey == "set-cookie") {
// FIXME: If a tab is closed, sometimes network data will come in after the frame has been detached from its page but before it is deleted.
// If this happens, m_frame->page() will return 0, and m_frame->loader()->client() will be in a bad state and calling into it will crash.
// For now we check for this explicitly by checking m_frame->page(). But we should find out why the network job hasn't been cancelled when the frame was detached.
m_response.setHTTPHeaderField(key, m_response.httpHeaderField(key) + "\r\n" + value);
return;
}
- }
-
- if (lowerKey == "www-authenticate")
+ } else if (lowerKey == "www-authenticate")
handleAuthHeader(ProtectionSpaceServerHTTP, value);
else if (lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty())
handleAuthHeader(ProtectionSpaceProxyHTTP, value);
-
- if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP))
+ else if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP))
handleFTPHeader(value);
m_response.setHTTPHeaderField(key, value);