[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

jianli at chromium.org jianli at chromium.org
Thu Apr 8 02:22:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 189823e5c7144f47b3b651b698b408ce9a6d1f74
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 15 17:27:25 2010 +0000

    [v8] Add V8 bindings for DOMFormData.
    https://bugs.webkit.org/show_bug.cgi?id=36026
    
    Reviewed by Nate Chapin.
    
    Test: http/tests/local/send-form-data.html
    
    * Android.v8bindings.mk:
    * WebCore.gypi:
    * bindings/v8/V8Index.h:
    * bindings/v8/custom/V8DOMFormDataCustom.cpp: Added.
    * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
    (WebCore::V8XMLHttpRequest::sendCallback):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56004 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk
index 8e0a16c..4bdd78e 100644
--- a/WebCore/Android.v8bindings.mk
+++ b/WebCore/Android.v8bindings.mk
@@ -104,6 +104,7 @@ LOCAL_SRC_FILES += \
 	bindings/v8/custom/V8CustomSQLTransactionCallback.cpp \
 	bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp \
 	bindings/v8/custom/V8CustomVoidCallback.cpp \
+  bindings/v8/custom/V8DOMFormDataCustom.cpp \
 	bindings/v8/custom/V8DOMSelectionCustom.cpp \
 	bindings/v8/custom/V8DOMWindowCustom.cpp \
 	bindings/v8/custom/V8DataGridColumnListCustom.cpp \
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9243212..1656dc8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,21 @@
 2010-03-15  Jian Li  <jianli at chromium.org>
 
+        Reviewed by Nate Chapin.
+
+        [v8] Add V8 bindings for DOMFormData.
+        https://bugs.webkit.org/show_bug.cgi?id=36026
+
+        Test: http/tests/local/send-form-data.html
+
+        * Android.v8bindings.mk:
+        * WebCore.gypi:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8DOMFormDataCustom.cpp: Added.
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::sendCallback):
+
+2010-03-15  Jian Li  <jianli at chromium.org>
+
         Reviewed by Sam Weinig.
 
         Add DOMFormData.idl to expose FormData interface.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 80c5d60..8e6fa3a 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -106,6 +106,7 @@
             'html/canvas/WebGLTexture.idl',
             'html/DataGridColumn.idl',
             'html/DataGridColumnList.idl',
+            'html/DOMFormData.idl',
             'html/File.idl',
             'html/FileList.idl',
             'html/HTMLAllCollection.idl',
@@ -720,6 +721,7 @@
             'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
             'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
             'bindings/v8/custom/V8DocumentLocationCustom.cpp',
+            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
             'bindings/v8/custom/V8DOMSelectionCustom.cpp',
             'bindings/v8/custom/V8DOMWindowCustom.cpp',
             'bindings/v8/custom/V8DocumentCustom.cpp',
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index 969a495..ff9f2d8 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -363,6 +363,7 @@ static const int v8DefaultWrapperInternalFieldCount = 2;
     V(CSSVARIABLESDECLARATION, CSSVariablesDeclaration)                 \
     V(CSSVARIABLESRULE, CSSVariablesRule)                               \
     V(DOMCOREEXCEPTION, DOMCoreException)                               \
+    V(DOMFORMDATA, DOMFormData)                                         \
     V(DOMIMPLEMENTATION, DOMImplementation)                             \
     V(DOMPARSER, DOMParser)                                             \
     V(DOMSELECTION, DOMSelection)                                       \
diff --git a/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
new file mode 100644
index 0000000..8a39332
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8DOMFormData.h"
+
+#include "DOMFormData.h"
+#include "V8Binding.h"
+#include "V8Blob.h"
+#include "V8Proxy.h"
+#include "V8Utilities.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.FormData.append()");
+    
+    if (args.Length() < 2)
+        return throwError("Not enough arguments", V8Proxy::SyntaxError);
+
+    DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder());
+
+    String name = toWebCoreStringWithNullCheck(args[0]);
+
+    v8::Handle<v8::Value> arg = args[1];
+    if (V8Blob::HasInstance(arg)) {
+        v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+        Blob* blob = V8Blob::toNative(object);
+        ASSERT(blob);
+        domFormData->append(name, blob);
+    } else
+        domFormData->append(name, toWebCoreStringWithNullCheck(arg));
+
+    return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index dce2d21..dff37f7 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -34,6 +34,7 @@
 #include "Frame.h"
 #include "V8Binding.h"
 #include "V8Blob.h"
+#include "V8DOMFormData.h"
 #include "V8Document.h"
 #include "V8HTMLDocument.h"
 #include "V8Proxy.h"
@@ -123,6 +124,11 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
             Blob* blob = V8Blob::toNative(object);
             ASSERT(blob);
             xmlHttpRequest->send(blob, ec);
+        } else if (V8DOMFormData::HasInstance(arg)) {
+            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
+            DOMFormData* domFormData = V8DOMFormData::toNative(object);
+            ASSERT(domFormData);
+            xmlHttpRequest->send(domFormData, ec);
         } else
             xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec);
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list