Title: [104001] trunk/Source/WebCore
Revision
104001
Author
[email protected]
Date
2012-01-03 19:34:18 -0800 (Tue, 03 Jan 2012)

Log Message

[BlackBerry] Add support of blob form data to the BlackBerry port
https://bugs.webkit.org/show_bug.cgi?id=75218

Pass FormDataElement::encodedBlob type of form data to the BlackBerry
platform request to support blob data and blob file range.

Reviewed by George Staikos.

The port can't be built now, no new tests so far.

* platform/network/blackberry/ResourceRequestBlackBerry.cpp:
(WebCore::ResourceRequest::initializePlatformRequest):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104000 => 104001)


--- trunk/Source/WebCore/ChangeLog	2012-01-04 02:57:43 UTC (rev 104000)
+++ trunk/Source/WebCore/ChangeLog	2012-01-04 03:34:18 UTC (rev 104001)
@@ -1,3 +1,18 @@
+2012-01-03  Leo Yang  <[email protected]>
+
+        [BlackBerry] Add support of blob form data to the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=75218
+
+        Pass FormDataElement::encodedBlob type of form data to the BlackBerry
+        platform request to support blob data and blob file range.
+
+        Reviewed by George Staikos.
+
+        The port can't be built now, no new tests so far.
+
+        * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
+        (WebCore::ResourceRequest::initializePlatformRequest):
+
 2012-01-03  Adam Barth  <[email protected]>
 
         Two null crashes in Treebuilder

Modified: trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp (104000 => 104001)


--- trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp	2012-01-04 02:57:43 UTC (rev 104000)
+++ trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp	2012-01-04 03:34:18 UTC (rev 104001)
@@ -19,6 +19,7 @@
 #include "config.h"
 #include "ResourceRequest.h"
 
+#include "BlobRegistryImpl.h"
 #include <BlackBerryPlatformClient.h>
 #include <network/NetworkRequest.h>
 #include <wtf/text/CString.h>
@@ -108,8 +109,20 @@
                     else if (element.m_type == FormDataElement::encodedFile)
                         platformRequest.addMultipartFilename(element.m_filename.characters(), element.m_filename.length());
 #if ENABLE(BLOB)
-                    else if (element.m_type == FormDataElement::encodedBlob)
-                        continue; // We don't support blob now!
+                    else if (element.m_type == FormDataElement::encodedBlob) {
+                        RefPtr<BlobStorageData> blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(KURL(ParsedURLString, element.m_blobURL));
+                        if (blobData) {
+                            for (size_t j = 0; j < blobData->items().size(); ++j) {
+                                const BlobDataItem& blobItem = blobData->items()[j];
+                                if (blobItem.type == BlobDataItem::Data)
+                                    platformRequest.addMultipartData(blobItem.data->data() + static_cast<int>(blobItem.offset), static_cast<int>(blobItem.length));
+                                else {
+                                    ASSERT(blobItem.type == BlobDataItem::File);
+                                    platformRequest.addMultipartFilename(blobItem.path.characters(), blobItem.path.length(), blobItem.offset, blobItem.length, blobItem.expectedModificationTime);
+                                }
+                            }
+                        }
+                    }
 #endif
                     else
                         ASSERT_NOT_REACHED(); // unknown type
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to