Web Inspector: Add Inspector Code Generation to JavaScriptCore for Runtime Domain
https://bugs.webkit.org/show_bug.cgi?id=125595
Reviewed by Timothy Hatcher.
* GNUmakefile.am:
Source/JavaScriptCore:
- Move CodeGeneration scripts from WebCore into JavaScriptCore/inspector/scripts
- For ports that build WebKit frameworks separately, export the scripts as PrivateHeaders
- Update CodeGeneratorInspector.py in a few ways:
- output dynamic filenames, so JavaScriptCore generates InspectorJSFoo.* and WebCore generates InspectorWebFoo.*
- take in more then one protocol JSON file. The first contains domains to generate, the others are dependencies
that are generated elsewhere that we can depend on for Types.
- Add DerivedSources build step to generate the Inspector Interfaces
* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.vcxproj/copy-files.cmd:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add scripts and code generation.
* inspector/protocol/Runtime.json: Renamed from Source/WebCore/inspector/protocol/Runtime.json.
Move protocol file into JavaScriptCore so its types will be generated in JavaScriptCore.
* inspector/scripts/CodeGeneratorInspector.py: Renamed from Source/WebCore/inspector/CodeGeneratorInspector.py.
Updates to the script as listed above.
* inspector/scripts/CodeGeneratorInspectorStrings.py: Renamed from Source/WebCore/inspector/CodeGeneratorInspectorStrings.py.
* inspector/scripts/generate-combined-inspector-json.py: Renamed from Source/WebCore/inspector/Scripts/generate-combined-inspector-json.py.
Moved from WebCore into JavaScriptCore for code generation.
Source/WebCore:
- CodeGeneration changed to output Frontend and Backend dispatchers
in namespace Inspector. So update all the agent's appropriately.
- Update Derived Sources code generation to use the Scripts that had
moved to JavaScriptCore. Some ports just use JSC/inspector/scripts
directly, but others have to use the Scripts exported by JSC
in JavaScriptCore's PrivateHeaders.
- Add ForwardingHeaders for the files generated in JavaScriptCore.
- Update the names of Inspector DerivedSources files, since they
were renamed to InspectorWeb*.
No new tests, this only moves code around. There are no functional changes.
* CMakeLists.txt:
* DerivedSources.make:
* ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h: Added.
* ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h: Added.
* ForwardingHeaders/inspector/InspectorJSTypeBuilders.h: Added.
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.vcxproj/build-generated-files.sh:
* WebCore.xcodeproj/project.pbxproj:
Remove files, rename files, update code generation.
* make-generated-sources.sh:
Update this standalone developer script to fill in the new InspectorScripts variable.
* inspector/ConsoleMessage.h:
* inspector/InjectedScriptHost.cpp:
* inspector/InspectorAgent.cpp:
* inspector/InspectorAgent.h:
* inspector/InspectorApplicationCacheAgent.cpp:
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorCSSAgent.h:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorConsoleAgent.cpp:
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorController.cpp:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMDebuggerAgent.cpp:
* inspector/InspectorDOMDebuggerAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.cpp:
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorDatabaseResource.cpp:
* inspector/InspectorDatabaseResource.h:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorFrontendClientLocal.cpp:
* inspector/InspectorHeapProfilerAgent.h:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorIndexedDBAgent.h:
* inspector/InspectorInputAgent.h:
* inspector/InspectorLayerTreeAgent.cpp:
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorMemoryAgent.cpp:
* inspector/InspectorMemoryAgent.h:
* inspector/InspectorPageAgent.cpp:
* inspector/InspectorPageAgent.h:
* inspector/InspectorProfilerAgent.cpp:
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorResourceAgent.cpp:
* inspector/InspectorResourceAgent.h:
* inspector/InspectorRuntimeAgent.h:
* inspector/InspectorTimelineAgent.cpp:
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorWorkerAgent.cpp:
* inspector/InspectorWorkerAgent.h:
* inspector/PageRuntimeAgent.h:
* inspector/ScriptCallFrame.cpp:
* inspector/WorkerInspectorController.cpp:
* inspector/WorkerRuntimeAgent.h:
Updates header names and class namespace changes.
Source/WebInspectorUI:
* Scripts/copy-user-interface-resources.sh:
Copy all the different backend commands files.
* Scripts/update-InspectorBackendCommands.rb:
Update with respect to new script location and new file names.
* WebInspectorUI.xcodeproj/project.pbxproj:
Remove Inputs and Outputs of build phase, which were wrong.
Now this build phase always runs, and not by accident.
* UserInterface/InspectorJSBackendCommands.js: Added.
* UserInterface/InspectorWebBackendCommands.js: Renamed from Source/WebInspectorUI/UserInterface/InspectorBackendCommands.js.
* UserInterface/Legacy/6.0/InspectorWebBackendCommands.js: Renamed from Source/WebInspectorUI/UserInterface/Legacy/6.0/InspectorBackendCommands.js.
* UserInterface/Legacy/7.0/InspectorWebBackendCommands.js: Renamed from Source/WebInspectorUI/UserInterface/Legacy/7.0/InspectorBackendCommands.js.
* UserInterface/LoadInspectorBackendCommands.js:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
LayoutTests:
* http/tests/inspector-protocol/resources/InspectorTest.js:
(InspectorTest.importInspectorScripts):
Update for the new backend commands files.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 00a39ad..44d09aa 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -112,6 +112,7 @@
"${JAVASCRIPTCORE_DIR}/runtime"
"${JAVASCRIPTCORE_DIR}/yarr"
"${WTF_DIR}"
+ "${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}"
"${DERIVED_SOURCES_WEBCORE_DIR}"
"${CMAKE_SOURCE_DIR}/Source"
"${CMAKE_BINARY_DIR}"
@@ -750,6 +751,8 @@
${WebCore_SVG_IDL_FILES}
)
+set(WebCore_INSPECTOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
+
set(WebCore_INSPECTOR_DOMAINS
inspector/protocol/ApplicationCache.json
inspector/protocol/CSS.json
@@ -770,7 +773,6 @@
inspector/protocol/Network.json
inspector/protocol/Page.json
inspector/protocol/Profiler.json
- inspector/protocol/Runtime.json
inspector/protocol/Timeline.json
inspector/protocol/Worker.json
)
@@ -3038,22 +3040,27 @@
VERBATIM)
-# Generate Inspector.json
+# Generate InspectorWeb.json
add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json
- MAIN_DEPENDENCY ${WEBCORE_DIR}/inspector/Scripts/generate-combined-inspector-json.py
+ OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json
+ MAIN_DEPENDENCY ${WebCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py
DEPENDS ${WebCore_INSPECTOR_DOMAINS}
- COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/generate-combined-inspector-json.py ${WEBCORE_DIR}/inspector/protocol > ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json
+ COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/generate-combined-inspector-json.py ${WEBCORE_DIR}/inspector/protocol > ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json
VERBATIM)
# All Web Inspector generated files are created with this one call to CodeGeneratorInspector.pm
add_custom_command(
- OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendDispatchers.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendDispatchers.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorFrontend.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorFrontend.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.h
- MAIN_DEPENDENCY ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json
- DEPENDS ${WEBCORE_DIR}/inspector/CodeGeneratorInspector.py ${WEBCORE_DIR}/inspector/CodeGeneratorInspectorStrings.py
- COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/CodeGeneratorInspector.py ${DERIVED_SOURCES_WEBCORE_DIR}/Inspector.json --output_h_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --output_cpp_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --output_js_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --write_always
+ OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendDispatchers.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendDispatchers.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebFrontendDispatchers.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebFrontendDispatchers.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.h
+ MAIN_DEPENDENCY ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json
+ DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspectorStrings.py ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
+ COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/CodeGeneratorInspector.py ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWeb.json ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJS.json --output_h_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --output_cpp_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --output_js_dir "${DERIVED_SOURCES_WEBCORE_DIR}" --output_type Web --write_always
VERBATIM)
-list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendDispatchers.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorFrontend.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.cpp)
+
+list(APPEND WebCore_SOURCES
+ ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebBackendDispatchers.cpp
+ ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebFrontendDispatchers.cpp
+ ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorWebTypeBuilders.cpp
+)
# Generate InspectorOverlayPage.h
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 38334f0..fdc382b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,88 @@
+2013-12-13 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Add Inspector Code Generation to JavaScriptCore for Runtime Domain
+ https://bugs.webkit.org/show_bug.cgi?id=125595
+
+ Reviewed by Timothy Hatcher.
+
+ - CodeGeneration changed to output Frontend and Backend dispatchers
+ in namespace Inspector. So update all the agent's appropriately.
+ - Update Derived Sources code generation to use the Scripts that had
+ moved to JavaScriptCore. Some ports just use JSC/inspector/scripts
+ directly, but others have to use the Scripts exported by JSC
+ in JavaScriptCore's PrivateHeaders.
+ - Add ForwardingHeaders for the files generated in JavaScriptCore.
+ - Update the names of Inspector DerivedSources files, since they
+ were renamed to InspectorWeb*.
+
+ No new tests, this only moves code around. There are no functional changes.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h: Added.
+ * ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h: Added.
+ * ForwardingHeaders/inspector/InspectorJSTypeBuilders.h: Added.
+ * GNUmakefile.am:
+ * GNUmakefile.list.am:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.vcxproj/WebCore.vcxproj.filters:
+ * WebCore.vcxproj/build-generated-files.sh:
+ * WebCore.xcodeproj/project.pbxproj:
+ Remove files, rename files, update code generation.
+
+ * make-generated-sources.sh:
+ Update this standalone developer script to fill in the new InspectorScripts variable.
+
+ * inspector/ConsoleMessage.h:
+ * inspector/InjectedScriptHost.cpp:
+ * inspector/InspectorAgent.cpp:
+ * inspector/InspectorAgent.h:
+ * inspector/InspectorApplicationCacheAgent.cpp:
+ * inspector/InspectorApplicationCacheAgent.h:
+ * inspector/InspectorCSSAgent.h:
+ * inspector/InspectorCanvasAgent.cpp:
+ * inspector/InspectorCanvasAgent.h:
+ * inspector/InspectorConsoleAgent.cpp:
+ * inspector/InspectorConsoleAgent.h:
+ * inspector/InspectorController.cpp:
+ * inspector/InspectorDOMAgent.cpp:
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorDOMDebuggerAgent.cpp:
+ * inspector/InspectorDOMDebuggerAgent.h:
+ * inspector/InspectorDOMStorageAgent.cpp:
+ * inspector/InspectorDOMStorageAgent.h:
+ * inspector/InspectorDatabaseAgent.cpp:
+ * inspector/InspectorDatabaseAgent.h:
+ * inspector/InspectorDatabaseResource.cpp:
+ * inspector/InspectorDatabaseResource.h:
+ * inspector/InspectorDebuggerAgent.cpp:
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/InspectorFrontendClientLocal.cpp:
+ * inspector/InspectorHeapProfilerAgent.h:
+ * inspector/InspectorIndexedDBAgent.cpp:
+ * inspector/InspectorIndexedDBAgent.h:
+ * inspector/InspectorInputAgent.h:
+ * inspector/InspectorLayerTreeAgent.cpp:
+ * inspector/InspectorLayerTreeAgent.h:
+ * inspector/InspectorMemoryAgent.cpp:
+ * inspector/InspectorMemoryAgent.h:
+ * inspector/InspectorPageAgent.cpp:
+ * inspector/InspectorPageAgent.h:
+ * inspector/InspectorProfilerAgent.cpp:
+ * inspector/InspectorProfilerAgent.h:
+ * inspector/InspectorResourceAgent.cpp:
+ * inspector/InspectorResourceAgent.h:
+ * inspector/InspectorRuntimeAgent.h:
+ * inspector/InspectorTimelineAgent.cpp:
+ * inspector/InspectorTimelineAgent.h:
+ * inspector/InspectorWorkerAgent.cpp:
+ * inspector/InspectorWorkerAgent.h:
+ * inspector/PageRuntimeAgent.h:
+ * inspector/ScriptCallFrame.cpp:
+ * inspector/WorkerInspectorController.cpp:
+ * inspector/WorkerRuntimeAgent.h:
+ Updates header names and class namespace changes.
+
2013-12-13 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
Adding RTCPeerConnectionErrorCallback
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index f017b7f..bb1677c 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -661,31 +661,6 @@
InternalSettingsGenerated.idl
#
-INSPECTOR_DOMAINS = \
- $(WebCore)/inspector/protocol/ApplicationCache.json \
- $(WebCore)/inspector/protocol/CSS.json \
- $(WebCore)/inspector/protocol/Canvas.json \
- $(WebCore)/inspector/protocol/Console.json \
- $(WebCore)/inspector/protocol/DOM.json \
- $(WebCore)/inspector/protocol/DOMDebugger.json \
- $(WebCore)/inspector/protocol/DOMStorage.json \
- $(WebCore)/inspector/protocol/Database.json \
- $(WebCore)/inspector/protocol/Debugger.json \
- $(WebCore)/inspector/protocol/FileSystem.json \
- $(WebCore)/inspector/protocol/HeapProfiler.json \
- $(WebCore)/inspector/protocol/IndexedDB.json \
- $(WebCore)/inspector/protocol/Input.json \
- $(WebCore)/inspector/protocol/InspectorDomain.json \
- $(WebCore)/inspector/protocol/LayerTree.json \
- $(WebCore)/inspector/protocol/Memory.json \
- $(WebCore)/inspector/protocol/Network.json \
- $(WebCore)/inspector/protocol/Page.json \
- $(WebCore)/inspector/protocol/Profiler.json \
- $(WebCore)/inspector/protocol/Runtime.json \
- $(WebCore)/inspector/protocol/Timeline.json \
- $(WebCore)/inspector/protocol/Worker.json
-#
-
.PHONY : all
DOM_CLASSES=$(basename $(notdir $(BINDING_IDLS)))
@@ -1093,17 +1068,44 @@
# Inspector interfaces generator
-all : Inspector.json
+INSPECTOR_DOMAINS = \
+ $(WebCore)/inspector/protocol/ApplicationCache.json \
+ $(WebCore)/inspector/protocol/CSS.json \
+ $(WebCore)/inspector/protocol/Canvas.json \
+ $(WebCore)/inspector/protocol/Console.json \
+ $(WebCore)/inspector/protocol/DOM.json \
+ $(WebCore)/inspector/protocol/DOMDebugger.json \
+ $(WebCore)/inspector/protocol/DOMStorage.json \
+ $(WebCore)/inspector/protocol/Database.json \
+ $(WebCore)/inspector/protocol/Debugger.json \
+ $(WebCore)/inspector/protocol/FileSystem.json \
+ $(WebCore)/inspector/protocol/HeapProfiler.json \
+ $(WebCore)/inspector/protocol/IndexedDB.json \
+ $(WebCore)/inspector/protocol/Input.json \
+ $(WebCore)/inspector/protocol/InspectorDomain.json \
+ $(WebCore)/inspector/protocol/LayerTree.json \
+ $(WebCore)/inspector/protocol/Memory.json \
+ $(WebCore)/inspector/protocol/Network.json \
+ $(WebCore)/inspector/protocol/Page.json \
+ $(WebCore)/inspector/protocol/Profiler.json \
+ $(WebCore)/inspector/protocol/Timeline.json \
+ $(WebCore)/inspector/protocol/Worker.json \
+#
-Inspector.json : inspector/Scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS)
- python $(WebCore)/inspector/Scripts/generate-combined-inspector-json.py "$(WebCore)/inspector/protocol" > ./Inspector.json
+INSPECTOR_GENERATOR_SCRIPTS = \
+ $(InspectorScripts)/CodeGeneratorInspector.py \
+ $(InspectorScripts)/CodeGeneratorInspectorStrings.py \
+#
-all : InspectorFrontend.h
+all : InspectorWeb.json
-INSPECTOR_GENERATOR_SCRIPTS = inspector/CodeGeneratorInspector.py inspector/CodeGeneratorInspectorStrings.py
+InspectorWeb.json : $(InspectorScripts)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS)
+ python $(InspectorScripts)/generate-combined-inspector-json.py $(WebCore)/inspector/protocol > ./InspectorWeb.json
-InspectorFrontend.h : Inspector.json $(INSPECTOR_GENERATOR_SCRIPTS)
- python $(WebCore)/inspector/CodeGeneratorInspector.py ./Inspector.json --output_h_dir . --output_cpp_dir . --output_js_dir .
+all : InspectorWebFrontendDispatchers.h
+
+InspectorWebFrontendDispatchers.h : InspectorWeb.json $(InspectorScripts)/InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS)
+ python $(InspectorScripts)/CodeGeneratorInspector.py ./InspectorWeb.json $(InspectorScripts)/InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type Web
all : InspectorOverlayPage.h
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h
new file mode 100644
index 0000000..d668187
--- /dev/null
+++ b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSBackendDispatchers.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InspectorJSBackendDispatchers_h
+#define WebCore_FWD_InspectorJSBackendDispatchers_h
+#include <JavaScriptCore/InspectorJSBackendDispatchers.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h
new file mode 100644
index 0000000..69767b0
--- /dev/null
+++ b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSFrontendDispatchers.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InspectorJSFrontendDispatchers_h
+#define WebCore_FWD_InspectorJSFrontendDispatchers_h
+#include <JavaScriptCore/InspectorJSFrontendDispatchers.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InspectorJSTypeBuilders.h b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSTypeBuilders.h
new file mode 100644
index 0000000..fb9494e
--- /dev/null
+++ b/Source/WebCore/ForwardingHeaders/inspector/InspectorJSTypeBuilders.h
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InspectorJSTypeBuilders_h
+#define WebCore_FWD_InspectorJSTypeBuilders_h
+#include <JavaScriptCore/InspectorJSTypeBuilders.h>
+#endif
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index c262ad7..eab69b6 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -333,6 +333,8 @@
DerivedSources/WebCore/InternalSettingsGenerated.idl
+INSPECTOR_SCRIPTS_DIR := $(JavaScriptCore)/inspector/scripts
+
INSPECTOR_DOMAINS := \
$(WebCore)/inspector/protocol/ApplicationCache.json \
$(WebCore)/inspector/protocol/CSS.json \
@@ -353,22 +355,21 @@
$(WebCore)/inspector/protocol/Network.json \
$(WebCore)/inspector/protocol/Page.json \
$(WebCore)/inspector/protocol/Profiler.json \
- $(WebCore)/inspector/protocol/Runtime.json \
$(WebCore)/inspector/protocol/Timeline.json \
$(WebCore)/inspector/protocol/Worker.json
-DerivedSources/WebCore/Inspector.json: $(WebCore)/inspector/Scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS)
- $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/generate-combined-inspector-json.py $(WebCore)/inspector/protocol > $(GENSOURCES_WEBCORE)/Inspector.json
+DerivedSources/WebCore/InspectorWeb.json: $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS)
+ $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(WebCore)/inspector/protocol > $(GENSOURCES_WEBCORE)/InspectorWeb.json
# All Web Inspector generated files are created with this one call to CodeGeneratorInspector.py
-DerivedSources/WebCore/InspectorBackendDispatchers.cpp: DerivedSources/WebCore/Inspector.json $(WebCore)/inspector/CodeGeneratorInspector.py $(WebCore)/inspector/CodeGeneratorInspectorStrings.py
- $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/CodeGeneratorInspector.py $< --output_h_dir $(GENSOURCES_WEBCORE) --output_cpp_dir $(GENSOURCES_WEBCORE) --output_js_dir $(GENSOURCES_WEBCORE)
+DerivedSources/WebCore/InspectorWebBackendDispatchers.cpp: $(GENSOURCES_WEBCORE)/InspectorWeb.json $(GENSOURCES_JAVASCRIPTCORE)/InspectorJS.json $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspectorStrings.py $(GENSOURCES_JAVASCRIPTCORE)/InspectorJSTypeBuilders.h
+ $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $(GENSOURCES_WEBCORE)/InspectorWeb.json $(GENSOURCES_JAVASCRIPTCORE)/InspectorJS.json --output_h_dir $(GENSOURCES_WEBCORE) --output_cpp_dir $(GENSOURCES_WEBCORE) --output_js_dir $(GENSOURCES_WEBCORE) --output_type Web
DerivedSources/WebCore/InspectorWebTypeBuilders.h: DerivedSources/WebCore/InspectorWebTypeBuilders.cpp
-DerivedSources/WebCore/InspectorWebTypeBuilders.cpp: DerivedSources/WebCore/InspectorFrontend.h
-DerivedSources/WebCore/InspectorFrontend.h: DerivedSources/WebCore/InspectorFrontend.cpp
-DerivedSources/WebCore/InspectorFrontend.cpp: DerivedSources/WebCore/InspectorBackendCommands.js
-DerivedSources/WebCore/InspectorBackendCommands.js: DerivedSources/WebCore/InspectorBackendDispatchers.h
-DerivedSources/WebCore/InspectorBackendDispatchers.h: DerivedSources/WebCore/InspectorBackendDispatchers.cpp
+DerivedSources/WebCore/InspectorWebTypeBuilders.cpp: DerivedSources/WebCore/InspectorWebFrontendDispatchers.h
+DerivedSources/WebCore/InspectorWebFrontendDispatchers.h: DerivedSources/WebCore/InspectorWebFrontendDispatchers.cpp
+DerivedSources/WebCore/InspectorWebFrontendDispatchers.cpp: DerivedSources/WebCore/InspectorWebBackendCommands.js
+DerivedSources/WebCore/InspectorWebBackendCommands.js: DerivedSources/WebCore/InspectorWebBackendDispatchers.h
+DerivedSources/WebCore/InspectorWebBackendDispatchers.h: DerivedSources/WebCore/InspectorWebBackendDispatchers.cpp
DerivedSources/WebCore/InspectorOverlayPage.h: $(WebCore)/inspector/InspectorOverlayPage.html $(WebCore)/inspector/InspectorOverlayPage.css $(WebCore)/inspector/InspectorOverlayPage.js
$(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.combined.html
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index f656dce..60b370c 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -21,11 +21,11 @@
DerivedSources/WebCore/HTMLNames.h \
DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h \
DerivedSources/WebCore/InjectedScriptSource.h \
- DerivedSources/WebCore/InspectorBackendDispatchers.cpp \
- DerivedSources/WebCore/InspectorBackendDispatchers.h \
- DerivedSources/WebCore/InspectorFrontend.cpp \
- DerivedSources/WebCore/InspectorFrontend.h \
DerivedSources/WebCore/InspectorOverlayPage.h \
+ DerivedSources/WebCore/InspectorWebBackendDispatchers.cpp \
+ DerivedSources/WebCore/InspectorWebBackendDispatchers.h \
+ DerivedSources/WebCore/InspectorWebFrontendDispatchers.cpp \
+ DerivedSources/WebCore/InspectorWebFrontendDispatchers.h \
DerivedSources/WebCore/InspectorWebTypeBuilders.cpp \
DerivedSources/WebCore/InspectorWebTypeBuilders.h \
DerivedSources/WebCore/JSAbstractWorker.cpp \
diff --git a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
index e4563ad..c06947e 100644
--- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
+++ b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
@@ -746,8 +746,8 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLNames.cpp" />
- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorBackendDispatchers.cpp" />
- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorFrontend.cpp" />
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebBackendDispatchers.cpp" />
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebFrontendDispatchers.cpp" />
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebTypeBuilders.cpp" />
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSAbstractWorker.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
@@ -18081,9 +18081,9 @@
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLNames.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptCanvasModuleSource.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptSource.h" />
- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorBackendDispatchers.h" />
- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorFrontend.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorOverlayPage.h" />
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebBackendDispatchers.h" />
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebFrontendDispatchers.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebTypeBuilders.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSAbstractWorker.h" />
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSAttr.h" />
@@ -18566,6 +18566,9 @@
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentRegistry.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatcher.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendChannel.h" />
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSBackendDispatchers.h" />
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSFrontendDispatchers.h" />
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSTypeBuilders.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorTypeBuilder.h" />
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorValues.h" />
<ClInclude Include="..\ForwardingHeaders\masm\X86Assembler.h" />
@@ -21052,4 +21055,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
index a9935e7..4add0f2 100644
--- a/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
+++ b/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
@@ -5272,10 +5272,10 @@
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLNames.cpp">
<Filter>DerivedSources</Filter>
</ClCompile>
- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorBackendDispatchers.cpp">
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebBackendDispatchers.cpp">
<Filter>DerivedSources</Filter>
</ClCompile>
- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorFrontend.cpp">
+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebFrontendDispatchers.cpp">
<Filter>DerivedSources</Filter>
</ClCompile>
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebTypeBuilders.cpp">
@@ -12248,6 +12248,15 @@
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendChannel.h">
<Filter>ForwardingHeaders\inspector</Filter>
</ClInclude>
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSBackendDispatchers.h">
+ <Filter>ForwardingHeaders\inspector</Filter>
+ </ClInclude>
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSFrontendDispatchers.h">
+ <Filter>ForwardingHeaders\inspector</Filter>
+ </ClInclude>
+ <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSTypeBuilders.h">
+ <Filter>ForwardingHeaders\inspector</Filter>
+ </ClInclude>
<ClInclude Include="..\ForwardingHeaders\inspector\InspectorTypeBuilder.h">
<Filter>ForwardingHeaders\inspector</Filter>
</ClInclude>
@@ -13069,15 +13078,15 @@
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptSource.h">
<Filter>DerivedSources</Filter>
</ClInclude>
- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorBackendDispatchers.h">
- <Filter>DerivedSources</Filter>
- </ClInclude>
- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorFrontend.h">
- <Filter>DerivedSources</Filter>
- </ClInclude>
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorOverlayPage.h">
<Filter>DerivedSources</Filter>
</ClInclude>
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebBackendDispatchers.h">
+ <Filter>DerivedSources</Filter>
+ </ClInclude>
+ <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebFrontendDispatchers.h">
+ <Filter>DerivedSources</Filter>
+ </ClInclude>
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorWebTypeBuilders.h">
<Filter>DerivedSources</Filter>
</ClInclude>
@@ -15188,4 +15197,4 @@
<Filter>platform\win</Filter>
</MASM>
</ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/Source/WebCore/WebCore.vcxproj/build-generated-files.sh b/Source/WebCore/WebCore.vcxproj/build-generated-files.sh
old mode 100644
new mode 100755
index a153920..0de20fc
--- a/Source/WebCore/WebCore.vcxproj/build-generated-files.sh
+++ b/Source/WebCore/WebCore.vcxproj/build-generated-files.sh
@@ -60,4 +60,6 @@
export WebCore="${XSRCROOT}"
export FEATURE_DEFINES=`$SDKROOT/tools/scripts/feature-defines.sh $SDKROOT $3`
+export InspectorScripts="$XDSTROOT/include/private/JavaScriptCore"
+
make -f "$WebCore/DerivedSources.make" -j ${NUMCPUS} || exit 1
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index c727af2..b0f2d49 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1608,11 +1608,11 @@
4F1534E011B533020021FD86 /* EditingBehaviorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F2D205412EAE7B3005C2874 /* InspectorAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F2D205212EAE7B3005C2874 /* InspectorAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
4F2D205512EAE7B3005C2874 /* InspectorAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */; };
- 4F4F5FFB11CBD2E100A186BF /* InspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* InspectorFrontend.cpp */; };
+ 4F4F5FFB11CBD2E100A186BF /* InspectorWebFrontendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F5FFA11CBD2D200A186BF /* InspectorWebFrontendDispatchers.cpp */; };
4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */; };
4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */; };
- 4F707A9911EF679400ACDA69 /* InspectorBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F707A9711EF679400ACDA69 /* InspectorBackendDispatchers.cpp */; };
- 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 4F707A9911EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F707A9711EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp */; };
+ 4F707A9A11EF679400ACDA69 /* InspectorWebBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorWebBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
4FB390AD15EF61F3007AD51F /* GeneratedImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FB390AC15EF61F3007AD51F /* GeneratedImage.cpp */; };
4FFC022B1643B710004E1638 /* NodeRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FAB48661643A67E00F70C07 /* NodeRareData.cpp */; };
4FFC022D1643B726004E1638 /* ElementRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FAB48641643A66D00F70C07 /* ElementRareData.cpp */; };
@@ -1896,7 +1896,7 @@
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
573D134714CE39FF0057ABCA /* InspectorWebTypeBuilders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 573D134514CE39FF0057ABCA /* InspectorWebTypeBuilders.cpp */; };
- 578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 578DA20E1520EB8C006141C1 /* InspectorWebFrontendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F4F5FFC11CBD30100A186BF /* InspectorWebFrontendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
578DA20F1520EBA3006141C1 /* InspectorWebTypeBuilders.h in Headers */ = {isa = PBXBuildFile; fileRef = 573D134614CE39FF0057ABCA /* InspectorWebTypeBuilders.h */; settings = {ATTRIBUTES = (Private, ); }; };
57B791A314C6A62900F202D1 /* ContentDistributor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */; };
57B791A414C6A62900F202D1 /* ContentDistributor.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B791A014C6A62900F202D1 /* ContentDistributor.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8353,12 +8353,12 @@
4F1534DF11B533020021FD86 /* EditingBehaviorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingBehaviorTypes.h; sourceTree = "<group>"; };
4F2D205212EAE7B3005C2874 /* InspectorAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgent.h; sourceTree = "<group>"; };
4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorAgent.cpp; sourceTree = "<group>"; };
- 4F4F5FFA11CBD2D200A186BF /* InspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontend.cpp; sourceTree = "<group>"; };
- 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontend.h; sourceTree = "<group>"; };
+ 4F4F5FFA11CBD2D200A186BF /* InspectorWebFrontendDispatchers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorWebFrontendDispatchers.cpp; sourceTree = "<group>"; };
+ 4F4F5FFC11CBD30100A186BF /* InspectorWebFrontendDispatchers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebFrontendDispatchers.h; sourceTree = "<group>"; };
4F6FDD621341DEDD001F8EE3 /* InspectorPageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorPageAgent.cpp; sourceTree = "<group>"; };
4F6FDD631341DEDD001F8EE3 /* InspectorPageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorPageAgent.h; sourceTree = "<group>"; };
- 4F707A9711EF679400ACDA69 /* InspectorBackendDispatchers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatchers.cpp; sourceTree = "<group>"; };
- 4F707A9811EF679400ACDA69 /* InspectorBackendDispatchers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatchers.h; sourceTree = "<group>"; };
+ 4F707A9711EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorWebBackendDispatchers.cpp; sourceTree = "<group>"; };
+ 4F707A9811EF679400ACDA69 /* InspectorWebBackendDispatchers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebBackendDispatchers.h; sourceTree = "<group>"; };
4FAB48641643A66D00F70C07 /* ElementRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ElementRareData.cpp; sourceTree = "<group>"; };
4FAB48661643A67E00F70C07 /* NodeRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeRareData.cpp; sourceTree = "<group>"; };
4FB390AC15EF61F3007AD51F /* GeneratedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeneratedImage.cpp; sourceTree = "<group>"; };
@@ -10355,8 +10355,6 @@
A5732B08136A161D005C8D7C /* DateComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DateComponents.cpp; sourceTree = "<group>"; };
A5732B09136A161D005C8D7C /* DateComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateComponents.h; sourceTree = "<group>"; };
A593CF7218402CE900BFCE27 /* protocol */ = {isa = PBXFileReference; lastKnownFileType = folder; path = protocol; sourceTree = "<group>"; };
- A593CF7318402D4B00BFCE27 /* CodeGeneratorInspector.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = CodeGeneratorInspector.py; sourceTree = "<group>"; };
- A593CF7418402D4B00BFCE27 /* CodeGeneratorInspectorStrings.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = CodeGeneratorInspectorStrings.py; sourceTree = "<group>"; };
A593CF7518402D4B00BFCE27 /* combine-javascript-resources.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = "combine-javascript-resources.pl"; sourceTree = "<group>"; };
A593CF8A1840535200BFCE27 /* InspectorWebAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWebAgentBase.h; sourceTree = "<group>"; };
A5A2AF091829734300DE1729 /* PageDebuggable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageDebuggable.cpp; sourceTree = "<group>"; };
@@ -14458,10 +14456,10 @@
children = (
AA912750157E35A500454E54 /* InjectedScriptCanvasModuleSource.h */,
7A563E5412DE32B000F4536D /* InjectedScriptSource.h */,
- 4F707A9711EF679400ACDA69 /* InspectorBackendDispatchers.cpp */,
- 4F707A9811EF679400ACDA69 /* InspectorBackendDispatchers.h */,
- 4F4F5FFA11CBD2D200A186BF /* InspectorFrontend.cpp */,
- 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */,
+ 4F707A9711EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp */,
+ 4F707A9811EF679400ACDA69 /* InspectorWebBackendDispatchers.h */,
+ 4F4F5FFA11CBD2D200A186BF /* InspectorWebFrontendDispatchers.cpp */,
+ 4F4F5FFC11CBD30100A186BF /* InspectorWebFrontendDispatchers.h */,
573D134514CE39FF0057ABCA /* InspectorWebTypeBuilders.cpp */,
573D134614CE39FF0057ABCA /* InspectorWebTypeBuilders.h */,
7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */,
@@ -14483,8 +14481,6 @@
children = (
A593CF7218402CE900BFCE27 /* protocol */,
A518225317E28CF100A9BA1D /* Scripts */,
- A593CF7318402D4B00BFCE27 /* CodeGeneratorInspector.py */,
- A593CF7418402D4B00BFCE27 /* CodeGeneratorInspectorStrings.py */,
A593CF7518402D4B00BFCE27 /* combine-javascript-resources.pl */,
F35AE5AB14925F5B004D5776 /* BindingVisitors.h */,
2DF2E9D4166E39740035BEF2 /* ConsoleAPITypes.h */,
@@ -23408,7 +23404,7 @@
93309DF2099E64920056E581 /* InsertTextCommand.h in Headers */,
4F2D205412EAE7B3005C2874 /* InspectorAgent.h in Headers */,
B885E8D511E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h in Headers */,
- 4F707A9A11EF679400ACDA69 /* InspectorBackendDispatchers.h in Headers */,
+ 4F707A9A11EF679400ACDA69 /* InspectorWebBackendDispatchers.h in Headers */,
AAD766EC157E502F00E85423 /* InspectorCanvasAgent.h in Headers */,
AAD766ED157E502F00E85423 /* InspectorCanvasInstrumentation.h in Headers */,
1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */,
@@ -23427,7 +23423,7 @@
F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */,
7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */,
0705853417FDE6D9005F2BCB /* JSMediaTrackConstraints.h in Headers */,
- 578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */,
+ 578DA20E1520EB8C006141C1 /* InspectorWebFrontendDispatchers.h in Headers */,
227777601345DEA9008EA455 /* InspectorForwarding.h in Headers */,
F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,
F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
@@ -25674,7 +25670,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\n\n/bin/ln -sfh \"${SRCROOT}\" WebCore\nexport WebCore=\"WebCore\"\n\nif [ ! $CC ]; then\n export CC=\"`xcrun -find clang`\"\nfi\n\nif [ ! $GPERF ]; then\n export GPERF=\"`xcrun -find gperf`\"\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make --no-builtin-rules -f \"WebCore/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.activecpu` SDKROOT=\"${SDKROOT}\"\nfi\n";
+ shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\n\n/bin/ln -sfh \"${SRCROOT}\" WebCore\nexport WebCore=\"WebCore\"\nexport InspectorScripts=\"${JAVASCRIPTCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n export CC=\"`xcrun -find clang`\"\nfi\n\nif [ ! $GPERF ]; then\n export GPERF=\"`xcrun -find gperf`\"\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make --no-builtin-rules -f \"WebCore/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.activecpu` SDKROOT=\"${SDKROOT}\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -26670,7 +26666,7 @@
93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */,
4F2D205512EAE7B3005C2874 /* InspectorAgent.cpp in Sources */,
B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
- 4F707A9911EF679400ACDA69 /* InspectorBackendDispatchers.cpp in Sources */,
+ 4F707A9911EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp in Sources */,
E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */,
AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */,
7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
@@ -26685,7 +26681,7 @@
7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */,
F3D4C47812E07663003DA150 /* InspectorDOMDebuggerAgent.cpp in Sources */,
7A74ECBA101839A600BF939E /* InspectorDOMStorageAgent.cpp in Sources */,
- 4F4F5FFB11CBD2E100A186BF /* InspectorFrontend.cpp in Sources */,
+ 4F4F5FFB11CBD2E100A186BF /* InspectorWebFrontendDispatchers.cpp in Sources */,
F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */,
7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
5112935F3D54B4B52FAF973F /* InspectorHeapProfilerAgent.cpp in Sources */,
diff --git a/Source/WebCore/inspector/CodeGeneratorInspector.py b/Source/WebCore/inspector/CodeGeneratorInspector.py
deleted file mode 100755
index a1db1b7..0000000
--- a/Source/WebCore/inspector/CodeGeneratorInspector.py
+++ /dev/null
@@ -1,2458 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. All rights reserved.
-# Copyright (c) 2012 Intel Corporation. All rights reserved.
-# Copyright (c) 2013 Apple Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * 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.
-
-import os.path
-import sys
-import string
-import optparse
-import re
-try:
- import json
-except ImportError:
- import simplejson as json
-
-import CodeGeneratorInspectorStrings
-
-
-DOMAIN_DEFINE_NAME_MAP = {
- "Database": "SQL_DATABASE",
- "Debugger": "JAVASCRIPT_DEBUGGER",
- "DOMDebugger": "JAVASCRIPT_DEBUGGER",
- "IndexedDB": "INDEXED_DATABASE",
- "Profiler": "JAVASCRIPT_DEBUGGER",
-}
-
-
-# Manually-filled map of type name replacements.
-TYPE_NAME_FIX_MAP = {
- "RGBA": "Rgba", # RGBA is reported to be conflicting with a define name in Windows CE.
- "": "Empty",
-}
-
-
-TYPES_WITH_RUNTIME_CAST_SET = frozenset(["Runtime.RemoteObject", "Runtime.PropertyDescriptor", "Runtime.InternalPropertyDescriptor",
- "Debugger.FunctionDetails", "Debugger.CallFrame",
- "Canvas.TraceLog", "Canvas.ResourceInfo", "Canvas.ResourceState",
- # This should be a temporary hack. TimelineEvent should be created via generated C++ API.
- "Timeline.TimelineEvent"])
-
-TYPES_WITH_OPEN_FIELD_LIST_SET = frozenset(["Timeline.TimelineEvent",
- # InspectorStyleSheet not only creates this property but wants to read it and modify it.
- "CSS.CSSProperty",
- # InspectorResourceAgent needs to update mime-type.
- "Network.Response"])
-
-EXACTLY_INT_SUPPORTED = False
-
-cmdline_parser = optparse.OptionParser(usage="usage: %prog [options] <Inspector.json>")
-cmdline_parser.add_option("--output_h_dir")
-cmdline_parser.add_option("--output_cpp_dir")
-cmdline_parser.add_option("--output_js_dir")
-cmdline_parser.add_option("--write_always", action="store_true")
-cmdline_parser.add_option("--no_verification", action="store_true")
-
-try:
- arg_options, arg_values = cmdline_parser.parse_args()
- if (len(arg_values) != 1):
- raise Exception("Exactly one plain argument expected (found %s)" % len(arg_values))
- input_json_filename = arg_values[0]
- output_header_dirname = arg_options.output_h_dir
- output_cpp_dirname = arg_options.output_cpp_dir
- output_js_dirname = arg_options.output_js_dir
- write_always = arg_options.write_always
- verification = not arg_options.no_verification
- if not output_header_dirname:
- raise Exception("Output .h directory must be specified")
- if not output_cpp_dirname:
- raise Exception("Output .cpp directory must be specified")
- if not output_js_dirname:
- raise Exception("Output .js directory must be specified")
-except Exception:
- # Work with python 2 and 3 http://docs.python.org/py3k/howto/pyporting.html
- exc = sys.exc_info()[1]
- sys.stderr.write("Failed to parse command-line arguments: %s\n\n" % exc)
- sys.stderr.write("Usage: <script> Inspector.json --output_h_dir <output_header_dir> --output_cpp_dir <output_cpp_dir> --output_js_dir <output_js_dir> [--write_always] [--no_verification]\n")
- exit(1)
-
-
-def dash_to_camelcase(word):
- return ''.join(x.capitalize() or '-' for x in word.split('-'))
-
-
-def fix_camel_case(name):
- refined = re.sub(r'-(\w)', lambda pat: pat.group(1).upper(), name)
- refined = to_title_case(refined)
- return re.sub(r'(?i)HTML|XML|WML|API|GC|XHR|DOM|CSS', lambda pat: pat.group(0).upper(), refined)
-
-
-def to_title_case(name):
- return name[:1].upper() + name[1:]
-
-
-class Capitalizer:
- @staticmethod
- def lower_camel_case_to_upper(str):
- if len(str) > 0 and str[0].islower():
- str = str[0].upper() + str[1:]
- return str
-
- @staticmethod
- def upper_camel_case_to_lower(str):
- pos = 0
- while pos < len(str) and str[pos].isupper():
- pos += 1
- if pos == 0:
- return str
- if pos == 1:
- return str[0].lower() + str[1:]
- if pos < len(str):
- pos -= 1
- possible_abbreviation = str[0:pos]
- if possible_abbreviation not in Capitalizer.ABBREVIATION:
- raise Exception("Unknown abbreviation %s" % possible_abbreviation)
- str = possible_abbreviation.lower() + str[pos:]
- return str
-
- @staticmethod
- def camel_case_to_capitalized_with_underscores(str):
- if len(str) == 0:
- return str
- output = Capitalizer.split_camel_case_(str)
- return "_".join(output).upper()
-
- @staticmethod
- def split_camel_case_(str):
- output = []
- pos_being = 0
- pos = 1
- has_oneletter = False
- while pos < len(str):
- if str[pos].isupper():
- output.append(str[pos_being:pos].upper())
- if pos - pos_being == 1:
- has_oneletter = True
- pos_being = pos
- pos += 1
- output.append(str[pos_being:])
- if has_oneletter:
- array_pos = 0
- while array_pos < len(output) - 1:
- if len(output[array_pos]) == 1:
- array_pos_end = array_pos + 1
- while array_pos_end < len(output) and len(output[array_pos_end]) == 1:
- array_pos_end += 1
- if array_pos_end - array_pos > 1:
- possible_abbreviation = "".join(output[array_pos:array_pos_end])
- if possible_abbreviation.upper() in Capitalizer.ABBREVIATION:
- output[array_pos:array_pos_end] = [possible_abbreviation]
- else:
- array_pos = array_pos_end - 1
- array_pos += 1
- return output
-
- ABBREVIATION = frozenset(["XHR", "DOM", "CSS"])
-
-VALIDATOR_IFDEF_NAME = "!ASSERT_DISABLED"
-
-
-class DomainNameFixes:
- @classmethod
- def get_fixed_data(cls, domain_name):
- field_name_res = Capitalizer.upper_camel_case_to_lower(domain_name) + "Agent"
-
- class Res(object):
- skip_js_bind = domain_name in cls.skip_js_bind_domains
-
- @staticmethod
- def get_guard():
- if domain_name in DOMAIN_DEFINE_NAME_MAP:
- define_name = DOMAIN_DEFINE_NAME_MAP[domain_name]
-
- class Guard:
- @staticmethod
- def generate_open(output):
- output.append("#if ENABLE(%s)\n" % define_name)
-
- @staticmethod
- def generate_close(output):
- output.append("#endif // ENABLE(%s)\n" % define_name)
-
- return Guard
-
- return Res
-
- skip_js_bind_domains = set(["DOMDebugger"])
-
-
-class RawTypes(object):
- @staticmethod
- def get(json_type):
- if json_type == "boolean":
- return RawTypes.Bool
- elif json_type == "string":
- return RawTypes.String
- elif json_type == "array":
- return RawTypes.Array
- elif json_type == "object":
- return RawTypes.Object
- elif json_type == "integer":
- return RawTypes.Int
- elif json_type == "number":
- return RawTypes.Number
- elif json_type == "any":
- return RawTypes.Any
- else:
- raise Exception("Unknown type: %s" % json_type)
-
- # For output parameter all values are passed by pointer except RefPtr-based types.
- class OutputPassModel:
- class ByPointer:
- @staticmethod
- def get_argument_prefix():
- return "&"
-
- @staticmethod
- def get_parameter_type_suffix():
- return "*"
-
- class ByReference:
- @staticmethod
- def get_argument_prefix():
- return ""
-
- @staticmethod
- def get_parameter_type_suffix():
- return "&"
-
- class BaseType(object):
- need_internal_runtime_cast_ = False
-
- @classmethod
- def request_raw_internal_runtime_cast(cls):
- if not cls.need_internal_runtime_cast_:
- cls.need_internal_runtime_cast_ = True
-
- @classmethod
- def get_raw_validator_call_text(cls):
- return "RuntimeCastHelper::assertType<Inspector::InspectorValue::Type%s>" % cls.get_validate_method_params().template_type
-
- class String(BaseType):
- @staticmethod
- def get_getter_name():
- return "String"
-
- get_setter_name = get_getter_name
-
- @staticmethod
- def get_c_initializer():
- return "\"\""
-
- @staticmethod
- def get_js_bind_type():
- return "string"
-
- @staticmethod
- def get_validate_method_params():
- class ValidateMethodParams:
- template_type = "String"
- return ValidateMethodParams
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByPointer
-
- @staticmethod
- def is_heavy_value():
- return True
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "String"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.String
-
- class Int(BaseType):
- @staticmethod
- def get_getter_name():
- return "Int"
-
- @staticmethod
- def get_setter_name():
- return "Number"
-
- @staticmethod
- def get_c_initializer():
- return "0"
-
- @staticmethod
- def get_js_bind_type():
- return "number"
-
- @classmethod
- def get_raw_validator_call_text(cls):
- return "RuntimeCastHelper::assertInt"
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByPointer
-
- @staticmethod
- def is_heavy_value():
- return False
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "int"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Int
-
- class Number(BaseType):
- @staticmethod
- def get_getter_name():
- return "Double"
-
- @staticmethod
- def get_setter_name():
- return "Number"
-
- @staticmethod
- def get_c_initializer():
- return "0"
-
- @staticmethod
- def get_js_bind_type():
- return "number"
-
- @staticmethod
- def get_validate_method_params():
- class ValidateMethodParams:
- template_type = "Number"
- return ValidateMethodParams
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByPointer
-
- @staticmethod
- def is_heavy_value():
- return False
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "double"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Number
-
- class Bool(BaseType):
- @staticmethod
- def get_getter_name():
- return "Boolean"
-
- get_setter_name = get_getter_name
-
- @staticmethod
- def get_c_initializer():
- return "false"
-
- @staticmethod
- def get_js_bind_type():
- return "boolean"
-
- @staticmethod
- def get_validate_method_params():
- class ValidateMethodParams:
- template_type = "Boolean"
- return ValidateMethodParams
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByPointer
-
- @staticmethod
- def is_heavy_value():
- return False
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "bool"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Bool
-
- class Object(BaseType):
- @staticmethod
- def get_getter_name():
- return "Object"
-
- @staticmethod
- def get_setter_name():
- return "Value"
-
- @staticmethod
- def get_c_initializer():
- return "InspectorObject::create()"
-
- @staticmethod
- def get_js_bind_type():
- return "object"
-
- @staticmethod
- def get_output_argument_prefix():
- return ""
-
- @staticmethod
- def get_validate_method_params():
- class ValidateMethodParams:
- template_type = "Object"
- return ValidateMethodParams
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByReference
-
- @staticmethod
- def is_heavy_value():
- return True
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "Inspector::InspectorObject"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Object
-
- class Any(BaseType):
- @staticmethod
- def get_getter_name():
- return "Value"
-
- get_setter_name = get_getter_name
-
- @staticmethod
- def get_c_initializer():
- raise Exception("Unsupported")
-
- @staticmethod
- def get_js_bind_type():
- raise Exception("Unsupported")
-
- @staticmethod
- def get_raw_validator_call_text():
- return "RuntimeCastHelper::assertAny"
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByReference
-
- @staticmethod
- def is_heavy_value():
- return True
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "Inspector::InspectorValue"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Any
-
- class Array(BaseType):
- @staticmethod
- def get_getter_name():
- return "Array"
-
- @staticmethod
- def get_setter_name():
- return "Value"
-
- @staticmethod
- def get_c_initializer():
- return "InspectorArray::create()"
-
- @staticmethod
- def get_js_bind_type():
- return "object"
-
- @staticmethod
- def get_output_argument_prefix():
- return ""
-
- @staticmethod
- def get_validate_method_params():
- class ValidateMethodParams:
- template_type = "Array"
- return ValidateMethodParams
-
- @staticmethod
- def get_output_pass_model():
- return RawTypes.OutputPassModel.ByReference
-
- @staticmethod
- def is_heavy_value():
- return True
-
- @staticmethod
- def get_array_item_raw_c_type_text():
- return "Inspector::InspectorArray"
-
- @staticmethod
- def get_raw_type_model():
- return TypeModel.Array
-
-
-def replace_right_shift(input_str):
- return input_str.replace(">>", "> >")
-
-
-class CommandReturnPassModel:
- class ByReference:
- def __init__(self, var_type, set_condition):
- self.var_type = var_type
- self.set_condition = set_condition
-
- def get_return_var_type(self):
- return self.var_type
-
- @staticmethod
- def get_output_argument_prefix():
- return ""
-
- @staticmethod
- def get_output_to_raw_expression():
- return "%s"
-
- def get_output_parameter_type(self):
- return self.var_type + "&"
-
- def get_set_return_condition(self):
- return self.set_condition
-
- class ByPointer:
- def __init__(self, var_type):
- self.var_type = var_type
-
- def get_return_var_type(self):
- return self.var_type
-
- @staticmethod
- def get_output_argument_prefix():
- return "&"
-
- @staticmethod
- def get_output_to_raw_expression():
- return "%s"
-
- def get_output_parameter_type(self):
- return self.var_type + "*"
-
- @staticmethod
- def get_set_return_condition():
- return None
-
- class OptOutput:
- def __init__(self, var_type):
- self.var_type = var_type
-
- def get_return_var_type(self):
- return "Inspector::TypeBuilder::OptOutput<%s>" % self.var_type
-
- @staticmethod
- def get_output_argument_prefix():
- return "&"
-
- @staticmethod
- def get_output_to_raw_expression():
- return "%s.getValue()"
-
- def get_output_parameter_type(self):
- return "Inspector::TypeBuilder::OptOutput<%s>*" % self.var_type
-
- @staticmethod
- def get_set_return_condition():
- return "%s.isAssigned()"
-
-
-class TypeModel:
- class RefPtrBased(object):
- def __init__(self, class_name):
- self.class_name = class_name
- self.optional = False
-
- def get_optional(self):
- result = TypeModel.RefPtrBased(self.class_name)
- result.optional = True
- return result
-
- def get_command_return_pass_model(self):
- if self.optional:
- set_condition = "%s"
- else:
- set_condition = None
- return CommandReturnPassModel.ByReference(replace_right_shift("RefPtr<%s>" % self.class_name), set_condition)
-
- def get_input_param_type_text(self):
- return replace_right_shift("PassRefPtr<%s>" % self.class_name)
-
- @staticmethod
- def get_event_setter_expression_pattern():
- return "%s"
-
- class Enum(object):
- def __init__(self, base_type_name):
- self.type_name = base_type_name + "::Enum"
-
- def get_optional(base_self):
- class EnumOptional:
- @classmethod
- def get_optional(cls):
- return cls
-
- @staticmethod
- def get_command_return_pass_model():
- return CommandReturnPassModel.OptOutput(base_self.type_name)
-
- @staticmethod
- def get_input_param_type_text():
- return base_self.type_name + "*"
-
- @staticmethod
- def get_event_setter_expression_pattern():
- raise Exception("TODO")
- return EnumOptional
-
- def get_command_return_pass_model(self):
- return CommandReturnPassModel.ByPointer(self.type_name)
-
- def get_input_param_type_text(self):
- return self.type_name
-
- @staticmethod
- def get_event_setter_expression_pattern():
- return "%s"
-
- class ValueType(object):
- def __init__(self, type_name, is_heavy):
- self.type_name = type_name
- self.is_heavy = is_heavy
-
- def get_optional(self):
- return self.ValueOptional(self)
-
- def get_command_return_pass_model(self):
- return CommandReturnPassModel.ByPointer(self.type_name)
-
- def get_input_param_type_text(self):
- if self.is_heavy:
- return "const %s&" % self.type_name
- else:
- return self.type_name
-
- def get_opt_output_type_(self):
- return self.type_name
-
- @staticmethod
- def get_event_setter_expression_pattern():
- return "%s"
-
- class ValueOptional:
- def __init__(self, base):
- self.base = base
-
- def get_optional(self):
- return self
-
- def get_command_return_pass_model(self):
- return CommandReturnPassModel.OptOutput(self.base.get_opt_output_type_())
-
- def get_input_param_type_text(self):
- return "const %s* const" % self.base.type_name
-
- @staticmethod
- def get_event_setter_expression_pattern():
- return "*%s"
-
- class ExactlyInt(ValueType):
- def __init__(self):
- TypeModel.ValueType.__init__(self, "int", False)
-
- def get_input_param_type_text(self):
- return "Inspector::TypeBuilder::ExactlyInt"
-
- def get_opt_output_type_(self):
- return "Inspector::TypeBuilder::ExactlyInt"
-
- @classmethod
- def init_class(cls):
- cls.Bool = cls.ValueType("bool", False)
- if EXACTLY_INT_SUPPORTED:
- cls.Int = cls.ExactlyInt()
- else:
- cls.Int = cls.ValueType("int", False)
- cls.Number = cls.ValueType("double", False)
- cls.String = cls.ValueType("String", True,)
- cls.Object = cls.RefPtrBased("Inspector::InspectorObject")
- cls.Array = cls.RefPtrBased("Inspector::InspectorArray")
- cls.Any = cls.RefPtrBased("Inspector::InspectorValue")
-
-TypeModel.init_class()
-
-
-# Collection of InspectorObject class methods that are likely to be overloaded in generated class.
-# We must explicitly import all overloaded methods or they won't be available to user.
-INSPECTOR_OBJECT_SETTER_NAMES = frozenset(["setValue", "setBoolean", "setNumber", "setString", "setValue", "setObject", "setArray"])
-
-
-def fix_type_name(json_name):
- if json_name in TYPE_NAME_FIX_MAP:
- fixed = TYPE_NAME_FIX_MAP[json_name]
-
- class Result(object):
- class_name = fixed
-
- @staticmethod
- def output_comment(writer):
- writer.newline("// Type originally was named '%s'.\n" % json_name)
- else:
-
- class Result(object):
- class_name = json_name
-
- @staticmethod
- def output_comment(writer):
- pass
-
- return Result
-
-
-class Writer:
- def __init__(self, output, indent):
- self.output = output
- self.indent = indent
-
- def newline(self, str):
- if (self.indent):
- self.output.append(self.indent)
- self.output.append(str)
-
- def append(self, str):
- self.output.append(str)
-
- def newline_multiline(self, str):
- parts = str.split('\n')
- self.newline(parts[0])
- for p in parts[1:]:
- self.output.append('\n')
- if p:
- self.newline(p)
-
- def append_multiline(self, str):
- parts = str.split('\n')
- self.append(parts[0])
- for p in parts[1:]:
- self.output.append('\n')
- if p:
- self.newline(p)
-
- def get_indent(self):
- return self.indent
-
- def get_indented(self, additional_indent):
- return Writer(self.output, self.indent + additional_indent)
-
- def insert_writer(self, additional_indent):
- new_output = []
- self.output.append(new_output)
- return Writer(new_output, self.indent + additional_indent)
-
-
-class EnumConstants:
- map_ = {}
- constants_ = []
-
- @classmethod
- def add_constant(cls, value):
- if value in cls.map_:
- return cls.map_[value]
- else:
- pos = len(cls.map_)
- cls.map_[value] = pos
- cls.constants_.append(value)
- return pos
-
- @classmethod
- def get_enum_constant_code(cls):
- output = []
- for item in cls.constants_:
- output.append(" \"" + item + "\"")
- return ",\n".join(output) + "\n"
-
-
-# Typebuilder code is generated in several passes: first typedefs, then other classes.
-# Manual pass management is needed because we cannot have forward declarations for typedefs.
-class TypeBuilderPass:
- TYPEDEF = "typedef"
- MAIN = "main"
-
-
-class TypeBindings:
- @staticmethod
- def create_named_type_declaration(json_typable, context_domain_name, type_data):
- json_type = type_data.get_json_type()
-
- class Helper:
- is_ad_hoc = False
- full_name_prefix_for_use = "Inspector::TypeBuilder::" + context_domain_name + "::"
- full_name_prefix_for_impl = "Inspector::TypeBuilder::" + context_domain_name + "::"
-
- @staticmethod
- def write_doc(writer):
- if "description" in json_type:
- writer.newline("/* ")
- writer.append(json_type["description"])
- writer.append(" */\n")
-
- @staticmethod
- def add_to_forward_listener(forward_listener):
- forward_listener.add_type_data(type_data)
-
-
- fixed_type_name = fix_type_name(json_type["id"])
- return TypeBindings.create_type_declaration_(json_typable, context_domain_name, fixed_type_name, Helper)
-
- @staticmethod
- def create_ad_hoc_type_declaration(json_typable, context_domain_name, ad_hoc_type_context):
- class Helper:
- is_ad_hoc = True
- full_name_prefix_for_use = ad_hoc_type_context.container_relative_name_prefix
- full_name_prefix_for_impl = ad_hoc_type_context.container_full_name_prefix
-
- @staticmethod
- def write_doc(writer):
- pass
-
- @staticmethod
- def add_to_forward_listener(forward_listener):
- pass
- fixed_type_name = ad_hoc_type_context.get_type_name_fix()
- return TypeBindings.create_type_declaration_(json_typable, context_domain_name, fixed_type_name, Helper)
-
- @staticmethod
- def create_type_declaration_(json_typable, context_domain_name, fixed_type_name, helper):
- if json_typable["type"] == "string":
- if "enum" in json_typable:
-
- class EnumBinding:
- need_user_runtime_cast_ = False
- need_internal_runtime_cast_ = False
-
- @classmethod
- def resolve_inner(cls, resolve_context):
- pass
-
- @classmethod
- def request_user_runtime_cast(cls, request):
- if request:
- cls.need_user_runtime_cast_ = True
- request.acknowledge()
-
- @classmethod
- def request_internal_runtime_cast(cls):
- cls.need_internal_runtime_cast_ = True
-
- @classmethod
- def get_code_generator(enum_binding_cls):
- #FIXME: generate ad-hoc enums too once we figure out how to better implement them in C++.
- comment_out = helper.is_ad_hoc
-
- class CodeGenerator:
- @staticmethod
- def generate_type_builder(writer, generate_context):
- enum = json_typable["enum"]
- helper.write_doc(writer)
- enum_name = fixed_type_name.class_name
- fixed_type_name.output_comment(writer)
- writer.newline("struct ")
- writer.append(enum_name)
- writer.append(" {\n")
- writer.newline(" enum Enum {\n")
- for enum_item in enum:
- enum_pos = EnumConstants.add_constant(enum_item)
-
- item_c_name = fix_camel_case(enum_item)
- if item_c_name in TYPE_NAME_FIX_MAP:
- item_c_name = TYPE_NAME_FIX_MAP[item_c_name]
- writer.newline(" ")
- writer.append(item_c_name)
- writer.append(" = ")
- writer.append("%s" % enum_pos)
- writer.append(",\n")
- writer.newline(" };\n")
- if enum_binding_cls.need_user_runtime_cast_:
- raise Exception("Not yet implemented")
-
- if enum_binding_cls.need_internal_runtime_cast_:
- writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
- writer.newline(" static void assertCorrectValue(Inspector::InspectorValue* value);\n")
- writer.append("#endif // %s\n" % VALIDATOR_IFDEF_NAME)
-
- validator_writer = generate_context.validator_writer
-
- domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
- domain_guard = domain_fixes.get_guard()
- if domain_guard:
- domain_guard.generate_open(validator_writer)
-
- validator_writer.newline("void %s%s::assertCorrectValue(Inspector::InspectorValue* value)\n" % (helper.full_name_prefix_for_impl, enum_name))
- validator_writer.newline("{\n")
- validator_writer.newline(" WTF::String s;\n")
- validator_writer.newline(" bool cast_res = value->asString(&s);\n")
- validator_writer.newline(" ASSERT(cast_res);\n")
- if len(enum) > 0:
- condition_list = []
- for enum_item in enum:
- enum_pos = EnumConstants.add_constant(enum_item)
- condition_list.append("s == \"%s\"" % enum_item)
- validator_writer.newline(" ASSERT(%s);\n" % " || ".join(condition_list))
- validator_writer.newline("}\n")
-
- if domain_guard:
- domain_guard.generate_close(validator_writer)
-
- validator_writer.newline("\n\n")
-
- writer.newline("}; // struct ")
- writer.append(enum_name)
- writer.append("\n")
-
- @staticmethod
- def register_use(forward_listener):
- pass
-
- @staticmethod
- def get_generate_pass_id():
- return TypeBuilderPass.MAIN
-
- return CodeGenerator
-
- @classmethod
- def get_validator_call_text(cls):
- return helper.full_name_prefix_for_use + fixed_type_name.class_name + "::assertCorrectValue"
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return helper.full_name_prefix_for_use + fixed_type_name.class_name + "::Enum"
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return "Inspector::TypeBuilder::getEnumConstantValue(%s)"
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.String
-
- @staticmethod
- def get_type_model():
- return TypeModel.Enum(helper.full_name_prefix_for_use + fixed_type_name.class_name)
-
- return EnumBinding
- else:
- if helper.is_ad_hoc:
-
- class PlainString:
- @classmethod
- def resolve_inner(cls, resolve_context):
- pass
-
- @staticmethod
- def request_user_runtime_cast(request):
- raise Exception("Unsupported")
-
- @staticmethod
- def request_internal_runtime_cast():
- pass
-
- @staticmethod
- def get_code_generator():
- return None
-
- @classmethod
- def get_validator_call_text(cls):
- return RawTypes.String.get_raw_validator_call_text()
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.String
-
- @staticmethod
- def get_type_model():
- return TypeModel.String
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return None
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return cls.reduce_to_raw_type().get_array_item_raw_c_type_text()
-
- return PlainString
-
- else:
-
- class TypedefString:
- @classmethod
- def resolve_inner(cls, resolve_context):
- pass
-
- @staticmethod
- def request_user_runtime_cast(request):
- raise Exception("Unsupported")
-
- @staticmethod
- def request_internal_runtime_cast():
- RawTypes.String.request_raw_internal_runtime_cast()
-
- @staticmethod
- def get_code_generator():
- class CodeGenerator:
- @staticmethod
- def generate_type_builder(writer, generate_context):
- helper.write_doc(writer)
- fixed_type_name.output_comment(writer)
- writer.newline("typedef String ")
- writer.append(fixed_type_name.class_name)
- writer.append(";\n\n")
-
- @staticmethod
- def register_use(forward_listener):
- pass
-
- @staticmethod
- def get_generate_pass_id():
- return TypeBuilderPass.TYPEDEF
-
- return CodeGenerator
-
- @classmethod
- def get_validator_call_text(cls):
- return RawTypes.String.get_raw_validator_call_text()
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.String
-
- @staticmethod
- def get_type_model():
- return TypeModel.ValueType("%s%s" % (helper.full_name_prefix_for_use, fixed_type_name.class_name), True)
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return None
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return "const %s%s&" % (helper.full_name_prefix_for_use, fixed_type_name.class_name)
-
- return TypedefString
-
- elif json_typable["type"] == "object":
- if "properties" in json_typable:
-
- class ClassBinding:
- resolve_data_ = None
- need_user_runtime_cast_ = False
- need_internal_runtime_cast_ = False
-
- @classmethod
- def resolve_inner(cls, resolve_context):
- if cls.resolve_data_:
- return
-
- properties = json_typable["properties"]
- main = []
- optional = []
-
- ad_hoc_type_list = []
-
- for prop in properties:
- prop_name = prop["name"]
- ad_hoc_type_context = cls.AdHocTypeContextImpl(prop_name, fixed_type_name.class_name, resolve_context, ad_hoc_type_list, helper.full_name_prefix_for_impl)
- binding = resolve_param_type(prop, context_domain_name, ad_hoc_type_context)
-
- code_generator = binding.get_code_generator()
- if code_generator:
- code_generator.register_use(resolve_context.forward_listener)
-
- class PropertyData:
- param_type_binding = binding
- p = prop
-
- if prop.get("optional"):
- optional.append(PropertyData)
- else:
- main.append(PropertyData)
-
- class ResolveData:
- main_properties = main
- optional_properties = optional
- ad_hoc_types = ad_hoc_type_list
-
- cls.resolve_data_ = ResolveData
-
- for ad_hoc in ad_hoc_type_list:
- ad_hoc.resolve_inner(resolve_context)
-
- @classmethod
- def request_user_runtime_cast(cls, request):
- if not request:
- return
- cls.need_user_runtime_cast_ = True
- request.acknowledge()
- cls.request_internal_runtime_cast()
-
- @classmethod
- def request_internal_runtime_cast(cls):
- if cls.need_internal_runtime_cast_:
- return
- cls.need_internal_runtime_cast_ = True
- for p in cls.resolve_data_.main_properties:
- p.param_type_binding.request_internal_runtime_cast()
- for p in cls.resolve_data_.optional_properties:
- p.param_type_binding.request_internal_runtime_cast()
-
- @classmethod
- def get_code_generator(class_binding_cls):
- class CodeGenerator:
- @classmethod
- def generate_type_builder(cls, writer, generate_context):
- resolve_data = class_binding_cls.resolve_data_
- helper.write_doc(writer)
- class_name = fixed_type_name.class_name
-
- is_open_type = (context_domain_name + "." + class_name) in TYPES_WITH_OPEN_FIELD_LIST_SET
-
- fixed_type_name.output_comment(writer)
- writer.newline("class ")
- writer.append(class_name)
- writer.append(" : public ")
- if is_open_type:
- writer.append("Inspector::InspectorObject")
- else:
- writer.append("Inspector::InspectorObjectBase")
- writer.append(" {\n")
- writer.newline("public:\n")
- ad_hoc_type_writer = writer.insert_writer(" ")
-
- for ad_hoc_type in resolve_data.ad_hoc_types:
- code_generator = ad_hoc_type.get_code_generator()
- if code_generator:
- code_generator.generate_type_builder(ad_hoc_type_writer, generate_context)
-
- writer.newline_multiline(
-""" enum {
- NoFieldsSet = 0,
-""")
-
- state_enum_items = []
- if len(resolve_data.main_properties) > 0:
- pos = 0
- for prop_data in resolve_data.main_properties:
- item_name = Capitalizer.lower_camel_case_to_upper(prop_data.p["name"]) + "Set"
- state_enum_items.append(item_name)
- writer.newline(" %s = 1 << %s,\n" % (item_name, pos))
- pos += 1
- all_fields_set_value = "(" + (" | ".join(state_enum_items)) + ")"
- else:
- all_fields_set_value = "0"
-
- writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_1
- % (all_fields_set_value, class_name, class_name))
-
- pos = 0
- for prop_data in resolve_data.main_properties:
- prop_name = prop_data.p["name"]
-
- param_type_binding = prop_data.param_type_binding
- param_raw_type = param_type_binding.reduce_to_raw_type()
-
- writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_2
- % (state_enum_items[pos],
- Capitalizer.lower_camel_case_to_upper(prop_name),
- param_type_binding.get_type_model().get_input_param_type_text(),
- state_enum_items[pos], prop_name,
- param_raw_type.get_setter_name(), prop_name,
- format_setter_value_expression(param_type_binding, "value"),
- state_enum_items[pos]))
-
- pos += 1
-
- writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_3
- % (class_name, class_name, class_name, class_name, class_name))
-
- writer.newline(" /*\n")
- writer.newline(" * Synthetic constructor:\n")
- writer.newline(" * RefPtr<%s> result = %s::create()" % (class_name, class_name))
- for prop_data in resolve_data.main_properties:
- writer.append_multiline("\n * .set%s(...)" % Capitalizer.lower_camel_case_to_upper(prop_data.p["name"]))
- writer.append_multiline(";\n */\n")
-
- writer.newline_multiline(CodeGeneratorInspectorStrings.class_binding_builder_part_4)
-
- writer.newline(" typedef Inspector::TypeBuilder::StructItemTraits ItemTraits;\n")
-
- for prop_data in resolve_data.optional_properties:
- prop_name = prop_data.p["name"]
- param_type_binding = prop_data.param_type_binding
- setter_name = "set%s" % Capitalizer.lower_camel_case_to_upper(prop_name)
-
- writer.append_multiline("\n void %s" % setter_name)
- writer.append("(%s value)\n" % param_type_binding.get_type_model().get_input_param_type_text())
- writer.newline(" {\n")
- writer.newline(" this->set%s(ASCIILiteral(\"%s\"), %s);\n"
- % (param_type_binding.reduce_to_raw_type().get_setter_name(), prop_data.p["name"],
- format_setter_value_expression(param_type_binding, "value")))
- writer.newline(" }\n")
-
-
- if setter_name in INSPECTOR_OBJECT_SETTER_NAMES:
- writer.newline(" using Inspector::InspectorObjectBase::%s;\n\n" % setter_name)
-
- if class_binding_cls.need_user_runtime_cast_:
- writer.newline(" static PassRefPtr<%s> runtimeCast(PassRefPtr<Inspector::InspectorValue> value)\n" % class_name)
- writer.newline(" {\n")
- writer.newline(" RefPtr<Inspector::InspectorObject> object;\n")
- writer.newline(" bool castRes = value->asObject(&object);\n")
- writer.newline(" ASSERT_UNUSED(castRes, castRes);\n")
- writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
- writer.newline(" assertCorrectValue(object.get());\n")
- writer.append("#endif // %s\n" % VALIDATOR_IFDEF_NAME)
- writer.newline(" COMPILE_ASSERT(sizeof(%s) == sizeof(Inspector::InspectorObjectBase), type_cast_problem);\n" % class_name)
- writer.newline(" return static_cast<%s*>(static_cast<Inspector::InspectorObjectBase*>(object.get()));\n" % class_name)
- writer.newline(" }\n")
- writer.append("\n")
-
- if class_binding_cls.need_internal_runtime_cast_:
- writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
- writer.newline(" static void assertCorrectValue(Inspector::InspectorValue* value);\n")
- writer.append("#endif // %s\n" % VALIDATOR_IFDEF_NAME)
-
- closed_field_set = (context_domain_name + "." + class_name) not in TYPES_WITH_OPEN_FIELD_LIST_SET
-
- validator_writer = generate_context.validator_writer
-
- domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
- domain_guard = domain_fixes.get_guard()
- if domain_guard:
- domain_guard.generate_open(validator_writer)
-
- validator_writer.newline("void %s%s::assertCorrectValue(Inspector::InspectorValue* value)\n" % (helper.full_name_prefix_for_impl, class_name))
- validator_writer.newline("{\n")
- validator_writer.newline(" RefPtr<InspectorObject> object;\n")
- validator_writer.newline(" bool castRes = value->asObject(&object);\n")
- validator_writer.newline(" ASSERT_UNUSED(castRes, castRes);\n")
- for prop_data in resolve_data.main_properties:
- validator_writer.newline(" {\n")
- it_name = "%sPos" % prop_data.p["name"]
- validator_writer.newline(" InspectorObject::iterator %s;\n" % it_name)
- validator_writer.newline(" %s = object->find(\"%s\");\n" % (it_name, prop_data.p["name"]))
- validator_writer.newline(" ASSERT(%s != object->end());\n" % it_name)
- validator_writer.newline(" %s(%s->value.get());\n" % (prop_data.param_type_binding.get_validator_call_text(), it_name))
- validator_writer.newline(" }\n")
-
- if closed_field_set:
- validator_writer.newline(" int foundPropertiesCount = %s;\n" % len(resolve_data.main_properties))
-
- for prop_data in resolve_data.optional_properties:
- validator_writer.newline(" {\n")
- it_name = "%sPos" % prop_data.p["name"]
- validator_writer.newline(" InspectorObject::iterator %s;\n" % it_name)
- validator_writer.newline(" %s = object->find(\"%s\");\n" % (it_name, prop_data.p["name"]))
- validator_writer.newline(" if (%s != object->end()) {\n" % it_name)
- validator_writer.newline(" %s(%s->value.get());\n" % (prop_data.param_type_binding.get_validator_call_text(), it_name))
- if closed_field_set:
- validator_writer.newline(" ++foundPropertiesCount;\n")
- validator_writer.newline(" }\n")
- validator_writer.newline(" }\n")
-
- if closed_field_set:
- validator_writer.newline(" if (foundPropertiesCount != object->size()) {\n")
- validator_writer.newline(" FATAL(\"Unexpected properties in object: %s\\n\", object->toJSONString().ascii().data());\n")
- validator_writer.newline(" }\n")
- validator_writer.newline("}\n")
-
- if domain_guard:
- domain_guard.generate_close(validator_writer)
-
- validator_writer.newline("\n\n")
-
- if is_open_type:
- cpp_writer = generate_context.cpp_writer
- writer.append("\n")
- writer.newline(" // Property names for type generated as open.\n")
- for prop_data in resolve_data.main_properties + resolve_data.optional_properties:
- prop_name = prop_data.p["name"]
- prop_field_name = Capitalizer.lower_camel_case_to_upper(prop_name)
- writer.newline(" static const char* %s;\n" % (prop_field_name))
- cpp_writer.newline("const char* %s%s::%s = \"%s\";\n" % (helper.full_name_prefix_for_impl, class_name, prop_field_name, prop_name))
-
-
- writer.newline("};\n\n")
-
- @staticmethod
- def generate_forward_declaration(writer):
- class_name = fixed_type_name.class_name
- writer.newline("class ")
- writer.append(class_name)
- writer.append(";\n")
-
- @staticmethod
- def register_use(forward_listener):
- helper.add_to_forward_listener(forward_listener)
-
- @staticmethod
- def get_generate_pass_id():
- return TypeBuilderPass.MAIN
-
- return CodeGenerator
-
- @staticmethod
- def get_validator_call_text():
- return helper.full_name_prefix_for_use + fixed_type_name.class_name + "::assertCorrectValue"
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return helper.full_name_prefix_for_use + fixed_type_name.class_name
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return None
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.Object
-
- @staticmethod
- def get_type_model():
- return TypeModel.RefPtrBased(helper.full_name_prefix_for_use + fixed_type_name.class_name)
-
- class AdHocTypeContextImpl:
- def __init__(self, property_name, class_name, resolve_context, ad_hoc_type_list, parent_full_name_prefix):
- self.property_name = property_name
- self.class_name = class_name
- self.resolve_context = resolve_context
- self.ad_hoc_type_list = ad_hoc_type_list
- self.container_full_name_prefix = parent_full_name_prefix + class_name + "::"
- self.container_relative_name_prefix = ""
-
- def get_type_name_fix(self):
- class NameFix:
- class_name = Capitalizer.lower_camel_case_to_upper(self.property_name)
-
- @staticmethod
- def output_comment(writer):
- writer.newline("// Named after property name '%s' while generating %s.\n" % (self.property_name, self.class_name))
-
- return NameFix
-
- def add_type(self, binding):
- self.ad_hoc_type_list.append(binding)
-
- return ClassBinding
- else:
-
- class PlainObjectBinding:
- @classmethod
- def resolve_inner(cls, resolve_context):
- pass
-
- @staticmethod
- def request_user_runtime_cast(request):
- pass
-
- @staticmethod
- def request_internal_runtime_cast():
- RawTypes.Object.request_raw_internal_runtime_cast()
-
- @staticmethod
- def get_code_generator():
- pass
-
- @staticmethod
- def get_validator_call_text():
- return "RuntimeCastHelper::assertType<InspectorValue::TypeObject>"
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return cls.reduce_to_raw_type().get_array_item_raw_c_type_text()
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return None
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.Object
-
- @staticmethod
- def get_type_model():
- return TypeModel.Object
-
- return PlainObjectBinding
- elif json_typable["type"] == "array":
- if "items" in json_typable:
-
- ad_hoc_types = []
-
- class AdHocTypeContext:
- container_full_name_prefix = "<not yet defined>"
- container_relative_name_prefix = ""
-
- @staticmethod
- def get_type_name_fix():
- return fixed_type_name
-
- @staticmethod
- def add_type(binding):
- ad_hoc_types.append(binding)
-
- item_binding = resolve_param_type(json_typable["items"], context_domain_name, AdHocTypeContext)
-
- class ArrayBinding:
- resolve_data_ = None
- need_internal_runtime_cast_ = False
-
- @classmethod
- def resolve_inner(cls, resolve_context):
- if cls.resolve_data_:
- return
-
- class ResolveData:
- item_type_binding = item_binding
- ad_hoc_type_list = ad_hoc_types
-
- cls.resolve_data_ = ResolveData
-
- for t in ad_hoc_types:
- t.resolve_inner(resolve_context)
-
- @classmethod
- def request_user_runtime_cast(cls, request):
- raise Exception("Not implemented yet")
-
- @classmethod
- def request_internal_runtime_cast(cls):
- if cls.need_internal_runtime_cast_:
- return
- cls.need_internal_runtime_cast_ = True
- cls.resolve_data_.item_type_binding.request_internal_runtime_cast()
-
- @classmethod
- def get_code_generator(array_binding_cls):
-
- class CodeGenerator:
- @staticmethod
- def generate_type_builder(writer, generate_context):
- ad_hoc_type_writer = writer
-
- resolve_data = array_binding_cls.resolve_data_
-
- for ad_hoc_type in resolve_data.ad_hoc_type_list:
- code_generator = ad_hoc_type.get_code_generator()
- if code_generator:
- code_generator.generate_type_builder(ad_hoc_type_writer, generate_context)
-
- @staticmethod
- def generate_forward_declaration(writer):
- pass
-
- @staticmethod
- def register_use(forward_listener):
- item_code_generator = item_binding.get_code_generator()
- if item_code_generator:
- item_code_generator.register_use(forward_listener)
-
- @staticmethod
- def get_generate_pass_id():
- return TypeBuilderPass.MAIN
-
- return CodeGenerator
-
- @classmethod
- def get_validator_call_text(cls):
- return cls.get_array_item_c_type_text() + "::assertCorrectValue"
-
- @classmethod
- def get_array_item_c_type_text(cls):
- return replace_right_shift("Inspector::TypeBuilder::Array<%s>" % cls.resolve_data_.item_type_binding.get_array_item_c_type_text())
-
- @staticmethod
- def get_setter_value_expression_pattern():
- return None
-
- @staticmethod
- def reduce_to_raw_type():
- return RawTypes.Array
-
- @classmethod
- def get_type_model(cls):
- return TypeModel.RefPtrBased(cls.get_array_item_c_type_text())
-
- return ArrayBinding
- else:
- # Fall-through to raw type.
- pass
-
- raw_type = RawTypes.get(json_typable["type"])
-
- return RawTypeBinding(raw_type)
-
-
-class RawTypeBinding:
- def __init__(self, raw_type):
- self.raw_type_ = raw_type
-
- def resolve_inner(self, resolve_context):
- pass
-
- def request_user_runtime_cast(self, request):
- raise Exception("Unsupported")
-
- def request_internal_runtime_cast(self):
- self.raw_type_.request_raw_internal_runtime_cast()
-
- def get_code_generator(self):
- return None
-
- def get_validator_call_text(self):
- return self.raw_type_.get_raw_validator_call_text()
-
- def get_array_item_c_type_text(self):
- return self.raw_type_.get_array_item_raw_c_type_text()
-
- def get_setter_value_expression_pattern(self):
- return None
-
- def reduce_to_raw_type(self):
- return self.raw_type_
-
- def get_type_model(self):
- return self.raw_type_.get_raw_type_model()
-
-
-class TypeData(object):
- def __init__(self, json_type, json_domain, domain_data):
- self.json_type_ = json_type
- self.json_domain_ = json_domain
- self.domain_data_ = domain_data
-
- if "type" not in json_type:
- raise Exception("Unknown type")
-
- json_type_name = json_type["type"]
- raw_type = RawTypes.get(json_type_name)
- self.raw_type_ = raw_type
- self.binding_being_resolved_ = False
- self.binding_ = None
-
- def get_raw_type(self):
- return self.raw_type_
-
- def get_binding(self):
- if not self.binding_:
- if self.binding_being_resolved_:
- raise Error("Type %s is already being resolved" % self.json_type_["type"])
- # Resolve only lazily, because resolving one named type may require resolving some other named type.
- self.binding_being_resolved_ = True
- try:
- self.binding_ = TypeBindings.create_named_type_declaration(self.json_type_, self.json_domain_["domain"], self)
- finally:
- self.binding_being_resolved_ = False
-
- return self.binding_
-
- def get_json_type(self):
- return self.json_type_
-
- def get_name(self):
- return self.json_type_["id"]
-
- def get_domain_name(self):
- return self.json_domain_["domain"]
-
-
-class DomainData:
- def __init__(self, json_domain):
- self.json_domain = json_domain
- self.types_ = []
-
- def add_type(self, type_data):
- self.types_.append(type_data)
-
- def name(self):
- return self.json_domain["domain"]
-
- def types(self):
- return self.types_
-
-
-class TypeMap:
- def __init__(self, api):
- self.map_ = {}
- self.domains_ = []
- for json_domain in api["domains"]:
- domain_name = json_domain["domain"]
-
- domain_map = {}
- self.map_[domain_name] = domain_map
-
- domain_data = DomainData(json_domain)
-
- # FIXME: The order of types should not matter. The generated code should work regardless of the order of types.
- if domain_name == "Page":
- self.domains_.insert(0, domain_data)
- else:
- self.domains_.append(domain_data)
-
- if "types" in json_domain:
- for json_type in json_domain["types"]:
- type_name = json_type["id"]
- type_data = TypeData(json_type, json_domain, domain_data)
- domain_map[type_name] = type_data
- domain_data.add_type(type_data)
-
- def domains(self):
- return self.domains_
-
- def get(self, domain_name, type_name):
- return self.map_[domain_name][type_name]
-
-
-def resolve_param_type(json_parameter, scope_domain_name, ad_hoc_type_context):
- if "$ref" in json_parameter:
- json_ref = json_parameter["$ref"]
- type_data = get_ref_data(json_ref, scope_domain_name)
- return type_data.get_binding()
- elif "type" in json_parameter:
- result = TypeBindings.create_ad_hoc_type_declaration(json_parameter, scope_domain_name, ad_hoc_type_context)
- ad_hoc_type_context.add_type(result)
- return result
- else:
- raise Exception("Unknown type")
-
-def resolve_param_raw_type(json_parameter, scope_domain_name):
- if "$ref" in json_parameter:
- json_ref = json_parameter["$ref"]
- type_data = get_ref_data(json_ref, scope_domain_name)
- return type_data.get_raw_type()
- elif "type" in json_parameter:
- json_type = json_parameter["type"]
- return RawTypes.get(json_type)
- else:
- raise Exception("Unknown type")
-
-
-def get_ref_data(json_ref, scope_domain_name):
- dot_pos = json_ref.find(".")
- if dot_pos == -1:
- domain_name = scope_domain_name
- type_name = json_ref
- else:
- domain_name = json_ref[:dot_pos]
- type_name = json_ref[dot_pos + 1:]
-
- return type_map.get(domain_name, type_name)
-
-
-input_file = open(input_json_filename, "r")
-json_string = input_file.read()
-json_api = json.loads(json_string)
-
-# Allow this script to work when the input is a single domain.
-if not "domains" in json_api:
- json_api = {"domains": [json_api]}
-
-
-class Templates:
- def get_this_script_path_(absolute_path):
- absolute_path = os.path.abspath(absolute_path)
- components = []
-
- def fill_recursive(path_part, depth):
- if depth <= 0 or path_part == '/':
- return
- fill_recursive(os.path.dirname(path_part), depth - 1)
- components.append(os.path.basename(path_part))
-
- # Typical path is /Source/WebCore/inspector/CodeGeneratorInspector.py
- # Let's take 4 components from the real path then.
- fill_recursive(absolute_path, 4)
-
- return "/".join(components)
-
- file_header_ = ("// File is generated by %s\n\n" % get_this_script_path_(sys.argv[0]) +
-"""// Copyright (c) 2013 Apple Inc. All Rights Reserved.
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-""")
-
- frontend_domain_class = string.Template(CodeGeneratorInspectorStrings.frontend_domain_class)
- backend_dispatcher_constructor = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_constructor)
- backend_dispatcher_dispatch_method = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method)
- backend_dispatcher_dispatch_method_simple = string.Template(CodeGeneratorInspectorStrings.backend_dispatcher_dispatch_method_simple)
- backend_method = string.Template(CodeGeneratorInspectorStrings.backend_method)
- frontend_method = string.Template(CodeGeneratorInspectorStrings.frontend_method)
- callback_method = string.Template(CodeGeneratorInspectorStrings.callback_method)
- frontend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.frontend_h)
- backend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_h)
- backend_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_cpp)
- frontend_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.frontend_cpp)
- typebuilder_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.typebuilder_h)
- typebuilder_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.typebuilder_cpp)
- backend_js = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_js)
- param_container_access_code = CodeGeneratorInspectorStrings.param_container_access_code
-
-
-
-
-
-type_map = TypeMap(json_api)
-
-
-class NeedRuntimeCastRequest:
- def __init__(self):
- self.ack_ = None
-
- def acknowledge(self):
- self.ack_ = True
-
- def is_acknowledged(self):
- return self.ack_
-
-
-def resolve_all_types():
- runtime_cast_generate_requests = {}
- for type_name in TYPES_WITH_RUNTIME_CAST_SET:
- runtime_cast_generate_requests[type_name] = NeedRuntimeCastRequest()
-
- class ForwardListener:
- type_data_set = set()
- already_declared_set = set()
-
- @classmethod
- def add_type_data(cls, type_data):
- if type_data not in cls.already_declared_set:
- cls.type_data_set.add(type_data)
-
- class ResolveContext:
- forward_listener = ForwardListener
-
- for domain_data in type_map.domains():
- for type_data in domain_data.types():
- # Do not generate forwards for this type any longer.
- ForwardListener.already_declared_set.add(type_data)
-
- binding = type_data.get_binding()
- binding.resolve_inner(ResolveContext)
-
- for domain_data in type_map.domains():
- for type_data in domain_data.types():
- full_type_name = "%s.%s" % (type_data.get_domain_name(), type_data.get_name())
- request = runtime_cast_generate_requests.pop(full_type_name, None)
- binding = type_data.get_binding()
- if request:
- binding.request_user_runtime_cast(request)
-
- if request and not request.is_acknowledged():
- raise Exception("Failed to generate runtimeCast in " + full_type_name)
-
- if verification:
- for full_type_name in runtime_cast_generate_requests:
- raise Exception("Failed to generate runtimeCast. Type " + full_type_name + " not found")
-
- return ForwardListener
-
-
-global_forward_listener = resolve_all_types()
-
-
-def get_annotated_type_text(raw_type, annotated_type):
- if annotated_type != raw_type:
- return "/*%s*/ %s" % (annotated_type, raw_type)
- else:
- return raw_type
-
-
-def format_setter_value_expression(param_type_binding, value_ref):
- pattern = param_type_binding.get_setter_value_expression_pattern()
- if pattern:
- return pattern % value_ref
- else:
- return value_ref
-
-class Generator:
- frontend_domain_class_lines = []
-
- backend_method_implementation_list = []
- frontend_method_list = []
- backend_js_domain_initializer_list = []
-
- backend_handler_interface_list = []
- backend_dispatcher_interface_list = []
- type_builder_fragments = []
- type_builder_forwards = []
- validator_impl_list = []
- type_builder_impl_list = []
-
-
- @staticmethod
- def go():
- Generator.process_types(type_map)
-
- first_cycle_guardable_list_list = [
- Generator.backend_method_implementation_list,
- Generator.backend_handler_interface_list,
- Generator.backend_dispatcher_interface_list]
-
- for json_domain in json_api["domains"]:
- domain_name = json_domain["domain"]
- domain_name_lower = domain_name.lower()
-
- domain_fixes = DomainNameFixes.get_fixed_data(domain_name)
-
- domain_guard = domain_fixes.get_guard()
-
- if domain_guard:
- for l in first_cycle_guardable_list_list:
- domain_guard.generate_open(l)
-
- frontend_method_declaration_lines = []
-
- Generator.backend_js_domain_initializer_list.append("// %s.\n" % domain_name)
-
- if not domain_fixes.skip_js_bind:
- Generator.backend_js_domain_initializer_list.append("InspectorBackend.register%sDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, \"%s\");\n" % (domain_name, domain_name))
-
- if "types" in json_domain:
- for json_type in json_domain["types"]:
- if "type" in json_type and json_type["type"] == "string" and "enum" in json_type:
- enum_name = "%s.%s" % (domain_name, json_type["id"])
- Generator.process_enum(json_type, enum_name)
- elif json_type["type"] == "object":
- if "properties" in json_type:
- for json_property in json_type["properties"]:
- if "type" in json_property and json_property["type"] == "string" and "enum" in json_property:
- enum_name = "%s.%s%s" % (domain_name, json_type["id"], to_title_case(json_property["name"]))
- Generator.process_enum(json_property, enum_name)
-
- if "events" in json_domain:
- if domain_guard:
- domain_guard.generate_open(Generator.frontend_method_list)
- domain_guard.generate_open(Generator.frontend_domain_class_lines)
-
- for json_event in json_domain["events"]:
- Generator.process_event(json_event, domain_name, frontend_method_declaration_lines)
-
- Generator.frontend_domain_class_lines.append(Templates.frontend_domain_class.substitute(None,
- domainClassName="Inspector%sFrontendDispatcher" % domain_name,
- frontendDomainMethodDeclarations="".join(flatten_list(frontend_method_declaration_lines))))
-
- if domain_guard:
- domain_guard.generate_close(Generator.frontend_method_list)
- domain_guard.generate_close(Generator.frontend_domain_class_lines)
-
- dispatcher_name = "Inspector" + Capitalizer.lower_camel_case_to_upper(domain_name) + "BackendDispatcher"
- agent_interface_name = dispatcher_name + "Handler"
-
- Generator.backend_dispatcher_interface_list.append("class %s FINAL : public Inspector::InspectorSupplementalBackendDispatcher {\n" % dispatcher_name)
- Generator.backend_dispatcher_interface_list.append("public:\n")
- Generator.backend_dispatcher_interface_list.append(" static PassRefPtr<%s> create(Inspector::InspectorBackendDispatcher*, %s*);\n" % (dispatcher_name, agent_interface_name))
- Generator.backend_dispatcher_interface_list.append(" virtual void dispatch(long callId, const String& method, PassRefPtr<Inspector::InspectorObject> message) OVERRIDE;\n")
- Generator.backend_dispatcher_interface_list.append("private:\n")
-
- Generator.backend_handler_interface_list.append("class %s {\n" % agent_interface_name)
- Generator.backend_handler_interface_list.append("public:\n")
-
- backend_method_count = len(Generator.backend_method_implementation_list)
-
- dispatcher_if_chain = []
- dispatcher_commands_list = []
- if "commands" in json_domain:
- for json_command in json_domain["commands"]:
- Generator.process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list)
-
- Generator.backend_handler_interface_list.append("protected:\n")
- Generator.backend_handler_interface_list.append(" virtual ~%s() { }\n" % agent_interface_name)
- Generator.backend_handler_interface_list.append("};\n\n")
-
- Generator.backend_dispatcher_interface_list.append("private:\n")
- Generator.backend_dispatcher_interface_list.append(" %s(Inspector::InspectorBackendDispatcher*, %s*);\n" % (dispatcher_name, agent_interface_name))
- Generator.backend_dispatcher_interface_list.append(" %s* m_agent;\n" % agent_interface_name)
- Generator.backend_dispatcher_interface_list.append("};\n\n")
-
- Generator.backend_method_implementation_list.insert(backend_method_count, Templates.backend_dispatcher_constructor.substitute(None,
- domainName=domain_name,
- dispatcherName=dispatcher_name,
- agentName=agent_interface_name))
-
- if "commands" in json_domain and len(json_domain["commands"]) <= 5:
- Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method_simple.substitute(None,
- domainName=domain_name,
- dispatcherName=dispatcher_name,
- ifChain="\n".join(dispatcher_if_chain)))
- else:
- Generator.backend_method_implementation_list.insert(backend_method_count + 1, Templates.backend_dispatcher_dispatch_method.substitute(None,
- domainName=domain_name,
- dispatcherName=dispatcher_name,
- dispatcherCommands="\n".join(dispatcher_commands_list)))
-
- if domain_guard:
- for l in reversed(first_cycle_guardable_list_list):
- domain_guard.generate_close(l)
- Generator.backend_js_domain_initializer_list.append("\n")
-
- @staticmethod
- def process_enum(json_enum, enum_name):
- enum_members = []
- for member in json_enum["enum"]:
- enum_members.append("%s: \"%s\"" % (fix_camel_case(member), member))
-
- Generator.backend_js_domain_initializer_list.append("InspectorBackend.registerEnum(\"%s\", {%s});\n" % (
- enum_name, ", ".join(enum_members)))
-
- @staticmethod
- def process_event(json_event, domain_name, frontend_method_declaration_lines):
- event_name = json_event["name"]
-
- ad_hoc_type_output = []
- frontend_method_declaration_lines.append(ad_hoc_type_output)
- ad_hoc_type_writer = Writer(ad_hoc_type_output, " ")
-
- decl_parameter_list = []
-
- json_parameters = json_event.get("parameters")
- Generator.generate_send_method(json_parameters, event_name, domain_name, ad_hoc_type_writer,
- decl_parameter_list,
- Generator.EventMethodStructTemplate,
- Generator.frontend_method_list, Templates.frontend_method, {"eventName": event_name})
-
- backend_js_event_param_list = []
- if json_parameters:
- for parameter in json_parameters:
- parameter_name = parameter["name"]
- backend_js_event_param_list.append("\"%s\"" % parameter_name)
-
- frontend_method_declaration_lines.append(
- " void %s(%s);\n" % (event_name, ", ".join(decl_parameter_list)))
-
- Generator.backend_js_domain_initializer_list.append("InspectorBackend.registerEvent(\"%s.%s\", [%s]);\n" % (
- domain_name, event_name, ", ".join(backend_js_event_param_list)))
-
- class EventMethodStructTemplate:
- @staticmethod
- def append_prolog(line_list):
- line_list.append(" RefPtr<InspectorObject> paramsObject = InspectorObject::create();\n")
-
- @staticmethod
- def append_epilog(line_list):
- line_list.append(" jsonMessage->setObject(ASCIILiteral(\"params\"), paramsObject);\n")
-
- container_name = "paramsObject"
-
- @staticmethod
- def process_command(json_command, domain_name, agent_interface_name, dispatcher_name, dispatcher_if_chain, dispatcher_commands_list):
- json_command_name = json_command["name"]
-
- ad_hoc_type_output = []
- Generator.backend_handler_interface_list.append(ad_hoc_type_output)
- ad_hoc_type_writer = Writer(ad_hoc_type_output, " ")
-
- Generator.backend_dispatcher_interface_list.append(" void %s(long callId, const Inspector::InspectorObject& message);\n" % json_command_name)
-
- Generator.backend_handler_interface_list.append(" virtual void %s(ErrorString*" % json_command_name)
-
- if not dispatcher_if_chain:
- dispatcher_if_chain.append(" if (method == \"%s\")" % json_command_name)
- else:
- dispatcher_if_chain.append(" else if (method == \"%s\")" % json_command_name)
- dispatcher_if_chain.append(" %s(callId, *message.get());" % json_command_name)
- dispatcher_commands_list.append(" { \"%s\", &%s::%s }," % (json_command_name, dispatcher_name, json_command_name))
-
- method_in_params_handling = []
- method_dispatch_handling = []
- method_out_params_handling = []
- method_ending_handling = []
- method_request_message_param_name = ""
- agent_call_param_list = []
- js_parameters_text = ""
- if "parameters" in json_command:
- json_params = json_command["parameters"]
- method_request_message_param_name = " message"
- method_in_params_handling.append(" RefPtr<InspectorArray> protocolErrors = InspectorArray::create();\n")
- method_in_params_handling.append(" RefPtr<InspectorObject> paramsContainer = message.getObject(ASCIILiteral(\"params\"));\n")
- method_in_params_handling.append(" InspectorObject* paramsContainerPtr = paramsContainer.get();\n")
- method_in_params_handling.append(" InspectorArray* protocolErrorsPtr = protocolErrors.get();\n")
- js_param_list = []
-
- for json_parameter in json_params:
- json_param_name = json_parameter["name"]
- param_raw_type = resolve_param_raw_type(json_parameter, domain_name)
-
- getter_name = param_raw_type.get_getter_name()
-
- optional = json_parameter.get("optional")
-
- non_optional_type_model = param_raw_type.get_raw_type_model()
- if optional:
- type_model = non_optional_type_model.get_optional()
- else:
- type_model = non_optional_type_model
-
- if optional:
- code = (" bool %s_valueFound = false;\n"
- " %s in_%s = InspectorBackendDispatcher::get%s(paramsContainerPtr, ASCIILiteral(\"%s\"), &%s_valueFound, protocolErrorsPtr);\n" %
- (json_param_name, non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name, getter_name, json_param_name, json_param_name))
- param = ", %s_valueFound ? &in_%s : nullptr" % (json_param_name, json_param_name)
- # FIXME: pass optional refptr-values as PassRefPtr
- formal_param_type_pattern = "const %s*"
- else:
- code = (" %s in_%s = InspectorBackendDispatcher::get%s(paramsContainerPtr, ASCIILiteral(\"%s\"), nullptr, protocolErrorsPtr);\n" %
- (non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name, getter_name, json_param_name))
- param = ", in_%s" % json_param_name
- # FIXME: pass not-optional refptr-values as NonNullPassRefPtr
- if param_raw_type.is_heavy_value():
- formal_param_type_pattern = "const %s&"
- else:
- formal_param_type_pattern = "%s"
-
- method_in_params_handling.append(code)
- agent_call_param_list.append(param)
- Generator.backend_handler_interface_list.append(", %s in_%s" % (formal_param_type_pattern % non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name))
-
- js_bind_type = param_raw_type.get_js_bind_type()
- js_param_text = "{\"name\": \"%s\", \"type\": \"%s\", \"optional\": %s}" % (
- json_param_name,
- js_bind_type,
- ("true" if ("optional" in json_parameter and json_parameter["optional"]) else "false"))
-
- js_param_list.append(js_param_text)
-
- method_in_params_handling.append(" if (protocolErrors->length()) {\n")
- method_in_params_handling.append(" String errorMessage = String::format(\"Some arguments of method '%%s' can't be processed\", \"%s.%s\");\n" % (domain_name, json_command_name))
- method_in_params_handling.append(" m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::InvalidParams, errorMessage, protocolErrors.release());\n")
- method_in_params_handling.append(" return;\n")
- method_in_params_handling.append(" }\n")
- method_in_params_handling.append("\n")
-
- js_parameters_text = ", ".join(js_param_list)
-
- method_dispatch_handling.append(" ErrorString error;\n")
- method_dispatch_handling.append(" RefPtr<InspectorObject> result = InspectorObject::create();\n")
-
- if json_command.get("async") == True:
- callback_name = Capitalizer.lower_camel_case_to_upper(json_command_name) + "Callback"
-
- callback_output = []
- callback_writer = Writer(callback_output, ad_hoc_type_writer.get_indent())
-
- decl_parameter_list = []
- Generator.generate_send_method(json_command.get("returns"), json_command_name, domain_name, ad_hoc_type_writer,
- decl_parameter_list,
- Generator.CallbackMethodStructTemplate,
- Generator.backend_method_implementation_list, Templates.callback_method,
- {"callbackName": callback_name, "handlerName": agent_interface_name})
-
- callback_writer.newline("class " + callback_name + " : public Inspector::InspectorBackendDispatcher::CallbackBase {\n")
- callback_writer.newline("public:\n")
- callback_writer.newline(" " + callback_name + "(PassRefPtr<Inspector::InspectorBackendDispatcher>, int id);\n")
- callback_writer.newline(" void sendSuccess(" + ", ".join(decl_parameter_list) + ");\n")
- callback_writer.newline("};\n")
-
- ad_hoc_type_output.append(callback_output)
-
- method_dispatch_handling.append(" RefPtr<%s::%s> callback = adoptRef(new %s::%s(m_backendDispatcher,callId));\n" % (agent_interface_name, callback_name, agent_interface_name, callback_name))
- method_ending_handling.append(" if (error.length()) {\n")
- method_ending_handling.append(" callback->disable();\n")
- method_ending_handling.append(" m_backendDispatcher->reportProtocolError(&callId, Inspector::InspectorBackendDispatcher::ServerError, error);\n")
- method_ending_handling.append(" return;\n")
- method_ending_handling.append(" }")
-
- agent_call_param_list.append(", callback")
- Generator.backend_handler_interface_list.append(", PassRefPtr<%s> callback" % callback_name)
- elif "returns" in json_command:
- has_multiple_returns = len(json_command["returns"]) > 1
- if has_multiple_returns:
- method_out_params_handling.append(" if (!error.length()) {\n")
- else:
- method_out_params_handling.append(" if (!error.length())\n")
-
- for json_return in json_command["returns"]:
-
- json_return_name = json_return["name"]
-
- optional = bool(json_return.get("optional"))
-
- return_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_return, json_command_name, domain_name, ad_hoc_type_writer, agent_interface_name + "::")
-
- raw_type = return_type_binding.reduce_to_raw_type()
- setter_type = raw_type.get_setter_name()
- initializer = raw_type.get_c_initializer()
-
- type_model = return_type_binding.get_type_model()
- if optional:
- type_model = type_model.get_optional()
-
- code = " %s out_%s;\n" % (type_model.get_command_return_pass_model().get_return_var_type(), json_return_name)
- param = ", %sout_%s" % (type_model.get_command_return_pass_model().get_output_argument_prefix(), json_return_name)
- var_name = "out_%s" % json_return_name
- setter_argument = type_model.get_command_return_pass_model().get_output_to_raw_expression() % var_name
- if return_type_binding.get_setter_value_expression_pattern():
- setter_argument = return_type_binding.get_setter_value_expression_pattern() % setter_argument
-
- cook = " result->set%s(ASCIILiteral(\"%s\"), %s);\n" % (setter_type, json_return_name, setter_argument)
-
- set_condition_pattern = type_model.get_command_return_pass_model().get_set_return_condition()
- if set_condition_pattern:
- cook = (" if (%s)\n " % (set_condition_pattern % var_name)) + cook
- annotated_type = type_model.get_command_return_pass_model().get_output_parameter_type()
-
- param_name = "out_%s" % json_return_name
- if optional:
- param_name = "opt_" + param_name
-
- Generator.backend_handler_interface_list.append(", %s %s" % (annotated_type, param_name))
- method_out_params_handling.append(cook)
- method_dispatch_handling.append(code)
-
- agent_call_param_list.append(param)
-
- if has_multiple_returns:
- method_out_params_handling.append(" }\n")
- method_out_params_handling.append("\n")
-
- method_dispatch_handling.append(" m_agent->%s(&error%s);\n" % (json_command_name, "".join(agent_call_param_list)))
- method_dispatch_handling.append("\n")
-
- if not method_ending_handling:
- method_ending_handling.append(" m_backendDispatcher->sendResponse(callId, result.release(), error);")
-
- backend_js_reply_param_list = []
- if "returns" in json_command:
- for json_return in json_command["returns"]:
- json_return_name = json_return["name"]
- backend_js_reply_param_list.append("\"%s\"" % json_return_name)
-
- js_reply_list = "[%s]" % ", ".join(backend_js_reply_param_list)
-
- Generator.backend_method_implementation_list.append(Templates.backend_method.substitute(None,
- dispatcherName=dispatcher_name,
- methodName=json_command_name,
- requestMessageObject=method_request_message_param_name,
- methodInParametersHandling="".join(method_in_params_handling),
- methodDispatchHandling="".join(method_dispatch_handling),
- methodOutParametersHandling="".join(method_out_params_handling),
- methodEndingHandling="".join(method_ending_handling)))
-
- Generator.backend_js_domain_initializer_list.append("InspectorBackend.registerCommand(\"%s.%s\", [%s], %s);\n" % (domain_name, json_command_name, js_parameters_text, js_reply_list))
- Generator.backend_handler_interface_list.append(") = 0;\n")
-
- class CallbackMethodStructTemplate:
- @staticmethod
- def append_prolog(line_list):
- pass
-
- @staticmethod
- def append_epilog(line_list):
- pass
-
- container_name = "jsonMessage"
-
- # Generates common code for event sending and callback response data sending.
- @staticmethod
- def generate_send_method(parameters, event_name, domain_name, ad_hoc_type_writer, decl_parameter_list,
- method_struct_template,
- generator_method_list, method_template, template_params):
- method_line_list = []
- if parameters:
- method_struct_template.append_prolog(method_line_list)
- for json_parameter in parameters:
- parameter_name = json_parameter["name"]
-
- param_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_parameter, event_name, domain_name, ad_hoc_type_writer, "")
-
- raw_type = param_type_binding.reduce_to_raw_type()
- raw_type_binding = RawTypeBinding(raw_type)
-
- optional = bool(json_parameter.get("optional"))
-
- setter_type = raw_type.get_setter_name()
-
- type_model = param_type_binding.get_type_model()
- raw_type_model = raw_type_binding.get_type_model()
- if optional:
- type_model = type_model.get_optional()
- raw_type_model = raw_type_model.get_optional()
-
- annotated_type = type_model.get_input_param_type_text()
- mode_type_binding = param_type_binding
-
- decl_parameter_list.append("%s %s" % (annotated_type, parameter_name))
-
- setter_argument = raw_type_model.get_event_setter_expression_pattern() % parameter_name
- if mode_type_binding.get_setter_value_expression_pattern():
- setter_argument = mode_type_binding.get_setter_value_expression_pattern() % setter_argument
-
- setter_code = " %s->set%s(ASCIILiteral(\"%s\"), %s);\n" % (method_struct_template.container_name, setter_type, parameter_name, setter_argument)
- if optional:
- setter_code = (" if (%s)\n " % parameter_name) + setter_code
- method_line_list.append(setter_code)
-
- method_struct_template.append_epilog(method_line_list)
-
- generator_method_list.append(method_template.substitute(None,
- domainName=domain_name,
- parameters=", ".join(decl_parameter_list),
- code="".join(method_line_list), **template_params))
-
- @staticmethod
- def resolve_type_and_generate_ad_hoc(json_param, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param):
- param_name = json_param["name"]
- ad_hoc_type_list = []
-
- class AdHocTypeContext:
- container_full_name_prefix = "<not yet defined>"
- container_relative_name_prefix = container_relative_name_prefix_param
-
- @staticmethod
- def get_type_name_fix():
- class NameFix:
- class_name = Capitalizer.lower_camel_case_to_upper(param_name)
-
- @staticmethod
- def output_comment(writer):
- writer.newline("// Named after parameter '%s' while generating command/event %s.\n" % (param_name, method_name))
-
- return NameFix
-
- @staticmethod
- def add_type(binding):
- ad_hoc_type_list.append(binding)
-
- type_binding = resolve_param_type(json_param, domain_name, AdHocTypeContext)
-
- class InterfaceForwardListener:
- @staticmethod
- def add_type_data(type_data):
- pass
-
- class InterfaceResolveContext:
- forward_listener = InterfaceForwardListener
-
- for type in ad_hoc_type_list:
- type.resolve_inner(InterfaceResolveContext)
-
- class InterfaceGenerateContext:
- validator_writer = "not supported in InterfaceGenerateContext"
- cpp_writer = validator_writer
-
- for type in ad_hoc_type_list:
- generator = type.get_code_generator()
- if generator:
- generator.generate_type_builder(ad_hoc_type_writer, InterfaceGenerateContext)
-
- return type_binding
-
- @staticmethod
- def process_types(type_map):
- output = Generator.type_builder_fragments
-
- class GenerateContext:
- validator_writer = Writer(Generator.validator_impl_list, "")
- cpp_writer = Writer(Generator.type_builder_impl_list, "")
-
- def generate_all_domains_code(out, type_data_callback):
- writer = Writer(out, "")
- for domain_data in type_map.domains():
- domain_fixes = DomainNameFixes.get_fixed_data(domain_data.name())
- domain_guard = domain_fixes.get_guard()
-
- namespace_declared = []
-
- def namespace_lazy_generator():
- if not namespace_declared:
- if domain_guard:
- domain_guard.generate_open(out)
- writer.newline("namespace ")
- writer.append(domain_data.name())
- writer.append(" {\n")
- # What is a better way to change value from outer scope?
- namespace_declared.append(True)
- return writer
-
- for type_data in domain_data.types():
- type_data_callback(type_data, namespace_lazy_generator)
-
- if namespace_declared:
- writer.append("} // ")
- writer.append(domain_data.name())
- writer.append("\n\n")
-
- if domain_guard:
- domain_guard.generate_close(out)
-
- def create_type_builder_caller(generate_pass_id):
- def call_type_builder(type_data, writer_getter):
- code_generator = type_data.get_binding().get_code_generator()
- if code_generator and generate_pass_id == code_generator.get_generate_pass_id():
- writer = writer_getter()
-
- code_generator.generate_type_builder(writer, GenerateContext)
- return call_type_builder
-
- generate_all_domains_code(output, create_type_builder_caller(TypeBuilderPass.MAIN))
-
- Generator.type_builder_forwards.append("// Forward declarations.\n")
-
- def generate_forward_callback(type_data, writer_getter):
- if type_data in global_forward_listener.type_data_set:
- binding = type_data.get_binding()
- binding.get_code_generator().generate_forward_declaration(writer_getter())
- generate_all_domains_code(Generator.type_builder_forwards, generate_forward_callback)
-
- Generator.type_builder_forwards.append("// End of forward declarations.\n\n")
-
- Generator.type_builder_forwards.append("// Typedefs.\n")
-
- generate_all_domains_code(Generator.type_builder_forwards, create_type_builder_caller(TypeBuilderPass.TYPEDEF))
-
- Generator.type_builder_forwards.append("// End of typedefs.\n\n")
-
-
-def flatten_list(input):
- res = []
-
- def fill_recursive(l):
- for item in l:
- if isinstance(item, list):
- fill_recursive(item)
- else:
- res.append(item)
- fill_recursive(input)
- return res
-
-
-# A writer that only updates file if it actually changed to better support incremental build.
-class SmartOutput:
- def __init__(self, file_name):
- self.file_name_ = file_name
- self.output_ = ""
-
- def write(self, text):
- self.output_ += text
-
- def close(self):
- text_changed = True
- self.output_ = self.output_.rstrip() + "\n"
-
- try:
- read_file = open(self.file_name_, "r")
- old_text = read_file.read()
- read_file.close()
- text_changed = old_text != self.output_
- except:
- # Ignore, just overwrite by default
- pass
-
- if text_changed or write_always:
- out_file = open(self.file_name_, "w")
- out_file.write(self.output_)
- out_file.close()
-
-
-Generator.go()
-
-backend_h_file = SmartOutput(output_header_dirname + "/InspectorBackendDispatchers.h")
-backend_cpp_file = SmartOutput(output_cpp_dirname + "/InspectorBackendDispatchers.cpp")
-
-frontend_h_file = SmartOutput(output_header_dirname + "/InspectorFrontend.h")
-frontend_cpp_file = SmartOutput(output_cpp_dirname + "/InspectorFrontend.cpp")
-
-typebuilder_h_file = SmartOutput(output_header_dirname + "/InspectorWebTypeBuilders.h")
-typebuilder_cpp_file = SmartOutput(output_cpp_dirname + "/InspectorWebTypeBuilders.cpp")
-
-backend_js_file = SmartOutput(output_js_dirname + "/InspectorBackendCommands.js")
-
-
-backend_h_file.write(Templates.backend_h.substitute(None,
- handlerInterfaces="".join(flatten_list(Generator.backend_handler_interface_list)),
- dispatcherInterfaces="".join(flatten_list(Generator.backend_dispatcher_interface_list))))
-
-backend_cpp_file.write(Templates.backend_cpp.substitute(None,
- methods="\n".join(Generator.backend_method_implementation_list)))
-
-frontend_h_file.write(Templates.frontend_h.substitute(None,
- domainClassList="".join(Generator.frontend_domain_class_lines)))
-
-frontend_cpp_file.write(Templates.frontend_cpp.substitute(None,
- methods="\n".join(Generator.frontend_method_list)))
-
-typebuilder_h_file.write(Templates.typebuilder_h.substitute(None,
- typeBuilders="".join(flatten_list(Generator.type_builder_fragments)),
- forwards="".join(Generator.type_builder_forwards),
- validatorIfdefName=VALIDATOR_IFDEF_NAME))
-
-typebuilder_cpp_file.write(Templates.typebuilder_cpp.substitute(None,
- enumConstantValues=EnumConstants.get_enum_constant_code(),
- implCode="".join(flatten_list(Generator.type_builder_impl_list)),
- validatorCode="".join(flatten_list(Generator.validator_impl_list)),
- validatorIfdefName=VALIDATOR_IFDEF_NAME))
-
-backend_js_file.write(Templates.backend_js.substitute(None,
- domainInitializers="".join(Generator.backend_js_domain_initializer_list)))
-
-backend_h_file.close()
-backend_cpp_file.close()
-
-frontend_h_file.close()
-frontend_cpp_file.close()
-
-typebuilder_h_file.close()
-typebuilder_cpp_file.close()
-
-backend_js_file.close()
diff --git a/Source/WebCore/inspector/CodeGeneratorInspectorStrings.py b/Source/WebCore/inspector/CodeGeneratorInspectorStrings.py
deleted file mode 100644
index 01fe512..0000000
--- a/Source/WebCore/inspector/CodeGeneratorInspectorStrings.py
+++ /dev/null
@@ -1,348 +0,0 @@
-# Copyright (c) 2013 Google Inc. All rights reserved.
-# Copyright (c) 2013 Apple Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * 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.
-
-# This file contains string resources for CodeGeneratorInspector.
-# Its syntax is a Python syntax subset, suitable for manual parsing.
-
-frontend_domain_class = (
-"""class $domainClassName {
-public:
- $domainClassName(InspectorFrontendChannel* inspectorFrontendChannel) : m_inspectorFrontendChannel(inspectorFrontendChannel) { }
-${frontendDomainMethodDeclarations}private:
- InspectorFrontendChannel* m_inspectorFrontendChannel;
-};
-
-""")
-
-backend_dispatcher_constructor = (
-"""PassRefPtr<${dispatcherName}> ${dispatcherName}::create(InspectorBackendDispatcher* backendDispatcher, ${agentName}* agent)
-{
- return adoptRef(new ${dispatcherName}(backendDispatcher, agent));
-}
-
-${dispatcherName}::${dispatcherName}(InspectorBackendDispatcher* backendDispatcher, ${agentName}* agent)
- : InspectorSupplementalBackendDispatcher(backendDispatcher)
- , m_agent(agent)
-{
- m_backendDispatcher->registerDispatcherForDomain(ASCIILiteral("${domainName}"), this);
-}
-""")
-
-backend_dispatcher_dispatch_method_simple = (
-"""void ${dispatcherName}::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
-{
- Ref<${dispatcherName}> protect(*this);
-
-${ifChain}
- else
- m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "${domainName}" + '.' + method + "' was not found");
-}
-""")
-
-backend_dispatcher_dispatch_method = (
-"""void ${dispatcherName}::dispatch(long callId, const String& method, PassRefPtr<InspectorObject> message)
-{
- Ref<${dispatcherName}> protect(*this);
-
- typedef void (${dispatcherName}::*CallHandler)(long callId, const Inspector::InspectorObject& message);
- typedef HashMap<String, CallHandler> DispatchMap;
- DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, ());
- if (dispatchMap.isEmpty()) {
- static const struct MethodTable {
- const char* name;
- CallHandler handler;
- } commands[] = {
-${dispatcherCommands}
- };
- size_t length = WTF_ARRAY_LENGTH(commands);
- for (size_t i = 0; i < length; ++i)
- dispatchMap.add(commands[i].name, commands[i].handler);
- }
-
- HashMap<String, CallHandler>::iterator it = dispatchMap.find(method);
- if (it == dispatchMap.end()) {
- m_backendDispatcher->reportProtocolError(&callId, InspectorBackendDispatcher::MethodNotFound, String("'") + "${domainName}" + '.' + method + "' was not found");
- return;
- }
-
- ((*this).*it->value)(callId, *message.get());
-}
-""")
-
-backend_method = (
-"""void ${dispatcherName}::${methodName}(long callId, const InspectorObject&${requestMessageObject})
-{
-${methodInParametersHandling}${methodDispatchHandling}${methodOutParametersHandling}${methodEndingHandling}
-}
-""")
-
-frontend_method = ("""void Inspector${domainName}FrontendDispatcher::$eventName(${parameters})
-{
- RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
- jsonMessage->setString(ASCIILiteral("method"), ASCIILiteral("${domainName}.${eventName}"));
-$code
- m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
-}
-""")
-
-callback_method = (
-"""${handlerName}::${callbackName}::${callbackName}(PassRefPtr<InspectorBackendDispatcher> backendDispatcher, int id) : Inspector::InspectorBackendDispatcher::CallbackBase(backendDispatcher, id) { }
-
-void ${handlerName}::${callbackName}::sendSuccess(${parameters})
-{
- RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
-${code} sendIfActive(jsonMessage, ErrorString());
-}
-""")
-
-frontend_h = (
-"""#ifndef InspectorFrontend_h
-#define InspectorFrontend_h
-
-#include "InspectorWebTypeBuilders.h"
-#include "InspectorForwarding.h"
-#include <inspector/InspectorValues.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-#if ENABLE(INSPECTOR)
-
-$domainClassList
-
-#endif // ENABLE(INSPECTOR)
-
-} // namespace WebCore
-
-#endif // !defined(InspectorFrontend_h)
-""")
-
-backend_h = (
-"""#ifndef InspectorBackendDispatchers_h
-#define InspectorBackendDispatchers_h
-
-#include "InspectorWebTypeBuilders.h"
-#include <inspector/InspectorBackendDispatcher.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-typedef String ErrorString;
-
-$handlerInterfaces
-
-$dispatcherInterfaces
-} // namespace WebCore
-
-#endif // !defined(InspectorBackendDispatchers_h)
-""")
-
-backend_cpp = (
-"""
-#include "config.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorBackendDispatchers.h"
-
-#include "InspectorAgent.h"
-#include "InspectorForwarding.h"
-#include <inspector/InspectorValues.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-using namespace Inspector;
-
-namespace WebCore {
-
-$methods
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-""")
-
-frontend_cpp = (
-"""
-
-#include "config.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorFrontend.h"
-
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-using namespace Inspector;
-
-namespace WebCore {
-
-$methods
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-""")
-
-typebuilder_h = (
-"""
-// FIXME: TYPE.
-#ifndef InspectorWebTypeBuilders_h
-#define InspectorWebTypeBuilders_h
-
-#if ENABLE(INSPECTOR)
-
-#include <inspector/InspectorTypeBuilder.h>
-#include <wtf/Assertions.h>
-#include <wtf/PassRefPtr.h>
-
-namespace Inspector {
-
-namespace TypeBuilder {
-
-${forwards}
-
-String getEnumConstantValue(int code);
-
-${typeBuilders}
-} // namespace TypeBuilder
-
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-
-#endif // !defined(InspectorWebTypeBuilders_h)
-
-""")
-
-typebuilder_cpp = (
-"""
-
-#include "config.h"
-#if ENABLE(INSPECTOR)
-
-#include "InspectorWebTypeBuilders.h"
-#include <wtf/text/CString.h>
-
-using namespace Inspector;
-
-namespace Inspector {
-
-namespace TypeBuilder {
-
-const char* const enum_constant_values[] = {
-$enumConstantValues};
-
-String getEnumConstantValue(int code) {
- return enum_constant_values[code];
-}
-
-} // namespace TypeBuilder
-
-$implCode
-
-#if $validatorIfdefName
-
-$validatorCode
-
-#endif // $validatorIfdefName
-
-} // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)
-""")
-
-backend_js = (
-"""
-
-$domainInitializers
-""")
-
-param_container_access_code = """
- RefPtr<InspectorObject> paramsContainer = message.getObject("params");
- InspectorObject* paramsContainerPtr = paramsContainer.get();
- InspectorArray* protocolErrorsPtr = protocolErrors.get();
-"""
-
-class_binding_builder_part_1 = (
-""" AllFieldsSet = %s
- };
-
- template<int STATE>
- class Builder {
- private:
- RefPtr<Inspector::InspectorObject> m_result;
-
- template<int STEP> Builder<STATE | STEP>& castState()
- {
- return *reinterpret_cast<Builder<STATE | STEP>*>(this);
- }
-
- Builder(PassRefPtr</*%s*/Inspector::InspectorObject> ptr)
- {
- COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
- m_result = ptr;
- }
- friend class %s;
- public:
-""")
-
-class_binding_builder_part_2 = ("""
- Builder<STATE | %s>& set%s(%s value)
- {
- COMPILE_ASSERT(!(STATE & %s), property_%s_already_set);
- m_result->set%s("%s", %s);
- return castState<%s>();
- }
-""")
-
-class_binding_builder_part_3 = ("""
- operator RefPtr<%s>& ()
- {
- COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
- COMPILE_ASSERT(sizeof(%s) == sizeof(Inspector::InspectorObject), cannot_cast);
- return *reinterpret_cast<RefPtr<%s>*>(&m_result);
- }
-
- PassRefPtr<%s> release()
- {
- return RefPtr<%s>(*this).release();
- }
- };
-
-""")
-
-class_binding_builder_part_4 = (
-""" static Builder<NoFieldsSet> create()
- {
- return Builder<NoFieldsSet>(Inspector::InspectorObject::create());
- }
-""")
diff --git a/Source/WebCore/inspector/ConsoleMessage.h b/Source/WebCore/inspector/ConsoleMessage.h
index 7fd16fc..16ccf1e 100644
--- a/Source/WebCore/inspector/ConsoleMessage.h
+++ b/Source/WebCore/inspector/ConsoleMessage.h
@@ -33,7 +33,7 @@
#include "ConsoleAPITypes.h"
#include "ConsoleTypes.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "ScriptState.h"
#include <wtf/Forward.h>
#include <wtf/Vector.h>
@@ -59,8 +59,8 @@
ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
~ConsoleMessage();
- void addToFrontend(InspectorConsoleFrontendDispatcher*, InjectedScriptManager*, bool generatePreview);
- void updateRepeatCountInConsole(InspectorConsoleFrontendDispatcher*);
+ void addToFrontend(Inspector::InspectorConsoleFrontendDispatcher*, InjectedScriptManager*, bool generatePreview);
+ void updateRepeatCountInConsole(Inspector::InspectorConsoleFrontendDispatcher*);
void incrementCount() { ++m_repeatCount; }
bool isEqual(ConsoleMessage* msg) const;
diff --git a/Source/WebCore/inspector/InjectedScriptHost.cpp b/Source/WebCore/inspector/InjectedScriptHost.cpp
index 5467575..adc4245 100644
--- a/Source/WebCore/inspector/InjectedScriptHost.cpp
+++ b/Source/WebCore/inspector/InjectedScriptHost.cpp
@@ -46,7 +46,7 @@
#include "InspectorDOMStorageAgent.h"
#include "InspectorDatabaseAgent.h"
#include "InspectorDebuggerAgent.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "Pasteboard.h"
#include "Storage.h"
#include "markup.h"
diff --git a/Source/WebCore/inspector/InspectorAgent.cpp b/Source/WebCore/inspector/InspectorAgent.cpp
index 194b779..1d5137b 100644
--- a/Source/WebCore/inspector/InspectorAgent.cpp
+++ b/Source/WebCore/inspector/InspectorAgent.cpp
@@ -40,8 +40,8 @@
#include "InjectedScriptHost.h"
#include "InjectedScriptManager.h"
#include "InspectorController.h"
-#include "InspectorFrontend.h"
#include "InspectorInstrumentation.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "MainFrame.h"
#include "Page.h"
diff --git a/Source/WebCore/inspector/InspectorAgent.h b/Source/WebCore/inspector/InspectorAgent.h
index 1cea7c2..00ac015 100644
--- a/Source/WebCore/inspector/InspectorAgent.h
+++ b/Source/WebCore/inspector/InspectorAgent.h
@@ -30,8 +30,8 @@
#ifndef InspectorAgent_h
#define InspectorAgent_h
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
@@ -39,6 +39,7 @@
namespace Inspector {
class InspectorObject;
+class InspectorInspectorFrontendDispatcher;
}
namespace WebCore {
@@ -47,13 +48,12 @@
class DocumentLoader;
class Frame;
class InjectedScriptManager;
-class InspectorInspectorFrontendDispatcher;
class InstrumentingAgents;
class Page;
typedef String ErrorString;
-class InspectorAgent : public InspectorAgentBase, public InspectorInspectorBackendDispatcherHandler {
+class InspectorAgent : public InspectorAgentBase, public Inspector::InspectorInspectorBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorAgent);
public:
static PassOwnPtr<InspectorAgent> create(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents)
@@ -90,8 +90,8 @@
InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*);
Page* m_inspectedPage;
- std::unique_ptr<InspectorInspectorFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorInspectorBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorInspectorFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorInspectorBackendDispatcher> m_backendDispatcher;
InjectedScriptManager* m_injectedScriptManager;
Vector<pair<long, String>> m_pendingEvaluateTestCommands;
diff --git a/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp b/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
index 6d7d805..83557f9 100644
--- a/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
+++ b/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
@@ -34,8 +34,8 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "InspectorAgent.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "NetworkStateNotifier.h"
#include "Page.h"
diff --git a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h b/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
index 8211a36..6e49fc4 100644
--- a/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
+++ b/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
@@ -28,13 +28,14 @@
#if ENABLE(INSPECTOR)
#include "ApplicationCacheHost.h"
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
namespace Inspector {
+class InspectorApplicationCacheFrontendDispatcher;
class InspectorObject;
class InspectorValue;
}
@@ -43,7 +44,6 @@
class Frame;
class InspectorAgent;
-class InspectorApplicationCacheFrontendDispatcher;
class InspectorPageAgent;
class InstrumentingAgents;
class Page;
@@ -51,7 +51,7 @@
typedef String ErrorString;
-class InspectorApplicationCacheAgent : public InspectorAgentBase, public InspectorApplicationCacheBackendDispatcherHandler {
+class InspectorApplicationCacheAgent : public InspectorAgentBase, public Inspector::InspectorApplicationCacheBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<InspectorApplicationCacheAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent)
@@ -80,8 +80,8 @@
DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId);
InspectorPageAgent* m_pageAgent;
- std::unique_ptr<InspectorApplicationCacheFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorApplicationCacheBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorApplicationCacheFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorApplicationCacheBackendDispatcher> m_backendDispatcher;
};
} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorCSSAgent.h b/Source/WebCore/inspector/InspectorCSSAgent.h
index a16fec8..1d72c9f 100644
--- a/Source/WebCore/inspector/InspectorCSSAgent.h
+++ b/Source/WebCore/inspector/InspectorCSSAgent.h
@@ -27,10 +27,10 @@
#include "CSSSelector.h"
#include "ContentSecurityPolicy.h"
-#include "InspectorBackendDispatchers.h"
#include "InspectorDOMAgent.h"
#include "InspectorStyleSheet.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include "SecurityContext.h"
#include <inspector/InspectorValues.h>
#include <wtf/HashMap.h>
@@ -39,6 +39,10 @@
#include <wtf/RefPtr.h>
#include <wtf/text/WTFString.h>
+namespace Inspector {
+class InspectorCSSFrontendDispatcher;
+}
+
namespace WebCore {
class CSSRule;
@@ -50,7 +54,6 @@
class DocumentStyleSheetCollection;
class Element;
class InspectorCSSOMWrappers;
-class InspectorCSSFrontendDispatcher;
class InstrumentingAgents;
class NameNodeMap;
class Node;
@@ -66,7 +69,7 @@
class InspectorCSSAgent
: public InspectorAgentBase
, public InspectorDOMAgent::DOMListener
- , public InspectorCSSBackendDispatcherHandler
+ , public Inspector::InspectorCSSBackendDispatcherHandler
, public InspectorStyleSheet::Listener {
WTF_MAKE_NONCOPYABLE(InspectorCSSAgent);
public:
@@ -183,8 +186,8 @@
void resetPseudoStates();
- std::unique_ptr<InspectorCSSFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorCSSBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorCSSFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorCSSBackendDispatcher> m_backendDispatcher;
InspectorDOMAgent* m_domAgent;
IdToInspectorStyleSheet m_idToInspectorStyleSheet;
diff --git a/Source/WebCore/inspector/InspectorCanvasAgent.cpp b/Source/WebCore/inspector/InspectorCanvasAgent.cpp
index 9430995..51ce447 100644
--- a/Source/WebCore/inspector/InspectorCanvasAgent.cpp
+++ b/Source/WebCore/inspector/InspectorCanvasAgent.cpp
@@ -41,8 +41,8 @@
#include "InjectedScript.h"
#include "InjectedScriptCanvasModule.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "MainFrame.h"
#include "NodeList.h"
diff --git a/Source/WebCore/inspector/InspectorCanvasAgent.h b/Source/WebCore/inspector/InspectorCanvasAgent.h
index 27d3edc..bb912ba 100644
--- a/Source/WebCore/inspector/InspectorCanvasAgent.h
+++ b/Source/WebCore/inspector/InspectorCanvasAgent.h
@@ -33,9 +33,9 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InspectorWebTypeBuilders.h"
#include "ScriptState.h"
#include <wtf/HashMap.h>
@@ -57,7 +57,7 @@
typedef String ErrorString;
-class InspectorCanvasAgent : public InspectorAgentBase, public InspectorCanvasBackendDispatcherHandler {
+class InspectorCanvasAgent : public InspectorAgentBase, public Inspector::InspectorCanvasBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager)
{
@@ -104,8 +104,8 @@
InspectorPageAgent* m_pageAgent;
InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<InspectorCanvasFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorCanvasBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorCanvasFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorCanvasBackendDispatcher> m_backendDispatcher;
bool m_enabled;
// Contains all frames with canvases, value is true only for frames that have an uninstrumented canvas.
typedef HashMap<Frame*, bool> FramesWithUninstrumentedCanvases;
diff --git a/Source/WebCore/inspector/InspectorConsoleAgent.cpp b/Source/WebCore/inspector/InspectorConsoleAgent.cpp
index de16f49..019c295 100644
--- a/Source/WebCore/inspector/InspectorConsoleAgent.cpp
+++ b/Source/WebCore/inspector/InspectorConsoleAgent.cpp
@@ -34,7 +34,7 @@
#include "DOMWindow.h"
#include "InjectedScriptHost.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "ResourceError.h"
#include "ResourceResponse.h"
diff --git a/Source/WebCore/inspector/InspectorConsoleAgent.h b/Source/WebCore/inspector/InspectorConsoleAgent.h
index 99455ca..90d0f1a 100644
--- a/Source/WebCore/inspector/InspectorConsoleAgent.h
+++ b/Source/WebCore/inspector/InspectorConsoleAgent.h
@@ -29,15 +29,15 @@
#include "ConsoleAPITypes.h"
#include "ConsoleTypes.h"
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "ScriptState.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
-#include <wtf/text/StringHash.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
namespace WebCore {
@@ -53,7 +53,7 @@
typedef String ErrorString;
-class InspectorConsoleAgent : public InspectorAgentBase, public InspectorConsoleBackendDispatcherHandler {
+class InspectorConsoleAgent : public InspectorAgentBase, public Inspector::InspectorConsoleBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent);
public:
InspectorConsoleAgent(InstrumentingAgents*, InjectedScriptManager*);
@@ -101,8 +101,8 @@
virtual bool developerExtrasEnabled() = 0;
InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<InspectorConsoleFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorConsoleBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorConsoleFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorConsoleBackendDispatcher> m_backendDispatcher;
ConsoleMessage* m_previousMessage;
Vector<OwnPtr<ConsoleMessage>> m_consoleMessages;
int m_expiredConsoleMessageCount;
diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp
index 4377580..d0b55c8 100644
--- a/Source/WebCore/inspector/InspectorController.cpp
+++ b/Source/WebCore/inspector/InspectorController.cpp
@@ -41,7 +41,6 @@
#include "InjectedScriptManager.h"
#include "InspectorAgent.h"
#include "InspectorApplicationCacheAgent.h"
-#include "InspectorBackendDispatchers.h"
#include "InspectorCSSAgent.h"
#include "InspectorCanvasAgent.h"
#include "InspectorClient.h"
@@ -50,7 +49,6 @@
#include "InspectorDOMStorageAgent.h"
#include "InspectorDatabaseAgent.h"
#include "InspectorDebuggerAgent.h"
-#include "InspectorFrontend.h"
#include "InspectorFrontendClient.h"
#include "InspectorHeapProfilerAgent.h"
#include "InspectorIndexedDBAgent.h"
@@ -63,13 +61,15 @@
#include "InspectorProfilerAgent.h"
#include "InspectorResourceAgent.h"
#include "InspectorTimelineAgent.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InspectorWorkerAgent.h"
#include "InstrumentingAgents.h"
#include "MainFrame.h"
+#include "Page.h"
#include "PageConsoleAgent.h"
#include "PageDebuggerAgent.h"
#include "PageRuntimeAgent.h"
-#include "Page.h"
#include "Settings.h"
#include <inspector/InspectorBackendDispatcher.h>
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp
index e1d273c..62071d2 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp
@@ -69,11 +69,11 @@
#include "IdentifiersFactory.h"
#include "InjectedScriptManager.h"
#include "InspectorClient.h"
-#include "InspectorFrontend.h"
#include "InspectorHistory.h"
#include "InspectorNodeFinder.h"
#include "InspectorOverlay.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "IntRect.h"
#include "JSEventListener.h"
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index f01f9ad..3c4ca3c 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -33,10 +33,10 @@
#include "EventTarget.h"
#include "InjectedScript.h"
#include "InjectedScriptManager.h"
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorOverlay.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "RenderLayer.h"
#include "Timer.h"
#include <inspector/InspectorValues.h>
@@ -93,7 +93,7 @@
const EventListenerVector eventListenerVector;
};
-class InspectorDOMAgent : public InspectorAgentBase, public InspectorDOMBackendDispatcherHandler {
+class InspectorDOMAgent : public InspectorAgentBase, public Inspector::InspectorDOMBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorDOMAgent);
public:
struct DOMListener {
@@ -247,8 +247,8 @@
InjectedScriptManager* m_injectedScriptManager;
InspectorOverlay* m_overlay;
InspectorClient* m_client;
- std::unique_ptr<InspectorDOMFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorDOMBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorDOMFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorDOMBackendDispatcher> m_backendDispatcher;
DOMListener* m_domListener;
NodeToIdMap m_documentNodeToIdMap;
typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
diff --git a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
index 143170a..0f77c09 100644
--- a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
@@ -38,8 +38,8 @@
#include "InspectorAgent.h"
#include "InspectorDOMAgent.h"
#include "InspectorDebuggerAgent.h"
-#include "InspectorFrontend.h"
#include "InspectorInstrumentation.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include <inspector/InspectorValues.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
index a3daaff..d8e6942 100644
--- a/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
@@ -33,9 +33,9 @@
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
#include "InspectorDebuggerAgent.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
@@ -56,7 +56,7 @@
typedef String ErrorString;
-class InspectorDOMDebuggerAgent : public InspectorAgentBase, public InspectorDebuggerAgent::Listener, public InspectorDOMDebuggerBackendDispatcherHandler {
+class InspectorDOMDebuggerAgent : public InspectorAgentBase, public InspectorDebuggerAgent::Listener, public Inspector::InspectorDOMDebuggerBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorDOMDebuggerAgent);
public:
static PassOwnPtr<InspectorDOMDebuggerAgent> create(InstrumentingAgents*, InspectorDOMAgent*, InspectorDebuggerAgent*, InspectorAgent*);
@@ -108,7 +108,7 @@
InspectorDOMAgent* m_domAgent;
InspectorDebuggerAgent* m_debuggerAgent;
- RefPtr<InspectorDOMDebuggerBackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::InspectorDOMDebuggerBackendDispatcher> m_backendDispatcher;
HashMap<Node*, uint32_t> m_domBreakpoints;
HashSet<String> m_eventListenerBreakpoints;
HashSet<String> m_xhrBreakpoints;
diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp b/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
index 9c59b1a6..1d66d12 100644
--- a/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
@@ -33,14 +33,14 @@
#include "InspectorDOMStorageAgent.h"
-#include "Database.h"
#include "DOMWindow.h"
+#include "Database.h"
#include "Document.h"
#include "ExceptionCode.h"
#include "ExceptionCodeDescription.h"
#include "Frame.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "Page.h"
#include "PageGroup.h"
diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.h b/Source/WebCore/inspector/InspectorDOMStorageAgent.h
index 97441b1..fbea01d 100644
--- a/Source/WebCore/inspector/InspectorDOMStorageAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.h
@@ -29,8 +29,8 @@
#ifndef InspectorDOMStorageAgent_h
#define InspectorDOMStorageAgent_h
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include "StorageArea.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
@@ -38,12 +38,12 @@
namespace Inspector {
class InspectorArray;
+class InspectorDOMStorageFrontendDispatcher;
}
namespace WebCore {
class Frame;
-class InspectorDOMStorageFrontendDispatcher;
class InspectorPageAgent;
class InstrumentingAgents;
class Page;
@@ -52,7 +52,7 @@
typedef String ErrorString;
-class InspectorDOMStorageAgent : public InspectorAgentBase, public InspectorDOMStorageBackendDispatcherHandler {
+class InspectorDOMStorageAgent : public InspectorAgentBase, public Inspector::InspectorDOMStorageBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorDOMStorageAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent)
{
@@ -84,8 +84,8 @@
PassRefPtr<StorageArea> findStorageArea(ErrorString*, const RefPtr<Inspector::InspectorObject>&, Frame*&);
InspectorPageAgent* m_pageAgent;
- std::unique_ptr<InspectorDOMStorageFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorDOMStorageBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorDOMStorageFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorDOMStorageBackendDispatcher> m_backendDispatcher;
bool m_enabled;
};
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
index 9b855cb..491c849 100644
--- a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
@@ -36,7 +36,7 @@
#include "ExceptionCode.h"
#include "ExceptionCodePlaceholder.h"
#include "InspectorDatabaseResource.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "SQLError.h"
#include "SQLResultSet.h"
@@ -51,7 +51,7 @@
#include <inspector/InspectorValues.h>
#include <wtf/Vector.h>
-typedef WebCore::InspectorDatabaseBackendDispatcherHandler::ExecuteSQLCallback ExecuteSQLCallback;
+typedef Inspector::InspectorDatabaseBackendDispatcherHandler::ExecuteSQLCallback ExecuteSQLCallback;
using namespace Inspector;
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.h b/Source/WebCore/inspector/InspectorDatabaseAgent.h
index 539a3ac..4412be2 100644
--- a/Source/WebCore/inspector/InspectorDatabaseAgent.h
+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.h
@@ -31,9 +31,9 @@
#if ENABLE(INSPECTOR) && ENABLE(SQL_DATABASE)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -50,7 +50,7 @@
typedef String ErrorString;
-class InspectorDatabaseAgent : public InspectorAgentBase, public InspectorDatabaseBackendDispatcherHandler {
+class InspectorDatabaseAgent : public InspectorAgentBase, public Inspector::InspectorDatabaseBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorDatabaseAgent> create(InstrumentingAgents* instrumentingAgents)
{
@@ -79,8 +79,8 @@
Database* databaseForId(const String& databaseId);
InspectorDatabaseResource* findByFileName(const String& fileName);
- std::unique_ptr<InspectorDatabaseFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorDatabaseBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorDatabaseFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorDatabaseBackendDispatcher> m_backendDispatcher;
typedef HashMap<String, RefPtr<InspectorDatabaseResource>> DatabaseResourcesMap;
DatabaseResourcesMap m_resources;
bool m_enabled;
diff --git a/Source/WebCore/inspector/InspectorDatabaseResource.cpp b/Source/WebCore/inspector/InspectorDatabaseResource.cpp
index 25a3146..1badbdf 100644
--- a/Source/WebCore/inspector/InspectorDatabaseResource.cpp
+++ b/Source/WebCore/inspector/InspectorDatabaseResource.cpp
@@ -35,7 +35,7 @@
#include "InspectorDatabaseResource.h"
#include "Database.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <inspector/InspectorValues.h>
using namespace Inspector;
diff --git a/Source/WebCore/inspector/InspectorDatabaseResource.h b/Source/WebCore/inspector/InspectorDatabaseResource.h
index 80c2ae4..ccd09c8 100644
--- a/Source/WebCore/inspector/InspectorDatabaseResource.h
+++ b/Source/WebCore/inspector/InspectorDatabaseResource.h
@@ -32,7 +32,7 @@
#define InspectorDatabaseResource_h
#if ENABLE(SQL_DATABASE) && ENABLE(INSPECTOR)
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -46,7 +46,7 @@
public:
static PassRefPtr<InspectorDatabaseResource> create(PassRefPtr<Database> database, const String& domain, const String& name, const String& version);
- void bind(InspectorDatabaseFrontendDispatcher*);
+ void bind(Inspector::InspectorDatabaseFrontendDispatcher*);
Database* database() { return m_database.get(); }
void setDatabase(PassRefPtr<Database> database) { m_database = database; }
String id() const { return m_id; }
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
index 85de246..03ee6c6 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
@@ -36,8 +36,8 @@
#include "ContentSearchUtils.h"
#include "InjectedScript.h"
#include "InjectedScriptManager.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "RegularExpression.h"
#include "ScriptDebugServer.h"
diff --git a/Source/WebCore/inspector/InspectorDebuggerAgent.h b/Source/WebCore/inspector/InspectorDebuggerAgent.h
index 95eda06..6ce5c59 100644
--- a/Source/WebCore/inspector/InspectorDebuggerAgent.h
+++ b/Source/WebCore/inspector/InspectorDebuggerAgent.h
@@ -36,9 +36,9 @@
#include "ConsoleAPITypes.h"
#include "ConsoleTypes.h"
#include "InjectedScript.h"
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "ScriptBreakpoint.h"
#include "ScriptDebugListener.h"
#include "ScriptState.h"
@@ -68,7 +68,7 @@
typedef String ErrorString;
-class InspectorDebuggerAgent : public InspectorAgentBase, public ScriptDebugListener, public InspectorDebuggerBackendDispatcherHandler {
+class InspectorDebuggerAgent : public InspectorAgentBase, public ScriptDebugListener, public Inspector::InspectorDebuggerBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static const char* backtraceObjectGroup;
@@ -120,9 +120,9 @@
void runScript(ErrorString*, const Inspector::TypeBuilder::Debugger::ScriptId&, const int* executionContextId, const String* objectGroup, const bool* doNotPauseOnExceptionsAndMuteConsole, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown);
virtual void setOverlayMessage(ErrorString*, const String*);
- void schedulePauseOnNextStatement(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
+ void schedulePauseOnNextStatement(Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
void cancelPauseOnNextStatement();
- void breakProgram(InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
+ void breakProgram(Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum breakReason, PassRefPtr<Inspector::InspectorObject> data);
virtual void scriptExecutionBlockedByCSP(const String& directiveText);
class Listener {
@@ -175,15 +175,15 @@
typedef HashMap<String, RefPtr<Inspector::InspectorObject>> BreakpointIdentifierToBreakpointMap;
InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<InspectorDebuggerFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorDebuggerBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorDebuggerFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorDebuggerBackendDispatcher> m_backendDispatcher;
JSC::ExecState* m_pausedScriptState;
Deprecated::ScriptValue m_currentCallStack;
ScriptsMap m_scripts;
BreakpointIdentifierToDebugServerBreakpointIDsMap m_breakpointIdentifierToDebugServerBreakpointIDs;
BreakpointIdentifierToBreakpointMap m_javaScriptBreakpoints;
BreakpointID m_continueToLocationBreakpointID;
- InspectorDebuggerFrontendDispatcher::Reason::Enum m_breakReason;
+ Inspector::InspectorDebuggerFrontendDispatcher::Reason::Enum m_breakReason;
RefPtr<Inspector::InspectorObject> m_breakAuxData;
bool m_enabled;
bool m_javaScriptPauseScheduled;
diff --git a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
index aa8ca0f..2373e82 100644
--- a/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
+++ b/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
@@ -41,10 +41,10 @@
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
#include "FrameView.h"
-#include "InspectorBackendDispatchers.h"
#include "InspectorController.h"
#include "InspectorFrontendHost.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebBackendDispatchers.h"
#include "MainFrame.h"
#include "Page.h"
#include "ScriptController.h"
diff --git a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h b/Source/WebCore/inspector/InspectorHeapProfilerAgent.h
index 62c13e4..4a67612 100644
--- a/Source/WebCore/inspector/InspectorHeapProfilerAgent.h
+++ b/Source/WebCore/inspector/InspectorHeapProfilerAgent.h
@@ -33,9 +33,9 @@
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
@@ -50,7 +50,7 @@
typedef String ErrorString;
-class InspectorHeapProfilerAgent : public InspectorAgentBase, public InspectorHeapProfilerBackendDispatcherHandler {
+class InspectorHeapProfilerAgent : public InspectorAgentBase, public Inspector::InspectorHeapProfilerBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<InspectorHeapProfilerAgent> create(InstrumentingAgents*, InjectedScriptManager*);
@@ -84,8 +84,8 @@
PassRefPtr<Inspector::TypeBuilder::HeapProfiler::ProfileHeader> createSnapshotHeader(const ScriptHeapSnapshot&);
InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<InspectorHeapProfilerFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorHeapProfilerBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorHeapProfilerFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorHeapProfilerBackendDispatcher> m_backendDispatcher;
unsigned m_nextUserInitiatedHeapSnapshotNumber;
IdToHeapSnapshotMap m_snapshots;
bool m_profileHeadersRequested;
diff --git a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
index fb42f87..77eb794 100644
--- a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
+++ b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
@@ -59,8 +59,8 @@
#include "IDBRequest.h"
#include "IDBTransaction.h"
#include "InjectedScript.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "SecurityOrigin.h"
#include <inspector/InspectorValues.h>
@@ -76,10 +76,10 @@
using Inspector::TypeBuilder::IndexedDB::ObjectStoreIndex;
typedef Inspector::InspectorBackendDispatcher::CallbackBase RequestCallback;
-typedef WebCore::InspectorIndexedDBBackendDispatcherHandler::RequestDatabaseNamesCallback RequestDatabaseNamesCallback;
-typedef WebCore::InspectorIndexedDBBackendDispatcherHandler::RequestDatabaseCallback RequestDatabaseCallback;
-typedef WebCore::InspectorIndexedDBBackendDispatcherHandler::RequestDataCallback RequestDataCallback;
-typedef WebCore::InspectorIndexedDBBackendDispatcherHandler::ClearObjectStoreCallback ClearObjectStoreCallback;
+typedef Inspector::InspectorIndexedDBBackendDispatcherHandler::RequestDatabaseNamesCallback RequestDatabaseNamesCallback;
+typedef Inspector::InspectorIndexedDBBackendDispatcherHandler::RequestDatabaseCallback RequestDatabaseCallback;
+typedef Inspector::InspectorIndexedDBBackendDispatcherHandler::RequestDataCallback RequestDataCallback;
+typedef Inspector::InspectorIndexedDBBackendDispatcherHandler::ClearObjectStoreCallback ClearObjectStoreCallback;
using namespace Inspector;
diff --git a/Source/WebCore/inspector/InspectorIndexedDBAgent.h b/Source/WebCore/inspector/InspectorIndexedDBAgent.h
index b955210..8cdc5c5 100644
--- a/Source/WebCore/inspector/InspectorIndexedDBAgent.h
+++ b/Source/WebCore/inspector/InspectorIndexedDBAgent.h
@@ -33,8 +33,8 @@
#if ENABLE(INSPECTOR) && ENABLE(INDEXED_DATABASE)
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -45,7 +45,7 @@
typedef String ErrorString;
-class InspectorIndexedDBAgent : public InspectorAgentBase, public InspectorIndexedDBBackendDispatcherHandler {
+class InspectorIndexedDBAgent : public InspectorAgentBase, public Inspector::InspectorIndexedDBBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorIndexedDBAgent> create(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, InspectorPageAgent* pageAgent)
{
@@ -69,7 +69,7 @@
InjectedScriptManager* m_injectedScriptManager;
InspectorPageAgent* m_pageAgent;
- RefPtr<InspectorIndexedDBBackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::InspectorIndexedDBBackendDispatcher> m_backendDispatcher;
};
} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorInputAgent.h b/Source/WebCore/inspector/InspectorInputAgent.h
index 4e062aa..a209113 100644
--- a/Source/WebCore/inspector/InspectorInputAgent.h
+++ b/Source/WebCore/inspector/InspectorInputAgent.h
@@ -33,8 +33,8 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
@@ -44,7 +44,7 @@
typedef String ErrorString;
-class InspectorInputAgent : public InspectorAgentBase, public InspectorInputBackendDispatcherHandler {
+class InspectorInputAgent : public InspectorAgentBase, public Inspector::InspectorInputBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorInputAgent);
public:
static PassOwnPtr<InspectorInputAgent> create(InstrumentingAgents* instrumentingAgents, Page* page)
@@ -65,7 +65,7 @@
InspectorInputAgent(InstrumentingAgents*, Page*);
Page* m_page;
- RefPtr<InspectorInputBackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::InspectorInputBackendDispatcher> m_backendDispatcher;
};
#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp b/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
index c415bfa..c96830e 100644
--- a/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
@@ -37,7 +37,7 @@
#include "IdentifiersFactory.h"
#include "InspectorDOMAgent.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "IntRect.h"
#include "PseudoElement.h"
diff --git a/Source/WebCore/inspector/InspectorLayerTreeAgent.h b/Source/WebCore/inspector/InspectorLayerTreeAgent.h
index 174560d..364e9ff 100644
--- a/Source/WebCore/inspector/InspectorLayerTreeAgent.h
+++ b/Source/WebCore/inspector/InspectorLayerTreeAgent.h
@@ -31,9 +31,9 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InspectorWebTypeBuilders.h"
#include "RenderLayer.h"
#include <wtf/PassOwnPtr.h>
@@ -47,7 +47,7 @@
typedef String ErrorString;
-class InspectorLayerTreeAgent : public InspectorAgentBase, public InspectorLayerTreeBackendDispatcherHandler {
+class InspectorLayerTreeAgent : public InspectorAgentBase, public Inspector::InspectorLayerTreeBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorLayerTreeAgent> create(InstrumentingAgents* instrumentingAgents)
{
@@ -87,8 +87,8 @@
String bindPseudoElement(PseudoElement*);
void unbindPseudoElement(PseudoElement*);
- std::unique_ptr<InspectorLayerTreeFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorLayerTreeBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorLayerTreeFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorLayerTreeBackendDispatcher> m_backendDispatcher;
HashMap<const RenderLayer*, String> m_documentLayerToIdMap;
HashMap<String, const RenderLayer*> m_idToLayer;
diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.cpp b/Source/WebCore/inspector/InspectorMemoryAgent.cpp
index 32d01ff..48ba7b8 100644
--- a/Source/WebCore/inspector/InspectorMemoryAgent.cpp
+++ b/Source/WebCore/inspector/InspectorMemoryAgent.cpp
@@ -40,7 +40,7 @@
#include "EventListenerMap.h"
#include "Frame.h"
#include "InspectorDOMStorageAgent.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "MemoryCache.h"
#include "Node.h"
diff --git a/Source/WebCore/inspector/InspectorMemoryAgent.h b/Source/WebCore/inspector/InspectorMemoryAgent.h
index 8f15654..2a2fa6b 100644
--- a/Source/WebCore/inspector/InspectorMemoryAgent.h
+++ b/Source/WebCore/inspector/InspectorMemoryAgent.h
@@ -33,8 +33,8 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -45,7 +45,7 @@
typedef String ErrorString;
-class InspectorMemoryAgent : public InspectorAgentBase, public InspectorMemoryBackendDispatcherHandler {
+class InspectorMemoryAgent : public InspectorAgentBase, public Inspector::InspectorMemoryBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorMemoryAgent);
public:
static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents);
@@ -59,7 +59,7 @@
private:
InspectorMemoryAgent(InstrumentingAgents*);
- RefPtr<InspectorMemoryBackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::InspectorMemoryBackendDispatcher> m_backendDispatcher;
};
} // namespace WebCore
diff --git a/Source/WebCore/inspector/InspectorPageAgent.cpp b/Source/WebCore/inspector/InspectorPageAgent.cpp
index f4dbfd5..ada90df 100644
--- a/Source/WebCore/inspector/InspectorPageAgent.cpp
+++ b/Source/WebCore/inspector/InspectorPageAgent.cpp
@@ -63,9 +63,9 @@
#include "InspectorAgent.h"
#include "InspectorClient.h"
#include "InspectorDOMAgent.h"
-#include "InspectorFrontend.h"
#include "InspectorInstrumentation.h"
#include "InspectorOverlay.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "MainFrame.h"
#include "MemoryCache.h"
diff --git a/Source/WebCore/inspector/InspectorPageAgent.h b/Source/WebCore/inspector/InspectorPageAgent.h
index 5d65699..2cc0ad4 100644
--- a/Source/WebCore/inspector/InspectorPageAgent.h
+++ b/Source/WebCore/inspector/InspectorPageAgent.h
@@ -35,9 +35,9 @@
#include "DeviceOrientationData.h"
#include "GeolocationPosition.h"
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "IntSize.h"
#include "LayoutRect.h"
#include <wtf/HashMap.h>
@@ -71,7 +71,7 @@
typedef String ErrorString;
-class InspectorPageAgent : public InspectorAgentBase, public InspectorPageBackendDispatcherHandler {
+class InspectorPageAgent : public InspectorAgentBase, public Inspector::InspectorPageBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorPageAgent);
public:
enum ResourceType {
@@ -121,7 +121,7 @@
virtual void setShowFPSCounter(ErrorString*, bool show);
virtual void canContinuouslyPaint(ErrorString*, bool*);
virtual void setContinuousPaintingEnabled(ErrorString*, bool enabled);
- virtual void getScriptExecutionStatus(ErrorString*, InspectorPageBackendDispatcherHandler::Result::Enum*);
+ virtual void getScriptExecutionStatus(ErrorString*, Inspector::InspectorPageBackendDispatcherHandler::Result::Enum*);
virtual void setScriptExecutionDisabled(ErrorString*, bool);
virtual void setGeolocationOverride(ErrorString*, const double*, const double*, const double*);
virtual void clearGeolocationOverride(ErrorString*);
@@ -200,8 +200,8 @@
InspectorAgent* m_inspectorAgent;
InjectedScriptManager* m_injectedScriptManager;
InspectorClient* m_client;
- std::unique_ptr<InspectorPageFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorPageBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorPageFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorPageBackendDispatcher> m_backendDispatcher;
InspectorOverlay* m_overlay;
long m_lastScriptIdentifier;
String m_pendingScriptToEvaluateOnLoadOnce;
diff --git a/Source/WebCore/inspector/InspectorProfilerAgent.cpp b/Source/WebCore/inspector/InspectorProfilerAgent.cpp
index 27dd5d2..f77e014 100644
--- a/Source/WebCore/inspector/InspectorProfilerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorProfilerAgent.cpp
@@ -39,7 +39,7 @@
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
#include "InspectorConsoleAgent.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "URL.h"
#include "Page.h"
diff --git a/Source/WebCore/inspector/InspectorProfilerAgent.h b/Source/WebCore/inspector/InspectorProfilerAgent.h
index 3f7836d..bace5c9 100644
--- a/Source/WebCore/inspector/InspectorProfilerAgent.h
+++ b/Source/WebCore/inspector/InspectorProfilerAgent.h
@@ -32,9 +32,9 @@
#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
@@ -58,7 +58,7 @@
typedef String ErrorString;
-class InspectorProfilerAgent : public InspectorAgentBase, public InspectorProfilerBackendDispatcherHandler {
+class InspectorProfilerAgent : public InspectorAgentBase, public Inspector::InspectorProfilerBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, Page*, InjectedScriptManager*);
@@ -118,8 +118,8 @@
InspectorConsoleAgent* m_consoleAgent;
InjectedScriptManager* m_injectedScriptManager;
- std::unique_ptr<InspectorProfilerFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorProfilerBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorProfilerFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorProfilerBackendDispatcher> m_backendDispatcher;
bool m_enabled;
bool m_profileHeadersRequested;
bool m_recordingCPUProfile;
diff --git a/Source/WebCore/inspector/InspectorResourceAgent.cpp b/Source/WebCore/inspector/InspectorResourceAgent.cpp
index 44f49c5..7f82f5f 100644
--- a/Source/WebCore/inspector/InspectorResourceAgent.cpp
+++ b/Source/WebCore/inspector/InspectorResourceAgent.cpp
@@ -46,10 +46,9 @@
#include "IconController.h"
#include "IdentifiersFactory.h"
#include "InspectorClient.h"
-#include "InspectorFrontend.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
-#include "URL.h"
#include "MemoryCache.h"
#include "NetworkResourcesData.h"
#include "Page.h"
@@ -64,6 +63,7 @@
#include "ScriptableDocumentParser.h"
#include "Settings.h"
#include "SubresourceLoader.h"
+#include "URL.h"
#include "WebSocketFrame.h"
#include "XMLHttpRequest.h"
#include <inspector/InspectorValues.h>
diff --git a/Source/WebCore/inspector/InspectorResourceAgent.h b/Source/WebCore/inspector/InspectorResourceAgent.h
index 9f2e72a..dc50917 100644
--- a/Source/WebCore/inspector/InspectorResourceAgent.h
+++ b/Source/WebCore/inspector/InspectorResourceAgent.h
@@ -31,9 +31,9 @@
#ifndef InspectorResourceAgent_h
#define InspectorResourceAgent_h
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -75,7 +75,7 @@
typedef String ErrorString;
-class InspectorResourceAgent : public InspectorAgentBase, public InspectorNetworkBackendDispatcherHandler {
+class InspectorResourceAgent : public InspectorAgentBase, public Inspector::InspectorNetworkBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorResourceAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)
{
@@ -152,8 +152,8 @@
InspectorPageAgent* m_pageAgent;
InspectorClient* m_client;
- std::unique_ptr<InspectorNetworkFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorNetworkBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorNetworkFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorNetworkBackendDispatcher> m_backendDispatcher;
String m_userAgentOverride;
OwnPtr<NetworkResourcesData> m_resourcesData;
bool m_enabled;
diff --git a/Source/WebCore/inspector/InspectorRuntimeAgent.h b/Source/WebCore/inspector/InspectorRuntimeAgent.h
index 8b444d9..53e836c 100644
--- a/Source/WebCore/inspector/InspectorRuntimeAgent.h
+++ b/Source/WebCore/inspector/InspectorRuntimeAgent.h
@@ -33,9 +33,11 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include "ScriptState.h"
+#include <inspector/InspectorJSBackendDispatchers.h>
+#include <inspector/InspectorJSFrontendDispatchers.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
@@ -55,7 +57,7 @@
typedef String ErrorString;
-class InspectorRuntimeAgent : public InspectorAgentBase, public InspectorRuntimeBackendDispatcherHandler {
+class InspectorRuntimeAgent : public InspectorAgentBase, public Inspector::InspectorRuntimeBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
public:
virtual ~InspectorRuntimeAgent();
diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
index 2472ed8..dd6174f 100644
--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -40,10 +40,10 @@
#include "IdentifiersFactory.h"
#include "InspectorClient.h"
#include "InspectorCounters.h"
-#include "InspectorFrontend.h"
#include "InspectorInstrumentation.h"
#include "InspectorMemoryAgent.h"
#include "InspectorPageAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "IntRect.h"
#include "JSDOMWindow.h"
diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.h b/Source/WebCore/inspector/InspectorTimelineAgent.h
index 05b8e02..469743a 100644
--- a/Source/WebCore/inspector/InspectorTimelineAgent.h
+++ b/Source/WebCore/inspector/InspectorTimelineAgent.h
@@ -33,9 +33,9 @@
#if ENABLE(INSPECTOR)
-#include "InspectorBackendDispatchers.h"
-#include "InspectorFrontend.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "LayoutRect.h"
#include <inspector/InspectorValues.h>
#include <wtf/PassOwnPtr.h>
@@ -123,7 +123,7 @@
class InspectorTimelineAgent
: public InspectorAgentBase
- , public InspectorTimelineBackendDispatcherHandler {
+ , public Inspector::InspectorTimelineBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
public:
enum InspectorType { PageInspector, WorkerInspector };
@@ -259,8 +259,8 @@
InspectorMemoryAgent* m_memoryAgent;
TimelineTimeConverter m_timeConverter;
- std::unique_ptr<InspectorTimelineFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorTimelineBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorTimelineFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorTimelineBackendDispatcher> m_backendDispatcher;
double m_timestampOffset;
Vector<TimelineRecordEntry> m_recordStack;
diff --git a/Source/WebCore/inspector/InspectorWorkerAgent.cpp b/Source/WebCore/inspector/InspectorWorkerAgent.cpp
index 88456c5..e6cefd4 100644
--- a/Source/WebCore/inspector/InspectorWorkerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorWorkerAgent.cpp
@@ -35,7 +35,7 @@
#include "InspectorWorkerAgent.h"
#include "InspectorForwarding.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "URL.h"
#include "WorkerGlobalScopeProxy.h"
diff --git a/Source/WebCore/inspector/InspectorWorkerAgent.h b/Source/WebCore/inspector/InspectorWorkerAgent.h
index ea475ed..9196224 100644
--- a/Source/WebCore/inspector/InspectorWorkerAgent.h
+++ b/Source/WebCore/inspector/InspectorWorkerAgent.h
@@ -31,24 +31,24 @@
#ifndef InspectorWorkerAgent_h
#define InspectorWorkerAgent_h
-#include "InspectorBackendDispatchers.h"
#include "InspectorWebAgentBase.h"
+#include "InspectorWebBackendDispatchers.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
namespace Inspector {
class InspectorObject;
+class InspectorWorkerFrontendDispatcher;
}
namespace WebCore {
-class InspectorWorkerFrontendDispatcher;
class InstrumentingAgents;
class URL;
class WorkerGlobalScopeProxy;
typedef String ErrorString;
-class InspectorWorkerAgent : public InspectorAgentBase, public InspectorWorkerBackendDispatcherHandler {
+class InspectorWorkerAgent : public InspectorAgentBase, public Inspector::InspectorWorkerBackendDispatcherHandler {
public:
static PassOwnPtr<InspectorWorkerAgent> create(InstrumentingAgents*);
~InspectorWorkerAgent();
@@ -76,8 +76,8 @@
void createWorkerFrontendChannel(WorkerGlobalScopeProxy*, const String& url);
void destroyWorkerFrontendChannels();
- std::unique_ptr<InspectorWorkerFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorWorkerBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorWorkerFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorWorkerBackendDispatcher> m_backendDispatcher;
bool m_enabled;
bool m_shouldPauseDedicatedWorkerOnStart;
diff --git a/Source/WebCore/inspector/PageRuntimeAgent.h b/Source/WebCore/inspector/PageRuntimeAgent.h
index cd04d94..94b6543 100644
--- a/Source/WebCore/inspector/PageRuntimeAgent.h
+++ b/Source/WebCore/inspector/PageRuntimeAgent.h
@@ -33,8 +33,8 @@
#if ENABLE(INSPECTOR)
-#include "InspectorFrontend.h"
#include "InspectorRuntimeAgent.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "ScriptState.h"
#include <wtf/PassOwnPtr.h>
@@ -70,8 +70,8 @@
Page* m_inspectedPage;
InspectorPageAgent* m_pageAgent;
- std::unique_ptr<InspectorRuntimeFrontendDispatcher> m_frontendDispatcher;
- RefPtr<InspectorRuntimeBackendDispatcher> m_backendDispatcher;
+ std::unique_ptr<Inspector::InspectorRuntimeFrontendDispatcher> m_frontendDispatcher;
+ RefPtr<Inspector::InspectorRuntimeBackendDispatcher> m_backendDispatcher;
bool m_mainWorldContextCreated;
};
diff --git a/Source/WebCore/inspector/ScriptCallFrame.cpp b/Source/WebCore/inspector/ScriptCallFrame.cpp
index abe9e12..69c28f9 100644
--- a/Source/WebCore/inspector/ScriptCallFrame.cpp
+++ b/Source/WebCore/inspector/ScriptCallFrame.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "ScriptCallFrame.h"
-#include "InspectorFrontend.h"
+#include "InspectorWebFrontendDispatchers.h"
#include <inspector/InspectorValues.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebCore/inspector/Scripts/generate-combined-inspector-json.py b/Source/WebCore/inspector/Scripts/generate-combined-inspector-json.py
deleted file mode 100755
index d99bcee..0000000
--- a/Source/WebCore/inspector/Scripts/generate-combined-inspector-json.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/python
-
-# Copyright (C) 2013 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-import glob
-import json
-import os
-import sys
-
-if len(sys.argv) < 2:
- print "usage: %s [json files or directory of json files ...]" % os.path.basename(sys.argv[0])
- sys.exit(1)
-
-files = []
-for arg in sys.argv[1:]:
- if not os.access(arg, os.F_OK):
- raise Exception("File \"%s\" not found" % arg)
- elif os.path.isdir(arg):
- files.extend(glob.glob(os.path.join(arg, "*.json")))
- else:
- files.append(arg)
-files.sort()
-
-# To keep as close to the original JSON formatting as possible, just
-# dump each JSON input file unmodified into an array of "domains".
-# Validate each file is valid JSON and that there is a "domain" key.
-
-first = True
-print "{\"domains\":["
-for file in files:
- if first:
- first = False
- else:
- print ","
-
- string = open(file).read()
-
- try:
- dictionary = json.loads(string)
- if not "domain" in dictionary:
- raise Exception("File \"%s\" does not contains a \"domain\" key." % file)
- except ValueError:
- sys.stderr.write("File \"%s\" does not contain valid JSON:\n" % file)
- raise
-
- print string.rstrip()
-print "]}"
diff --git a/Source/WebCore/inspector/WorkerInspectorController.cpp b/Source/WebCore/inspector/WorkerInspectorController.cpp
index 7f5e70f..55a4245 100644
--- a/Source/WebCore/inspector/WorkerInspectorController.cpp
+++ b/Source/WebCore/inspector/WorkerInspectorController.cpp
@@ -36,14 +36,14 @@
#include "InjectedScriptHost.h"
#include "InjectedScriptManager.h"
-#include "InspectorBackendDispatchers.h"
#include "InspectorClient.h"
#include "InspectorConsoleAgent.h"
#include "InspectorForwarding.h"
-#include "InspectorFrontend.h"
#include "InspectorHeapProfilerAgent.h"
#include "InspectorProfilerAgent.h"
#include "InspectorTimelineAgent.h"
+#include "InspectorWebBackendDispatchers.h"
+#include "InspectorWebFrontendDispatchers.h"
#include "InstrumentingAgents.h"
#include "WorkerConsoleAgent.h"
#include "WorkerDebuggerAgent.h"
diff --git a/Source/WebCore/inspector/WorkerRuntimeAgent.h b/Source/WebCore/inspector/WorkerRuntimeAgent.h
index 5b629c1..99cf7e4 100644
--- a/Source/WebCore/inspector/WorkerRuntimeAgent.h
+++ b/Source/WebCore/inspector/WorkerRuntimeAgent.h
@@ -64,7 +64,7 @@
virtual void muteConsole();
virtual void unmuteConsole();
WorkerGlobalScope* m_workerGlobalScope;
- RefPtr<InspectorRuntimeBackendDispatcher> m_backendDispatcher;
+ RefPtr<Inspector::InspectorRuntimeBackendDispatcher> m_backendDispatcher;
bool m_paused;
};
diff --git a/Source/WebCore/inspector/protocol/Runtime.json b/Source/WebCore/inspector/protocol/Runtime.json
deleted file mode 100644
index fa72721..0000000
--- a/Source/WebCore/inspector/protocol/Runtime.json
+++ /dev/null
@@ -1,210 +0,0 @@
-{
- "domain": "Runtime",
- "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
- "types": [
- {
- "id": "RemoteObjectId",
- "type": "string",
- "description": "Unique object identifier."
- },
- {
- "id": "RemoteObject",
- "type": "object",
- "description": "Mirror object referencing original JavaScript object.",
- "properties": [
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
- { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
- { "name": "value", "type": "any", "optional": true, "description": "Remote object value (in case of primitive values or JSON values if it was requested)." },
- { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
- { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containsing abbreviated property values." }
- ]
- },
- {
- "id": "ObjectPreview",
- "type": "object",
- "description": "Object containing abbreviated remote object value.",
- "properties": [
- { "name": "lossless", "type": "boolean", "description": "Determines whether preview is lossless (contains all information of the original object)." },
- { "name": "overflow", "type": "boolean", "description": "True iff some of the properties of the original did not fit." },
- { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." }
- ]
- },
- {
- "id": "PropertyPreview",
- "type": "object",
- "properties": [
- { "name": "name", "type": "string", "description": "Property name." },
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean"], "description": "Object type." },
- { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
- { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
- ]
- },
- {
- "id": "PropertyDescriptor",
- "type": "object",
- "description": "Object property descriptor.",
- "properties": [
- { "name": "name", "type": "string", "description": "Property name." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
- { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
- { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
- { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
- { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
- { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
- { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
- { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." }
- ]
- },
- {
- "id": "InternalPropertyDescriptor",
- "type": "object",
- "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
- "properties": [
- { "name": "name", "type": "string", "description": "Conventional property name." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
- ]
- },
- {
- "id": "CallArgument",
- "type": "object",
- "description": "Represents function call argument. Either remote object id <code>objectId</code> or primitive <code>value</code> or neither of (for undefined) them should be specified.",
- "properties": [
- { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
- ]
- },
- {
- "id": "ExecutionContextId",
- "type": "integer",
- "description": "Id of an execution context."
- },
- {
- "id": "RuntimeFrameId",
- "type": "string",
- "description": "Unique frame identifier. FIXME: This duplicates Network.FrameId."
- },
- {
- "id": "ExecutionContextDescription",
- "type": "object",
- "description": "Description of an isolated world.",
- "properties": [
- { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
- { "name": "isPageContext", "type": "boolean", "description": "True if this is a context where inpspected web page scripts run. False if it is a content script isolated context." },
- { "name": "name", "type": "string", "description": "Human readable name describing given context."},
- { "name": "frameId", "$ref": "RuntimeFrameId", "description": "Id of the owning frame." }
- ]
- },
- {
- "id": "SyntaxErrorType",
- "type": "string",
- "enum": ["none", "irrecoverable", "unterminated-literal", "recoverable"],
- "description": "Syntax error type: \"none\" for no error, \"irrecoverable\" for unrecoverable errors, \"unterminated-literal\" for when there is an unterminated literal, \"recoverable\" for when the expression is unfinished but valid so far."
- },
- {
- "id": "ErrorRange",
- "type": "object",
- "description": "Range of an error in source code.",
- "properties": [
- { "name": "startOffset", "type": "integer", "description": "Start offset of range (inclusive)." },
- { "name": "endOffset", "type": "integer", "description": "End offset of range (exclusive)." }
- ]
- }
- ],
- "commands": [
- {
- "name": "parse",
- "parameters": [
- { "name": "source", "type": "string", "description": "Source code to parse." }
- ],
- "returns": [
- { "name": "result", "$ref": "SyntaxErrorType", "description": "Parse result." },
- { "name": "message", "type": "string", "optional": true, "description": "Parse error message." },
- { "name": "range", "$ref": "ErrorRange", "optional": true, "description": "Range in the source where the error occurred." }
- ],
- "description": "Parses JavaScript source code for errors."
- },
- {
- "name": "evaluate",
- "parameters": [
- { "name": "expression", "type": "string", "description": "Expression to evaluate." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
- { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions and mute console. Overrides setPauseOnException state." },
- { "name": "contextId", "$ref": "Runtime.ExecutionContextId", "optional": true, "description": "Specifies in which isolated context to perform evaluation. Each content script lives in an isolated context and this parameter may be used to specify one of those contexts. If the parameter is omitted or 0 the evaluation will be performed in the context of the inspected page." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
- { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
- ],
- "description": "Evaluates expression on global object."
- },
- {
- "name": "callFunctionOn",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },
- { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
- { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
- { "name": "doNotPauseOnExceptionsAndMuteConsole", "type": "boolean", "optional": true, "description": "Specifies whether function call should stop on exceptions and mute console. Overrides setPauseOnException state." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
- { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
- ],
- "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "getProperties",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
- { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." }
- ],
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." },
- { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor"}, "description": "Internal object properties." }
- ],
- "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "releaseObject",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
- ],
- "description": "Releases remote object with given id."
- },
- {
- "name": "releaseObjectGroup",
- "parameters": [
- { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
- ],
- "description": "Releases all remote objects that belong to a given group."
- },
- {
- "name": "run",
- "description": "Tells inspected instance(worker or page) that it can run in case it was started paused."
- },
- {
- "name": "enable",
- "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
- },
- {
- "name": "disable",
- "description": "Disables reporting of execution contexts creation."
- }
- ],
- "events": [
- {
- "name": "executionContextCreated",
- "parameters": [
- { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." }
- ],
- "description": "Issued when new execution context is created."
- }
- ]
-}
diff --git a/Source/WebCore/make-generated-sources.sh b/Source/WebCore/make-generated-sources.sh
index 96b2112..fe2a727 100755
--- a/Source/WebCore/make-generated-sources.sh
+++ b/Source/WebCore/make-generated-sources.sh
@@ -2,6 +2,7 @@
export SOURCE_ROOT=$PWD
export SRCROOT=$PWD
export WebCore=$PWD
+export InspectorScripts=$PWD/../JavaScriptCore/inspector/scripts
mkdir -p DerivedSources/WebCore &&
make -C DerivedSources/WebCore -f ../../DerivedSources.make $@