WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-87965-20120611202847.patch (text/plain), 5.75 KB, created by
Charles Wei
on 2012-06-11 05:28:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Charles Wei
Created:
2012-06-11 05:28:47 PDT
Size:
5.75 KB
patch
obsolete
>Subversion Revision: 119971 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5cc2a36eb7b12814b132975ba3cc3950bcc53548..e1bb6a7cdff59af6f692d6b53c65c778460e0d5e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2012-06-11 Charles Wei <charles.wei@torchmobile.com.cn> >+ >+ Need customized toDOMStringList for IndexedDB JSC binding. >+ https://bugs.webkit.org/show_bug.cgi?id=87965 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ IndexedDB database interface uses DOMStringList as the input parameter. >+ The generated toDOMStringList() can't convert an JSArry of Strings to >+ native DOMStringList. We need a custom function to do this. >+ >+ * UseJSC.cmake: >+ * bindings/js/JSDOMStringListCustom.cpp: Added. >+ (WebCore): >+ (WebCore::toDOMStringList): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateHeader): >+ (JSValueToNative): >+ * dom/DOMStringList.idl: >+ > 2012-06-11 Csaba Osztrogonác <ossy@webkit.org> > > [Qt][Win] Fix UString related build problem in Source/WebCore/bridge/qt/qt_instance.cpp >diff --git a/Source/WebCore/UseJSC.cmake b/Source/WebCore/UseJSC.cmake >index 2015e3b7cd587083d097b4b404fdcbcb395f2085..f7148f273556289ee6d7fb866e55ab1e6305a678 100644 >--- a/Source/WebCore/UseJSC.cmake >+++ b/Source/WebCore/UseJSC.cmake >@@ -57,6 +57,7 @@ LIST(APPEND WebCore_SOURCES > bindings/js/JSDOMMimeTypeArrayCustom.cpp > bindings/js/JSDOMPluginArrayCustom.cpp > bindings/js/JSDOMPluginCustom.cpp >+ bindings/js/JSDOMStringListCustom.cpp > bindings/js/JSDOMStringMapCustom.cpp > bindings/js/JSDOMTokenListCustom.cpp > bindings/js/JSDOMWindowBase.cpp >diff --git a/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp b/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..5bd7cf5ba4d6faf69c78c0198e95ab8385b18fb0 >--- /dev/null >+++ b/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp >@@ -0,0 +1,40 @@ >+/* >+ * Copyright (C) 2012 Research In Motion Limited. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "JSDOMStringList.h" >+ >+using namespace JSC; >+ >+namespace WebCore { >+ >+PassRefPtr<DOMStringList> toDOMStringList(ExecState* exec, JSValue value) >+{ >+ if (!value.inherits(&JSArray::s_info)) >+ return 0; >+ >+ JSArray* array = asArray(value); >+ RefPtr<DOMStringList> stringList = DOMStringList::create(); >+ for (int i = 0; i < array->length(); i++) >+ stringList->append(ustringToString(array->getIndex(i).toString(exec)->value(exec))); >+ >+ return stringList.release(); >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 37e4f1cd08fe3b4c6c95173a7343dda105dd316e..cb0afced43dcab25ff4585f1de83a182d560dbba 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -1020,7 +1020,9 @@ sub GenerateHeader > if (!$hasParent || $dataNode->extendedAttributes->{"JSGenerateToNativeObject"}) { > if ($interfaceName eq "NodeFilter") { > push(@headerContent, "PassRefPtr<NodeFilter> toNodeFilter(JSC::JSGlobalData&, JSC::JSValue);\n"); >- } else { >+ } elsif($interfaceName eq "DOMStringList") { >+ push(@headerContent, "PassRefPtr<DOMStringList> toDOMStringList(JSC::ExecState*, JSC::JSValue);\n"); >+ }else { > push(@headerContent, "$implType* to${interfaceName}(JSC::JSValue);\n"); > } > } >@@ -2825,7 +2827,8 @@ my %nativeType = ( > "CompareHow" => "Range::CompareHow", > "DOMString" => "const String&", > # FIXME: Add proper support for T[], T[]?, sequence<T> >- "DOMString[]" => "DOMStringList*", >+ "DOMString[]" => "RefPtr<DOMStringList>", >+ "DOMStringList" => "RefPtr<DOMStringList>", > "DOMObject" => "ScriptValue", > "NodeFilter" => "RefPtr<NodeFilter>", > "SerializedScriptValue" => "RefPtr<SerializedScriptValue>", >@@ -2981,7 +2984,12 @@ sub JSValueToNative > > if ($type eq "DOMString[]") { > AddToImplIncludes("JSDOMStringList.h", $conditional); >- return "toDOMStringList($value)"; >+ return "toDOMStringList(exec, $value)"; >+ } >+ >+ if ($type eq "DOMStringList") { >+ AddToImplIncludes("JSDOMStringList.h", $conditional); >+ return "toDOMStringList(exec, $value)"; > } > > if ($type eq "unsigned long[]") { >diff --git a/Source/WebCore/dom/DOMStringList.idl b/Source/WebCore/dom/DOMStringList.idl >index 8f059ae2b036921f22c248e8ceb1a700f6656c56..5bef887bc8a71f5441c2a381aa5ac3b318b121c0 100644 >--- a/Source/WebCore/dom/DOMStringList.idl >+++ b/Source/WebCore/dom/DOMStringList.idl >@@ -26,7 +26,8 @@ > module core { > > interface [ >- IndexedGetter >+ IndexedGetter, >+ JSCustomToNativeObject > ] DOMStringList { > readonly attribute unsigned long length; > [TreatReturnedNullStringAs=Null] DOMString item(in [IsIndex,Optional=DefaultIsUndefined] unsigned long index);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 87965
:
146836
|
146992
|
147016
|
147030
|
147039
|
147041
|
147069
|
147260