2008-11-18 Darin Fisher <darin@chromium.org>
authordarin@chromium.org <darin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2008 02:05:41 +0000 (02:05 +0000)
committerdarin@chromium.org <darin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2008 02:05:41 +0000 (02:05 +0000)
        Reviewed by Geoff Garen.

        https://bugs.webkit.org/show_bug.cgi?id=22345
        Define ScriptValue as a thin container for a JSC::Value*.

        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ScheduledAction.cpp:
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::evaluate):
        * bindings/js/ScriptController.h:
        * bindings/js/ScriptValue.cpp: Added.
        (WebCore::ScriptValue::getString):
        * bindings/js/ScriptValue.h: Added.
        (WebCore::ScriptValue::ScriptValue):
        (WebCore::ScriptValue::jsValue):
        * dom/ScriptElement.cpp:
        * dom/XMLTokenizer.cpp:
        * dom/XMLTokenizerLibxml2.cpp:
        * html/HTMLTokenizer.cpp:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::executeIfJavaScriptURL):
        (WebCore::FrameLoader::executeScript):
        * loader/FrameLoader.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38610 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/ScheduledAction.cpp
WebCore/bindings/js/ScriptController.cpp
WebCore/bindings/js/ScriptController.h
WebCore/bindings/js/ScriptValue.cpp [new file with mode: 0644]
WebCore/bindings/js/ScriptValue.h [new file with mode: 0644]
WebCore/dom/ScriptElement.cpp
WebCore/dom/XMLTokenizer.cpp
WebCore/dom/XMLTokenizerLibxml2.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebFrame.mm
WebKit/mac/WebView/WebView.mm
WebKit/win/ChangeLog
WebKit/win/WebView.cpp
WebKit/wx/ChangeLog
WebKit/wx/WebFrame.cpp

index 1e6e5166ff3e81b97ea2cdcbaf73d4a7188ba4d1..8827d3e9945bf98239d43d07cde8d4cecba3f5eb 100644 (file)
@@ -1,3 +1,30 @@
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22345
+        Define ScriptValue as a thin container for a JSC::Value*.
+
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/ScheduledAction.cpp:
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluate):
+        * bindings/js/ScriptController.h:
+        * bindings/js/ScriptValue.cpp: Added.
+        (WebCore::ScriptValue::getString):
+        * bindings/js/ScriptValue.h: Added.
+        (WebCore::ScriptValue::ScriptValue):
+        (WebCore::ScriptValue::jsValue):
+        * dom/ScriptElement.cpp:
+        * dom/XMLTokenizer.cpp:
+        * dom/XMLTokenizerLibxml2.cpp:
+        * html/HTMLTokenizer.cpp:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::executeIfJavaScriptURL):
+        (WebCore::FrameLoader::executeScript):
+        * loader/FrameLoader.h:
+
 2008-11-19  Beth Dakin  <bdakin@apple.com>
 
         Reviewed by Justin Garcia.
index 2b00457daba860a174dd40198865bcf7284b74af..0122881030e6eb3ac3c9877106d99e99d932ec94 100644 (file)
                                        RelativePath="..\bindings\js\ScriptControllerWin.cpp"\r
                                        >\r
                                </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\ScriptValue.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\bindings\js\ScriptValue.h"\r
+                                       >\r
+                               </File>\r
                                <File\r
                                        RelativePath="..\bindings\js\StringSourceProvider.h"\r
                                        >\r
index 9f92bd00e1f6e93babf69accdd267de5e04417f0..09d65eded475dc10b9efc364f2f971aa071e39cd 100644 (file)
                933A14B90B7D1D5200A53FFD /* JSTextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A14B70B7D1D5200A53FFD /* JSTextEvent.h */; };
                93442C9E0D2B335C00338FF9 /* HTMLTableRowsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */; };
                93442CA00D2B336000338FF9 /* HTMLTableRowsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */; };
+               934CC0E10ED39D6F00A658F2 /* ScriptValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934CC0DF0ED39D6F00A658F2 /* ScriptValue.cpp */; };
+               934CC0E20ED39D6F00A658F2 /* ScriptValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 934CC0E00ED39D6F00A658F2 /* ScriptValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */; };
                934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */; };
                933A14B70B7D1D5200A53FFD /* JSTextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextEvent.h; sourceTree = "<group>"; };
                93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableRowsCollection.h; sourceTree = "<group>"; };
                93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTableRowsCollection.cpp; sourceTree = "<group>"; };
+               934CC0DF0ED39D6F00A658F2 /* ScriptValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptValue.cpp; sourceTree = "<group>"; };
+               934CC0E00ED39D6F00A658F2 /* ScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptValue.h; sourceTree = "<group>"; };
                934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSStringExtras.mm; sourceTree = "<group>"; };
                934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreNSStringExtras.h; sourceTree = "<group>"; };
                934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeBase.cpp; sourceTree = "<group>"; };
                                93B70D5309EB0C7C009D8468 /* ScriptController.cpp */,
                                A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */,
                                93B70D5409EB0C7C009D8468 /* ScriptController.h */,
+                               934CC0DF0ED39D6F00A658F2 /* ScriptValue.cpp */,
+                               934CC0E00ED39D6F00A658F2 /* ScriptValue.h */,
                                65488D6A0DD5A83D009D83B2 /* StringSourceProvider.h */,
                                BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */,
                                BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */,
                                E108224B0EC3153A00E93953 /* WorkerTask.h in Headers */,
                                0FD723820EC8BD9300CA5DD7 /* FloatQuad.h in Headers */,
                                E14799A70ECDE3A400292BF3 /* WorkerMessagingProxy.h in Headers */,
+                               934CC0E20ED39D6F00A658F2 /* ScriptValue.h in Headers */,
                                0897C14D0ED2EBA500AE06DB /* WMLBRElement.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                E14799B40ECDE9D800292BF3 /* WorkerMessagingProxy.cpp in Sources */,
                                0897C14C0ED2EBA500AE06DB /* WMLBRElement.cpp in Sources */,
                                E182504F0ED2F20200499A8F /* FrameLoaderClient.cpp in Sources */,
+                               934CC0E10ED39D6F00A658F2 /* ScriptValue.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 5aaf23ac1fd679cabaac60e459ca70476c9b7d82..683e9772dd2308f1e43b4a9eafcfb2c219669db8 100644 (file)
@@ -31,6 +31,7 @@
 #include "JSDOMBinding.h"
 #include "JSDOMWindow.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include <runtime/JSLock.h>
 
 using namespace JSC;
index 9ca813e684188559518321721395e7612baf7386..40c50a2b686ad3d0349fb7b80d203f583ca4df3a 100644 (file)
@@ -38,6 +38,7 @@
 #include "PageGroup.h"
 #include "PausedTimeouts.h"
 #include "runtime_root.h"
+#include "ScriptValue.h"
 #include "Settings.h"
 #include "StringSourceProvider.h"
 
@@ -87,7 +88,7 @@ ScriptController::~ScriptController()
     disconnectPlatformScriptObjects();
 }
 
-JSValue* ScriptController::evaluate(const String& sourceURL, int baseLine, const String& str) 
+ScriptValue ScriptController::evaluate(const String& sourceURL, int baseLine, const String& str) 
 {
     // evaluate code. Returns the JS return value or 0
     // if there was none, an error occured or the type couldn't be converted.
index ab7af91f8cb7e180831601a544130bca62897ecf..b727ed15ea3d00db0249e62b0b36779b9856abe0 100644 (file)
@@ -54,6 +54,7 @@ class EventListener;
 class HTMLPlugInElement;
 class Frame;
 class Node;
+class ScriptValue;
 class String;
 class Widget;
 
@@ -77,7 +78,7 @@ public:
         return m_windowShell->window();
     }
 
-    JSC::JSValue* evaluate(const String& sourceURL, int baseLine, const String& code);
+    ScriptValue evaluate(const String& sourceURL, int baseLine, const String& code);
 
     PassRefPtr<EventListener> createInlineEventListener(const String& functionName, const String& code, Node*);
 #if ENABLE(SVG)
diff --git a/WebCore/bindings/js/ScriptValue.cpp b/WebCore/bindings/js/ScriptValue.cpp
new file mode 100644 (file)
index 0000000..626cdf6
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple 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:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  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. 
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS 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 APPLE OR ITS 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 "ScriptValue.h"
+
+#include "PlatformString.h"
+#include <runtime/JSLock.h>
+#include <runtime/Protect.h>
+#include <runtime/UString.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+bool ScriptValue::getString(String& result) const
+{
+    if (!m_value.get())
+        return false;
+    JSLock lock(false);
+    UString ustring;
+    if (!m_value->getString(ustring))
+        return false;
+    result = ustring;
+    return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptValue.h b/WebCore/bindings/js/ScriptValue.h
new file mode 100644 (file)
index 0000000..9b9dc3d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2008, 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.
+ */
+
+#ifndef ScriptValue_h
+#define ScriptValue_h
+
+#include <runtime/Protect.h>
+
+namespace WebCore {
+
+class String;
+
+class ScriptValue {
+public:
+    ScriptValue(JSC::JSValue* value = JSC::noValue()) : m_value(value) {}
+
+    JSC::JSValue* jsValue() const { return m_value.get(); }
+    bool getString(String& result) const;
+
+private:
+    JSC::ProtectedPtr<JSC::JSValue> m_value;
+};
+
+} // namespace WebCore
+
+#endif // ScriptValue_h
index dd8618540cbe0eb12108951eafc5d81b89b1f807..80990fb67c546480a6c0bc115b2ed21f24e4b8fd 100644 (file)
@@ -31,6 +31,7 @@
 #include "FrameLoader.h"
 #include "MIMETypeRegistry.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "StringHash.h"
 #include "Text.h"
 #include <wtf/StdLibExtras.h>
index 4dcd35e4e392c1e92bf0a1404a3e95e072904c64..2a1c89d5556e670a1cf2997dceb8064d6dbe18d2 100644 (file)
@@ -42,6 +42,7 @@
 #include "HTMLScriptElement.h"
 #include "HTMLStyleElement.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "ProcessingInstruction.h"
 #include "ResourceError.h"
 #include "ResourceHandle.h"
index e7ff3c103ee62f4d4bc906cd42b80eebc8e1c967..329f3b03a6848c865edc860a74e35761854f9f2e 100644 (file)
@@ -41,6 +41,7 @@
 #include "HTMLStyleElement.h"
 #include "HTMLTokenizer.h" // for decodeNamedEntity
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "ProcessingInstruction.h"
 #include "ResourceError.h"
 #include "ResourceHandle.h"
index 06c993691d102b45ae66e29b5721e58157f72073..901919b84578306cea50e81337d833eb8c351bcf 100644 (file)
@@ -44,6 +44,7 @@
 #include "Page.h"
 #include "PreloadScanner.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "SystemTime.h"
 #include <wtf/ASCIICType.h>
 
index 85eac27397c5ed7c1c87bae62aba563f3040e355..91a7d7f76a129eacc209e084222ac566e9dae4d2 100644 (file)
@@ -88,6 +88,7 @@
 #include "XMLTokenizer.h"
 #include "JSDOMBinding.h"
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include <runtime/JSLock.h>
 #include <runtime/JSObject.h>
 #include <wtf/StdLibExtras.h>
 #include "SVGViewSpec.h"
 #endif
 
-using namespace JSC;
-
 namespace WebCore {
 
 #if ENABLE(SVG)
@@ -190,18 +189,6 @@ struct ScheduledRedirection {
 static double storedTimeOfLastCompletedLoad;
 static FrameLoader::LocalLoadPolicy localLoadPolicy = FrameLoader::AllowLocalLoadsForLocalOnly;
 
-static bool getString(JSValue* result, String& string)
-{
-    if (!result)
-        return false;
-    JSLock lock(false);
-    UString ustring;
-    if (!result->getString(ustring))
-        return false;
-    string = ustring;
-    return true;
-}
-
 bool isBackForwardLoadType(FrameLoadType type)
 {
     switch (type) {
@@ -762,10 +749,10 @@ bool FrameLoader::executeIfJavaScriptURL(const KURL& url, bool userGesture, bool
         return false;
 
     String script = decodeURLEscapeSequences(url.string().substring(strlen("javascript:")));
-    JSValue* result = executeScript(script, userGesture);
+    ScriptValue result = executeScript(script, userGesture);
 
     String scriptResult;
-    if (!getString(result, scriptResult))
+    if (!result.getString(scriptResult))
         return true;
 
     SecurityOrigin* currentSecurityOrigin = 0;
@@ -784,20 +771,20 @@ bool FrameLoader::executeIfJavaScriptURL(const KURL& url, bool userGesture, bool
     return true;
 }
 
-JSValue* FrameLoader::executeScript(const String& script, bool forceUserGesture)
+ScriptValue FrameLoader::executeScript(const String& script, bool forceUserGesture)
 {
     return executeScript(forceUserGesture ? String() : m_URL.string(), 1, script);
 }
 
-JSValue* FrameLoader::executeScript(const String& url, int baseLine, const String& script)
+ScriptValue FrameLoader::executeScript(const String& url, int baseLine, const String& script)
 {
     if (!m_frame->script()->isEnabled() || m_frame->script()->isPaused())
-        return noValue();
+        return ScriptValue();
 
     bool wasRunningScript = m_isRunningScript;
     m_isRunningScript = true;
 
-    JSValue* result = m_frame->script()->evaluate(url, baseLine, script);
+    ScriptValue result = m_frame->script()->evaluate(url, baseLine, script);
 
     if (!wasRunningScript) {
         m_isRunningScript = false;
index af080b860022bc59b2eea56ab6e5db89cc7da0eb..4e60f47090b434424f7d4aff41ef27f530300cdf 100644 (file)
@@ -75,6 +75,7 @@ namespace WebCore {
     class ResourceLoader;
     class ResourceRequest;
     class ResourceResponse;
+    class ScriptValue;
     class SecurityOrigin;
     class SharedBuffer;
     class SubstituteData;
@@ -334,8 +335,8 @@ namespace WebCore {
         // Returns true if url is a JavaScript URL.
         bool executeIfJavaScriptURL(const KURL& url, bool userGesture = false, bool replaceDocument = true);
 
-        JSC::JSValue* executeScript(const String& url, int baseLine, const String& script);
-        JSC::JSValue* executeScript(const String& script, bool forceUserGesture = false);
+        ScriptValue executeScript(const String& url, int baseLine, const String& script);
+        ScriptValue executeScript(const String& script, bool forceUserGesture = false);
 
         void gotoAnchor();
         bool gotoAnchor(const String& name); // returns true if the anchor was found
index 355ad178bba6a401a8bff10621ca03fc9dae1214..db308390817f81035340af928442f37c0fafd0d8 100644 (file)
@@ -1,3 +1,15 @@
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22345
+        Define ScriptValue as a thin container for a JSC::Value*.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
+        * WebView/WebView.mm:
+        (-[WebView aeDescByEvaluatingJavaScriptFromString:]):
+
 2008-11-19  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index 71894caa3ff52d24c0630567ef86200957d3cd90..0c5c06356fa5b498d6657b3af6611bd69337e95e 100644 (file)
@@ -77,6 +77,7 @@
 #import <WebCore/TypingCommand.h>
 #import <WebCore/htmlediting.h>
 #import <WebCore/ScriptController.h>
+#import <WebCore/ScriptValue.h>
 #import <WebCore/markup.h>
 #import <WebCore/visible_units.h>
 #import <runtime/JSLock.h>
@@ -654,7 +655,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 {
     ASSERT(_private->coreFrame->document());
     
-    JSValue* result = _private->coreFrame->loader()->executeScript(string, forceUserGesture);
+    JSValue* result = _private->coreFrame->loader()->executeScript(string, forceUserGesture).jsValue();
 
     if (!_private->coreFrame) // In case the script removed our frame from the page.
         return @"";
index 348e1e20c6be78fb295dc7f75279822668355c6d..2de8f8e009f96a69ba4ba2b93cbb4ce0e9322fdb 100644 (file)
 #import <WebCore/PlatformMouseEvent.h>
 #import <WebCore/ProgressTracker.h>
 #import <WebCore/ScriptController.h>
+#import <WebCore/ScriptValue.h>
 #import <WebCore/SelectionController.h>
 #import <WebCore/Settings.h>
 #import <WebCore/TextResourceDecoder.h>
@@ -3649,7 +3650,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal
         return nil;
     if (!coreFrame->document())
         return nil;
-    JSValue* result = coreFrame->loader()->executeScript(script, true);
+    JSValue* result = coreFrame->loader()->executeScript(script, true).jsValue();
     if (!result) // FIXME: pass errors
         return 0;
     JSLock lock(false);
index 59969f75a4e4cd426400dbc5b6757ff41dc09332..6452dcc34b4a3fbfac0352bf8bfe0019194e0a8e 100644 (file)
@@ -1,3 +1,13 @@
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22345
+        Define ScriptValue as a thin container for a JSC::Value*.
+
+        * WebView.cpp:
+        (WebView::stringByEvaluatingJavaScriptFromString):
+
 2008-11-19  Adele Peterson  <adele@apple.com>
 
         Reviewed by Darin Adler.
index 381e69b7d84503799ec1a66108b4f7a95b80b0a6..9b7b3256e2b04e1608db8febbbec31dbdb4e4dd0 100644 (file)
@@ -92,6 +92,7 @@
 #include <WebCore/RenderTheme.h>
 #include <WebCore/ResourceHandle.h>
 #include <WebCore/ResourceHandleClient.h>
+#include <WebCore/ScriptValue.h>
 #include <WebCore/ScrollbarTheme.h>
 #include <WebCore/SelectionController.h>
 #include <WebCore/Settings.h>
@@ -2665,8 +2666,8 @@ HRESULT STDMETHODCALLTYPE WebView::stringByEvaluatingJavaScriptFromString(
     if (!coreFrame)
         return E_FAIL;
 
-    JSC::JSValue* scriptExecutionResult = coreFrame->loader()->executeScript(WebCore::String(script), true);
-    if(!scriptExecutionResult)
+    JSC::JSValue* scriptExecutionResult = coreFrame->loader()->executeScript(WebCore::String(script), true).jsValue();
+    if (!scriptExecutionResult)
         return E_FAIL;
     else if (scriptExecutionResult->isString()) {
         JSLock lock(false);
index 49e7192680ba876dd5e3b1990d48691425f6b11a..340b951818e6cf799a2f192d5113c22ecbec4ca9 100644 (file)
@@ -1,3 +1,13 @@
+2008-11-19  Darin Fisher  <darin@chromium.org>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22345
+        Define ScriptValue as a thin container for a JSC::Value*.
+
+        * WebFrame.cpp:
+        (wxWebFrame::RunScript):
+
 2008-11-17  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Sam Weinig.
index a1b304576e52825db469249d5c2562041b975780..d3337166a130699e9887bcd64aea03e0101da0e9 100644 (file)
@@ -42,6 +42,7 @@
 #include "FrameLoaderClientWx.h"
 
 #include "ScriptController.h"
+#include "ScriptValue.h"
 #include "JSDOMBinding.h"
 #include <runtime/JSValue.h>
 #include <runtime/UString.h>
@@ -172,7 +173,7 @@ wxString wxWebFrame::RunScript(const wxString& javascript)
 {
     wxString returnValue = wxEmptyString;
     if (m_impl->frame) {
-        JSC::JSValue* result = m_impl->frame->loader()->executeScript(javascript, true);
+        JSC::JSValue* result = m_impl->frame->loader()->executeScript(javascript, true).jsValue();
         if (result)
             returnValue = wxString(result->toString(m_impl->frame->script()->globalObject()->globalExec()).UTF8String().c_str(), wxConvUTF8);        
     }