2010-07-27 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jul 2010 13:41:20 +0000 (13:41 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jul 2010 13:41:20 +0000 (13:41 +0000)
        Reviewed by Pavel Feldman.

        WebInspector: Current implementation of message based inspector
        transport generated by CodeGeneratorInspector should be upstreamed
        from WebKit/chromium to WebCore.
        https://bugs.webkit.org/show_bug.cgi?id=42983

        * Android.derived.v8bindings.mk:
        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * GNUmakefile.am:
        * WebCore.exp.in:
        * WebCore.gypi:
        * WebCore.pri:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ScriptObject.cpp:
        * bindings/js/ScriptObject.h:
        * bindings/v8/ScriptObject.cpp:
        * bindings/v8/ScriptObject.h:
        * inspector/CodeGeneratorInspector.pm:
        * inspector/InspectorBackend.idl: Removed.
        * inspector/InspectorFrontendClient.h:
        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
        (WebCore::InspectorFrontendClientLocal::sendMessageToBackend):
        * inspector/InspectorFrontendClientLocal.h:
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::sendMessageToBackend):
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.idl:
        * inspector/front-end/InspectorBackendStub.js:
        (.WebInspector.InspectorBackendStub):
        (.WebInspector.InspectorBackendStub.prototype._registerDelegate):
        (.WebInspector.InspectorBackendStub.prototype.sendMessageToBackend):

2010-07-27  Ilya Tikhonovsky  <loislo@chromium.org>

        Reviewed by Pavel Feldman.

        WebInspector: Current implementation of message based inspector
        transport generated by CodeGeneratorInspector should be upstreamed
        from WebKit/chromium to WebCore.
        https://bugs.webkit.org/show_bug.cgi?id=42983

        * WebKit.gypi:
        * src/InspectorFrontendClientImpl.cpp:
        (WebKit::InspectorFrontendClientImpl::sendMessageToBackend):
        * src/InspectorFrontendClientImpl.h:
        * src/ToolsAgent.h:
        * src/WebDevToolsAgentImpl.cpp:
        (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController):
        (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
        * src/WebDevToolsAgentImpl.h:
        * src/js/InspectorControllerImpl.js: Removed.

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

32 files changed:
WebCore/Android.derived.v8bindings.mk
WebCore/CMakeLists.txt
WebCore/ChangeLog
WebCore/DerivedSources.cpp
WebCore/DerivedSources.make
WebCore/GNUmakefile.am
WebCore/WebCore.exp.in
WebCore/WebCore.gypi
WebCore/WebCore.pri
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/js/ScriptObject.cpp
WebCore/bindings/js/ScriptObject.h
WebCore/bindings/v8/ScriptObject.cpp
WebCore/bindings/v8/ScriptObject.h
WebCore/inspector/CodeGeneratorInspector.pm
WebCore/inspector/InspectorBackend.idl [deleted file]
WebCore/inspector/InspectorFrontendClient.h
WebCore/inspector/InspectorFrontendClientLocal.cpp
WebCore/inspector/InspectorFrontendClientLocal.h
WebCore/inspector/InspectorFrontendHost.cpp
WebCore/inspector/InspectorFrontendHost.h
WebCore/inspector/InspectorFrontendHost.idl
WebCore/inspector/front-end/InspectorBackendStub.js
WebKit/chromium/ChangeLog
WebKit/chromium/WebKit.gypi
WebKit/chromium/src/InspectorFrontendClientImpl.cpp
WebKit/chromium/src/InspectorFrontendClientImpl.h
WebKit/chromium/src/ToolsAgent.h
WebKit/chromium/src/WebDevToolsAgentImpl.cpp
WebKit/chromium/src/WebDevToolsAgentImpl.h
WebKit/chromium/src/js/InspectorControllerImpl.js [deleted file]

index 1e7fa37b4f0df91cdc125345d09505f10fa3a795..cfa8dc91cc1726fef84a3a723cfb8acaf338666c 100644 (file)
@@ -571,7 +571,6 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
 # These headers are required by the V8 bindings even when Inspector is disabled
 GEN := \
     $(intermediates)/bindings/V8InjectedScriptHost.h \
-    $(intermediates)/bindings/V8InspectorBackend.h \
     $(intermediates)/bindings/V8InspectorFrontendHost.h
 
 $(GEN): PRIVATE_PATH := $(LOCAL_PATH)
index d695636ad7f058ba7bfe0a1e46ddaaa4f1dfc07f..3bfa0a9f766c968c9c75cd2dbd5727513ee0f1a9 100644 (file)
@@ -293,7 +293,6 @@ SET(WebCore_IDL_FILES
     html/canvas/Uint8Array.idl
 
     inspector/InjectedScriptHost.idl
-    inspector/InspectorBackend.idl
     inspector/InspectorFrontendHost.idl
     inspector/JavaScriptCallFrame.idl
     inspector/ScriptProfile.idl
index eeec11fc25f50f7f25312952c17dd9a18333f34c..6c3d000abf52bd2906c988a0ed05c570842d8096 100644 (file)
@@ -1,3 +1,42 @@
+2010-07-27  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        WebInspector: Current implementation of message based inspector
+        transport generated by CodeGeneratorInspector should be upstreamed
+        from WebKit/chromium to WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=42983
+
+        * Android.derived.v8bindings.mk:
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.exp.in:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/ScriptObject.cpp:
+        * bindings/js/ScriptObject.h:
+        * bindings/v8/ScriptObject.cpp:
+        * bindings/v8/ScriptObject.h:
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/InspectorBackend.idl: Removed.
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+        (WebCore::InspectorFrontendClientLocal::sendMessageToBackend):
+        * inspector/InspectorFrontendClientLocal.h:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::sendMessageToBackend):
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/front-end/InspectorBackendStub.js:
+        (.WebInspector.InspectorBackendStub):
+        (.WebInspector.InspectorBackendStub.prototype._registerDelegate):
+        (.WebInspector.InspectorBackendStub.prototype.sendMessageToBackend):
+
 2010-07-27  Satish Sampath  <satish@chromium.org>
 
         Reviewed by Kent Tamura.
index 78c523fa1f86db023e7a3879a48a77b961ce4451..ea6e47e04f580727913bb216f89e5898feafd660 100644 (file)
 #include "JSImageData.cpp"
 #include "JSIndexedDatabaseRequest.cpp"
 #include "JSInjectedScriptHost.cpp"
-#include "JSInspectorBackend.cpp"
 #include "JSInspectorFrontendHost.cpp"
 #include "JSJavaScriptCallFrame.cpp"
 #include "JSKeyboardEvent.cpp"
index 7c53e8695bc837dc9b00cb79e9fe85b7d0f456ee..8cecc2b568bda0595dcf8673fe543705a730a6cb 100644 (file)
@@ -233,7 +233,6 @@ DOM_CLASSES = \
     ImageData \
     IndexedDatabaseRequest \
     InjectedScriptHost \
-    InspectorBackend \
     InspectorFrontendHost \
     KeyboardEvent \
     Location \
index f7217acc41ed3c984f61c257adf1901ac5dd352a..6fefc8ba373eade67c51edcd5ff192b5867804ed 100644 (file)
@@ -392,8 +392,6 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSImageData.h \
        DerivedSources/WebCore/JSInjectedScriptHost.cpp \
        DerivedSources/WebCore/JSInjectedScriptHost.h \
-       DerivedSources/WebCore/JSInspectorBackend.cpp \
-       DerivedSources/WebCore/JSInspectorBackend.h \
        DerivedSources/WebCore/JSInspectorFrontendHost.cpp \
        DerivedSources/WebCore/JSInspectorFrontendHost.h \
        DerivedSources/WebCore/JSInt16Array.cpp \
index 665dab4ab189840d515f464f08bbc4bead13a015..dfbd150c7e0103a76d8cf2984aec6cc469c7dcee 100644 (file)
@@ -1195,6 +1195,7 @@ __ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
 __ZN7WebCore28InspectorFrontendClientLocal19requestAttachWindowEv
 __ZN7WebCore28InspectorFrontendClientLocal19requestDetachWindowEv
 __ZN7WebCore28InspectorFrontendClientLocal19windowObjectClearedEv
+__ZN7WebCore28InspectorFrontendClientLocal20sendMessageToBackendERKNS_6StringE
 __ZN7WebCore28InspectorFrontendClientLocal26changeAttachedWindowHeightEj
 __ZN7WebCore28InspectorFrontendClientLocal27restoreAttachedWindowHeightEv
 __ZN7WebCore28InspectorFrontendClientLocalC2EPNS_19InspectorControllerEPNS_4PageE
index 7d7cff5353539118c637922378997903e18bd191..aafb222ea2d6d2c529397a544ab9a0de2d08483f 100644 (file)
             'html/ValidityState.idl',
             'html/VoidCallback.idl',
             'inspector/InjectedScriptHost.idl',
-            'inspector/InspectorBackend.idl',
             'inspector/InspectorFrontendHost.idl',
             'inspector/JavaScriptCallFrame.idl',
             'inspector/ScriptProfile.idl',
index 18a76a041ab547530f94ffb752c60ca253036f34..e59cc98fecfe9e0061403dc0aca792f95d862202 100644 (file)
@@ -448,7 +448,6 @@ IDL_BINDINGS += \
     html/ValidityState.idl \
     html/VoidCallback.idl \
     inspector/InjectedScriptHost.idl \
-    inspector/InspectorBackend.idl \
     inspector/InspectorFrontendHost.idl \
     inspector/JavaScriptCallFrame.idl \
     inspector/ScriptProfile.idl \
index 8195439f3d8dc6183cb17ba039a9a7c8cfe84671..89c07d5803bb35c52ce69b67d5952907de2c99a1 100644 (file)
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInjectedScriptHost.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"\r
-                               >\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Debug_Internal|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Debug_Cairo|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release_Cairo|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Debug_All|Win32"\r
-                                       ExcludedFromBuild="true"\r
-                                       >\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                       />\r
-                               </FileConfiguration>\r
-                       </File>\r
-                       <File\r
-                               RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp"\r
                                >\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.h"\r
+                               RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"\r
                                >\r
                        </File>\r
                        <File\r
index 74de681a19a9e8d78d93964f130fc80a3ecb556e..945aa5da02bfd7217bb055ecc1bbc3048261a916 100644 (file)
                41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CB0FF5986900576B3B /* AbstractWorker.h */; };
                41E1B1D30FF5986900576B3B /* SharedWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */; };
                41E1B1D40FF5986900576B3B /* SharedWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 41E1B1CE0FF5986900576B3B /* SharedWorker.h */; };
-               41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */; };
-               41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */; };
                41F061740F5F00AC00A07EAC /* InspectorDOMStorageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */; };
                41F061750F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */; };
                41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F0618C0F5F069800A07EAC /* ConsoleMessage.h */; };
                41E1B1CD0FF5986900576B3B /* SharedWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharedWorker.cpp; path = workers/SharedWorker.cpp; sourceTree = "<group>"; };
                41E1B1CE0FF5986900576B3B /* SharedWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedWorker.h; path = workers/SharedWorker.h; sourceTree = "<group>"; };
                41E1B1CF0FF5986900576B3B /* SharedWorker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SharedWorker.idl; path = workers/SharedWorker.idl; sourceTree = "<group>"; };
-               41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorBackend.cpp; sourceTree = "<group>"; };
-               41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInspectorBackend.h; sourceTree = "<group>"; };
                41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageResource.h; sourceTree = "<group>"; };
                41F061730F5F00AC00A07EAC /* InspectorDOMStorageResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMStorageResource.cpp; sourceTree = "<group>"; };
                41F0618C0F5F069800A07EAC /* ConsoleMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleMessage.h; sourceTree = "<group>"; };
                7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = "<group>"; };
                7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
                7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
-               7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = "<group>"; };
                7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; };
                7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; };
                7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
                                4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */,
                                7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */,
                                7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */,
-                               41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */,
-                               41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */,
                                7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */,
                                7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
                                1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */,
                                B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
                                7A74ECB8101839A500BF939E /* InspectorBackend.cpp */,
                                7A74ECB9101839A600BF939E /* InspectorBackend.h */,
-                               7A74ECB61018399A00BF939E /* InspectorBackend.idl */,
                                1C81B9580E97330800266E07 /* InspectorClient.h */,
                                1C81B9570E97330800266E07 /* InspectorController.cpp */,
                                1C81B9560E97330800266E07 /* InspectorController.h */,
                                A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
                                C585A69711D4FB13004C3E4B /* JSIndexedDatabaseRequest.h in Headers */,
                                7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
-                               41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */,
                                7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
                                49EECF07105070C400099FAB /* JSInt16Array.h in Headers */,
                                49EECF05105070C400099FAB /* JSInt32Array.h in Headers */,
                                C585A69611D4FB13004C3E4B /* JSIndexedDatabaseRequest.cpp in Sources */,
                                7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */,
                                7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */,
-                               41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */,
                                7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
                                7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
                                49EECF06105070C400099FAB /* JSInt16Array.cpp in Sources */,
index 16b9f01832f8934342d37ed9cf976082ecc45ca1..de397f781a62c5343daf1ea358d922260bdfa0e8 100644 (file)
@@ -37,7 +37,6 @@
 
 #if ENABLE(INSPECTOR)
 #include "JSInjectedScriptHost.h"
-#include "JSInspectorBackend.h"
 #include "JSInspectorFrontendHost.h"
 #endif
 
@@ -158,14 +157,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
 }
 
 #if ENABLE(INSPECTOR)
-bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)
-{
-    JSLock lock(SilenceAssertionsOnly);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
-    globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
-    return handleException(scriptState);
-}
-
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
 {
     JSLock lock(SilenceAssertionsOnly);
index 0c993e1b2776cc591f76b17ba08461aaafb1358e..9880976da61c73480cdc359532ed373b334db8dc 100644 (file)
@@ -39,7 +39,6 @@
 
 namespace WebCore {
     class InjectedScriptHost;
-    class InspectorBackend;
     class InspectorFrontendHost;
 
     class ScriptObject : public ScriptValue {
@@ -70,7 +69,6 @@ namespace WebCore {
     public:
         static bool set(ScriptState*, const char* name, const ScriptObject&);
 #if ENABLE(INSPECTOR)
-        static bool set(ScriptState*, const char* name, InspectorBackend*);
         static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
         static bool set(ScriptState*, const char* name, InjectedScriptHost*);
 #endif
index 520c57b8cd51992bb32eeac912b28674c21240f2..8f815375a97fd0cb4eed220c0cb5e2f37b6b934b 100644 (file)
@@ -38,7 +38,6 @@
 #include "Frame.h"
 #include "V8Binding.h"
 #include "V8InjectedScriptHost.h"
-#include "V8InspectorBackend.h"
 #include "V8InspectorFrontendHost.h"
 #include "V8Proxy.h"
 
@@ -146,13 +145,6 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
 }
 
 #if ENABLE(INSPECTOR)
-bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorBackend* value)
-{
-    ScriptScope scope(scriptState);
-    scope.global()->Set(v8::String::New(name), toV8(value));
-    return scope.success();
-}
-
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
 {
     ScriptScope scope(scriptState);
index a60f2a885b3812a5520cd2c93950221f08220870..bee079c32080556138f2dc011c2b6f2d723eb114 100644 (file)
@@ -37,7 +37,6 @@
 
 namespace WebCore {
     class InjectedScriptHost;
-    class InspectorBackend;
     class InspectorFrontendHost;
     class ScriptState;
 
@@ -69,7 +68,6 @@ namespace WebCore {
     class ScriptGlobalObject {
     public:
         static bool set(ScriptState*, const char* name, const ScriptObject&);
-        static bool set(ScriptState*, const char* name, InspectorBackend*);
         static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
         static bool set(ScriptState*, const char* name, InjectedScriptHost*);
         static bool get(ScriptState*, const char* name, ScriptObject&);
index f554026036364dd8fdb8b77de72623f97db21023..5488dbd98dce4afa271c6f9ec4cfbe3b24fbac27 100644 (file)
@@ -164,7 +164,7 @@ sub GenerateInterface
     $backendClassName = $className . "BackendDispatcher";
     my @backendHead;
     push(@backendHead, "    ${backendClassName}(InspectorBackend* inspectorBackend) : m_inspectorBackend(inspectorBackend) { }");
-    push(@backendHead, "    void dispatch(const String& message, String* exception);");
+    push(@backendHead, "    void dispatch(const String& message);");
     push(@backendHead, "private:");
     $backendConstructor = join("\n", @backendHead);
     $backendFooter = "    InspectorBackend* m_inspectorBackend;";
@@ -288,8 +288,9 @@ sub generateBackendDispatcher
     my @methods = map($backendMethods{$_}, keys %backendMethods);
     my @mapEntries = map("dispatchMap.add(\"$_\", &${backendClassName}::$_);", @methods);
 
-    push(@body, "void ${backendClassName}::dispatch(const String& message, String* exception)");
+    push(@body, "void ${backendClassName}::dispatch(const String& message)");
     push(@body, "{");
+    push(@body, "    String exception;");
     push(@body, "    typedef void (${backendClassName}::*CallHandler)(PassRefPtr<InspectorArray> args, String* exception);");
     push(@body, "    typedef HashMap<String, CallHandler> DispatchMap;");
     push(@body, "    DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, );");
@@ -300,38 +301,38 @@ sub generateBackendDispatcher
     push(@body, "    RefPtr<InspectorValue> parsedMessage = InspectorValue::parseJSON(message);");
     push(@body, "    if (!parsedMessage) {");
     push(@body, "        ASSERT_NOT_REACHED();");
-    push(@body, "        *exception = \"Error: Invalid message format. Message should be in JSON format.\";");
+    push(@body, "        exception = \"Error: Invalid message format. Message should be in JSON format.\";");
     push(@body, "        return;");
     push(@body, "    }");
     push(@body, "");
     push(@body, "    RefPtr<InspectorArray> messageArray = parsedMessage->asArray();");
     push(@body, "    if (!messageArray) {");
     push(@body, "        ASSERT_NOT_REACHED();");
-    push(@body, "        *exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";");
+    push(@body, "        exception = \"Error: Invalid message format. The message should be a JSONified array of arguments.\";");
     push(@body, "        return;");
     push(@body, "    }");
     push(@body, "");
     push(@body, "    if (!messageArray->length()) {");
     push(@body, "        ASSERT_NOT_REACHED();");
-    push(@body, "        *exception = \"Error: Invalid message format. Empty message was received.\";");
+    push(@body, "        exception = \"Error: Invalid message format. Empty message was received.\";");
     push(@body, "        return;");
     push(@body, "    }");
     push(@body, "");
     push(@body, "    String methodName;");
     push(@body, "    if (!messageArray->get(0)->asString(&methodName)) {");
     push(@body, "        ASSERT_NOT_REACHED();");
-    push(@body, "        *exception = \"Error: Invalid message format. The first element of the message should be method name.\";");
+    push(@body, "        exception = \"Error: Invalid message format. The first element of the message should be method name.\";");
     push(@body, "        return;");
     push(@body, "    }");
     push(@body, "");
     push(@body, "    HashMap<String, CallHandler>::iterator it = dispatchMap.find(methodName);");
     push(@body, "    if (it == dispatchMap.end()) {");
     push(@body, "        ASSERT_NOT_REACHED();");
-    push(@body, "        *exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());");
+    push(@body, "        exception = String::format(\"Error: Invalid method name. '%s' wasn't found.\", methodName.utf8().data());");
     push(@body, "        return;");
     push(@body, "    }");
     push(@body, "");
-    push(@body, "    ((*this).*it->second)(messageArray, exception);");
+    push(@body, "    ((*this).*it->second)(messageArray, &exception);");
     push(@body, "}");
     return @body;
 }
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
deleted file mode 100644 (file)
index 5941358..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 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
- * "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.
- */
-
-module core {
-    interface [Conditional=INSPECTOR] InspectorBackend {
-        void storeLastActivePanel(in DOMString panelName);
-
-        void saveApplicationSettings(in DOMString settings);
-        void saveSessionSettings(in DOMString settings);
-
-        void enableSearchingForNode();
-        void disableSearchingForNode();
-
-        void enableMonitoringXHR();
-        void disableMonitoringXHR();
-
-        void enableResourceTracking(in boolean always);
-        void disableResourceTracking(in boolean always);
-        void getResourceContent(in long callId, in unsigned long identifier);
-        void reloadPage();
-
-        void startTimelineProfiler();
-        void stopTimelineProfiler();
-
-#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
-        void enableDebugger(in boolean always);
-        void disableDebugger(in boolean always);
-
-        void setBreakpoint(in long callId, in DOMString sourceID, in unsigned long lineNumber, in boolean enabled, in DOMString condition);
-        void removeBreakpoint(in DOMString sourceID, in unsigned long lineNumber);
-        void activateBreakpoints();
-        void deactivateBreakpoints();
-
-        void pause();
-        void resume();
-
-        void stepOverStatement();
-        void stepIntoStatement();
-        void stepOutOfFunction();
-
-        void setPauseOnExceptionsState(in long pauseOnExceptionsState);
-
-        void editScriptSource(in long callId, in DOMString sourceID, in DOMString newContent);
-        void getScriptSource(in long callId, in DOMString sourceID);
-
-        void enableProfiler(in boolean always);
-        void disableProfiler(in boolean always);
-
-        void startProfiling();
-        void stopProfiling();
-
-        void getProfileHeaders(in long callId);
-        void getProfile(in long callId, in unsigned long uid);
-
-        void removeProfile(in unsigned long uid);
-        void clearProfiles();
-
-        void takeHeapSnapshot();
-#endif
-        void setInjectedScriptSource(in DOMString scriptSource);
-        void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in DOMString methodName, in DOMString arguments, in boolean async);
-
-        void addScriptToEvaluateOnLoad(in DOMString scriptSource);
-        void removeAllScriptsToEvaluateOnLoad();
-
-        void getChildNodes(in long callId, in long nodeId);
-        void setAttribute(in long callId, in long elementId, in DOMString name, in DOMString value);
-        void removeAttribute(in long callId, in long elementId, in DOMString name);
-        void setTextNodeValue(in long callId, in long nodeId, in DOMString value);
-        void getEventListenersForNode(in long callId, in long nodeId);
-        void copyNode(in long nodeId);
-        void removeNode(in long callId, in long nodeId);
-        void changeTagName(in long callId, in long nodeId, in DOMString newTagName);
-        void getOuterHTML(in long callId, in long nodeId);
-        void setOuterHTML(in long callId, in long nodeId, in DOMString outerHTML);
-        void addInspectedNode(in long nodeId);
-        void performSearch(in DOMString query, in boolean runSynchronously);
-        void searchCanceled();
-        void pushNodeByPathToFrontend(in long callId, in DOMString path);
-
-        void clearConsoleMessages(in long callId);
-
-        void highlightDOMNode(in long nodeId);
-        void hideDOMNodeHighlight();
-
-        void getStyles(in long callId, in long nodeId, in boolean authOnly);
-        void getAllStyles(in long callId);
-        void getInlineStyle(in long callId, in long nodeId);
-        void getComputedStyle(in long callId, in long nodeId);
-        void getStyleSheet(in long callId, in long styleSheetId);
-        void getRuleRanges(in long callId, in long styleSheetId);
-        void applyStyleText(in long callId, in long styleId, in DOMString styleText, in DOMString propertyName);
-        void setStyleText(in long callId, in long styleId, in DOMString styleText);
-        void setStyleProperty(in long callId, in long styleId, in DOMString name, in DOMString value);
-        void toggleStyleEnabled(in long callId, in long styleId, in DOMString propertyName, in boolean disabled);
-        void setRuleSelector(in long callId, in long ruleId, in DOMString selector, in long selectedNodeId);
-        void addRule(in long callId, in DOMString selector, in long selectedNodeId);
-
-        void getCookies(in long callId);
-        void deleteCookie(in DOMString cookieName, in DOMString domain);
-
-#if defined(ENABLE_OFFLINE_WEB_APPLICATIONS)
-        void getApplicationCaches(in long callId);
-#endif
-
-        void releaseWrapperObjectGroup(in long injectedScriptId, in DOMString objectGroup);
-        void didEvaluateForTestInFrontend(in long callId, in DOMString jsonResult);
-
-#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
-        void getDatabaseTableNames(in long callId, in long databaseId);
-#endif
-
-#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
-        void getDOMStorageEntries(in long callId, in long storageId);
-        void setDOMStorageItem(in long callId, in long storageId, in DOMString key, in DOMString value);
-        void removeDOMStorageItem(in long callId, in long storageId, in DOMString key);
-#endif
-    };
-}
index 515388c59e81b650f9fe45a9bf2239524876779f..c20eb10cf723fbfa90fda7926220343039add062 100644 (file)
@@ -59,6 +59,8 @@ public:
     virtual void changeAttachedWindowHeight(unsigned) = 0;
 
     virtual void inspectedURLChanged(const String&) = 0;
+
+    virtual void sendMessageToBackend(const String&) = 0;
 };
 
 } // namespace WebCore
index b9824599f70620ed4356933c9a10f4dc43b2ac93..f6f7811c7ef0acf0b5d2e77827f303ba601d128b 100644 (file)
@@ -37,6 +37,7 @@
 #include "FloatRect.h"
 #include "Frame.h"
 #include "FrameView.h"
+#include "InspectorBackendDispatcher.h"
 #include "InspectorController.h"
 #include "InspectorFrontend.h"
 #include "InspectorFrontendHost.h"
@@ -72,7 +73,6 @@ void InspectorFrontendClientLocal::windowObjectCleared()
 {
     // FIXME: don't keep reference to the script state
     m_frontendScriptState = scriptStateFromPage(debuggerWorld(), m_frontendPage);
-    ScriptGlobalObject::set(m_frontendScriptState, "InspectorBackend", m_inspectorController->inspectorBackend());
     m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
     ScriptGlobalObject::set(m_frontendScriptState, "InspectorFrontendHost", m_frontendHost.get());
 }
@@ -159,7 +159,12 @@ unsigned InspectorFrontendClientLocal::constrainedAttachedWindowHeight(unsigned
     using namespace std;
     return roundf(max(minimumAttachedHeight, min<float>(preferredHeight, totalWindowHeight * maximumAttachedHeightRatio)));
 }
-    
+
+void InspectorFrontendClientLocal::sendMessageToBackend(const String& message)
+{
+    m_inspectorController->inspectorBackendDispatcher()->dispatch(message);
+}
+
 } // namespace WebCore
 
 #endif
index ce661fe06c3040a697e9f44d5192709c1aa54edf..9dcaa5a7d1b8c6256b26e18f0337f2529cddfbb3 100644 (file)
@@ -59,6 +59,8 @@ public:
     virtual void detachWindow() = 0;
     bool canAttachWindow();
 
+    virtual void sendMessageToBackend(const String& message);
+
 protected:
     virtual void setAttachedWindowHeight(unsigned) = 0;
     void setAttachedWindow(bool);
index 70fc3ad20155e9128994f3778ab3ce23cbd655c8..6957dd13fb16311c64ed682c3f72a94edd2c474c 100644 (file)
@@ -207,6 +207,11 @@ void InspectorFrontendHost::copyText(const String& text)
     Pasteboard::generalPasteboard()->writePlainText(text);
 }
 
+void InspectorFrontendHost::sendMessageToBackend(const String& message)
+{
+    m_client->sendMessageToBackend(message);
+}
+
 #if ENABLE(CONTEXT_MENUS)
 void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMenuItem*>& items)
 {
index 4d3e0d14be8cea72a7e23b78adaaf2d0ccffa462..7fb4a1e4182bdc4af166a9291812232a8acfe03d 100644 (file)
@@ -75,6 +75,7 @@ public:
 
     // Called from [Custom] implementations.
     void showContextMenu(Event*, const Vector<ContextMenuItem*>& items);
+    void sendMessageToBackend(const String& message);
 
 private:
 #if ENABLE(CONTEXT_MENUS)
index 1139a1c84c621e7c1a5b6ad9b61a90051e7192e7..d1b360498af85ae2cb3b7ce7711b5ad962434a33 100644 (file)
@@ -50,5 +50,6 @@ module core {
         [Custom] DOMString platform();
         [Custom] DOMString port();
         [Custom] void showContextMenu(in MouseEvent event, in DOMObject items);
+        void sendMessageToBackend(in DOMString message);
     };
 }
index 857e026978e5ee9d3d19f402a1e827f326dc0256..bc344f8f89708c5da824b473d9ef0619732f32f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 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
@@ -32,263 +32,99 @@ if (!window.InspectorBackend) {
 
 WebInspector.InspectorBackendStub = function()
 {
-    this._attachedWindowHeight = 0;
-    this._timelineEnabled = false;
+    this._registerDelegate("addInspectedNode");
+    this._registerDelegate("addScriptToEvaluateOnLoad");
+    this._registerDelegate("changeTagName");
+    this._registerDelegate("clearConsoleMessages");
+    this._registerDelegate("copyNode");
+    this._registerDelegate("deleteCookie");
+    this._registerDelegate("didEvaluateForTestInFrontend");
+    this._registerDelegate("disableMonitoringXHR");
+    this._registerDelegate("disableResourceTracking");
+    this._registerDelegate("disableSearchingForNode");
+    this._registerDelegate("disableTimeline");
+    this._registerDelegate("dispatchOnInjectedScript");
+    this._registerDelegate("enableMonitoringXHR");
+    this._registerDelegate("enableResourceTracking");
+    this._registerDelegate("enableSearchingForNode");
+    this._registerDelegate("enableTimeline");
+    this._registerDelegate("getChildNodes");
+    this._registerDelegate("getCookies");
+    this._registerDelegate("getDatabaseTableNames");
+    this._registerDelegate("getDOMStorageEntries");
+    this._registerDelegate("getEventListenersForNode");
+    this._registerDelegate("getOuterHTML");
+    this._registerDelegate("getProfile");
+    this._registerDelegate("getProfileHeaders");
+    this._registerDelegate("removeProfile");
+    this._registerDelegate("clearProfiles");
+    this._registerDelegate("getResourceContent");
+    this._registerDelegate("highlightDOMNode");
+    this._registerDelegate("hideDOMNodeHighlight");
+    this._registerDelegate("performSearch");
+    this._registerDelegate("pushNodeByPathToFrontend");
+    this._registerDelegate("releaseWrapperObjectGroup");
+    this._registerDelegate("removeAllScriptsToEvaluateOnLoad");
+    this._registerDelegate("reloadPage");
+    this._registerDelegate("removeAttribute");
+    this._registerDelegate("removeDOMStorageItem");
+    this._registerDelegate("removeNode");
+    this._registerDelegate("saveApplicationSettings");
+    this._registerDelegate("saveSessionSettings");
+    this._registerDelegate("searchCanceled");
+    this._registerDelegate("setAttribute");
+    this._registerDelegate("setDOMStorageItem");
+    this._registerDelegate("setInjectedScriptSource");
+    this._registerDelegate("setOuterHTML");
+    this._registerDelegate("setTextNodeValue");
+    this._registerDelegate("startProfiling");
+    this._registerDelegate("startTimelineProfiler");
+    this._registerDelegate("stopProfiling");
+    this._registerDelegate("stopTimelineProfiler");
+    this._registerDelegate("storeLastActivePanel");
+    this._registerDelegate("takeHeapSnapshot");
+
+    this._registerDelegate("getAllStyles");
+    this._registerDelegate("getStyles");
+    this._registerDelegate("getComputedStyle");
+    this._registerDelegate("getInlineStyle");
+    this._registerDelegate("getStyleSheet");
+    this._registerDelegate("getRuleRanges");
+    this._registerDelegate("applyStyleText");
+    this._registerDelegate("setStyleText");
+    this._registerDelegate("setStyleProperty");
+    this._registerDelegate("toggleStyleEnabled");
+    this._registerDelegate("setRuleSelector");
+    this._registerDelegate("addRule");
+
+    this._registerDelegate("disableDebugger");
+    this._registerDelegate("editScriptSource");
+    this._registerDelegate("getScriptSource");
+    this._registerDelegate("enableDebugger");
+    this._registerDelegate("setBreakpoint");
+    this._registerDelegate("removeBreakpoint");
+    this._registerDelegate("activateBreakpoints");
+    this._registerDelegate("deactivateBreakpoints");
+    this._registerDelegate("resume");
+    this._registerDelegate("stepIntoStatement");
+    this._registerDelegate("stepOutOfFunction");
+    this._registerDelegate("stepOverStatement");
+    this._registerDelegate("setPauseOnExceptionsState");
 }
 
 WebInspector.InspectorBackendStub.prototype = {
-    wrapCallback: function(func)
+    _registerDelegate: function(methodName)
     {
-        return func;
+        this[methodName] = this.sendMessageToBackend.bind(this, methodName);
     },
 
-    closeWindow: function()
-    {
-        this._windowVisible = false;
-    },
-
-    attach: function()
-    {
-    },
-
-    detach: function()
-    {
-    },
-
-    storeLastActivePanel: function(panel)
-    {
-    },
-
-    clearConsoleMessages: function()
-    {
-    },
-
-    getOuterHTML: function()
-    {
-    },
-
-    setOuterHTML: function()
-    {
-    },
-
-    addInspectedNode: function()
-    {
-    },
-
-    search: function(sourceRow, query)
-    {
-    },
-
-    moveByUnrestricted: function(x, y)
-    {
-    },
-
-    getResourceContent: function(callId, identifier)
-    {
-        WebInspector.didGetResourceContent(callId, "");
-    },
-
-    highlightDOMNode: function(node)
-    {
-    },
-
-    hideDOMNodeHighlight: function()
-    {
-    },
-
-    inspectedWindow: function()
-    {
-        return window;
-    },
-
-    loaded: function()
-    {
-    },
-
-    localizedStringsURL: function()
-    {
-        return undefined;
-    },
-
-    windowUnloading: function()
-    {
-        return false;
-    },
-
-    hiddenPanels: function()
-    {
-        return "";
-    },
-
-    enableResourceTracking: function()
-    {
-        WebInspector.resourceTrackingWasEnabled();
-    },
-
-    disableResourceTracking: function()
-    {
-        WebInspector.resourceTrackingWasDisabled();
-    },
-
-
-    enableSearchingForNode: function()
-    {
-        WebInspector.searchingForNodeWasEnabled();
-    },
-
-    disableSearchingForNode: function()
-    {
-        WebInspector.searchingForNodeWasDisabled();
-    },
-
-    enableMonitoringXHR: function()
-    {
-        WebInspector.monitoringXHRWasEnabled();
-    },
-
-    disableMonitoringXHR: function()
-    {
-        WebInspector.monitoringXHRWasDisabled();
-    },
-
-    reloadPage: function()
-    {
-    },
-
-    enableDebugger: function()
-    {
-        WebInspector.debuggerWasEnabled();
-    },
-
-    disableDebugger: function()
-    {
-        WebInspector.debuggerWasDisabled();
-    },
-
-    setBreakpoint: function(callId, sourceID, line, enabled, condition)
-    {
-        WebInspector.didSetBreakpoint(callId, true, line);
-    },
-
-    removeBreakpoint: function(sourceID, line)
-    {
-    },
-
-    activateBreakpoints: function()
-    {
-        this._breakpointsActivated = true;
-    },
-
-    deactivateBreakpoints: function()
-    {
-        this._breakpointsActivated = false;
-    },
-
-    pause: function()
-    {
-    },
-
-    setPauseOnExceptionsState: function(value)
-    {
-        WebInspector.updatePauseOnExceptionsState(value);
-    },
-
-    editScriptSource: function()
-    {
-        WebInspector.didEditScriptSource(callId, false);
-    },
-
-    getScriptSource: function(callId, sourceID)
-    {
-        WebInspector.didGetScriptSource(callId, null);
-    },
-
-    resume: function()
-    {
-    },
-
-    enableProfiler: function()
-    {
-        WebInspector.profilerWasEnabled();
-    },
-
-    disableProfiler: function()
-    {
-        WebInspector.profilerWasDisabled();
-    },
-
-    startProfiling: function()
-    {
-    },
-
-    stopProfiling: function()
-    {
-    },
-
-    getProfileHeaders: function(callId)
-    {
-        WebInspector.didGetProfileHeaders(callId, []);
-    },
-
-    getProfile: function(callId, uid)
-    {
-    },
-
-    takeHeapSnapshot: function()
-    {
-    },
-
-    databaseTableNames: function(database)
-    {
-        return [];
-    },
-
-    stepIntoStatement: function()
-    {
-    },
-
-    stepOutOfFunction: function()
-    {
-    },
-
-    stepOverStatement: function()
-    {
-    },
-
-    saveApplicationSettings: function()
-    {
-    },
-
-    saveSessionSettings: function()
-    {
-    },
-
-    dispatchOnInjectedScript: function()
-    {
-    },
-
-    releaseWrapperObjectGroup: function()
-    {
-    },
-
-    setInjectedScriptSource: function()
-    {
-    },
-    
-    addScriptToEvaluateOnLoad: function()
-    {
-    },
-
-    removeAllScriptsToEvaluateOnLoad: function()
-    {
-    },
-
-    performSearch: function()
-    {
-    },
-
-    searchCanceled: function()
+    sendMessageToBackend: function()
     {
+        var message = JSON.stringify(Array.prototype.slice.call(arguments));
+        if (WebInspector._paramsObject && "page" in WebInspector._paramsObject)
+            WebInspector.socket.send(message);
+        else
+            InspectorFrontendHost.sendMessageToBackend(message);
     }
 }
 
index 9cc182326c3cdb5eb4f2b8ace070b97320f557b7..9d136dad7e06943a18c76922ba5d2f7c3e35ba47 100644 (file)
@@ -1,3 +1,23 @@
+2010-07-27  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        WebInspector: Current implementation of message based inspector
+        transport generated by CodeGeneratorInspector should be upstreamed
+        from WebKit/chromium to WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=42983
+
+        * WebKit.gypi:
+        * src/InspectorFrontendClientImpl.cpp:
+        (WebKit::InspectorFrontendClientImpl::sendMessageToBackend):
+        * src/InspectorFrontendClientImpl.h:
+        * src/ToolsAgent.h:
+        * src/WebDevToolsAgentImpl.cpp:
+        (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController):
+        (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
+        * src/WebDevToolsAgentImpl.h:
+        * src/js/InspectorControllerImpl.js: Removed.
+
 2010-07-27  Dominic Mazzoni  <dmazzoni@google.com>
 
         Reviewed by Chris Fleizach.
index 7d7b19c07621b7eb02b3e4cbd950791ca462e971..b45e3e70c9e66653466ad21b4b548e77c6e448f8 100644 (file)
@@ -33,7 +33,6 @@
         # List of DevTools source files, ordered by dependencies. It is used both
         # for copying them to resource dir, and for generating 'devtools.html' file.
         'devtools_js_files': [
-            'src/js/InspectorControllerImpl.js',
             'src/js/ProfilerAgent.js',
             'src/js/ProfilerProcessor.js',
             'src/js/HeapProfilerPanel.js',
index 73cedfa47e6c24add0d01e5d860bbf9fe749df72..870bdee0cbbd4cc7263d902dd65d56d7062eea1f 100644 (file)
@@ -124,4 +124,15 @@ void InspectorFrontendClientImpl::inspectedURLChanged(const String& url)
     m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url);
 }
 
+void InspectorFrontendClientImpl::sendMessageToBackend(const String& message)
+{
+    WebDevToolsMessageData messageData;
+    messageData.className = "ToolsAgent";
+    messageData.methodName = "dispatchOnInspectorController";
+    WebVector<WebString> args(static_cast<size_t>(1));
+    args[0] = message;
+    messageData.arguments.swap(args);
+    m_client->sendMessageToAgent(messageData);
+}
+
 } // namespace WebKit
index f869ac3e1fee4f8f3b3dc475597a7b55ad227615..f7174ce30b9952ec82624928b1f467af71bdf69c 100644 (file)
@@ -68,6 +68,7 @@ public:
 
     virtual void inspectedURLChanged(const WebCore::String&);
 
+    virtual void sendMessageToBackend(const WebCore::String&);
 private:
     WebCore::Page* m_frontendPage;
     WebDevToolsFrontendClient* m_client;
index c9a15d50aa961f69ef1e54ec6bf658b90465670b..937fcf0e251178b06c612bee8d73208cac887bf3 100644 (file)
@@ -39,8 +39,7 @@ namespace WebKit {
 // API for auxiliary UI functions such as dom elements highlighting.
 #define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \
     /* Dispatches given function on the InspectorController object */ \
-    METHOD2(dispatchOnInspectorController, int /* call_id */, \
-        String /* message */) \
+    METHOD1(dispatchOnInspectorController, String /* message */) \
 
 DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT)
 
index 3d79e0c61c8752cebc49deb651cad759b8f04231..1a65bfeb3ad9f86e80c26be40b1ba5aeb4a387db 100644 (file)
@@ -55,7 +55,6 @@
 #include "ScriptState.h"
 #include "ScriptValue.h"
 #include "V8Binding.h"
-#include "V8InspectorBackend.h"
 #include "V8Proxy.h"
 #include "V8Utilities.h"
 #include "WebDataSource.h"
@@ -93,7 +92,6 @@ using WebCore::ScriptState;
 using WebCore::ScriptValue;
 using WebCore::String;
 using WebCore::V8DOMWrapper;
-using WebCore::V8InspectorBackend;
 using WebCore::V8Proxy;
 
 namespace WebKit {
@@ -309,11 +307,9 @@ void WebDevToolsAgentImpl::forceRepaint()
     m_client->forceRepaint();
 }
 
-void WebDevToolsAgentImpl::dispatchOnInspectorController(int callId, const String& message)
+void WebDevToolsAgentImpl::dispatchOnInspectorController(const String& message)
 {
-    String exception;
-    inspectorController()->inspectorBackendDispatcher()->dispatch(message, &exception);
-    m_toolsAgentDelegateStub->didDispatchOn(callId, "", exception);
+    inspectorController()->inspectorBackendDispatcher()->dispatch(message);
 }
 
 void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const WebDevToolsMessageData& data)
@@ -375,38 +371,6 @@ void WebDevToolsAgentImpl::initDevToolsAgentHost()
         "dispatch",
         WebDevToolsAgentImpl::jsDispatchOnClient);
     devtoolsAgentHost.build();
-
-    v8::HandleScope scope;
-    v8::Context::Scope utilityScope(m_utilityContext);
-    // Call custom code to create inspector backend wrapper in the utility context
-    // instead of calling V8DOMWrapper::convertToV8Object that would create the
-    // wrapper in the Page main frame context.
-    v8::Handle<v8::Object> backendWrapper = createInspectorBackendV8Wrapper();
-    if (backendWrapper.IsEmpty())
-        return;
-    m_utilityContext->Global()->Set(v8::String::New("InspectorBackend"), backendWrapper);
-}
-
-v8::Local<v8::Object> WebDevToolsAgentImpl::createInspectorBackendV8Wrapper()
-{
-    v8::Handle<v8::Function> function = V8InspectorBackend::GetTemplate()->GetFunction();
-    if (function.IsEmpty()) {
-        // Return if allocation failed.
-        return v8::Local<v8::Object>();
-    }
-    v8::Local<v8::Object> instance = SafeAllocation::newInstance(function);
-    if (instance.IsEmpty()) {
-        // Avoid setting the wrapper if allocation failed.
-        return v8::Local<v8::Object>();
-    }
-    InspectorBackend* backend = m_webViewImpl->page()->inspectorController()->inspectorBackend();
-    V8DOMWrapper::setDOMWrapper(instance, &V8InspectorBackend::info, backend);
-    // Create a weak reference to the v8 wrapper of InspectorBackend to deref
-    // InspectorBackend when the wrapper is garbage collected.
-    backend->ref();
-    v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(instance);
-    weakHandle.MakeWeak(backend, &InspectorBackendWeakReferenceCallback);
-    return instance;
 }
 
 void WebDevToolsAgentImpl::createInspectorFrontendProxy()
index 1bb71a3d723b64b98dbecfd0981e2ea11fd382d4..c8e22b0ae613f5ba8754fa3568ed9681775ba742 100644 (file)
@@ -72,7 +72,7 @@ public:
     virtual ~WebDevToolsAgentImpl();
 
     // ToolsAgent implementation.
-    virtual void dispatchOnInspectorController(int callId, const WebCore::String& message);
+    virtual void dispatchOnInspectorController(const WebCore::String& message);
 
     // WebDevToolsAgentPrivate implementation.
     virtual void didClearWindowObject(WebFrameImpl* frame);
@@ -127,12 +127,6 @@ private:
 
     WebCore::InspectorController* inspectorController();
 
-    // Creates InspectorBackend v8 wrapper in the utility context so that it's
-    // methods prototype is Function.protoype object from the utility context.
-    // Otherwise some useful methods  defined on Function.prototype(such as bind)
-    // are missing for InspectorController native methods.
-    v8::Local<v8::Object> createInspectorBackendV8Wrapper();
-
     int m_hostId;
     WebDevToolsAgentClient* m_client;
     WebViewImpl* m_webViewImpl;
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
deleted file mode 100644 (file)
index d8ee1e4..0000000
+++ /dev/null
@@ -1,156 +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.
- */
-
-/**
- * @fileoverview DevTools' implementation of the InspectorController API.
- */
-
-if (!this.devtools)
-    devtools = {};
-
-devtools.InspectorBackendImpl = function()
-{
-    WebInspector.InspectorBackendStub.call(this);
-    this.installInspectorControllerDelegate_("addInspectedNode");
-    this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad");
-    this.installInspectorControllerDelegate_("changeTagName");
-    this.installInspectorControllerDelegate_("clearConsoleMessages");
-    this.installInspectorControllerDelegate_("copyNode");
-    this.installInspectorControllerDelegate_("deleteCookie");
-    this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend");
-    this.installInspectorControllerDelegate_("disableMonitoringXHR");
-    this.installInspectorControllerDelegate_("disableResourceTracking");
-    this.installInspectorControllerDelegate_("disableSearchingForNode");
-    this.installInspectorControllerDelegate_("disableTimeline");
-    this.installInspectorControllerDelegate_("dispatchOnInjectedScript");
-    this.installInspectorControllerDelegate_("enableMonitoringXHR");
-    this.installInspectorControllerDelegate_("enableResourceTracking");
-    this.installInspectorControllerDelegate_("enableSearchingForNode");
-    this.installInspectorControllerDelegate_("enableTimeline");
-    this.installInspectorControllerDelegate_("getChildNodes");
-    this.installInspectorControllerDelegate_("getCookies");
-    this.installInspectorControllerDelegate_("getApplicationCaches");
-    this.installInspectorControllerDelegate_("getDatabaseTableNames");
-    this.installInspectorControllerDelegate_("getDOMStorageEntries");
-    this.installInspectorControllerDelegate_("getEventListenersForNode");
-    this.installInspectorControllerDelegate_("getOuterHTML");
-    this.installInspectorControllerDelegate_("getProfile");
-    this.installInspectorControllerDelegate_("getProfileHeaders");
-    this.installInspectorControllerDelegate_("removeProfile");
-    this.installInspectorControllerDelegate_("clearProfiles");
-    this.installInspectorControllerDelegate_("getResourceContent");
-    this.installInspectorControllerDelegate_("highlightDOMNode");
-    this.installInspectorControllerDelegate_("hideDOMNodeHighlight");
-    this.installInspectorControllerDelegate_("performSearch");
-    this.installInspectorControllerDelegate_("pushNodeByPathToFrontend");
-    this.installInspectorControllerDelegate_("releaseWrapperObjectGroup");
-    this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad");
-    this.installInspectorControllerDelegate_("reloadPage");
-    this.installInspectorControllerDelegate_("removeAttribute");
-    this.installInspectorControllerDelegate_("removeDOMStorageItem");
-    this.installInspectorControllerDelegate_("removeNode");
-    this.installInspectorControllerDelegate_("saveApplicationSettings");
-    this.installInspectorControllerDelegate_("saveSessionSettings");
-    this.installInspectorControllerDelegate_("searchCanceled");
-    this.installInspectorControllerDelegate_("setAttribute");
-    this.installInspectorControllerDelegate_("setDOMStorageItem");
-    this.installInspectorControllerDelegate_("setInjectedScriptSource");
-    this.installInspectorControllerDelegate_("setOuterHTML");
-    this.installInspectorControllerDelegate_("setTextNodeValue");
-    this.installInspectorControllerDelegate_("startProfiling");
-    this.installInspectorControllerDelegate_("startTimelineProfiler");
-    this.installInspectorControllerDelegate_("stopProfiling");
-    this.installInspectorControllerDelegate_("stopTimelineProfiler");
-    this.installInspectorControllerDelegate_("storeLastActivePanel");
-    this.installInspectorControllerDelegate_("takeHeapSnapshot");
-
-    this.installInspectorControllerDelegate_("getAllStyles");
-    this.installInspectorControllerDelegate_("getStyles");
-    this.installInspectorControllerDelegate_("getComputedStyle");
-    this.installInspectorControllerDelegate_("getInlineStyle");
-    this.installInspectorControllerDelegate_("getStyleSheet");
-    this.installInspectorControllerDelegate_("getRuleRanges");
-    this.installInspectorControllerDelegate_("applyStyleText");
-    this.installInspectorControllerDelegate_("setStyleText");
-    this.installInspectorControllerDelegate_("setStyleProperty");
-    this.installInspectorControllerDelegate_("toggleStyleEnabled");
-    this.installInspectorControllerDelegate_("setRuleSelector");
-    this.installInspectorControllerDelegate_("addRule");
-
-    this.installInspectorControllerDelegate_("disableDebugger");
-    this.installInspectorControllerDelegate_("editScriptSource");
-    this.installInspectorControllerDelegate_("getScriptSource");
-    this.installInspectorControllerDelegate_("enableDebugger");
-    this.installInspectorControllerDelegate_("setBreakpoint");
-    this.installInspectorControllerDelegate_("removeBreakpoint");
-    this.installInspectorControllerDelegate_("activateBreakpoints");
-    this.installInspectorControllerDelegate_("deactivateBreakpoints");
-    this.installInspectorControllerDelegate_("resume");
-    this.installInspectorControllerDelegate_("stepIntoStatement");
-    this.installInspectorControllerDelegate_("stepOutOfFunction");
-    this.installInspectorControllerDelegate_("stepOverStatement");
-    this.installInspectorControllerDelegate_("setPauseOnExceptionsState");
-};
-devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype;
-
-
-devtools.InspectorBackendImpl.prototype.pause = function()
-{
-    RemoteDebuggerCommandExecutor.DebuggerPauseScript();
-};
-
-
-/**
- * Installs delegating handler into the inspector controller.
- * @param {string} methodName Method to install delegating handler for.
- */
-devtools.InspectorBackendImpl.prototype.installInspectorControllerDelegate_ = function(methodName)
-{
-    this[methodName] = this.callInspectorController_.bind(this, methodName);
-};
-
-
-/**
- * Bound function with the installInjectedScriptDelegate_ actual
- * implementation.
- */
-devtools.InspectorBackendImpl.prototype.callInspectorController_ = function()
-{
-    var args = Array.prototype.slice.call(arguments);
-    var message = JSON.stringify(args);
-    var callbackId = WebInspector.Callback.wrap(function(){});
-    if ("page" in WebInspector._paramsObject)
-        WebInspector.socket.send(callbackId + " " + message);
-    else
-        RemoteToolsAgent.dispatchOnInspectorController(callbackId, message);
-};
-
-
-InspectorBackend = new devtools.InspectorBackendImpl();