Title: [122604] trunk/Source/WebCore
- Revision
- 122604
- Author
- [email protected]
- Date
- 2012-07-13 10:39:59 -0700 (Fri, 13 Jul 2012)
Log Message
[BlackBerry] Some small changes in network code
https://bugs.webkit.org/show_bug.cgi?id=90974
Reviewed by Rob Buis.
1. Set status in NetworkJob/SocketStreamHandleBlackBerry so that
its wrapped stream can also query the stream result.
2. pass download attribute to NetworkRequest.
RIM PR# 171555
Reviewed internally by Lyon Chen and Joe Mason.
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyClose):
* platform/network/blackberry/NetworkJob.h:
(WebCore::NetworkJob::status):
* platform/network/blackberry/ResourceRequestBlackBerry.cpp:
(WebCore::platformTargetTypeForRequest):
* platform/network/blackberry/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::status):
(SocketStreamHandle):
* platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
(WebCore::SocketStreamHandle::notifyStatusReceived):
(WebCore::SocketStreamHandle::notifyClose):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (122603 => 122604)
--- trunk/Source/WebCore/ChangeLog 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/ChangeLog 2012-07-13 17:39:59 UTC (rev 122604)
@@ -1,3 +1,30 @@
+2012-07-13 Mary Wu <[email protected]>
+
+ [BlackBerry] Some small changes in network code
+ https://bugs.webkit.org/show_bug.cgi?id=90974
+
+ Reviewed by Rob Buis.
+
+ 1. Set status in NetworkJob/SocketStreamHandleBlackBerry so that
+ its wrapped stream can also query the stream result.
+ 2. pass download attribute to NetworkRequest.
+
+ RIM PR# 171555
+ Reviewed internally by Lyon Chen and Joe Mason.
+
+ * platform/network/blackberry/NetworkJob.cpp:
+ (WebCore::NetworkJob::handleNotifyClose):
+ * platform/network/blackberry/NetworkJob.h:
+ (WebCore::NetworkJob::status):
+ * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
+ (WebCore::platformTargetTypeForRequest):
+ * platform/network/blackberry/SocketStreamHandle.h:
+ (WebCore::SocketStreamHandle::status):
+ (SocketStreamHandle):
+ * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
+ (WebCore::SocketStreamHandle::notifyStatusReceived):
+ (WebCore::SocketStreamHandle::notifyClose):
+
2012-07-13 Vsevolod Vlasov <[email protected]>
Web Inspector: Remove uiSourceCode from Resource.
Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp (122603 => 122604)
--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp 2012-07-13 17:39:59 UTC (rev 122604)
@@ -481,7 +481,8 @@
sendResponseIfNeeded();
if (isClientAvailable()) {
-
+ if (isError(status))
+ m_extendedStatusCode = status;
RecursionGuard guard(m_callingClient);
if (shouldNotifyClientFailed()) {
String domain = m_extendedStatusCode < 0 ? ResourceError::platformErrorDomain : ResourceError::httpErrorDomain;
Modified: trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h (122603 => 122604)
--- trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h 2012-07-13 17:39:59 UTC (rev 122604)
@@ -80,6 +80,7 @@
void handleNotifyDataSent(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
virtual void notifyClose(int status);
void handleNotifyClose(int status);
+ virtual int status() const { return m_extendedStatusCode; }
private:
bool isClientAvailable() const { return !m_cancelled && m_handle && m_handle->client(); }
Modified: trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp (122603 => 122604)
--- trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp 2012-07-13 17:39:59 UTC (rev 122604)
@@ -55,6 +55,8 @@
{
if (request.isXMLHTTPRequest())
return NetworkRequest::TargetIsXMLHTTPRequest;
+ if (request.forceDownload())
+ return NetworkRequest::TargetIsDownload;
switch (request.targetType()) {
case ResourceRequest::TargetIsMainFrame:
Modified: trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandle.h (122603 => 122604)
--- trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandle.h 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandle.h 2012-07-13 17:39:59 UTC (rev 122604)
@@ -57,6 +57,7 @@
virtual void notifyDataReceived(BlackBerry::Platform::NetworkBuffer*);
virtual void notifyReadyToSendData();
virtual void notifyClose(int status);
+ virtual int status() const { return m_status; }
protected:
virtual int platformSend(const char* data, int length);
@@ -66,6 +67,7 @@
SocketStreamHandle(const String& groupName, const KURL&, SocketStreamHandleClient*);
OwnPtr<BlackBerry::Platform::FilterStream> m_socketStream;
+ int m_status;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp (122603 => 122604)
--- trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp 2012-07-13 17:32:41 UTC (rev 122603)
+++ trunk/Source/WebCore/platform/network/blackberry/SocketStreamHandleBlackBerry.cpp 2012-07-13 17:39:59 UTC (rev 122604)
@@ -105,7 +105,7 @@
// The client can close the handle, potentially removing the last reference.
RefPtr<SocketStreamHandle> protect(this);
-
+ m_status = status;
if (FilterStream::StatusSuccess != status)
m_client->didFailSocketStream(this, SocketStreamError(status));
else {
@@ -135,6 +135,9 @@
// The client can close the handle, potentially removing the last reference.
RefPtr<SocketStreamHandle> protect(this);
+ if (status < 0 || (400 <= status && status < 600))
+ m_status = status;
+
if (FilterStream::StatusSuccess != status)
m_client->didFailSocketStream(this, SocketStreamError(status));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes