<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[45559] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/45559">45559</a></dd>
<dt>Author</dt> <dd>japhet@chromium.org</dd>
<dt>Date</dt> <dd>2009-07-06 10:38:30 -0700 (Mon, 06 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-07-06  Nate Chapin  &lt;japhet@chromium.org&gt;

        Reviewed by David Levin.

        Upstream V8Binding and update some function names.

        https://bugs.webkit.org/show_bug.cgi?id=26857</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorebindingsscriptsCodeGeneratorV8pm">trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm</a></li>
<li><a href="#trunkWebCorebindingsv8V8Bindingh">trunk/WebCore/bindings/v8/V8Binding.h</a></li>
<li><a href="#trunkWebCorebindingsv8V8LazyEventListenercpp">trunk/WebCore/bindings/v8/V8LazyEventListener.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8V8Proxycpp">trunk/WebCore/bindings/v8/V8Proxy.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8WorkerContextExecutionProxycpp">trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8CSSStyleDeclarationCustomcpp">trunk/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8CanvasRenderingContext2DCustomcpp">trunk/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8CustomXPathNSResolvercpp">trunk/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8DOMWindowCustomcpp">trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8HTMLCanvasElementCustomcpp">trunk/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8HTMLIFrameElementCustomcpp">trunk/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8HTMLOptionsCollectionCustomcpp">trunk/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8HTMLSelectElementCustomcpp">trunk/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8SQLTransactionCustomcpp">trunk/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8WorkerContextCustomcpp">trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8customV8XMLHttpRequestCustomcpp">trunk/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCorebindingsv8V8Bindingcpp">trunk/WebCore/bindings/v8/V8Binding.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/ChangeLog        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2009-07-06  Nate Chapin  &lt;japhet@chromium.org&gt;
+
+        Reviewed by David Levin.
+
+        Upstream V8Binding and update some function names.
+
+        https://bugs.webkit.org/show_bug.cgi?id=26857
+
+        * bindings/scripts/CodeGeneratorV8.pm: Update function names in auto-generated files.
+        * bindings/v8/V8Binding.cpp: Upstreamed from src.chromium.org.
+        * bindings/v8/V8Binding.h: Upstreamed from src.chromium.org.
+        * bindings/v8/V8LazyEventListener.cpp:
+        (WebCore::V8LazyEventListener::getListenerFunction):
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::handleConsoleMessage):
+        (WebCore::V8Proxy::compileScript):
+        (WebCore::V8Proxy::sourceName):
+        * bindings/v8/WorkerContextExecutionProxy.cpp:
+        (WebCore::handleConsoleMessage):
+        * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
+        (WebCore::NAMED_PROPERTY_SETTER):
+        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+        * bindings/v8/custom/V8CustomXPathNSResolver.cpp:
+        (WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+        * bindings/v8/custom/V8HTMLIFrameElementCustom.cpp:
+        (WebCore::ACCESSOR_SETTER):
+        * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
+        (WebCore::removeElement):
+        * bindings/v8/custom/V8SQLTransactionCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        (WebCore::SetTimeoutOrInterval):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::CALLBACK_FUNC_DECL):
+
</ins><span class="cx"> 2009-07-06  Gustavo Noronha Silva  &lt;gustavo.noronha@collabora.co.uk&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Jan Alonzo.
</span></span></pre></div>
<a id="trunkWebCorebindingsscriptsCodeGeneratorV8pm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -562,7 +562,7 @@
</span><span class="cx">             $getterString = &quot;imp_instance&quot;;
</span><span class="cx">         }
</span><span class="cx">         if ($nativeType eq &quot;String&quot;) {
</span><del>-            $getterString = &quot;ToString($getterString)&quot;;
</del><ins>+            $getterString = &quot;toString($getterString)&quot;;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         my $result;
</span><span class="lines">@@ -1053,7 +1053,7 @@
</span><span class="cx">     push(@implFixedHeader,
</span><span class="cx">          &quot;#include \&quot;config.h\&quot;\n&quot; .
</span><span class="cx">          &quot;#include \&quot;V8Proxy.h\&quot;\n&quot; .
</span><del>-         &quot;#include \&quot;v8_binding.h\&quot;\n\n&quot; .
</del><ins>+         &quot;#include \&quot;V8Binding.h\&quot;\n\n&quot; .
</ins><span class="cx">          &quot;#undef LOG\n\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     my $conditionalString;
</span><span class="lines">@@ -1799,15 +1799,15 @@
</span><span class="cx">     return &quot;static_cast&lt;$type&gt;($value-&gt;NumberValue())&quot; if $type eq &quot;float&quot; or $type eq &quot;double&quot;;
</span><span class="cx">     return &quot;$value-&gt;NumberValue()&quot; if $type eq &quot;SVGNumber&quot;;
</span><span class="cx"> 
</span><del>-    return &quot;ToInt32($value${maybeOkParam})&quot; if $type eq &quot;unsigned long&quot; or $type eq &quot;unsigned short&quot; or $type eq &quot;long&quot;;
</del><ins>+    return &quot;toInt32($value${maybeOkParam})&quot; if $type eq &quot;unsigned long&quot; or $type eq &quot;unsigned short&quot; or $type eq &quot;long&quot;;
</ins><span class="cx">     return &quot;static_cast&lt;Range::CompareHow&gt;($value-&gt;Int32Value())&quot; if $type eq &quot;CompareHow&quot;;
</span><span class="cx">     return &quot;static_cast&lt;SVGPaint::SVGPaintType&gt;($value-&gt;ToInt32()-&gt;Int32Value())&quot; if $type eq &quot;SVGPaintType&quot;;
</span><span class="cx"> 
</span><del>-    return &quot;ToWebCoreString($value)&quot; if $type eq &quot;AtomicString&quot; or $type eq &quot;DOMUserData&quot;;
</del><ins>+    return &quot;toWebCoreString($value)&quot; if $type eq &quot;AtomicString&quot; or $type eq &quot;DOMUserData&quot;;
</ins><span class="cx">     if ($type eq &quot;DOMString&quot;) {
</span><del>-        return &quot;valueToStringWithNullCheck($value)&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;ConvertNullToNullString&quot;};
-        return &quot;valueToStringWithNullOrUndefinedCheck($value)&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;ConvertUndefinedOrNullToNullString&quot;};
-        return &quot;ToWebCoreString($value)&quot;;
</del><ins>+        return &quot;toWebCoreStringWithNullCheck($value)&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;ConvertNullToNullString&quot;};
+        return &quot;toWebCoreStringWithNullOrUndefinedCheck($value)&quot; if $signature-&gt;extendedAttributes-&gt;{&quot;ConvertUndefinedOrNullToNullString&quot;};
+        return &quot;toWebCoreString($value)&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($type eq &quot;NodeFilter&quot;) {
</span></span></pre></div>
<a id="trunkWebCorebindingsv8V8Bindingcpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/v8/V8Binding.cpp (0 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/V8Binding.cpp                                (rev 0)
+++ trunk/WebCore/bindings/v8/V8Binding.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -0,0 +1,154 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 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
+ * &quot;AS IS&quot; 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 &quot;config.h&quot;
+#include &quot;V8Binding.h&quot;
+
+#include &quot;AtomicString.h&quot;
+#include &quot;CString.h&quot;
+#include &quot;MathExtras.h&quot;
+#include &quot;PlatformString.h&quot;
+#include &quot;StringBuffer.h&quot;
+
+#include &lt;v8.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+
+namespace WebCore {
+
+// WebCoreStringResource is a helper class for v8ExternalString. It is used
+// to manage the life-cycle of the underlying buffer of the external string.
+class WebCoreStringResource : public v8::String::ExternalStringResource {
+public:
+    explicit WebCoreStringResource(const String&amp; string)
+        : m_impl(string.impl())
+    {
+    }
+
+    virtual ~WebCoreStringResource() { }
+
+    const uint16_t* data() const
+    {
+        return reinterpret_cast&lt;const uint16_t*&gt;(m_impl.characters());
+    }
+
+    size_t length() const { return m_impl.length(); }
+
+    String webcoreString() { return m_impl; }
+
+private:
+    // A shallow copy of the string. Keeps the string buffer alive until the V8 engine garbage collects it.
+    String m_impl;
+};
+
+String v8StringToWebCoreString(v8::Handle&lt;v8::String&gt; v8String, bool externalize)
+{
+    WebCoreStringResource* stringResource = static_cast&lt;WebCoreStringResource*&gt;(v8String-&gt;GetExternalStringResource());
+    if (stringResource)
+        return stringResource-&gt;webcoreString();
+
+    int length = v8String-&gt;Length();
+    if (!length) {
+        // Avoid trying to morph empty strings, as they do not have enough room to contain the external reference.
+        return StringImpl::empty();
+    }
+
+    UChar* buffer;
+    String result = String::createUninitialized(length, buffer);
+    v8String-&gt;Write(reinterpret_cast&lt;uint16_t*&gt;(buffer), 0, length);
+
+    if (externalize) {
+        WebCoreStringResource* resource = new WebCoreStringResource(result);
+        if (!v8String-&gt;MakeExternal(resource)) {
+            // In case of a failure delete the external resource as it was not used.
+            delete resource;
+        }
+    }
+    return result;
+}
+
+String v8ValueToWebCoreString(v8::Handle&lt;v8::Value&gt; object)
+{
+    if (object-&gt;IsString()) 
+        return v8StringToWebCoreString(v8::Handle&lt;v8::String&gt;::Cast(object), true);
+
+    if (object-&gt;IsInt32()) {
+        int value = object-&gt;Int32Value();
+        // Most numbers used are &lt;= 100. Even if they aren't used there's very little in using the space.
+        const int kLowNumbers = 100;
+        DEFINE_STATIC_LOCAL(AtomicString*, lowNumbers, [kLowNumbers + 1]);
+        String webCoreString;
+        if (0 &lt;= value &amp;&amp; value &lt;= kLowNumbers) {
+            webCoreString = lowNumbers[value];
+            if (!webCoreString) {
+                AtomicString valueString = AtomicString(String::number(value));
+                lowNumbers[value] = valueString;
+                webCoreString = valueString;
+            }
+        } else 
+            webCoreString = String::number(value);
+        return webCoreString;
+    }
+
+    v8::TryCatch block;
+    v8::Handle&lt;v8::String&gt; v8String = object-&gt;ToString();
+    // Check for empty handles to handle the case where an exception
+    // is thrown as part of invoking toString on the objectect.
+    if (v8String.IsEmpty())
+        return StringImpl::empty();
+    return v8StringToWebCoreString(v8String, false);
+}
+
+AtomicString v8StringToAtomicWebCoreString(v8::Handle&lt;v8::String&gt; v8String)
+{
+    String string = v8StringToWebCoreString(v8String, true);
+    return AtomicString(string);
+}
+
+AtomicString v8ValueToAtomicWebCoreString(v8::Handle&lt;v8::Value&gt; v8String)
+{
+    String string = v8ValueToWebCoreString(v8String);
+    return AtomicString(string);
+}
+
+v8::Handle&lt;v8::String&gt; v8String(const String&amp; string)
+{
+    if (!string.length())
+        return v8::String::Empty();
+    return v8::String::NewExternal(new WebCoreStringResource(string));
+}
+
+v8::Local&lt;v8::String&gt; v8ExternalString(const String&amp; string)
+{
+    if (!string.length())
+        return v8::String::Empty();
+    return v8::String::NewExternal(new WebCoreStringResource(string));
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCorebindingsv8V8Bindingh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/V8Binding.h (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/V8Binding.h        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/V8Binding.h        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -31,16 +31,76 @@
</span><span class="cx"> #ifndef V8Binding_h
</span><span class="cx"> #define V8Binding_h
</span><span class="cx"> 
</span><del>-// FIXME: This is a temporary forwarding header until all bindings have migrated
-// over and v8_binding actually becomes V8Binding.
-#include &quot;v8_binding.h&quot;
</del><ins>+#include &quot;MathExtras.h&quot;
+#include &quot;PlatformString.h&quot;
</ins><span class="cx"> 
</span><ins>+#include &lt;v8.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-    // FIXME: Remove once migration is complete.
</del><ins>+    // Convert v8 types to a WebCore::String. If the V8 string is not already
+    // an external string then it is transformed into an external string at this
+    // point to avoid repeated conversions.
+    String v8StringToWebCoreString(v8::Handle&lt;v8::String&gt;, bool externalize);
+    String v8ValueToWebCoreString(v8::Handle&lt;v8::Value&gt;);
+
+    // Convert v8 types to a WebCore::AtomicString.
+    AtomicString v8StringToAtomicWebCoreString(v8::Handle&lt;v8::String&gt;);
+    AtomicString v8ValueToAtomicWebCoreString(v8::Handle&lt;v8::Value&gt;);
+
+    // Convert a string to a V8 string.
+    v8::Handle&lt;v8::String&gt; v8String(const String&amp;);
+
+    inline String toString(const String&amp; string)
+    {
+        return string;
+    }
+
+    // Return a V8 external string that shares the underlying buffer with the given
+    // WebCore string. The reference counting mechanism is used to keep the
+    // underlying buffer alive while the string is still live in the V8 engine.
+    v8::Local&lt;v8::String&gt; v8ExternalString(const String&amp;);
+
+    // Convert a value to a 32-bit integer.  The conversion fails if the
+    // value cannot be converted to an integer or converts to nan or to an infinity.
+    inline int toInt32(v8::Handle&lt;v8::Value&gt; value, bool&amp; ok)
+    {
+        ok = true;
+
+        // Fast case.  The value is already a 32-bit integer.
+        if (value-&gt;IsInt32())
+            return value-&gt;Int32Value();
+
+        // Can the value be converted to a number?
+        v8::Local&lt;v8::Number&gt; numberObject = value-&gt;ToNumber();
+        if (numberObject.IsEmpty()) {
+            ok = false;
+            return 0;
+        }
+
+        // Does the value convert to nan or to an infinity?
+        double numberValue = numberObject-&gt;Value();
+        if (isnan(numberValue) || isinf(numberValue)) {
+            ok = false;
+            return 0;
+        }
+
+        // Can the value be converted to a 32-bit integer?
+        v8::Local&lt;v8::Int32&gt; intValue = value-&gt;ToInt32();
+        if (intValue.IsEmpty()) {
+            ok = false;
+            return 0;
+        }
+
+        // Return the result of the int32 conversion.
+        return intValue-&gt;Value();
+    }
+
+    // Convert a value to a 32-bit integer assuming the conversion cannot fail.
</ins><span class="cx">     inline int toInt32(v8::Handle&lt;v8::Value&gt; value)
</span><span class="cx">     {
</span><del>-        return ToInt32(value);
</del><ins>+        bool ok;
+        return toInt32(value, ok);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     inline float toFloat(v8::Local&lt;v8::Value&gt; value)
</span><span class="lines">@@ -48,24 +108,19 @@
</span><span class="cx">         return static_cast&lt;float&gt;(value-&gt;NumberValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME: Remove once migration is complete.
-    inline String toWebCoreString(v8::Handle&lt;v8::Value&gt; obj)
</del><ins>+    // FIXME: Drop this in favor of the type specific v8ValueToWebCoreString when we rework the code generation.
+    inline String toWebCoreString(v8::Handle&lt;v8::Value&gt; object)
</ins><span class="cx">     {
</span><del>-        return ToWebCoreString(obj);
</del><ins>+        return v8ValueToWebCoreString(object);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME: Remove once migration is complete.
</del><ins>+    // The string returned by this function is still owned by the argument
+    // and will be deallocated when the argument is deallocated.
</ins><span class="cx">     inline const uint16_t* fromWebCoreString(const String&amp; str)
</span><span class="cx">     {
</span><del>-        return FromWebCoreString(str);
</del><ins>+        return reinterpret_cast&lt;const uint16_t*&gt;(str.characters());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME: Rename valueToStringWithNullCheck once migration is complete.
-    inline String toWebCoreStringWithNullCheck(v8::Handle&lt;v8::Value&gt; value)
-    {
-        return valueToStringWithNullCheck(value);
-    }
-
</del><span class="cx">     inline bool isUndefinedOrNull(v8::Handle&lt;v8::Value&gt; value)
</span><span class="cx">     {
</span><span class="cx">         return value-&gt;IsNull() || value-&gt;IsUndefined();
</span><span class="lines">@@ -75,7 +130,40 @@
</span><span class="cx">     {
</span><span class="cx">         return value ? v8::True() : v8::False();
</span><span class="cx">     }
</span><ins>+   
+    inline String toWebCoreStringWithNullCheck(v8::Handle&lt;v8::Value&gt; value)
+    {
+        if (value-&gt;IsNull()) 
+            return String();
+        return v8ValueToWebCoreString(value);
+    }
</ins><span class="cx"> 
</span><del>-}
</del><ins>+    inline String toWebCoreStringWithNullOrUndefinedCheck(v8::Handle&lt;v8::Value&gt; value)
+    {
+        if (value-&gt;IsNull() || value-&gt;IsUndefined())
+            return String();
+        return toWebCoreString(value);
+    }

+    inline v8::Handle&lt;v8::String&gt; v8UndetectableString(const String&amp; str)
+    {
+        return v8::String::NewUndetectable(fromWebCoreString(str), str.length());
+    }
</ins><span class="cx"> 
</span><ins>+    inline v8::Handle&lt;v8::Value&gt; v8StringOrNull(const String&amp; str)
+    {
+        return str.isNull() ? v8::Handle&lt;v8::Value&gt;(v8::Null()) : v8::Handle&lt;v8::Value&gt;(v8String(str));
+    }
+
+    inline v8::Handle&lt;v8::Value&gt; v8StringOrUndefined(const String&amp; str)
+    {
+        return str.isNull() ? v8::Handle&lt;v8::Value&gt;(v8::Undefined()) : v8::Handle&lt;v8::Value&gt;(v8String(str));
+    }
+
+    inline v8::Handle&lt;v8::Value&gt; v8StringOrFalse(const String&amp; str)
+    {
+        return str.isNull() ? v8::Handle&lt;v8::Value&gt;(v8::False()) : v8::Handle&lt;v8::Value&gt;(v8String(str));
+    }
+} // namespace WebCore
+
</ins><span class="cx"> #endif // V8Binding_h
</span></span></pre></div>
<a id="trunkWebCorebindingsv8V8LazyEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/V8LazyEventListener.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/V8LazyEventListener.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/V8LazyEventListener.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">             if (!value.IsEmpty()) {
</span><span class="cx">                 ASSERT(value-&gt;IsFunction());
</span><span class="cx">                 v8::Local&lt;v8::Function&gt; listenerFunction = v8::Local&lt;v8::Function&gt;::Cast(value);
</span><del>-                listenerFunction-&gt;SetName(v8::String::New(FromWebCoreString(m_functionName), m_functionName.length()));
</del><ins>+                listenerFunction-&gt;SetName(v8::String::New(fromWebCoreString(m_functionName), m_functionName.length()));
</ins><span class="cx"> 
</span><span class="cx">                 m_listener = v8::Persistent&lt;v8::Function&gt;::New(listenerFunction);
</span><span class="cx"> #ifndef NDEBUG
</span></span></pre></div>
<a id="trunkWebCorebindingsv8V8Proxycpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/V8Proxy.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/V8Proxy.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/V8Proxy.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -707,11 +707,11 @@
</span><span class="cx"> 
</span><span class="cx">     v8::Handle&lt;v8::String&gt; errorMessageString = message-&gt;Get();
</span><span class="cx">     ASSERT(!errorMessageString.IsEmpty());
</span><del>-    String errorMessage = ToWebCoreString(errorMessageString);
</del><ins>+    String errorMessage = toWebCoreString(errorMessageString);
</ins><span class="cx"> 
</span><span class="cx">     v8::Handle&lt;v8::Value&gt; resourceName = message-&gt;GetScriptResourceName();
</span><span class="cx">     bool useURL = resourceName.IsEmpty() || !resourceName-&gt;IsString();
</span><del>-    String resourceNameString = useURL ? frame-&gt;document()-&gt;url() : ToWebCoreString(resourceName);
</del><ins>+    String resourceNameString = useURL ? frame-&gt;document()-&gt;url() : toWebCoreString(resourceName);
</ins><span class="cx">     JavaScriptConsoleMessage consoleMessage(errorMessage, resourceNameString, message-&gt;GetLineNumber());
</span><span class="cx">     ConsoleMessageManager::addMessage(page, consoleMessage);
</span><span class="cx"> }
</span><span class="lines">@@ -965,7 +965,7 @@
</span><span class="cx"> 
</span><span class="cx"> v8::Handle&lt;v8::Script&gt; V8Proxy::compileScript(v8::Handle&lt;v8::String&gt; code, const String&amp; fileName, int baseLine)
</span><span class="cx"> {
</span><del>-    const uint16_t* fileNameString = FromWebCoreString(fileName);
</del><ins>+    const uint16_t* fileNameString = fromWebCoreString(fileName);
</ins><span class="cx">     v8::Handle&lt;v8::String&gt; name = v8::String::New(fileNameString, fileName.length());
</span><span class="cx">     v8::Handle&lt;v8::Integer&gt; line = v8::Integer::New(baseLine);
</span><span class="cx">     v8::ScriptOrigin origin(name, line);
</span><span class="lines">@@ -3217,7 +3217,7 @@
</span><span class="cx">     frameSourceName = v8::Local&lt;v8::Function&gt;::Cast(v8UtilityContext-&gt;Global()-&gt;Get(v8::String::New(&quot;frameSourceName&quot;)));
</span><span class="cx">     if (frameSourceName.IsEmpty())
</span><span class="cx">         return String();
</span><del>-    return ToWebCoreString(v8::Debug::Call(frameSourceName));
</del><ins>+    return toWebCoreString(v8::Debug::Call(frameSourceName));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void V8Proxy::registerExtension(v8::Extension* extension, const String&amp; schemeRestriction)
</span></span></pre></div>
<a id="trunkWebCorebindingsv8WorkerContextExecutionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -71,11 +71,11 @@
</span><span class="cx">     
</span><span class="cx">     v8::Handle&lt;v8::String&gt; errorMessageString = message-&gt;Get();
</span><span class="cx">     ASSERT(!errorMessageString.IsEmpty());
</span><del>-    String errorMessage = ToWebCoreString(errorMessageString);
</del><ins>+    String errorMessage = toWebCoreString(errorMessageString);
</ins><span class="cx">     
</span><span class="cx">     v8::Handle&lt;v8::Value&gt; resourceName = message-&gt;GetScriptResourceName();
</span><span class="cx">     bool useURL = (resourceName.IsEmpty() || !resourceName-&gt;IsString());
</span><del>-    String resourceNameString = useURL ? workerContext-&gt;url() : ToWebCoreString(resourceName);
</del><ins>+    String resourceNameString = useURL ? workerContext-&gt;url() : toWebCoreString(resourceName);
</ins><span class="cx">     
</span><span class="cx">     workerContext-&gt;addMessage(ConsoleDestination, JSMessageSource, ErrorMessageLevel, errorMessage, message-&gt;GetLineNumber(), resourceNameString);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8CSSStyleDeclarationCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">     if (!propInfo)
</span><span class="cx">         return notHandledByInterceptor();
</span><span class="cx"> 
</span><del>-    String propertyValue = valueToStringWithNullCheck(value);
</del><ins>+    String propertyValue = toWebCoreStringWithNullCheck(value);
</ins><span class="cx">     if (propInfo-&gt;hadPixelOrPosPrefix)
</span><span class="cx">         propertyValue.append(&quot;px&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8CanvasRenderingContext2DCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -105,13 +105,13 @@
</span><span class="cx">     switch (args.Length()) {
</span><span class="cx">     case 1:
</span><span class="cx">         if (args[0]-&gt;IsString())
</span><del>-            context-&gt;setStrokeColor(ToWebCoreString(args[0]));
</del><ins>+            context-&gt;setStrokeColor(toWebCoreString(args[0]));
</ins><span class="cx">         else
</span><span class="cx">             context-&gt;setStrokeColor(toFloat(args[0]));
</span><span class="cx">         break;
</span><span class="cx">     case 2:
</span><span class="cx">         if (args[0]-&gt;IsString())
</span><del>-            context-&gt;setStrokeColor(ToWebCoreString(args[0]), toFloat(args[1]));
</del><ins>+            context-&gt;setStrokeColor(toWebCoreString(args[0]), toFloat(args[1]));
</ins><span class="cx">         else
</span><span class="cx">             context-&gt;setStrokeColor(toFloat(args[0]), toFloat(args[1]));
</span><span class="cx">         break;
</span><span class="lines">@@ -135,13 +135,13 @@
</span><span class="cx">     switch (args.Length()) {
</span><span class="cx">     case 1:
</span><span class="cx">         if (args[0]-&gt;IsString())
</span><del>-            context-&gt;setFillColor(ToWebCoreString(args[0]));
</del><ins>+            context-&gt;setFillColor(toWebCoreString(args[0]));
</ins><span class="cx">         else 
</span><span class="cx">             context-&gt;setFillColor(toFloat(args[0]));
</span><span class="cx">         break;
</span><span class="cx">     case 2:
</span><span class="cx">         if (args[0]-&gt;IsString())
</span><del>-            context-&gt;setFillColor(ToWebCoreString(args[0]), toFloat(args[1]));
</del><ins>+            context-&gt;setFillColor(toWebCoreString(args[0]), toFloat(args[1]));
</ins><span class="cx">         else
</span><span class="cx">             context-&gt;setFillColor(toFloat(args[0]), toFloat(args[1]));
</span><span class="cx">         break;
</span><span class="lines">@@ -184,13 +184,13 @@
</span><span class="cx">         break;
</span><span class="cx">     case 4:
</span><span class="cx">         if (args[3]-&gt;IsString())
</span><del>-            context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), ToWebCoreString(args[3]));
</del><ins>+            context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toWebCoreString(args[3]));
</ins><span class="cx">         else
</span><span class="cx">             context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]));
</span><span class="cx">         break;
</span><span class="cx">     case 5:
</span><span class="cx">         if (args[3]-&gt;IsString())
</span><del>-            context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), ToWebCoreString(args[3]), toFloat(args[4]));
</del><ins>+            context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toWebCoreString(args[3]), toFloat(args[4]));
</ins><span class="cx">         else
</span><span class="cx">             context-&gt;setShadow(toFloat(args[0]), toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]));
</span><span class="cx">         break;
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (V8HTMLImageElement::HasInstance(arg)) {
</span><span class="cx">         HTMLImageElement* image_element = V8Proxy::convertDOMWrapperToNode&lt;HTMLImageElement&gt;(arg);
</span><del>-        context-&gt;drawImageFromRect(image_element,  toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8]), ToWebCoreString(args[9]));
</del><ins>+        context-&gt;drawImageFromRect(image_element,  toFloat(args[1]), toFloat(args[2]), toFloat(args[3]), toFloat(args[4]), toFloat(args[5]), toFloat(args[6]), toFloat(args[7]), toFloat(args[8]), toWebCoreString(args[9]));
</ins><span class="cx">     } else
</span><span class="cx">         V8Proxy::throwError(V8Proxy::TypeError, &quot;drawImageFromRect: Invalid type of arguments&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">     if (V8HTMLImageElement::HasInstance(arg)) {
</span><span class="cx">         HTMLImageElement* image_element = V8Proxy::convertDOMWrapperToNode&lt;HTMLImageElement&gt;(arg);
</span><span class="cx">         ExceptionCode ec = 0;
</span><del>-        RefPtr&lt;CanvasPattern&gt; pattern = context-&gt;createPattern(image_element, valueToStringWithNullCheck(args[1]), ec);
</del><ins>+        RefPtr&lt;CanvasPattern&gt; pattern = context-&gt;createPattern(image_element, toWebCoreStringWithNullCheck(args[1]), ec);
</ins><span class="cx">         if (ec != 0) {
</span><span class="cx">             V8Proxy::setDOMException(ec);
</span><span class="cx">             return notHandledByInterceptor();
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">     if (V8HTMLCanvasElement::HasInstance(arg)) {
</span><span class="cx">         HTMLCanvasElement* canvas_element = V8Proxy::convertDOMWrapperToNode&lt;HTMLCanvasElement&gt;(arg);
</span><span class="cx">         ExceptionCode ec = 0;
</span><del>-        RefPtr&lt;CanvasPattern&gt; pattern = context-&gt;createPattern(canvas_element, valueToStringWithNullCheck(args[1]), ec);
</del><ins>+        RefPtr&lt;CanvasPattern&gt; pattern = context-&gt;createPattern(canvas_element, toWebCoreStringWithNullCheck(args[1]), ec);
</ins><span class="cx">         if (ec != 0) {
</span><span class="cx">             V8Proxy::setDOMException(ec);
</span><span class="cx">             return notHandledByInterceptor();
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">         return notHandledByInterceptor();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String text = ToWebCoreString(args[0]);
</del><ins>+    String text = toWebCoreString(args[0]);
</ins><span class="cx">     float x = toFloat(args[1]);
</span><span class="cx">     float y = toFloat(args[2]);
</span><span class="cx"> 
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx">         return notHandledByInterceptor();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String text = ToWebCoreString(args[0]);
</del><ins>+    String text = toWebCoreString(args[0]);
</ins><span class="cx">     float x = toFloat(args[1]);
</span><span class="cx">     float y = toFloat(args[2]);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8CustomXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8CustomXPathNSResolver.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     if (try_catch.HasCaught())
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    return valueToStringWithNullCheck(retval);
</del><ins>+    return toWebCoreStringWithNullCheck(retval);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8DOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -277,9 +277,9 @@
</span><span class="cx">     if (args.Length() &gt; 2) {
</span><span class="cx">         if (V8Proxy::isWrapperOfType(args[1], V8ClassIndex::MESSAGEPORT))
</span><span class="cx">             port = V8Proxy::convertToNativeObject&lt;MessagePort&gt;(V8ClassIndex::MESSAGEPORT, args[1]);
</span><del>-        targetOrigin = valueToStringWithNullOrUndefinedCheck(args[2]);
</del><ins>+        targetOrigin = toWebCoreStringWithNullOrUndefinedCheck(args[2]);
</ins><span class="cx">     } else {
</span><del>-        targetOrigin = valueToStringWithNullOrUndefinedCheck(args[1]);
</del><ins>+        targetOrigin = toWebCoreStringWithNullOrUndefinedCheck(args[1]);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (tryCatch.HasCaught())
</span><span class="lines">@@ -562,9 +562,9 @@
</span><span class="cx">     if (!canShowModalDialogNow(frame) || !allowPopUp())
</span><span class="cx">         return v8::Undefined();
</span><span class="cx"> 
</span><del>-    String url = valueToStringWithNullOrUndefinedCheck(args[0]);
</del><ins>+    String url = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
</ins><span class="cx">     v8::Local&lt;v8::Value&gt; dialogArgs = args[1];
</span><del>-    String featureArgs = valueToStringWithNullOrUndefinedCheck(args[2]);
</del><ins>+    String featureArgs = toWebCoreStringWithNullOrUndefinedCheck(args[2]);
</ins><span class="cx"> 
</span><span class="cx">     const HashMap&lt;String, String&gt; features = parseModalDialogFeatures(featureArgs);
</span><span class="cx"> 
</span><span class="lines">@@ -651,7 +651,7 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         return v8::Undefined();
</span><span class="cx"> 
</span><del>-    String urlString = valueToStringWithNullOrUndefinedCheck(args[0]);
</del><ins>+    String urlString = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
</ins><span class="cx">     AtomicString frameName = (args[1]-&gt;IsUndefined() || args[1]-&gt;IsNull()) ? &quot;_blank&quot; : AtomicString(toWebCoreString(args[1]));
</span><span class="cx"> 
</span><span class="cx">     // Because FrameTree::find() returns true for empty strings, we must check
</span><span class="lines">@@ -700,7 +700,7 @@
</span><span class="cx">     // Parse the values, and then work with a copy of the parsed values
</span><span class="cx">     // so we can restore the values we may not want to overwrite after
</span><span class="cx">     // we do the multiple monitor fixes.
</span><del>-    WindowFeatures rawFeatures(valueToStringWithNullOrUndefinedCheck(args[2]));
</del><ins>+    WindowFeatures rawFeatures(toWebCoreStringWithNullOrUndefinedCheck(args[2]));
</ins><span class="cx">     WindowFeatures windowFeatures(rawFeatures);
</span><span class="cx">     FloatRect screenRect = screenAvailableRect(page-&gt;mainFrame()-&gt;view());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8HTMLCanvasElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     INC_STATS(&quot;DOM.HTMLCanvasElement.context&quot;);
</span><span class="cx">     v8::Handle&lt;v8::Value&gt; holder = args.Holder();
</span><span class="cx">     HTMLCanvasElement* imp = V8Proxy::convertDOMWrapperToNode&lt;HTMLCanvasElement&gt;(holder);
</span><del>-    String contextId = ToWebCoreString(args[0]);
</del><ins>+    String contextId = toWebCoreString(args[0]);
</ins><span class="cx">     CanvasRenderingContext2D* result = imp-&gt;getContext(contextId);
</span><span class="cx">     return V8Proxy::convertToV8Object(V8ClassIndex::CANVASRENDERINGCONTEXT2D, result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8HTMLIFrameElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> ACCESSOR_SETTER(HTMLIFrameElementSrc)
</span><span class="cx"> {
</span><span class="cx">     HTMLIFrameElement* iframe = V8Proxy::convertDOMWrapperToNode&lt;HTMLIFrameElement&gt;(info.Holder());
</span><del>-    String v = valueToStringWithNullCheck(value);
</del><ins>+    String v = toWebCoreStringWithNullCheck(value);
</ins><span class="cx"> 
</span><span class="cx">     if (!allowSettingFrameSrcToJavascriptUrl(iframe, v))
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8HTMLOptionsCollectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     else {
</span><span class="cx">         bool ok;
</span><span class="cx">         v8::TryCatch try_catch;
</span><del>-        int index = ToInt32(args[1], ok);
</del><ins>+        int index = toInt32(args[1], ok);
</ins><span class="cx"> 
</span><span class="cx">         if (try_catch.HasCaught())
</span><span class="cx">             return v8::Undefined();
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8HTMLSelectElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">         return v8::Undefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    imp-&gt;remove(ToInt32(args[0]));
</del><ins>+    imp-&gt;remove(toInt32(args[0]));
</ins><span class="cx">     return v8::Undefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8SQLTransactionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         return v8::Undefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String statement = ToWebCoreString(args[0]);
</del><ins>+    String statement = toWebCoreString(args[0]);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;SQLValue&gt; sqlValues;
</span><span class="cx"> 
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">             else if (value-&gt;IsNumber())
</span><span class="cx">                 sqlValues.append(SQLValue(value-&gt;NumberValue()));
</span><span class="cx">             else
</span><del>-                sqlValues.append(SQLValue(ToWebCoreString(value)));
</del><ins>+                sqlValues.append(SQLValue(toWebCoreString(value)));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8WorkerContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">     int timerId;
</span><span class="cx"> 
</span><span class="cx">     if (function-&gt;IsString()) {
</span><del>-        WebCore::String stringFunction = ToWebCoreString(function);
</del><ins>+        WebCore::String stringFunction = toWebCoreString(function);
</ins><span class="cx">         timerId = DOMTimer::install(workerContext, new ScheduledAction(stringFunction, workerContext-&gt;url()), timeout, singleShot);
</span><span class="cx">     } else if (function-&gt;IsFunction()) {
</span><span class="cx">         size_t paramCount = argumentCount &gt;= 2 ? argumentCount - 2 : 0;
</span></span></pre></div>
<a id="trunkWebCorebindingsv8customV8XMLHttpRequestCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp (45558 => 45559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp        2009-07-06 14:37:55 UTC (rev 45558)
+++ trunk/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp        2009-07-06 17:38:30 UTC (rev 45559)
</span><span class="lines">@@ -345,10 +345,10 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     String user, passwd;
</span><span class="cx">     if (args.Length() &gt;= 4 &amp;&amp; !args[3]-&gt;IsUndefined()) {
</span><del>-        user = valueToStringWithNullCheck(args[3]);
</del><ins>+        user = toWebCoreStringWithNullCheck(args[3]);
</ins><span class="cx"> 
</span><span class="cx">         if (args.Length() &gt;= 5 &amp;&amp; !args[4]-&gt;IsUndefined()) {
</span><del>-            passwd = valueToStringWithNullCheck(args[4]);
</del><ins>+            passwd = toWebCoreStringWithNullCheck(args[4]);
</ins><span class="cx">             xmlHttpRequest-&gt;open(method, url, async, user, passwd, ec);
</span><span class="cx">         } else
</span><span class="cx">             xmlHttpRequest-&gt;open(method, url, async, user, ec);
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx">             ASSERT(document);
</span><span class="cx">             xmlHttpRequest-&gt;send(document, ec);
</span><span class="cx">         } else
</span><del>-            xmlHttpRequest-&gt;send(valueToStringWithNullCheck(arg), ec);
</del><ins>+            xmlHttpRequest-&gt;send(toWebCoreStringWithNullCheck(arg), ec);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (ec)
</span></span></pre>
</div>
</div>

</body>
</html>