[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

yurys at chromium.org yurys at chromium.org
Wed Feb 10 22:11:08 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit b5918451b4e81d639954117ed35440b17273b15f
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 3 18:26:05 2010 +0000

    2010-02-03  Yury Semikhatsky  <yurys at chromium.org>
    
            Unreviewed. Revert r54285 which failed to compile on Linux GTK.
    
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSInjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::injectedScriptFor):
            * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
            (WebCore::InjectedScriptHost::injectedScriptFor):
            * inspector/InjectedScript.cpp: Removed.
            * inspector/InjectedScript.h: Removed.
            * inspector/InjectedScriptHost.cpp:
            (WebCore::InjectedScriptHost::injectedScriptForId):
            (WebCore::InjectedScriptHost::releaseWrapperObjectGroup):
            * inspector/InjectedScriptHost.h:
            * inspector/InspectorBackend.cpp:
            (WebCore::InspectorBackend::dispatchOnInjectedScript):
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::InspectorController):
            (WebCore::InspectorController::~InspectorController):
            (WebCore::InspectorController::inspectedPageDestroyed):
            (WebCore::InspectorController::windowScriptObjectAvailable):
            (WebCore::InspectorController::scriptObjectReady):
            (WebCore::InspectorController::setFrontendProxyObject):
            (WebCore::InspectorController::close):
            (WebCore::InspectorController::getProfile):
            (WebCore::InspectorController::enableDebugger):
            (WebCore::InspectorController::didPause):
            (WebCore::InspectorController::injectedScriptForNodeId):
            * inspector/InspectorController.h:
            (WebCore::InspectorController::frontendScriptState):
            * inspector/InspectorFrontend.cpp:
            (WebCore::InspectorFrontend::addConsoleMessage):
            * inspector/front-end/InjectedScript.js:
            (injectedScriptConstructor):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 8291811..ed49e83 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1581,8 +1581,6 @@
             'inspector/InspectorClient.h',
             'inspector/ConsoleMessage.cpp',
             'inspector/ConsoleMessage.h',
-            'inspector/InjectedScript.cpp',
-            'inspector/InjectedScript.h',
             'inspector/InjectedScriptHost.cpp',
             'inspector/InjectedScriptHost.h',
             'inspector/InspectorBackend.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index be4244d..61e8c3c 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -664,7 +664,6 @@ SOURCES += \
     html/PreloadScanner.cpp \
     html/ValidityState.cpp \
     inspector/ConsoleMessage.cpp \
-    inspector/InjectedScript.cpp \
     inspector/InjectedScriptHost.cpp \
     inspector/InspectorBackend.cpp \
     inspector/InspectorController.cpp \
@@ -1356,7 +1355,6 @@ HEADERS += \
     html/TimeRanges.h \
     html/ValidityState.h \
     inspector/ConsoleMessage.h \
-    inspector/InjectedScript.h \
     inspector/InjectedScriptHost.h \
     inspector/InspectorBackend.h \
     inspector/InspectorController.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 8bcca83..c31de7d 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42557,14 +42557,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\inspector\InjectedScript.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\inspector\InjectedScript.h"
-				>
-			</File>
-			<File
 				RelativePath="..\inspector\InjectedScriptHost.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index f4b8b02..4b34eb0 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4814,8 +4814,6 @@
 		ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED501DC50B249F2900AE18D9 /* EditorMac.mm */; };
 		EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
-		F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3644AFD1119805900E0D537 /* InjectedScript.cpp */; };
-		F3644B001119805900E0D537 /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = F3644AFE1119805900E0D537 /* InjectedScript.h */; };
 		F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */; };
 		F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */; };
 		F5C041DA0FFCA7CE00839D4A /* HTMLDataListElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5C041D70FFCA7CE00839D4A /* HTMLDataListElement.cpp */; };
@@ -10095,8 +10093,6 @@
 		ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = EditorMac.mm; path = mac/EditorMac.mm; sourceTree = "<group>"; };
 		EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
 		EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
-		F3644AFD1119805900E0D537 /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = "<group>"; };
-		F3644AFE1119805900E0D537 /* InjectedScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScript.h; sourceTree = "<group>"; };
 		F4EAF4AC10C742B1009100D3 /* OpenTypeSanitizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OpenTypeSanitizer.cpp; path = opentype/OpenTypeSanitizer.cpp; sourceTree = "<group>"; };
 		F4EAF4AD10C742B1009100D3 /* OpenTypeSanitizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OpenTypeSanitizer.h; path = opentype/OpenTypeSanitizer.h; sourceTree = "<group>"; };
 		F523D23B02DE4396018635CA /* HTMLDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocument.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -10596,8 +10592,6 @@
 				1C81B9590E97330800266E07 /* front-end */,
 				41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */,
 				41F0618C0F5F069800A07EAC /* ConsoleMessage.h */,
-				F3644AFD1119805900E0D537 /* InjectedScript.cpp */,
-				F3644AFE1119805900E0D537 /* InjectedScript.h */,
 				7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */,
 				7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */,
 				7A0E76F810BF08ED00A0276E /* InjectedScriptHost.idl */,
@@ -18499,7 +18493,6 @@
 				E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */,
 				93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
-				F3644B001119805900E0D537 /* InjectedScript.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
 				84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
 				B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
@@ -20676,7 +20669,6 @@
 				93F19B0308245E59001E9ABC /* XSLStyleSheetLibxslt.cpp in Sources */,
 				E1F1E82F0C3C2BB9006DB391 /* XSLTExtensions.cpp in Sources */,
 				93F19B0408245E59001E9ABC /* XSLTProcessor.cpp in Sources */,
-				F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */,
 				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index 96c5c43..d38d8ee 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -43,7 +43,6 @@
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
-#include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorController.h"
 #include "InspectorResource.h"
@@ -195,21 +194,20 @@ JSValue JSInjectedScriptHost::selectDOMStorage(ExecState*, const ArgList& args)
 }
 #endif
 
-InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
+ScriptObject InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
 {
     JSLock lock(SilenceAssertionsOnly);
     JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     JSObject* injectedScript = globalObject->injectedScript();
     if (injectedScript)
-        return InjectedScript(ScriptObject(scriptState, injectedScript));
+        return ScriptObject(scriptState, injectedScript);
 
     ASSERT(!m_injectedScriptSource.isEmpty());
     ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, scriptState, m_nextInjectedScriptId);
     globalObject->setInjectedScript(injectedScriptObject.jsObject());
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
+    m_idToInjectedScript.set(m_nextInjectedScriptId, injectedScriptObject);
     m_nextInjectedScriptId++;
-    return result;
+    return injectedScriptObject;
 }
 
 } // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 32c4b33..0ddcf97 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -34,7 +34,6 @@
 #include "DOMWindow.h"
 #include "Database.h"
 #include "Frame.h"
-#include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorController.h"
 #include "Node.h"
@@ -195,7 +194,7 @@ v8::Handle<v8::Value> V8InjectedScriptHost::selectDOMStorageCallback(const v8::A
 }
 #endif
 
-InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScriptState)
+ScriptObject InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScriptState)
 {
     v8::HandleScope handleScope;
     v8::Local<v8::Context> context = inspectedScriptState->context();
@@ -209,15 +208,14 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScrip
     v8::Local<v8::String> key = v8::String::New("Devtools_InjectedScript");
     v8::Local<v8::Value> val = global->GetHiddenValue(key);
     if (!val.IsEmpty() && val->IsObject())
-        return InjectedScript(ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val)));
+        return ScriptObject(inspectedScriptState, v8::Local<v8::Object>::Cast(val));
 
     ASSERT(!m_injectedScriptSource.isEmpty());
     ScriptObject injectedScriptObject = createInjectedScript(m_injectedScriptSource, this, inspectedScriptState, m_nextInjectedScriptId);
-    InjectedScript result(injectedScriptObject);
-    m_idToInjectedScript.set(m_nextInjectedScriptId, result);
+    m_idToInjectedScript.set(m_nextInjectedScriptId, injectedScriptObject);
     ++m_nextInjectedScriptId;
     global->SetHiddenValue(key, injectedScriptObject.v8Object());
-    return result;
+    return injectedScriptObject;
 }
 
 } // namespace WebCore
diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp
deleted file mode 100644
index 5275401..0000000
--- a/WebCore/inspector/InjectedScript.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 "InjectedScript.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "PlatformString.h"
-#include "ScriptFunctionCall.h"
-
-namespace WebCore {
-
-InjectedScript::InjectedScript(ScriptObject injectedScriptObject)
-    : m_injectedScriptObject(injectedScriptObject)
-{
-}
-
-void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, String* result, bool* hadException) 
-{
-    ASSERT(!hasNoValue());
-    ScriptState* scriptState = m_injectedScriptObject.scriptState();
-    ScriptFunctionCall function(scriptState, m_injectedScriptObject, "dispatch");
-    function.appendArgument(methodName);
-    function.appendArgument(arguments);
-    if (async)
-        function.appendArgument(callId);
-    *hadException = false;
-    ScriptValue resultValue = function.call(*hadException);
-    if (!*hadException)
-        *result = resultValue.toString(scriptState);
-}
-
-String InjectedScript::callFrames()
-{
-    ASSERT(!hasNoValue());
-    ScriptState* scriptState = m_injectedScriptObject.scriptState();
-    ScriptFunctionCall function(scriptState, m_injectedScriptObject, "callFrames");
-    ScriptValue callFramesValue = function.call();
-    return callFramesValue.toString(scriptState);
-}
-
-String InjectedScript::wrapAndStringifyForConsole(ScriptValue value)
-{
-    ASSERT(!hasNoValue());
-    ScriptState* scriptState = m_injectedScriptObject.scriptState();
-    ScriptFunctionCall wrapFunction(scriptState, m_injectedScriptObject, "wrapAndStringifyObject");
-    wrapFunction.appendArgument(value);
-    wrapFunction.appendArgument("console");
-    ScriptValue r = wrapFunction.call();
-    if (r.hasNoValue())
-        return "";
-    return r.toString(scriptState);
-}
-
-void InjectedScript::releaseWrapperObjectGroup(const String& objectGroup)
-{
-    ASSERT(!hasNoValue());
-    ScriptState* scriptState = m_injectedScriptObject.scriptState();
-    ScriptFunctionCall releaseFunction(scriptState, m_injectedScriptObject, "releaseWrapperObjectGroup");
-    releaseFunction.appendArgument(objectGroup);
-    releaseFunction.call();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h
deleted file mode 100644
index dc8a808..0000000
--- a/WebCore/inspector/InjectedScript.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef InjectedScript_h
-#define InjectedScript_h
-
-#include "InjectedScriptHost.h"
-#include "ScriptObject.h"
-#include <wtf/Noncopyable.h>
-
-namespace WebCore {
-
-class String;
-
-class InjectedScript {
-public:
-    InjectedScript() { }
-    ~InjectedScript() { }
-
-    bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
-
-    void dispatch(long callId, const String& methodName, const String& arguments, bool async, String* result, bool* hadException);
-    String callFrames();
-    String wrapAndStringifyForConsole(ScriptValue);
-    void releaseWrapperObjectGroup(const String&);
-
-private:
-    friend InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState*);
-    explicit InjectedScript(ScriptObject);
-    ScriptObject m_injectedScriptObject;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/inspector/InjectedScriptHost.cpp b/WebCore/inspector/InjectedScriptHost.cpp
index f88528d..d5bbd1c 100644
--- a/WebCore/inspector/InjectedScriptHost.cpp
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -38,7 +38,6 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
-#include "InjectedScript.h"
 #include "InspectorClient.h"
 #include "InspectorController.h"
 #include "InspectorDOMAgent.h"
@@ -168,7 +167,7 @@ void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, const St
         frontend->didDispatchOnInjectedScript(callId, result, isException);
 }
 
-InjectedScript InjectedScriptHost::injectedScriptForId(long id)
+ScriptObject InjectedScriptHost::injectedScriptForId(long id)
 {
     return m_idToInjectedScript.get(id);
 }
@@ -181,13 +180,13 @@ void InjectedScriptHost::discardInjectedScripts()
 void InjectedScriptHost::releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup)
 {
     if (injectedScriptId) {
-         InjectedScript injectedScript = m_idToInjectedScript.get(injectedScriptId);
+         ScriptObject injectedScript = m_idToInjectedScript.get(injectedScriptId);
          if (!injectedScript.hasNoValue())
-             injectedScript.releaseWrapperObjectGroup(objectGroup);
+             releaseWrapperObjectGroup(injectedScript, objectGroup);
     } else {
          // Iterate over all injected scripts if injectedScriptId is not specified.
          for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it)
-              it->second.releaseWrapperObjectGroup(objectGroup);
+              releaseWrapperObjectGroup(it->second, objectGroup);
     }
 }
 
@@ -205,6 +204,13 @@ InspectorFrontend* InjectedScriptHost::inspectorFrontend()
     return m_inspectorController->m_frontend.get();
 }
 
+void InjectedScriptHost::releaseWrapperObjectGroup(const ScriptObject& injectedScript, const String& objectGroup)
+{
+    ScriptFunctionCall releaseFunction(injectedScript.scriptState(), injectedScript, "releaseWrapperObjectGroup");
+    releaseFunction.appendArgument(objectGroup);
+    releaseFunction.call();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
index 2b0f8b4..d91c8e2 100644
--- a/WebCore/inspector/InjectedScriptHost.h
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -41,7 +41,6 @@
 namespace WebCore {
 
 class Database;
-class InjectedScript;
 class InspectorDOMAgent;
 class InspectorFrontend;
 class JavaScriptCallFrame;
@@ -84,8 +83,8 @@ public:
 #endif
     void reportDidDispatchOnInjectedScript(long callId, const String& result, bool isException);
 
-    InjectedScript injectedScriptFor(ScriptState*);
-    InjectedScript injectedScriptForId(long);
+    ScriptObject injectedScriptFor(ScriptState*);
+    ScriptObject injectedScriptForId(long);
     void discardInjectedScripts();
     void releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup);
 
@@ -94,10 +93,12 @@ private:
     InspectorDOMAgent* inspectorDOMAgent();
     InspectorFrontend* inspectorFrontend();
 
+    void releaseWrapperObjectGroup(const ScriptObject& injectedScript, const String& objectGroup);
+
     InspectorController* m_inspectorController;
     String m_injectedScriptSource;
     long m_nextInjectedScriptId;
-    typedef HashMap<long, InjectedScript> IdToInjectedScriptMap;
+    typedef HashMap<long, ScriptObject> IdToInjectedScriptMap;
     IdToInjectedScriptMap m_idToInjectedScript;
 };
 
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 2c74212..999a4b7 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -40,7 +40,6 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
-#include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorClient.h"
 #include "InspectorController.h"
@@ -286,7 +285,7 @@ void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScript
     // FIXME: explicitly pass injectedScriptId along with node id to the frontend.
     bool injectedScriptIdIsNodeId = injectedScriptId <= 0;
 
-    InjectedScript injectedScript;
+    ScriptObject injectedScript;
     if (injectedScriptIdIsNodeId)
         injectedScript = m_inspectorController->injectedScriptForNodeId(-injectedScriptId);
     else
@@ -295,12 +294,19 @@ void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScript
     if (injectedScript.hasNoValue())
         return;
 
-    String result;
+    ScriptFunctionCall function(injectedScript.scriptState(), injectedScript, "dispatch");
+    function.appendArgument(methodName);
+    function.appendArgument(arguments);
+    if (async)
+        function.appendArgument(callId);
     bool hadException = false;
-    injectedScript.dispatch(callId, methodName, arguments, async, &result, &hadException);
+    ScriptValue result = function.call(hadException);
     if (async)
         return;  // InjectedScript will return result asynchronously by means of ::reportDidDispatchOnInjectedScript.
-    frontend->didDispatchOnInjectedScript(callId, result, hadException);
+    if (hadException)
+        frontend->didDispatchOnInjectedScript(callId, "", true);
+    else
+        frontend->didDispatchOnInjectedScript(callId, result.toString(injectedScript.scriptState()), false);
 }
 
 void InspectorBackend::getChildNodes(long callId, long nodeId)
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index dbc5275..4e3b423 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -54,7 +54,6 @@
 #include "HTMLFrameOwnerElement.h"
 #include "HitTestResult.h"
 #include "InjectedScriptHost.h"
-#include "InjectedScript.h"
 #include "InspectorBackend.h"
 #include "InspectorClient.h"
 #include "InspectorDOMAgent.h"
@@ -132,7 +131,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
     , m_client(client)
     , m_page(0)
     , m_expiredConsoleMessageCount(0)
-    , m_frontendScriptState(0)
+    , m_scriptState(0)
     , m_windowVisible(false)
     , m_showAfterVisible(CurrentPanel)
     , m_groupLevel(0)
@@ -162,7 +161,7 @@ InspectorController::~InspectorController()
 {
     // These should have been cleared in inspectedPageDestroyed().
     ASSERT(!m_client);
-    ASSERT(!m_frontendScriptState);
+    ASSERT(!m_scriptState);
     ASSERT(!m_inspectedPage);
     ASSERT(!m_page || (m_page && !m_page->parentInspectorController()));
 
@@ -183,9 +182,10 @@ void InspectorController::inspectedPageDestroyed()
 {
     close();
 
-    if (m_frontendScriptState) {
-        ScriptGlobalObject::remove(m_frontendScriptState, "InspectorBackend");
-        ScriptGlobalObject::remove(m_frontendScriptState, "InspectorFrontendHost");
+    if (m_scriptState) {
+        ScriptGlobalObject::remove(m_scriptState, "InspectorBackend");
+        ScriptGlobalObject::remove(m_scriptState, "InspectorFrontendHost");
+        ScriptGlobalObject::remove(m_scriptState, "InjectedScriptHost");
     }
     ASSERT(m_inspectedPage);
     m_inspectedPage = 0;
@@ -508,21 +508,22 @@ void InspectorController::windowScriptObjectAvailable()
 
     // Grant the inspector the ability to script the inspected page.
     m_page->mainFrame()->document()->securityOrigin()->grantUniversalAccess();
-    m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_page);
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorBackend.get());
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_inspectorFrontendHost.get());
+    m_scriptState = scriptStateFromPage(debuggerWorld(), m_page);
+    ScriptGlobalObject::set(m_scriptState, "InspectorBackend", m_inspectorBackend.get());
+    ScriptGlobalObject::set(m_scriptState, "InspectorFrontendHost", m_inspectorFrontendHost.get());
 }
 
 void InspectorController::scriptObjectReady()
 {
-    ASSERT(m_frontendScriptState);
-    if (!m_frontendScriptState)
+    ASSERT(m_scriptState);
+    if (!m_scriptState)
         return;
 
     ScriptObject webInspectorObj;
-    if (!ScriptGlobalObject::get(m_frontendScriptState, "WebInspector", webInspectorObj))
+    if (!ScriptGlobalObject::get(m_scriptState, "WebInspector", webInspectorObj))
         return;
-    setFrontendProxyObject(m_frontendScriptState, webInspectorObj);
+    ScriptObject injectedScriptObj;
+    setFrontendProxyObject(m_scriptState, webInspectorObj, injectedScriptObj);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     String debuggerEnabled = setting(debuggerEnabledSettingName);
@@ -541,7 +542,7 @@ void InspectorController::scriptObjectReady()
 
 void InspectorController::setFrontendProxyObject(ScriptState* scriptState, ScriptObject webInspectorObj, ScriptObject)
 {
-    m_frontendScriptState = scriptState;
+    m_scriptState = scriptState;
     m_frontend.set(new InspectorFrontend(this, scriptState, webInspectorObj));
     releaseDOMAgent();
     m_domAgent = InspectorDOMAgent::create(m_frontend.get());
@@ -602,7 +603,7 @@ void InspectorController::close()
     releaseDOMAgent();
     m_frontend.set(0);
     m_timelineAgent = 0;
-    m_frontendScriptState = 0;
+    m_scriptState = 0;
     if (m_page) {
         if (!m_page->mainFrame() || !m_page->mainFrame()->loader() || !m_page->mainFrame()->loader()->isLoading()) {
             m_page->setParentInspectorController(0);
@@ -1391,7 +1392,7 @@ void InspectorController::getProfile(long callId, unsigned uid)
         return;
     ProfilesMap::iterator it = m_profiles.find(uid);
     if (it != m_profiles.end())
-        m_frontend->didGetProfile(callId, toJS(m_frontendScriptState, it->second.get()));
+        m_frontend->didGetProfile(callId, toJS(m_scriptState, it->second.get()));
 }
 
 ScriptObject InspectorController::createProfileHeader(const ScriptProfile& profile)
@@ -1517,7 +1518,7 @@ void InspectorController::enableDebugger()
     if (m_debuggerEnabled)
         return;
 
-    if (!m_frontendScriptState || !m_frontend)
+    if (!m_scriptState || !m_frontend)
         m_attachDebuggerWhenShown = true;
     else {
         m_frontend->attachDebuggerWhenShown();
@@ -1568,8 +1569,11 @@ void InspectorController::didPause()
     JavaScriptCallFrame* callFrame = m_injectedScriptHost->currentCallFrame();
     ScriptState* scriptState = callFrame->scopeChain()->globalObject->globalExec();
     ASSERT(scriptState);
-    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptFor(scriptState);
-    String callFrames = injectedScript.callFrames();
+    ScriptObject injectedScriptObj = m_injectedScriptHost->injectedScriptFor(scriptState);
+    ScriptFunctionCall function(scriptState, injectedScriptObj, "getCallFrames");
+    ScriptValue callFramesValue = function.call();
+    String callFrames = callFramesValue.toString(scriptState);
+
     m_frontend->pausedScript(callFrames);
 }
 
@@ -1806,7 +1810,7 @@ void InspectorController::deleteCookie(const String& cookieName, const String& d
     }
 }
 
-InjectedScript InspectorController::injectedScriptForNodeId(long id)
+ScriptObject InspectorController::injectedScriptForNodeId(long id)
 {
 
     Frame* frame = 0;
@@ -1824,7 +1828,7 @@ InjectedScript InspectorController::injectedScriptForNodeId(long id)
     if (frame)
         return m_injectedScriptHost->injectedScriptFor(mainWorldScriptState(frame));
 
-    return InjectedScript();
+    return ScriptObject();
 }
 
 } // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 0b914fb..9ef202f 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -64,7 +64,6 @@ class DocumentLoader;
 class Element;
 class GraphicsContext;
 class HitTestResult;
-class InjectedScript;
 class InjectedScriptHost;
 class InspectorBackend;
 class InspectorClient;
@@ -158,7 +157,7 @@ public:
     void windowScriptObjectAvailable();
 
     void setFrontendProxyObject(ScriptState* state, ScriptObject webInspectorObj, ScriptObject injectedScriptObj = ScriptObject());
-    ScriptState* frontendScriptState() const { return m_frontendScriptState; }
+    ScriptState* frontendScriptState() const { return m_scriptState; }
 
     void populateScriptObjects();
     void resetScriptObjects();
@@ -249,7 +248,7 @@ public:
 
     void evaluateForTestInFrontend(long callId, const String& script);
 
-    InjectedScript injectedScriptForNodeId(long id);
+    ScriptObject injectedScriptForNodeId(long id);
 
 private:
     static const char* const FrontendSettingsSettingName;
@@ -329,7 +328,7 @@ private:
 #if ENABLE(DOM_STORAGE)
     DOMStorageResourcesMap m_domStorageResources;
 #endif
-    ScriptState* m_frontendScriptState;
+    ScriptState* m_scriptState;
     bool m_windowVisible;
     SpecialPanels m_showAfterVisible;
     RefPtr<Node> m_highlightedNode;
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index cc92976..d5c817d 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -34,7 +34,6 @@
 
 #include "ConsoleMessage.h"
 #include "Frame.h"
-#include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorController.h"
 #include "Node.h"
@@ -106,9 +105,15 @@ void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const
             function.appendArgument(frames[i]);
     } else if (!arguments.isEmpty()) {
         function.appendArgument(true);
-        InjectedScript injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptFor(scriptState);
+        ScriptObject injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptFor(scriptState);
         for (unsigned i = 0; i < arguments.size(); ++i) {
-            String s = injectedScript.wrapAndStringifyForConsole(arguments[i]);
+            ScriptFunctionCall wrapFunction(scriptState, injectedScript, "wrapAndStringifyObject");
+            wrapFunction.appendArgument(arguments[i]);
+            wrapFunction.appendArgument("console");
+            ScriptValue r = wrapFunction.call();
+            if (r.hasNoValue())
+                return;
+            String s = r.toString(scriptState);
             function.appendArgument(s);
         }
     } else {
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 337628f..9389117 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -923,7 +923,7 @@ InjectedScript.openInInspectedWindow = function(url)
     return true;
 }
 
-InjectedScript.callFrames = function()
+InjectedScript.getCallFrames = function()
 {
     var callFrame = InjectedScriptHost.currentCallFrame();
     if (!callFrame)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list