Web Inspector: Move InjectedScript classes into JavaScriptCore
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2014 19:00:48 +0000 (19:00 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jan 2014 19:00:48 +0000 (19:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=126598

Source/JavaScriptCore:

Reviewed by Timothy Hatcher.

Part 1: Extract InspectorInstrumentationCookie class from InspectorInstrumentation.
Part 2: Move InjectedScriptSource and generation into JavaScriptCore.
Part 3: Update CodeGeneratorInspector to avoid inlining virtual destructors.
Part 4: Move all inspector scripts into JavaScriptCore and update generators.
Part 5: Move InjectedScript classes into JavaScriptCore
Part 6: Put it all together. Make WebCore use the JavaScriptCore InjectedScript files.

There are pieces of logic that WebCore wants to hook into in the InjectedScript
execution (e.g. for CommandLineAPIModule and InspectorInstrumentation). Create
hooks for those in a base class called InspectorEnvironment. For now, the
InspectorControllers (Page, JSGlobalObject, Worker) will be the InspectorEnvironments
and provide answers to its hooks.

* inspector/InspectorEnvironment.h: Added.
New hooks needed by WebCore in various places. Mostly stubbed in JavaScriptCore.

* inspector/InjectedScript.cpp: Renamed from Source/WebCore/inspector/InjectedScript.cpp.
* inspector/InjectedScript.h: Added.
* inspector/InjectedScriptBase.cpp: Renamed from Source/WebCore/inspector/InjectedScriptBase.cpp.
* inspector/InjectedScriptBase.h: Renamed from Source/WebCore/inspector/InjectedScriptBase.h.
* inspector/InjectedScriptModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptModule.cpp.
* inspector/InjectedScriptModule.h: Renamed from Source/WebCore/inspector/InjectedScriptModule.h.
Cleanup the style of these files (nullptr, formatting, whitespace, etc).
Use the InspectorEnvironments call/evaluate function for ScriptFunctionCalls and checking access

* inspector/InjectedScriptManager.cpp: Renamed from Source/WebCore/inspector/InjectedScriptManager.cpp.
* inspector/InjectedScriptManager.h: Renamed from Source/WebCore/inspector/InjectedScriptManager.h.
Take an InspectorEnvironment with multiple hooks, instead of a single hook function.

* inspector/InjectedScriptHost.cpp: Added.
* inspector/InjectedScriptHost.h: Added.
* inspector/JSInjectedScriptHost.cpp: Renamed from Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp.
* inspector/JSInjectedScriptHost.h: Added.
* inspector/JSInjectedScriptHostPrototype.cpp: Added.
* inspector/JSInjectedScriptHostPrototype.h: Added.
Implementation of InjectedScriptHost which is passed into the script (InjectedScriptSource.js)
that we inject into the page. This is mostly copied from the original autogenerated code,
then simplified and cleaned up. InjectedScriptHost can be subclasses to provide specialized
implementations of isHTMLAllCollection and type for Web/DOM types unknown to a pure JS context.

For OS X be sure to export the scripts as if they are private headers.

* GNUmakefile.am:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/cssmin.py: Renamed from Source/WebCore/inspector/Scripts/cssmin.py.
* inspector/scripts/inline-and-minify-stylesheets-and-scripts.py: Renamed from Source/WebCore/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py.
* inspector/scripts/jsmin.py: Renamed from Source/WebCore/inspector/Scripts/jsmin.py.
* inspector/scripts/xxd.pl: Renamed from Source/WebCore/inspector/xxd.pl.

This avoids build errors about duplicate exported virtual inlined methods
are included from multiple places. Just put empty destructors in the
implementation file instead of inlined.

* inspector/scripts/CodeGeneratorInspector.py:
(Generator):
(Generator.go):
* inspector/scripts/CodeGeneratorInspectorStrings.py:

Move InjectedScriptSource.js and derived sources generation.

* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/InjectedScriptSource.js: Renamed from Source/WebCore/inspector/InjectedScriptSource.js.

Source/WebCore:

Reviewed by Timothy Hatcher.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* GNUmakefile.list.am:
* UseJSC.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Remove old InjectedScript files.

* ForwardingHeaders/inspector/InjectedScript.h: Added.
* ForwardingHeaders/inspector/InjectedScriptBase.h: Added.
* ForwardingHeaders/inspector/InjectedScriptHost.h: Added.
* ForwardingHeaders/inspector/InjectedScriptManager.h: Added.
* ForwardingHeaders/inspector/InjectedScriptModule.h: Added.
* ForwardingHeaders/inspector/InspectorEnvironment.h: Added.
Expose headers to WebCore.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::developerExtrasEnabled):
(WebCore::InspectorController::canAccessInspectedScriptState):
(WebCore::InspectorController::functionCallHandler):
(WebCore::InspectorController::evaluateHandler):
(WebCore::InspectorController::willCallInjectedScriptFunction):
(WebCore::InspectorController::didCallInjectedScriptFunction):
* inspector/WorkerInspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::functionCallHandler):
(WebCore::WorkerInspectorController::evaluateHandler):
(WebCore::WorkerInspectorController::willCallInjectedScriptFunction):
(WebCore::WorkerInspectorController::didCallInjectedScriptFunction):
Make both InspectorControllers in WebCore be InspectorEnvironments.

* bindings/js/JSMainThreadExecState.h:
* bindings/js/JSMainThreadExecState.cpp:
(WebCore::evaluateHandlerFromAnyThread):
Make JSC::evaluate wrapper like the existing JSC::call wrapper.
These will be the ScriptFunctionCall implementations when debugging
a WebCore::Page or worker, instead of the pure JSC versions.

* inspector/PageInjectedScriptHost.h: Copied from Source/WebCore/inspector/CommandLineAPIModule.h.
* inspector/PageInjectedScriptHost.cpp: Copied from Source/WebCore/inspector/PageInjectedScriptManager.cpp.
(WebCore::PageInjectedScriptHost::type):
(WebCore::PageInjectedScriptHost::isHTMLAllCollection):
WebCore InjectedScriptHost implementation for DOM type handling.

* inspector/PageInjectedScriptManager.h:
* inspector/PageInjectedScriptManager.cpp:
(WebCore::PageInjectedScriptManager::PageInjectedScriptManager):
(WebCore::PageInjectedScriptManager::discardInjectedScriptsFor):
WebCore InjectedScriptManager implementation for CommandLineAPI and
specialized DOMWindow injected script management.

* bindings/js/JSBindingsAllInOne.cpp:
* inspector/CommandLineAPIHost.cpp:
* inspector/CommandLineAPIHost.h:
* inspector/CommandLineAPIModule.cpp:
(WebCore::CommandLineAPIModule::host):
* inspector/CommandLineAPIModule.h:
* inspector/ConsoleMessage.cpp:
(WebCore::ConsoleMessage::addToFrontend):
* inspector/ConsoleMessage.h:
* inspector/InjectedScriptCanvasModule.cpp:
(WebCore::InjectedScriptCanvasModule::InjectedScriptCanvasModule):
* inspector/InjectedScriptCanvasModule.h:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
(WebCore::InspectorCanvasAgent::create):
* inspector/InspectorConsoleAgent.cpp:
(WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDOMAgent.h:
(WebCore::InspectorDOMAgent::create):
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
(WebCore::InspectorDebuggerAgent::injectedScriptManager):
* inspector/InspectorHeapProfilerAgent.cpp:
(WebCore::InspectorHeapProfilerAgent::create):
(WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
* inspector/InspectorHeapProfilerAgent.h:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorIndexedDBAgent.h:
(WebCore::InspectorIndexedDBAgent::create):
* inspector/InspectorPageAgent.cpp:
* inspector/InspectorPageAgent.h:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::PageProfilerAgent::PageProfilerAgent):
(WebCore::InspectorProfilerAgent::create):
(WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
(WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorRuntimeAgent.cpp:
* inspector/InspectorRuntimeAgent.h:
(WebCore::InspectorRuntimeAgent::injectedScriptManager):
* inspector/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent):
* inspector/PageConsoleAgent.h:
(WebCore::PageConsoleAgent::create):
* inspector/PageDebuggerAgent.cpp:
* inspector/PageDebuggerAgent.h:
* inspector/PageRuntimeAgent.cpp:
* inspector/PageRuntimeAgent.h:
(WebCore::PageRuntimeAgent::create):
* inspector/WorkerConsoleAgent.cpp:
(WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
* inspector/WorkerConsoleAgent.h:
(WebCore::WorkerConsoleAgent::create):
* inspector/WorkerDebuggerAgent.cpp:
* inspector/WorkerDebuggerAgent.h:
* inspector/WorkerRuntimeAgent.cpp:
* inspector/WorkerRuntimeAgent.h:
(WebCore::WorkerRuntimeAgent::create):
Switch to using the Inspector namespace and JSC InjectedScript files.

* bindings/js/JSInjectedScriptManager.cpp: Removed.
* inspector/InjectedScript.h: Removed.
* inspector/InjectedScriptHost.cpp: Removed.
* inspector/InjectedScriptHost.h: Removed.
* inspector/InjectedScriptHost.idl: Removed.

With the updated location switch to using the appropriate INSPECTOR_SCRIPTS_DIR
variable which defines where the scripts are.

* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

Currently InjectedScriptBase uses InspectorInstrumentation directly
to track calling into JavaScript for timeline purposes. We will remove
the direct call from InjectedScriptBase and extracting the Cookie class
will make that easier.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorInstrumentationCookie.cpp: Added.
(WebCore::InspectorInstrumentationCookie::InspectorInstrumentationCookie):
(WebCore::InspectorInstrumentationCookie::operator=):
(WebCore::InspectorInstrumentationCookie::~InspectorInstrumentationCookie):
* inspector/InspectorInstrumentationCookie.h: Added.
(WebCore::InspectorInstrumentationCookie::isValid):
(WebCore::InspectorInstrumentationCookie::instrumentingAgents):
(WebCore::InspectorInstrumentationCookie::hasMatchingTimelineAgentId):

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

104 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/GNUmakefile.am
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/inspector/InjectedScript.cpp [moved from Source/WebCore/inspector/InjectedScript.cpp with 77% similarity]
Source/JavaScriptCore/inspector/InjectedScript.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/InjectedScriptBase.cpp [moved from Source/WebCore/inspector/InjectedScriptBase.cpp with 69% similarity]
Source/JavaScriptCore/inspector/InjectedScriptBase.h [moved from Source/WebCore/inspector/InjectedScriptBase.h with 78% similarity]
Source/JavaScriptCore/inspector/InjectedScriptHost.cpp [new file with mode: 0644]
Source/JavaScriptCore/inspector/InjectedScriptHost.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/InjectedScriptManager.cpp [moved from Source/WebCore/inspector/InjectedScriptManager.cpp with 55% similarity]
Source/JavaScriptCore/inspector/InjectedScriptManager.h [moved from Source/WebCore/inspector/InjectedScriptManager.h with 70% similarity]
Source/JavaScriptCore/inspector/InjectedScriptModule.cpp [moved from Source/WebCore/inspector/InjectedScriptModule.cpp with 86% similarity]
Source/JavaScriptCore/inspector/InjectedScriptModule.h [moved from Source/WebCore/inspector/InjectedScriptModule.h with 89% similarity]
Source/JavaScriptCore/inspector/InjectedScriptSource.js [moved from Source/WebCore/inspector/InjectedScriptSource.js with 100% similarity]
Source/JavaScriptCore/inspector/InspectorEnvironment.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp [moved from Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp with 53% similarity]
Source/JavaScriptCore/inspector/JSInjectedScriptHost.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp [new file with mode: 0644]
Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py
Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py
Source/JavaScriptCore/inspector/scripts/cssmin.py [moved from Source/WebCore/inspector/Scripts/cssmin.py with 100% similarity]
Source/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py [moved from Source/WebCore/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py with 100% similarity]
Source/JavaScriptCore/inspector/scripts/jsmin.py [moved from Source/WebCore/inspector/Scripts/jsmin.py with 100% similarity]
Source/JavaScriptCore/inspector/scripts/xxd.pl [moved from Source/WebCore/inspector/xxd.pl with 100% similarity]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/ForwardingHeaders/inspector/InjectedScript.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/inspector/InjectedScriptBase.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/inspector/InjectedScriptHost.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/inspector/InjectedScriptManager.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/inspector/InjectedScriptModule.h [new file with mode: 0644]
Source/WebCore/ForwardingHeaders/inspector/InspectorEnvironment.h [new file with mode: 0644]
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/UseJSC.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSInjectedScriptManager.cpp [deleted file]
Source/WebCore/bindings/js/JSMainThreadExecState.cpp
Source/WebCore/bindings/js/JSMainThreadExecState.h
Source/WebCore/inspector/CommandLineAPIHost.cpp
Source/WebCore/inspector/CommandLineAPIHost.h
Source/WebCore/inspector/CommandLineAPIModule.cpp
Source/WebCore/inspector/CommandLineAPIModule.h
Source/WebCore/inspector/ConsoleMessage.cpp
Source/WebCore/inspector/ConsoleMessage.h
Source/WebCore/inspector/InjectedScript.h [deleted file]
Source/WebCore/inspector/InjectedScriptCanvasModule.cpp
Source/WebCore/inspector/InjectedScriptCanvasModule.h
Source/WebCore/inspector/InjectedScriptHost.cpp [deleted file]
Source/WebCore/inspector/InjectedScriptHost.h [deleted file]
Source/WebCore/inspector/InjectedScriptHost.idl [deleted file]
Source/WebCore/inspector/InspectorAllInOne.cpp
Source/WebCore/inspector/InspectorCanvasAgent.cpp
Source/WebCore/inspector/InspectorCanvasAgent.h
Source/WebCore/inspector/InspectorConsoleAgent.cpp
Source/WebCore/inspector/InspectorConsoleAgent.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/InspectorHeapProfilerAgent.cpp
Source/WebCore/inspector/InspectorHeapProfilerAgent.h
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorInstrumentationCookie.cpp [new file with mode: 0644]
Source/WebCore/inspector/InspectorInstrumentationCookie.h [new file with mode: 0644]
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.h
Source/WebCore/inspector/InspectorRuntimeAgent.cpp
Source/WebCore/inspector/InspectorRuntimeAgent.h
Source/WebCore/inspector/PageConsoleAgent.cpp
Source/WebCore/inspector/PageConsoleAgent.h
Source/WebCore/inspector/PageDebuggerAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.h
Source/WebCore/inspector/PageInjectedScriptHost.cpp [new file with mode: 0644]
Source/WebCore/inspector/PageInjectedScriptHost.h [new file with mode: 0644]
Source/WebCore/inspector/PageInjectedScriptManager.cpp
Source/WebCore/inspector/PageInjectedScriptManager.h
Source/WebCore/inspector/PageRuntimeAgent.cpp
Source/WebCore/inspector/PageRuntimeAgent.h
Source/WebCore/inspector/WorkerConsoleAgent.cpp
Source/WebCore/inspector/WorkerConsoleAgent.h
Source/WebCore/inspector/WorkerDebuggerAgent.cpp
Source/WebCore/inspector/WorkerDebuggerAgent.h
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerInspectorController.h
Source/WebCore/inspector/WorkerRuntimeAgent.cpp
Source/WebCore/inspector/WorkerRuntimeAgent.h

index 8845891..6c25eb2 100644 (file)
@@ -228,6 +228,13 @@ set(JavaScriptCore_SOURCES
     inspector/InspectorAgentRegistry.cpp
     inspector/InspectorBackendDispatcher.cpp
     inspector/InspectorValues.cpp
+    inspector/InjectedScript.cpp
+    inspector/InjectedScriptBase.cpp
+    inspector/InjectedScriptHost.cpp
+    inspector/InjectedScriptManager.cpp
+    inspector/InjectedScriptModule.cpp
+    inspector/JSInjectedScriptHost.cpp
+    inspector/JSInjectedScriptHostPrototype.cpp
 
     interpreter/AbstractPC.cpp
     interpreter/CallFrame.cpp
@@ -775,6 +782,16 @@ list(APPEND JavaScriptCore_HEADERS
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InspectorJSTypeBuilders.h
 )
 
+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
+    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js
+    DEPENDS ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
+    COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${JAVASCRIPTCORE_DIR}/inspector/InjectedScriptSource.js > ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js
+    COMMAND ${PERL_EXECUTABLE} ${JavaScriptCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h
+    VERBATIM)
+
+list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
+
 
 if (WTF_CPU_ARM)
     list(APPEND JavaScriptCore_SOURCES
index 75ef59c..20214fc 100644 (file)
@@ -1,3 +1,82 @@
+2014-01-09  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Move InjectedScript classes into JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=126598
+
+        Reviewed by Timothy Hatcher.
+
+        Part 5: Move InjectedScript classes into JavaScriptCore
+
+        There are pieces of logic that WebCore wants to hook into in the InjectedScript
+        execution (e.g. for CommandLineAPIModule and InspectorInstrumentation). Create
+        hooks for those in a base class called InspectorEnvironment. For now, the
+        InspectorControllers (Page, JSGlobalObject, Worker) will be the InspectorEnvironments
+        and provide answers to its hooks.
+
+        * inspector/InspectorEnvironment.h: Added.
+        New hooks needed by WebCore in various places. Mostly stubbed in JavaScriptCore.
+
+        * inspector/InjectedScript.cpp: Renamed from Source/WebCore/inspector/InjectedScript.cpp.
+        * inspector/InjectedScript.h: Added.
+        * inspector/InjectedScriptBase.cpp: Renamed from Source/WebCore/inspector/InjectedScriptBase.cpp.
+        * inspector/InjectedScriptBase.h: Renamed from Source/WebCore/inspector/InjectedScriptBase.h.
+        * inspector/InjectedScriptModule.cpp: Renamed from Source/WebCore/inspector/InjectedScriptModule.cpp.
+        * inspector/InjectedScriptModule.h: Renamed from Source/WebCore/inspector/InjectedScriptModule.h.
+        Cleanup the style of these files (nullptr, formatting, whitespace, etc).
+        Use the InspectorEnvironments call/evaluate function for ScriptFunctionCalls and checking access
+
+        * inspector/InjectedScriptManager.cpp: Renamed from Source/WebCore/inspector/InjectedScriptManager.cpp.
+        * inspector/InjectedScriptManager.h: Renamed from Source/WebCore/inspector/InjectedScriptManager.h.
+        Take an InspectorEnvironment with multiple hooks, instead of a single hook function.
+
+        * inspector/InjectedScriptHost.cpp: Added.
+        * inspector/InjectedScriptHost.h: Added.
+        * inspector/JSInjectedScriptHost.cpp: Renamed from Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp.
+        * inspector/JSInjectedScriptHost.h: Added.
+        * inspector/JSInjectedScriptHostPrototype.cpp: Added.
+        * inspector/JSInjectedScriptHostPrototype.h: Added.
+        Implementation of InjectedScriptHost which is passed into the script (InjectedScriptSource.js)
+        that we inject into the page. This is mostly copied from the original autogenerated code,
+        then simplified and cleaned up. InjectedScriptHost can be subclasses to provide specialized
+        implementations of isHTMLAllCollection and type for Web/DOM types unknown to a pure JS context.
+
+
+        Part 4: Move all inspector scripts into JavaScriptCore and update generators.
+
+        For OS X be sure to export the scripts as if they are private headers.
+
+        * GNUmakefile.am:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/scripts/cssmin.py: Renamed from Source/WebCore/inspector/Scripts/cssmin.py.
+        * inspector/scripts/inline-and-minify-stylesheets-and-scripts.py: Renamed from Source/WebCore/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py.
+        * inspector/scripts/jsmin.py: Renamed from Source/WebCore/inspector/Scripts/jsmin.py.
+        * inspector/scripts/xxd.pl: Renamed from Source/WebCore/inspector/xxd.pl.
+
+
+        Part 3: Update CodeGeneratorInspector to avoid inlining virtual destructors.
+
+        This avoids build errors about duplicate exported virtual inlined methods
+        are included from multiple places. Just put empty destructors in the
+        implementation file instead of inlined.
+
+        * inspector/scripts/CodeGeneratorInspector.py:
+        (Generator):
+        (Generator.go):
+        * inspector/scripts/CodeGeneratorInspectorStrings.py:
+
+
+        Part 2: Move InjectedScriptSource and generation into JavaScriptCore.
+
+        Move InjectedScriptSource.js and derived sources generation.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * inspector/InjectedScriptSource.js: Renamed from Source/WebCore/inspector/InjectedScriptSource.js.
+
 2014-01-09  Balazs Kilvady  <kilvadyb@homejinni.com>
 
         Regression: failing RegExp tests on 32 bit architectures.
index 501b0f1..1156e97 100644 (file)
@@ -97,6 +97,7 @@ INSPECTOR_GENERATOR_SCRIPTS = \
 all : \
     InspectorJS.json \
     InspectorJSFrontendDispatchers.h \
+    InjectedScriptSource.h \
 #
 
 InspectorJS.json : inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS)
@@ -105,3 +106,8 @@ InspectorJS.json : inspector/scripts/generate-combined-inspector-json.py $(INSPE
 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
 InspectorJSFrontendDispatchers.h : InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS)
        python $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py ./InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type JavaScript
+
+InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore)/inspector/scripts/jsmin.py $(JavaScriptCore)/inspector/scripts/xxd.pl
+       python $(JavaScriptCore)/inspector/scripts/jsmin.py < $(JavaScriptCore)/inspector/InjectedScriptSource.js > ./InjectedScriptSource.min.js
+       perl $(JavaScriptCore)/inspector/scripts/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
+       rm -f ./InjectedScriptSource.min.js
index 159963d..31b5ee8 100644 (file)
@@ -188,13 +188,17 @@ EXTRA_DIST += \
        Source/JavaScriptCore/create_regex_tables \
        Source/JavaScriptCore/icu/LICENSE \
        Source/JavaScriptCore/icu/README \
+       Source/JavaScriptCore/inspector/InjectedScriptSource.js \
        Source/JavaScriptCore/inspector/protocol/Debugger.json \
        Source/JavaScriptCore/inspector/protocol/GenericTypes.json \
        Source/JavaScriptCore/inspector/protocol/InspectorDomain.json \
        Source/JavaScriptCore/inspector/protocol/Runtime.json \
        Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py \
        Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py \
+       Source/JavaScriptCore/inspector/scripts/cssmin.py \
        Source/JavaScriptCore/inspector/scripts/generate-combined-inspector-json.py \
+       Source/JavaScriptCore/inspector/scripts/jsmin.py \
+       Source/JavaScriptCore/inspector/scripts/xxd.pl \
        Source/JavaScriptCore/KeywordLookupGenerator.py \
        Source/JavaScriptCore/parser/Keywords.table \
        Source/JavaScriptCore/THANKS \
@@ -246,3 +250,7 @@ DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h: DerivedSources/J
 DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js
 DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h
 DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp
+
+DerivedSources/JavaScriptCore/InjectedScriptSource.h: $(JavaScriptCore)/inspector/InjectedScriptSource.js
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py <$(JavaScriptCore)/inspector/InjectedScriptSource.js > $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InjectedScriptSource_js $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.h
index 9c00f9f..2375299 100644 (file)
@@ -627,15 +627,30 @@ javascriptcore_sources += \
        Source/JavaScriptCore/icu/unicode/utf_old.h \
        Source/JavaScriptCore/icu/unicode/utypes.h \
        Source/JavaScriptCore/icu/unicode/uversion.h \
+       Source/JavaScriptCore/inspector/InjectedScript.cpp \
+       Source/JavaScriptCore/inspector/InjectedScript.h \
+       Source/JavaScriptCore/inspector/InjectedScriptBase.cpp \
+       Source/JavaScriptCore/inspector/InjectedScriptBase.h \
+       Source/JavaScriptCore/inspector/InjectedScriptHost.cpp \
+       Source/JavaScriptCore/inspector/InjectedScriptHost.h \
+       Source/JavaScriptCore/inspector/InjectedScriptManager.cpp \
+       Source/JavaScriptCore/inspector/InjectedScriptManager.h \
+       Source/JavaScriptCore/inspector/InjectedScriptModule.cpp \
+       Source/JavaScriptCore/inspector/InjectedScriptModule.h \
        Source/JavaScriptCore/inspector/InspectorAgentBase.h \
        Source/JavaScriptCore/inspector/InspectorAgentRegistry.cpp \
        Source/JavaScriptCore/inspector/InspectorAgentRegistry.h \
        Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp \
        Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h \
+       Source/JavaScriptCore/inspector/InspectorEnvironment.h \
        Source/JavaScriptCore/inspector/InspectorFrontendChannel.h \
        Source/JavaScriptCore/inspector/InspectorTypeBuilder.h \
        Source/JavaScriptCore/inspector/InspectorValues.cpp \
        Source/JavaScriptCore/inspector/InspectorValues.h \
+       Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp \
+       Source/JavaScriptCore/inspector/JSInjectedScriptHost.h \
+       Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp \
+       Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h \
        Source/JavaScriptCore/interpreter/AbstractPC.cpp \
        Source/JavaScriptCore/interpreter/AbstractPC.h \
        Source/JavaScriptCore/interpreter/CachedCall.h \
@@ -1192,6 +1207,7 @@ javascriptcore_sources += \
        Source/JavaScriptCore/yarr/YarrPattern.h \
        Source/JavaScriptCore/yarr/YarrSyntaxChecker.cpp \
        Source/JavaScriptCore/yarr/YarrSyntaxChecker.h \
+       DerivedSources/JavaScriptCore/InjectedScriptSource.h \
        DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp \
        DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h \
        DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp \
index 66c5658..6ac0464 100644 (file)
     <ClCompile Include="..\heap\WeakSet.cpp" />
     <ClCompile Include="..\heap\WriteBarrierBuffer.cpp" />
     <ClCompile Include="..\heap\WriteBarrierSupport.cpp" />
+    <ClCompile Include="..\inspector\InjectedScript.cpp" />
+    <ClCompile Include="..\inspector\InjectedScriptBase.cpp" />
+    <ClCompile Include="..\inspector\InjectedScriptHost.cpp" />
+    <ClCompile Include="..\inspector\InjectedScriptManager.cpp" />
+    <ClCompile Include="..\inspector\InjectedScriptModule.cpp" />
     <ClCompile Include="..\inspector\InspectorAgentRegistry.cpp" />
     <ClCompile Include="..\inspector\InspectorBackendDispatcher.cpp" />
     <ClCompile Include="..\inspector\InspectorValues.cpp" />
+    <ClCompile Include="..\inspector\JSInjectedScriptHost.cpp" />
+    <ClCompile Include="..\inspector\JSInjectedScriptHostPrototype.cpp" />
     <ClCompile Include="..\interpreter\AbstractPC.cpp" />
     <ClCompile Include="..\interpreter\CallFrame.cpp" />
     <ClCompile Include="..\interpreter\Interpreter.cpp" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\DatePrototype.lut.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ErrorPrototype.lut.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HeaderDetection.h" />
+    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptSource.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorJSBackendDispatchers.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorJSFrontendDispatchers.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorJSTypeBuilders.h" />
     <ClInclude Include="..\heap\WeakSetInlines.h" />
     <ClInclude Include="..\heap\WriteBarrierBuffer.h" />
     <ClInclude Include="..\heap\WriteBarrierSupport.h" />
+    <ClInclude Include="..\inspector\InjectedScript.h" />
+    <ClInclude Include="..\inspector\InjectedScriptBase.h" />
+    <ClInclude Include="..\inspector\InjectedScriptHost.h" />
+    <ClInclude Include="..\inspector\InjectedScriptManager.h" />
+    <ClInclude Include="..\inspector\InjectedScriptModule.h" />
     <ClInclude Include="..\inspector\InspectorAgentBase.h" />
     <ClInclude Include="..\inspector\InspectorAgentRegistry.h" />
     <ClInclude Include="..\inspector\InspectorBackendDispatcher.h" />
+    <ClInclude Include="..\inspector\InspectorEnvironment.h" />
     <ClInclude Include="..\inspector\InspectorFrontendChannel.h" />
     <ClInclude Include="..\inspector\InspectorTypeBuilder.h" />
     <ClInclude Include="..\inspector\InspectorValues.h" />
+    <ClInclude Include="..\inspector\JSInjectedScriptHost.h" />
+    <ClInclude Include="..\inspector\JSInjectedScriptHostPrototype.h" />
     <ClInclude Include="..\interpreter\AbstractPC.h" />
     <ClInclude Include="..\interpreter\CachedCall.h" />
     <ClInclude Include="..\interpreter\CallFrame.h" />
index 1bf8170..021a265 100644 (file)
                A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1A009C01831A22D00CF8711 /* MacroAssemblerARM64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923C156EED3B00566CB2 /* MacroAssemblerARM64.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8640923B156EED3B00566CB2 /* ARM64Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */; };
+               A513E5B8185B8BD3007E95AD /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B6185B8BD3007E95AD /* InjectedScript.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A513E5BE185BFACC007E95AD /* InjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A513E5BF185BFACC007E95AD /* JSInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */; };
+               A513E5C0185BFACC007E95AD /* JSInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */; };
+               A513E5C1185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */; };
+               A513E5C2185BFACC007E95AD /* JSInjectedScriptHostPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */; };
+               A513E5C7185F9446007E95AD /* InjectedScriptSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C6185F9436007E95AD /* InjectedScriptSource.h */; };
+               A513E5CA185F9624007E95AD /* InjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */; };
+               A513E5CB185F9624007E95AD /* InjectedScriptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C9185F9624007E95AD /* InjectedScriptManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A514B2C2185A684400F3C7CB /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */; };
+               A514B2C3185A684400F3C7CB /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A532438718568335002ED692 /* InspectorJSBackendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */; };
                A532438818568335002ED692 /* InspectorJSBackendDispatchers.h in Headers */ = {isa = PBXBuildFile; fileRef = A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A532438918568335002ED692 /* InspectorJSFrontendDispatchers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */; };
                A55D93A5185012A800400DED /* ScriptFunctionCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */; };
                A55D93A6185012A800400DED /* ScriptFunctionCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93A4185012A800400DED /* ScriptFunctionCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A55D93AC18514F7900400DED /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E20187B7B8600843B10 /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */; };
+               A5840E21187B7B8600843B10 /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E27187C981E00843B10 /* cssmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E26187C980700843B10 /* cssmin.py */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */ = {isa = PBXBuildFile; fileRef = A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E2A187CA75900843B10 /* xxd.pl in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C5185F92F0007E95AD /* xxd.pl */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E2B187CA75B00843B10 /* jsmin.py in Headers */ = {isa = PBXBuildFile; fileRef = A513E5C4185F92DC007E95AD /* jsmin.py */; settings = {ATTRIBUTES = (Private, ); }; };
+               A58E35911860DECF001F24FE /* InjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */; };
                A593CF7C1840360300BFCE27 /* InspectorBackendDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */; };
                A593CF7D1840360300BFCE27 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A593CF7F1840362C00BFCE27 /* InspectorAgentBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A5BA15ED182340B400A82E69 /* RemoteInspectorXPCConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */; };
                A5BA15EE182340B400A82E69 /* RemoteInspectorXPCConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */; };
                A5BA15F0182345AF00A82E69 /* RemoteInspectorDebuggable.h in Headers */ = {isa = PBXBuildFile; fileRef = A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5D0A1BB1862301B00C7B496 /* InspectorEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A700873917CBE85300C3E643 /* MapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873717CBE85300C3E643 /* MapConstructor.cpp */; };
                A700873A17CBE85300C3E643 /* MapConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A700873817CBE85300C3E643 /* MapConstructor.h */; };
                A700873D17CBE8D300C3E643 /* MapPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A700873B17CBE8D300C3E643 /* MapPrototype.cpp */; };
                A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = "<group>"; };
                A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; };
                A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; };
+               A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = "<group>"; };
+               A513E5B6185B8BD3007E95AD /* InjectedScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScript.h; sourceTree = "<group>"; };
+               A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptHost.h; sourceTree = "<group>"; };
+               A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHost.cpp; sourceTree = "<group>"; };
+               A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInjectedScriptHost.h; sourceTree = "<group>"; };
+               A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHostPrototype.cpp; sourceTree = "<group>"; };
+               A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInjectedScriptHostPrototype.h; sourceTree = "<group>"; };
+               A513E5C3185F92C9007E95AD /* InjectedScriptSource.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = InjectedScriptSource.js; sourceTree = "<group>"; };
+               A513E5C4185F92DC007E95AD /* jsmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = jsmin.py; sourceTree = "<group>"; };
+               A513E5C5185F92F0007E95AD /* xxd.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = xxd.pl; sourceTree = "<group>"; };
+               A513E5C6185F9436007E95AD /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = "<group>"; };
+               A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptManager.cpp; sourceTree = "<group>"; };
+               A513E5C9185F9624007E95AD /* InjectedScriptManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptManager.h; sourceTree = "<group>"; };
+               A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptBase.cpp; sourceTree = "<group>"; };
+               A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptBase.h; sourceTree = "<group>"; };
                A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSBackendDispatchers.cpp; sourceTree = "<group>"; };
                A532438218568317002ED692 /* InspectorJSBackendDispatchers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorJSBackendDispatchers.h; sourceTree = "<group>"; };
                A532438318568317002ED692 /* InspectorJSFrontendDispatchers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorJSFrontendDispatchers.cpp; sourceTree = "<group>"; };
                A55D93A3185012A800400DED /* ScriptFunctionCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptFunctionCall.cpp; sourceTree = "<group>"; };
                A55D93A4185012A800400DED /* ScriptFunctionCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFunctionCall.h; sourceTree = "<group>"; };
                A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = "<group>"; };
+               A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptModule.cpp; sourceTree = "<group>"; };
+               A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptModule.h; sourceTree = "<group>"; };
+               A5840E26187C980700843B10 /* cssmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cssmin.py; sourceTree = "<group>"; };
+               A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "inline-and-minify-stylesheets-and-scripts.py"; sourceTree = "<group>"; };
+               A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptHost.cpp; sourceTree = "<group>"; };
                A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackendDispatcher.cpp; sourceTree = "<group>"; };
                A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; };
                A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorAgentBase.h; sourceTree = "<group>"; };
                A5BA15E6182340B300A82E69 /* RemoteInspectorXPCConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorXPCConnection.h; sourceTree = "<group>"; };
                A5BA15E7182340B300A82E69 /* RemoteInspectorXPCConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteInspectorXPCConnection.mm; sourceTree = "<group>"; };
                A5BA15EF182345AF00A82E69 /* RemoteInspectorDebuggable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteInspectorDebuggable.h; sourceTree = "<group>"; };
+               A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorEnvironment.h; sourceTree = "<group>"; };
                A700873717CBE85300C3E643 /* MapConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapConstructor.cpp; sourceTree = "<group>"; };
                A700873817CBE85300C3E643 /* MapConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapConstructor.h; sourceTree = "<group>"; };
                A700873B17CBE8D300C3E643 /* MapPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MapPrototype.cpp; sourceTree = "<group>"; };
                        children = (
                                BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */,
                                BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
+                               A513E5C6185F9436007E95AD /* InjectedScriptSource.h */,
                                A53243951856A475002ED692 /* InspectorJS.json */,
                                A53243961856A475002ED692 /* InspectorJSBackendCommands.js */,
                                A532438118568317002ED692 /* InspectorJSBackendDispatchers.cpp */,
                        children = (
                                A532438F185696E6002ED692 /* CodeGeneratorInspector.py */,
                                A5324390185696E6002ED692 /* CodeGeneratorInspectorStrings.py */,
+                               A5840E26187C980700843B10 /* cssmin.py */,
                                A5324391185696E6002ED692 /* generate-combined-inspector-json.py */,
+                               A5840E28187CA5B800843B10 /* inline-and-minify-stylesheets-and-scripts.py */,
+                               A513E5C4185F92DC007E95AD /* jsmin.py */,
+                               A513E5C5185F92F0007E95AD /* xxd.pl */,
                        );
                        path = scripts;
                        sourceTree = "<group>";
                                A532438D185696CA002ED692 /* protocol */,
                                A5BA15E01823409D00A82E69 /* remote */,
                                A532438E185696CE002ED692 /* scripts */,
+                               A513E5B5185B8BD3007E95AD /* InjectedScript.cpp */,
+                               A513E5B6185B8BD3007E95AD /* InjectedScript.h */,
+                               A514B2C0185A684400F3C7CB /* InjectedScriptBase.cpp */,
+                               A514B2C1185A684400F3C7CB /* InjectedScriptBase.h */,
+                               A58E35901860DEC7001F24FE /* InjectedScriptHost.cpp */,
+                               A513E5B9185BFACC007E95AD /* InjectedScriptHost.h */,
+                               A513E5C8185F9624007E95AD /* InjectedScriptManager.cpp */,
+                               A513E5C9185F9624007E95AD /* InjectedScriptManager.h */,
+                               A5840E1E187B7B8600843B10 /* InjectedScriptModule.cpp */,
+                               A5840E1F187B7B8600843B10 /* InjectedScriptModule.h */,
+                               A513E5C3185F92C9007E95AD /* InjectedScriptSource.js */,
                                A593CF7E1840362C00BFCE27 /* InspectorAgentBase.h */,
                                A593CF84184038CA00BFCE27 /* InspectorAgentRegistry.cpp */,
                                A593CF85184038CA00BFCE27 /* InspectorAgentRegistry.h */,
                                A593CF7A1840360300BFCE27 /* InspectorBackendDispatcher.cpp */,
                                A593CF7B1840360300BFCE27 /* InspectorBackendDispatcher.h */,
+                               A5D0A1BA1862301B00C7B496 /* InspectorEnvironment.h */,
                                A5945594182479EB00CC3843 /* InspectorFrontendChannel.h */,
                                A55D93AB18514F7900400DED /* InspectorTypeBuilder.h */,
                                A593CF801840377100BFCE27 /* InspectorValues.cpp */,
                                A593CF811840377100BFCE27 /* InspectorValues.h */,
+                               A513E5BA185BFACC007E95AD /* JSInjectedScriptHost.cpp */,
+                               A513E5BB185BFACC007E95AD /* JSInjectedScriptHost.h */,
+                               A513E5BC185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp */,
+                               A513E5BD185BFACC007E95AD /* JSInjectedScriptHostPrototype.h */,
                        );
                        path = inspector;
                        sourceTree = "<group>";
                                65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */,
                                2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */,
                                2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
-                               A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
-                               A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
-                               A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
                                FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */,
+                               A532439318569709002ED692 /* CodeGeneratorInspectorStrings.py in Headers */,
+                               A532439218569709002ED692 /* CodeGeneratorInspector.py in Headers */,
                                0F24E54F17EE274900ABB217 /* TempRegisterSet.h in Headers */,
                                A7BFF3C0179868940002F462 /* DFGFiltrationResult.h in Headers */,
+                               A5840E27187C981E00843B10 /* cssmin.py in Headers */,
                                C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */,
+                               A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */,
                                C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */,
                                0F8335B81639C1EA001443B5 /* ArrayAllocationProfile.h in Headers */,
+                               A5840E29187CA5E600843B10 /* inline-and-minify-stylesheets-and-scripts.py in Headers */,
+                               A5840E2B187CA75B00843B10 /* jsmin.py in Headers */,
                                A53243981856A489002ED692 /* InspectorJS.json in Headers */,
+                               A5840E2A187CA75900843B10 /* xxd.pl in Headers */,
                                FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */,
                                A7A8AF3517ADB5F3005AB174 /* ArrayBuffer.h in Headers */,
                                FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */,
                                A7E5A3A81797432D00E893C0 /* CompilationResult.h in Headers */,
                                BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */,
                                0FDB2CEA174896C7007B3C1B /* ConcurrentJITLock.h in Headers */,
+                               A513E5C2185BFACC007E95AD /* JSInjectedScriptHostPrototype.h in Headers */,
                                BC18C3F50E16F5CD00B34460 /* config.h in Headers */,
                                144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */,
                                BC18C3F60E16F5CD00B34460 /* ConstructData.h in Headers */,
                                0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */,
                                0F2BDC491522809600CD8910 /* DFGVariableEvent.h in Headers */,
                                0F2BDC4B1522809D00CD8910 /* DFGVariableEventStream.h in Headers */,
+                               A514B2C3185A684400F3C7CB /* InjectedScriptBase.h in Headers */,
                                0FFB921E16D02F470055A5DB /* DFGVariadicFunction.h in Headers */,
+                               A5D0A1BB1862301B00C7B496 /* InspectorEnvironment.h in Headers */,
                                0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */,
                                0FC97F4218202119002C9B26 /* DFGWatchpointCollectionPhase.h in Headers */,
                                0FDB2CE8174830A2007B3C1B /* DFGWorklist.h in Headers */,
                                BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */,
                                BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
                                BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,
+                               A513E5CB185F9624007E95AD /* InjectedScriptManager.h in Headers */,
                                0F0B83AD14BCF60400885B4F /* LineInfo.h in Headers */,
                                86D3B3C310159D7F002865E7 /* LinkBuffer.h in Headers */,
                                0F431738146BAC69007E3890 /* ListableHandler.h in Headers */,
                                C21122E315DD9AB300790E3A /* MarkStackInlines.h in Headers */,
                                A5945595182479EB00CC3843 /* InspectorFrontendChannel.h in Headers */,
                                8612E4CD152389EC00C836BE /* MatchResult.h in Headers */,
+                               A5840E21187B7B8600843B10 /* InjectedScriptModule.h in Headers */,
                                BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */,
                                90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
                                0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */,
                                0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */,
                                0F24E55117EE274900ABB217 /* Repatch.h in Headers */,
                                86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */,
+                               A513E5B8185B8BD3007E95AD /* InjectedScript.h in Headers */,
                                869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */,
                                C22B31B9140577D700DB475A /* SamplingCounter.h in Headers */,
                                1429D8860ED21C3D00B89619 /* SamplingTool.h in Headers */,
                                A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */,
                                0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
                                0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
+                               A513E5BE185BFACC007E95AD /* InjectedScriptHost.h in Headers */,
                                0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
                                0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */,
                                BC18C4200E16F5CD00B34460 /* VM.h in Headers */,
                                FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */,
+                               A513E5C7185F9446007E95AD /* InjectedScriptSource.h in Headers */,
                                FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
                                0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */,
                                142E313C134FF0A600AFADB5 /* Weak.h in Headers */,
+                               A513E5C0185BFACC007E95AD /* JSInjectedScriptHost.h in Headers */,
                                14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */,
                                14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */,
                                A5BA15E8182340B300A82E69 /* RemoteInspector.h in Headers */,
                                1428082D107EC0570013E7B2 /* CallData.cpp in Sources */,
                                1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */,
                                0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */,
+                               A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */,
                                0F93329D14CA7DC30085F3C6 /* CallLinkStatus.cpp in Sources */,
                                0F73D7AE165A142D00ACAB71 /* ClosureCallStubRoutine.cpp in Sources */,
                                969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
                                A78A9778179738B8009DF744 /* DFGJITFinalizer.cpp in Sources */,
                                0FC97F3F18202119002C9B26 /* DFGJumpReplacement.cpp in Sources */,
                                A73A535A1799CD5D00170C19 /* DFGLazyJSValue.cpp in Sources */,
+                               A58E35911860DECF001F24FE /* InjectedScriptHost.cpp in Sources */,
                                A7D9A29717A0BC7400EE2618 /* DFGLICMPhase.cpp in Sources */,
                                A7D89CFB17A0B8CC00773AD8 /* DFGLivenessAnalysisPhase.cpp in Sources */,
                                0FF0F19916B729F6005DF95B /* DFGLongLivedState.cpp in Sources */,
                                0FF0F19C16B72A03005DF95B /* DFGNode.cpp in Sources */,
                                0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
                                86EC9DCF1328DF82002B2AD7 /* DFGOperations.cpp in Sources */,
+                               A514B2C2185A684400F3C7CB /* InjectedScriptBase.cpp in Sources */,
                                A7D89CFD17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.cpp in Sources */,
                                0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
                                0FD8A32517D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.cpp in Sources */,
                                0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
                                95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
                                148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */,
+                               A513E5C1185BFACC007E95AD /* JSInjectedScriptHostPrototype.cpp in Sources */,
                                0FF4275715914A20004CB9FF /* LinkBuffer.cpp in Sources */,
                                A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */,
                                FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */,
                                A54CF2F9184EAEDA00237F19 /* ScriptObject.cpp in Sources */,
                                14469DE0107EC7E700650446 /* NativeErrorConstructor.cpp in Sources */,
                                14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */,
+                               A513E5CA185F9624007E95AD /* InjectedScriptManager.cpp in Sources */,
                                148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */,
                                655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */,
                                14469DE2107EC7E700650446 /* NumberConstructor.cpp in Sources */,
                                14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */,
                                14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */,
                                A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */,
+                               A513E5BF185BFACC007E95AD /* JSInjectedScriptHost.cpp in Sources */,
                                A7CA3AEB17DA5168006538AF /* WeakMapData.cpp in Sources */,
+                               A5840E20187B7B8600843B10 /* InjectedScriptModule.cpp in Sources */,
                                A7CA3AE517DA41AE006538AF /* WeakMapPrototype.cpp in Sources */,
                                14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */,
                                0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #include "config.h"
+#include "InjectedScript.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "InjectedScript.h"
-
-#include "InjectedScriptHost.h"
-#include "InjectedScriptModule.h"
-#include "JSMainThreadExecState.h"
-#include "Node.h"
-#include <bindings/ScriptFunctionCall.h>
-#include <bindings/ScriptObject.h>
-#include <inspector/InspectorValues.h>
+#include "InspectorValues.h"
+#include "ScriptFunctionCall.h"
+#include "ScriptObject.h"
 #include <wtf/text/WTFString.h>
 
 using Inspector::TypeBuilder::Array;
-using Inspector::TypeBuilder::Debugger::FunctionDetails;
-using Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor;
-using Inspector::TypeBuilder::Runtime::RemoteObject;
 
-using namespace Inspector;
-
-namespace WebCore {
+namespace Inspector {
 
 InjectedScript::InjectedScript()
-    : InjectedScriptBase("InjectedScript")
+    : InjectedScriptBase(ASCIILiteral("InjectedScript"))
+{
+}
+
+InjectedScript::InjectedScript(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment)
+    : InjectedScriptBase(ASCIILiteral("InjectedScript"), injectedScriptObject, environment)
 {
 }
 
-InjectedScript::InjectedScript(Deprecated::ScriptObject injectedScriptObject, InspectedStateAccessCheck accessCheck)
-    : InjectedScriptBase("InjectedScript", injectedScriptObject, accessCheck)
+InjectedScript::~InjectedScript()
 {
 }
 
 void InjectedScript::evaluate(ErrorString* errorString, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "evaluate", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluate"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(expression);
     function.appendArgument(objectGroup);
     function.appendArgument(includeCommandLineAPI);
@@ -75,7 +70,7 @@ void InjectedScript::evaluate(ErrorString* errorString, const String& expression
 
 void InjectedScript::callFunctionOn(ErrorString* errorString, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "callFunctionOn", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("callFunctionOn"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
     function.appendArgument(expression);
     function.appendArgument(arguments);
@@ -84,9 +79,9 @@ void InjectedScript::callFunctionOn(ErrorString* errorString, const String& obje
     makeEvalCall(errorString, function, result, wasThrown);
 }
 
-void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<RemoteObject>* result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
+void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "evaluateOnCallFrame", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("evaluateOnCallFrame"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(callFrames);
     function.appendArgument(callFrameId);
     function.appendArgument(expression);
@@ -97,47 +92,51 @@ void InjectedScript::evaluateOnCallFrame(ErrorString* errorString, const Depreca
     makeEvalCall(errorString, function, result, wasThrown);
 }
 
-void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<FunctionDetails>* result)
+void InjectedScript::getFunctionDetails(ErrorString* errorString, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>* result)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "getFunctionDetails", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getFunctionDetails"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(functionId);
+
     RefPtr<InspectorValue> resultValue;
     makeCall(function, &resultValue);
     if (!resultValue || resultValue->type() != InspectorValue::TypeObject) {
         if (!resultValue->asString(errorString))
-            *errorString = "Internal error";
+            *errorString = ASCIILiteral("Internal error");
         return;
     }
-    *result = FunctionDetails::runtimeCast(resultValue);
+
+    *result = Inspector::TypeBuilder::Debugger::FunctionDetails::runtimeCast(resultValue);
 }
 
 void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr<Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>* properties)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "getProperties", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
     function.appendArgument(ownProperties);
 
     RefPtr<InspectorValue> result;
     makeCall(function, &result);
     if (!result || result->type() != InspectorValue::TypeArray) {
-        *errorString = "Internal error";
+        *errorString = ASCIILiteral("Internal error");
         return;
     }
+
     *properties = Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>::runtimeCast(result);
 }
 
-void InjectedScript::getInternalProperties(ErrorString* errorString, const String& objectId, RefPtr<Array<InternalPropertyDescriptor>>* properties)
+void InjectedScript::getInternalProperties(ErrorString* errorString, const String& objectId, RefPtr<Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>* properties)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "getInternalProperties", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getInternalProperties"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
 
     RefPtr<InspectorValue> result;
     makeCall(function, &result);
     if (!result || result->type() != InspectorValue::TypeArray) {
-        *errorString = "Internal error";
+        *errorString = ASCIILiteral("Internal error");
         return;
     }
-    RefPtr<Array<InternalPropertyDescriptor>> array = Array<InternalPropertyDescriptor>::runtimeCast(result);
+
+    RefPtr<Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>> array = Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>::runtimeCast(result);
     if (array->length() > 0)
         *properties = array;
 }
@@ -146,14 +145,16 @@ void InjectedScript::getInternalProperties(ErrorString* errorString, const Strin
 PassRefPtr<Array<Inspector::TypeBuilder::Debugger::CallFrame>> InjectedScript::wrapCallFrames(const Deprecated::ScriptValue& callFrames)
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "wrapCallFrames", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("wrapCallFrames"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(callFrames);
+
     bool hadException = false;
     Deprecated::ScriptValue callFramesValue = callFunctionWithEvalEnabled(function, hadException);
     ASSERT(!hadException);
     RefPtr<InspectorValue> result = callFramesValue.toInspectorValue(scriptState());
     if (result->type() == InspectorValue::TypeArray)
         return Array<Inspector::TypeBuilder::Debugger::CallFrame>::runtimeCast(result);
+
     return Array<Inspector::TypeBuilder::Debugger::CallFrame>::create();
 }
 #endif
@@ -161,15 +162,17 @@ PassRefPtr<Array<Inspector::TypeBuilder::Debugger::CallFrame>> InjectedScript::w
 PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapObject(const Deprecated::ScriptValue& value, const String& groupName, bool generatePreview) const
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapObject");
+    Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapObject"), inspectorEnvironment()->functionCallHandler());
     wrapFunction.appendArgument(value);
     wrapFunction.appendArgument(groupName);
-    wrapFunction.appendArgument(canAccessInspectedWindow());
+    wrapFunction.appendArgument(hasAccessToInspectedScriptState());
     wrapFunction.appendArgument(generatePreview);
+
     bool hadException = false;
     Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException);
     if (hadException)
-        return 0;
+        return nullptr;
+
     RefPtr<InspectorObject> rawResult = r.toInspectorValue(scriptState())->asObject();
     return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult);
 }
@@ -177,17 +180,19 @@ PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapOb
 PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), "wrapTable");
-    wrapFunction.appendArgument(canAccessInspectedWindow());
+    Deprecated::ScriptFunctionCall wrapFunction(injectedScriptObject(), ASCIILiteral("wrapTable"), inspectorEnvironment()->functionCallHandler());
+    wrapFunction.appendArgument(hasAccessToInspectedScriptState());
     wrapFunction.appendArgument(table);
     if (columns.hasNoValue())
         wrapFunction.appendArgument(false);
     else
         wrapFunction.appendArgument(columns);
+
     bool hadException = false;
     Deprecated::ScriptValue r = callFunctionWithEvalEnabled(wrapFunction, hadException);
     if (hadException)
-        return 0;
+        return nullptr;
+
     RefPtr<InspectorObject> rawResult = r.toInspectorValue(scriptState())->asObject();
     return Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(rawResult);
 }
@@ -195,19 +200,20 @@ PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> InjectedScript::wrapTa
 Deprecated::ScriptValue InjectedScript::findObjectById(const String& objectId) const
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "findObjectById", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("findObjectById"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
 
     bool hadException = false;
     Deprecated::ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException);
     ASSERT(!hadException);
+
     return resultValue;
 }
 
 void InjectedScript::inspectObject(Deprecated::ScriptValue value)
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "inspectObject", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("inspectObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(value);
     RefPtr<InspectorValue> result;
     makeCall(function, &result);
@@ -215,7 +221,7 @@ void InjectedScript::inspectObject(Deprecated::ScriptValue value)
 
 void InjectedScript::releaseObject(const String& objectId)
 {
-    Deprecated::ScriptFunctionCall function(injectedScriptObject(), "releaseObject", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("releaseObject"), inspectorEnvironment()->functionCallHandler());
     function.appendArgument(objectId);
     RefPtr<InspectorValue> result;
     makeCall(function, &result);
@@ -224,13 +230,14 @@ void InjectedScript::releaseObject(const String& objectId)
 void InjectedScript::releaseObjectGroup(const String& objectGroup)
 {
     ASSERT(!hasNoValue());
-    Deprecated::ScriptFunctionCall releaseFunction(injectedScriptObject(), "releaseObjectGroup", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall releaseFunction(injectedScriptObject(), ASCIILiteral("releaseObjectGroup"), inspectorEnvironment()->functionCallHandler());
     releaseFunction.appendArgument(objectGroup);
+
     bool hadException = false;
     callFunctionWithEvalEnabled(releaseFunction, hadException);
     ASSERT(!hadException);
 }
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
diff --git a/Source/JavaScriptCore/inspector/InjectedScript.h b/Source/JavaScriptCore/inspector/InjectedScript.h
new file mode 100644 (file)
index 0000000..ae67126
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InjectedScript_h
+#define InjectedScript_h
+
+#if ENABLE(INSPECTOR)
+
+#include "InjectedScriptBase.h"
+#include "InspectorJSTypeBuilders.h"
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace Deprecated {
+class ScriptObject;
+}
+
+namespace Inspector {
+
+class InjectedScriptModule;
+class InspectorEnvironment;
+
+class JS_EXPORT_PRIVATE InjectedScript : public InjectedScriptBase {
+public:
+    InjectedScript();
+    InjectedScript(Deprecated::ScriptObject, InspectorEnvironment*);
+    virtual ~InjectedScript();
+
+    void evaluate(ErrorString*, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
+    void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
+    void evaluateOnCallFrame(ErrorString*, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
+    void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>* result);
+    void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>* result);
+    void getInternalProperties(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor>>* result);
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>> wrapCallFrames(const Deprecated::ScriptValue&);
+#endif
+    PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const;
+    PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const;
+
+    Deprecated::ScriptValue findObjectById(const String& objectId) const;
+    void inspectObject(Deprecated::ScriptValue);
+    void releaseObject(const String& objectId);
+    void releaseObjectGroup(const String& objectGroup);
+
+private:
+    friend class InjectedScriptModule;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // InjectedScript_h
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #include "config.h"
+#include "InjectedScriptBase.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "InjectedScriptBase.h"
-
-#include "InspectorInstrumentation.h"
-#include <bindings/ScriptFunctionCall.h>
-#include <inspector/InspectorValues.h>
-#include <runtime/JSGlobalObject.h>
+#include "InspectorValues.h"
+#include "JSGlobalObject.h"
+#include "ScriptFunctionCall.h"
 #include <wtf/text/WTFString.h>
 
-using Inspector::TypeBuilder::Runtime::RemoteObject;
-
-using namespace Inspector;
-
-namespace WebCore {
+namespace Inspector {
 
 InjectedScriptBase::InjectedScriptBase(const String& name)
     : m_name(name)
-    , m_inspectedStateAccessCheck(0)
+    , m_environment(nullptr)
 {
 }
 
-InjectedScriptBase::InjectedScriptBase(const String& name, Deprecated::ScriptObject injectedScriptObject, InspectedStateAccessCheck accessCheck)
+InjectedScriptBase::InjectedScriptBase(const String& name, Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment)
     : m_name(name)
     , m_injectedScriptObject(injectedScriptObject)
-    , m_inspectedStateAccessCheck(accessCheck)
+    , m_environment(environment)
 {
 }
 
-void InjectedScriptBase::initialize(Deprecated::ScriptObject injectedScriptObject, InspectedStateAccessCheck accessCheck)
+InjectedScriptBase::~InjectedScriptBase()
+{
+}
+
+void InjectedScriptBase::initialize(Deprecated::ScriptObject injectedScriptObject, InspectorEnvironment* environment)
 {
     m_injectedScriptObject = injectedScriptObject;
-    m_inspectedStateAccessCheck = accessCheck;
+    m_environment = environment;
 }
 
-bool InjectedScriptBase::canAccessInspectedWindow() const
+bool InjectedScriptBase::hasAccessToInspectedScriptState() const
 {
-    return m_inspectedStateAccessCheck(m_injectedScriptObject.scriptState());
+    return m_environment && m_environment->canAccessInspectedScriptState(m_injectedScriptObject.scriptState());
 }
 
 const Deprecated::ScriptObject& InjectedScriptBase::injectedScriptObject() const
@@ -77,8 +76,8 @@ const Deprecated::ScriptObject& InjectedScriptBase::injectedScriptObject() const
 
 Deprecated::ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall& function, bool& hadException) const
 {
-    ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextFromExecState(m_injectedScriptObject.scriptState());
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFunction(scriptExecutionContext, name(), 1);
+    if (m_environment)
+        m_environment->willCallInjectedScriptFunction(m_injectedScriptObject.scriptState(), name(), 1);
 
     JSC::ExecState* scriptState = m_injectedScriptObject.scriptState();
     bool evalIsDisabled = false;
@@ -94,13 +93,15 @@ Deprecated::ScriptValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecat
     if (evalIsDisabled)
         scriptState->lexicalGlobalObject()->setEvalEnabled(false);
 
-    InspectorInstrumentation::didCallFunction(cookie);
+    if (m_environment)
+        m_environment->didCallInjectedScriptFunction();
+
     return resultValue;
 }
 
 void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<InspectorValue>* result)
 {
-    if (hasNoValue() || !canAccessInspectedWindow()) {
+    if (hasNoValue() || !hasAccessToInspectedScriptState()) {
         *result = InspectorValue::null();
         return;
     }
@@ -112,39 +113,43 @@ void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefP
     if (!hadException) {
         *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState());
         if (!*result)
-            *result = InspectorString::create(String::format("Object has too long reference chain(must not be longer than %d)", InspectorValue::maxDepth));
+            *result = InspectorString::create(String::format("Object has too long reference chain (must not be longer than %d)", InspectorValue::maxDepth));
     } else
         *result = InspectorString::create("Exception while making a call.");
 }
 
-void InjectedScriptBase::makeEvalCall(ErrorString* errorString, Deprecated::ScriptFunctionCall& function, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* objectResult, Inspector::TypeBuilder::OptOutput<bool>* wasThrown)
+void InjectedScriptBase::makeEvalCall(ErrorString* errorString, Deprecated::ScriptFunctionCall& function, RefPtr<TypeBuilder::Runtime::RemoteObject>* objectResult, TypeBuilder::OptOutput<bool>* wasThrown)
 {
     RefPtr<InspectorValue> result;
     makeCall(function, &result);
     if (!result) {
-        *errorString = "Internal error: result value is empty";
+        *errorString = ASCIILiteral("Internal error: result value is empty");
         return;
     }
+
     if (result->type() == InspectorValue::TypeString) {
         result->asString(errorString);
         ASSERT(errorString->length());
         return;
     }
+
     RefPtr<InspectorObject> resultPair = result->asObject();
     if (!resultPair) {
-        *errorString = "Internal error: result is not an Object";
+        *errorString = ASCIILiteral("Internal error: result is not an Object");
         return;
     }
-    RefPtr<InspectorObject> resultObj = resultPair->getObject("result");
+
+    RefPtr<InspectorObject> resultObj = resultPair->getObject(ASCIILiteral("result"));
     bool wasThrownVal = false;
-    if (!resultObj || !resultPair->getBoolean("wasThrown", &wasThrownVal)) {
-        *errorString = "Internal error: result is not a pair of value and wasThrown flag";
+    if (!resultObj || !resultPair->getBoolean(ASCIILiteral("wasThrown"), &wasThrownVal)) {
+        *errorString = ASCIILiteral("Internal error: result is not a pair of value and wasThrown flag");
         return;
     }
-    *objectResult = Inspector::TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj);
+
+    *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj);
     *wasThrown = wasThrownVal;
 }
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef InjectedScriptBase_h
 #define InjectedScriptBase_h
 
-#include "InspectorWebTypeBuilders.h"
-#include <bindings/ScriptObject.h>
+#if ENABLE(INSPECTOR)
+
+#include "InspectorEnvironment.h"
+#include "InspectorJSTypeBuilders.h"
+#include "bindings/ScriptObject.h"
 #include <wtf/Forward.h>
 #include <wtf/RefPtr.h>
 
@@ -41,43 +45,39 @@ class ScriptFunctionCall;
 }
 
 namespace Inspector {
-class InspectorValue;
-}
-
-namespace WebCore {
 
 typedef String ErrorString;
 
-#if ENABLE(INSPECTOR)
-
-class InjectedScriptBase {
+class JS_EXPORT_PRIVATE InjectedScriptBase {
 public:
-    virtual ~InjectedScriptBase() { }
+    virtual ~InjectedScriptBase();
 
     const String& name() const { return m_name; }
     bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
     JSC::ExecState* scriptState() const { return m_injectedScriptObject.scriptState(); }
 
 protected:
-    typedef bool (*InspectedStateAccessCheck)(JSC::ExecState*);
     InjectedScriptBase(const String& name);
-    InjectedScriptBase(const String& name, Deprecated::ScriptObject, InspectedStateAccessCheck);
+    InjectedScriptBase(const String& name, Deprecated::ScriptObject, InspectorEnvironment*);
+
+    InspectorEnvironment* inspectorEnvironment() const { return m_environment; }
+
+    void initialize(Deprecated::ScriptObject, InspectorEnvironment*);
+    bool hasAccessToInspectedScriptState() const;
 
-    void initialize(Deprecated::ScriptObject, InspectedStateAccessCheck);
-    bool canAccessInspectedWindow() const;
     const Deprecated::ScriptObject& injectedScriptObject() const;
     Deprecated::ScriptValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const;
-    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<Inspector::InspectorValue>* result);
-    void makeEvalCall(ErrorString*, Deprecated::ScriptFunctionCall&, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown);
+    void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<InspectorValue>* result);
+    void makeEvalCall(ErrorString*, Deprecated::ScriptFunctionCall&, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
 
 private:
     String m_name;
     Deprecated::ScriptObject m_injectedScriptObject;
-    InspectedStateAccessCheck m_inspectedStateAccessCheck;
+    InspectorEnvironment* m_environment;
 };
 
-#endif
+} // namespace Inspector
 
-} // namespace WebCore
+#endif // ENABLE(INSPECTOR)
 
-#endif
+#endif // InjectedScriptBase_h
diff --git a/Source/JavaScriptCore/inspector/InjectedScriptHost.cpp b/Source/JavaScriptCore/inspector/InjectedScriptHost.cpp
new file mode 100644 (file)
index 0000000..46b3c4e
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedScriptHost.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "JSInjectedScriptHost.h"
+
+using namespace JSC;
+
+namespace Inspector {
+
+InjectedScriptHost::~InjectedScriptHost()
+{
+}
+
+JSValue InjectedScriptHost::jsWrapper(ExecState* exec, JSGlobalObject* globalObject)
+{
+    auto key = std::make_pair(exec, globalObject);
+    auto it = m_wrappers.find(key);
+    if (it != m_wrappers.end())
+        return it->value.get();
+
+    JSValue jsValue = toJS(exec, globalObject, this);
+    if (!jsValue.isObject())
+        return jsValue;
+
+    JSObject* jsObject = jsValue.toObject(exec, globalObject);
+    Strong<JSObject> wrapper(exec->vm(), jsObject);
+    m_wrappers.add(key, wrapper);
+
+    return jsValue;
+}
+
+static void clearWrapperFromValue(JSValue value)
+{
+    JSInjectedScriptHost* jsInjectedScriptHost = toJSInjectedScriptHost(value);
+    ASSERT(jsInjectedScriptHost);
+    if (jsInjectedScriptHost)
+        jsInjectedScriptHost->releaseImpl();
+}
+
+void InjectedScriptHost::clearWrapper(ExecState* exec, JSGlobalObject* globalObject)
+{
+    auto key = std::make_pair(exec, globalObject);
+    clearWrapperFromValue(m_wrappers.take(key).get());
+}
+
+void InjectedScriptHost::clearAllWrappers()
+{
+    for (auto wrapper : m_wrappers)
+        clearWrapperFromValue(wrapper.value.get());
+
+    m_wrappers.clear();
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/JavaScriptCore/inspector/InjectedScriptHost.h b/Source/JavaScriptCore/inspector/InjectedScriptHost.h
new file mode 100644 (file)
index 0000000..db93f86
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InjectedScriptHost_h
+#define InjectedScriptHost_h
+
+#if ENABLE(INSPECTOR)
+
+#include "JSCJSValueInlines.h"
+#include "Strong.h"
+#include "StrongInlines.h"
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
+
+namespace Inspector {
+
+class JS_EXPORT_PRIVATE InjectedScriptHost : public RefCounted<InjectedScriptHost> {
+public:
+    static PassRefPtr<InjectedScriptHost> create() { return adoptRef(new InjectedScriptHost); }
+    virtual ~InjectedScriptHost();
+
+    virtual JSC::JSValue type(JSC::ExecState*, JSC::JSValue) { return JSC::jsUndefined(); }
+    virtual bool isHTMLAllCollection(JSC::JSValue) { return false; }
+
+    JSC::JSValue jsWrapper(JSC::ExecState*, JSC::JSGlobalObject*);
+    void clearWrapper(JSC::ExecState*, JSC::JSGlobalObject*);
+    void clearAllWrappers();
+
+private:
+    HashMap<std::pair<JSC::ExecState*, JSC::JSGlobalObject*>, JSC::Strong<JSC::JSObject>> m_wrappers;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(InjectedScriptHost_h)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
 
 #if ENABLE(INSPECTOR)
 
-#include "InjectedScript.h"
+#include "Completion.h"
 #include "InjectedScriptHost.h"
 #include "InjectedScriptSource.h"
-#include "PageInjectedScriptManager.h"
-#include "ScriptState.h"
-#include <bindings/ScriptObject.h>
-#include <inspector/InspectorValues.h>
-#include <wtf/PassOwnPtr.h>
+#include "InspectorValues.h"
+#include "JSInjectedScriptHost.h"
+#include "JSLock.h"
+#include "ScriptObject.h"
+#include "SourceCode.h"
 
-using namespace Inspector;
+using namespace JSC;
 
-namespace WebCore {
+namespace Inspector {
 
-PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForPage()
-{
-    return adoptPtr(new PageInjectedScriptManager(&InjectedScriptManager::canAccessInspectedWindow));
-}
-
-PassOwnPtr<InjectedScriptManager> InjectedScriptManager::createForWorker()
-{
-    return adoptPtr(new InjectedScriptManager(&InjectedScriptManager::canAccessInspectedWorkerGlobalScope));
-}
-
-InjectedScriptManager::InjectedScriptManager(InspectedStateAccessCheck accessCheck)
-    : m_nextInjectedScriptId(1)
-    , m_injectedScriptHost(InjectedScriptHost::create())
-    , m_inspectedStateAccessCheck(accessCheck)
+InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, PassRefPtr<InjectedScriptHost> injectedScriptHost)
+    : m_environment(environment)
+    , m_injectedScriptHost(injectedScriptHost)
+    , m_nextInjectedScriptId(1)
 {
 }
 
@@ -69,7 +59,8 @@ InjectedScriptManager::~InjectedScriptManager()
 
 void InjectedScriptManager::disconnect()
 {
-    m_injectedScriptHost.clear();
+    discardInjectedScripts();
+    m_injectedScriptHost = nullptr;
 }
 
 InjectedScriptHost* InjectedScriptManager::injectedScriptHost()
@@ -79,21 +70,24 @@ InjectedScriptHost* InjectedScriptManager::injectedScriptHost()
 
 InjectedScript InjectedScriptManager::injectedScriptForId(int id)
 {
-    IdToInjectedScriptMap::iterator it = m_idToInjectedScript.find(id);
+    auto it = m_idToInjectedScript.find(id);
     if (it != m_idToInjectedScript.end())
         return it->value;
-    for (ExecStateToId::iterator it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) {
+
+    for (auto it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) {
         if (it->value == id)
             return injectedScriptFor(it->key);
     }
+
     return InjectedScript();
 }
 
-int InjectedScriptManager::injectedScriptIdFor(JSC::ExecState* scriptState)
+int InjectedScriptManager::injectedScriptIdFor(ExecState* scriptState)
 {
-    ExecStateToId::iterator it = m_scriptStateToId.find(scriptState);
+    auto it = m_scriptStateToId.find(scriptState);
     if (it != m_scriptStateToId.end())
         return it->value;
+
     int id = m_nextInjectedScriptId++;
     m_scriptStateToId.set(scriptState, id);
     return id;
@@ -104,56 +98,24 @@ InjectedScript InjectedScriptManager::injectedScriptForObjectId(const String& ob
     RefPtr<InspectorValue> parsedObjectId = InspectorValue::parseJSON(objectId);
     if (parsedObjectId && parsedObjectId->type() == InspectorValue::TypeObject) {
         long injectedScriptId = 0;
-        bool success = parsedObjectId->asObject()->getNumber("injectedScriptId", &injectedScriptId);
+        bool success = parsedObjectId->asObject()->getNumber(ASCIILiteral("injectedScriptId"), &injectedScriptId);
         if (success)
             return m_idToInjectedScript.get(injectedScriptId);
     }
+
     return InjectedScript();
 }
 
 void InjectedScriptManager::discardInjectedScripts()
 {
+    m_injectedScriptHost->clearAllWrappers();
     m_idToInjectedScript.clear();
     m_scriptStateToId.clear();
 }
 
-void InjectedScriptManager::discardInjectedScriptsFor(DOMWindow* window)
-{
-    if (m_scriptStateToId.isEmpty())
-        return;
-
-    Vector<long> idsToRemove;
-    IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end();
-    for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != end; ++it) {
-        JSC::ExecState* scriptState = it->value.scriptState();
-        if (window != domWindowFromExecState(scriptState))
-            continue;
-        m_scriptStateToId.remove(scriptState);
-        idsToRemove.append(it->key);
-    }
-
-    for (size_t i = 0; i < idsToRemove.size(); i++)
-        m_idToInjectedScript.remove(idsToRemove[i]);
-
-    // Now remove script states that have id but no injected script.
-    Vector<JSC::ExecState*> scriptStatesToRemove;
-    for (ExecStateToId::iterator it = m_scriptStateToId.begin(); it != m_scriptStateToId.end(); ++it) {
-        JSC::ExecState* scriptState = it->key;
-        if (window == domWindowFromExecState(scriptState))
-            scriptStatesToRemove.append(scriptState);
-    }
-    for (size_t i = 0; i < scriptStatesToRemove.size(); i++)
-        m_scriptStateToId.remove(scriptStatesToRemove[i]);
-}
-
-bool InjectedScriptManager::canAccessInspectedWorkerGlobalScope(JSC::ExecState*)
-{
-    return true;
-}
-
 void InjectedScriptManager::releaseObjectGroup(const String& objectGroup)
 {
-    for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it)
+    for (auto it = m_idToInjectedScript.begin(); it != m_idToInjectedScript.end(); ++it)
         it->value.releaseObjectGroup(objectGroup);
 }
 
@@ -162,21 +124,52 @@ String InjectedScriptManager::injectedScriptSource()
     return String(reinterpret_cast<const char*>(InjectedScriptSource_js), sizeof(InjectedScriptSource_js));
 }
 
-InjectedScript InjectedScriptManager::injectedScriptFor(JSC::ExecState* inspectedExecState)
+Deprecated::ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ExecState* scriptState, int id)
+{
+    JSLockHolder lock(scriptState);
+
+    SourceCode sourceCode = makeSource(source);
+    JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
+    JSValue globalThisValue = scriptState->globalThisValue();
+
+    JSValue evaluationException;
+    InspectorEvaluateHandler evaluateHandler = m_environment.evaluateHandler();
+    JSValue functionValue = evaluateHandler(scriptState, sourceCode, globalThisValue, &evaluationException);
+    if (evaluationException)
+        return Deprecated::ScriptObject();
+
+    CallData callData;
+    CallType callType = getCallData(functionValue, callData);
+    if (callType == CallTypeNone)
+        return Deprecated::ScriptObject();
+
+    MarkedArgumentBuffer args;
+    args.append(m_injectedScriptHost->jsWrapper(scriptState, globalObject));
+    args.append(globalThisValue);
+    args.append(jsNumber(id));
+
+    JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
+    if (result.isObject())
+        return Deprecated::ScriptObject(scriptState, result.getObject());
+
+    return Deprecated::ScriptObject();
+}
+
+InjectedScript InjectedScriptManager::injectedScriptFor(ExecState* inspectedExecState)
 {
-    ExecStateToId::iterator it = m_scriptStateToId.find(inspectedExecState);
+    auto it = m_scriptStateToId.find(inspectedExecState);
     if (it != m_scriptStateToId.end()) {
-        IdToInjectedScriptMap::iterator it1 = m_idToInjectedScript.find(it->value);
+        auto it1 = m_idToInjectedScript.find(it->value);
         if (it1 != m_idToInjectedScript.end())
             return it1->value;
     }
 
-    if (!m_inspectedStateAccessCheck(inspectedExecState))
+    if (!m_environment.canAccessInspectedScriptState(inspectedExecState))
         return InjectedScript();
 
     int id = injectedScriptIdFor(inspectedExecState);
     Deprecated::ScriptObject injectedScriptObject = createInjectedScript(injectedScriptSource(), inspectedExecState, id);
-    InjectedScript result(injectedScriptObject, m_inspectedStateAccessCheck);
+    InjectedScript result(injectedScriptObject, &m_environment);
     m_idToInjectedScript.set(id, result);
     didCreateInjectedScript(result);
     return result;
@@ -187,6 +180,6 @@ void InjectedScriptManager::didCreateInjectedScript(InjectedScript)
     // Intentionally empty. This allows for subclasses to inject additional scripts.
 }
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,9 @@
 #ifndef InjectedScriptManager_h
 #define InjectedScriptManager_h
 
+#include "InjectedScript.h"
+#include "InjectedScriptHost.h"
+#include "InspectorEnvironment.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/text/WTFString.h>
@@ -43,59 +46,40 @@ class ExecState;
 }
 
 namespace Inspector {
-class InspectorObject;
-}
-
-namespace WebCore {
 
-class DOMWindow;
-class InjectedScript;
-class InjectedScriptHost;
-class CommandLineAPIHost;
-
-class InjectedScriptManager {
+class JS_EXPORT_PRIVATE InjectedScriptManager {
     WTF_MAKE_NONCOPYABLE(InjectedScriptManager); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<InjectedScriptManager> createForPage();
-    static PassOwnPtr<InjectedScriptManager> createForWorker();
+    InjectedScriptManager(InspectorEnvironment&, PassRefPtr<InjectedScriptHost>);
     virtual ~InjectedScriptManager();
 
     virtual void disconnect();
 
     InjectedScriptHost* injectedScriptHost();
-    virtual CommandLineAPIHost* commandLineAPIHost() const { return nullptr; }
+    InspectorEnvironment& inspectorEnvironment() const { return m_environment; }
 
     InjectedScript injectedScriptFor(JSC::ExecState*);
     InjectedScript injectedScriptForId(int);
     int injectedScriptIdFor(JSC::ExecState*);
     InjectedScript injectedScriptForObjectId(const String& objectId);
     void discardInjectedScripts();
-    void discardInjectedScriptsFor(DOMWindow*);
     void releaseObjectGroup(const String& objectGroup);
 
-    typedef bool (*InspectedStateAccessCheck)(JSC::ExecState*);
-    InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspectedStateAccessCheck; }
-
 protected:
-    explicit InjectedScriptManager(InspectedStateAccessCheck);
     virtual void didCreateInjectedScript(InjectedScript);
 
+    HashMap<int, InjectedScript> m_idToInjectedScript;
+    HashMap<JSC::ExecState*, int> m_scriptStateToId;
+
 private:
     String injectedScriptSource();
     Deprecated::ScriptObject createInjectedScript(const String& source, JSC::ExecState*, int id);
 
-    static bool canAccessInspectedWindow(JSC::ExecState*);
-    static bool canAccessInspectedWorkerGlobalScope(JSC::ExecState*);
-
-    int m_nextInjectedScriptId;
-    typedef HashMap<int, InjectedScript> IdToInjectedScriptMap;
-    IdToInjectedScriptMap m_idToInjectedScript;
+    InspectorEnvironment& m_environment;
     RefPtr<InjectedScriptHost> m_injectedScriptHost;
-    InspectedStateAccessCheck m_inspectedStateAccessCheck;
-    typedef HashMap<JSC::ExecState*, int> ExecStateToId;
-    ExecStateToId m_scriptStateToId;
+    int m_nextInjectedScriptId;
 };
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // !defined(InjectedScriptManager_h)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #include "config.h"
+#include "InjectedScriptModule.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "InjectedScriptModule.h"
-
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
-#include "JSMainThreadExecState.h"
-#include <bindings/ScriptFunctionCall.h>
-#include <bindings/ScriptObject.h>
-
-using namespace Inspector;
+#include "ScriptFunctionCall.h"
+#include "ScriptObject.h"
 
-namespace WebCore {
+namespace Inspector {
 
 InjectedScriptModule::InjectedScriptModule(const String& name)
     : InjectedScriptBase(name)
 {
 }
 
+InjectedScriptModule::~InjectedScriptModule()
+{
+}
+
 void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, JSC::ExecState* scriptState)
 {
     InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(scriptState);
@@ -62,13 +63,13 @@ void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptM
         return;
 
     // FIXME: Make the InjectedScript a module itself.
-    Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), "module", WebCore::functionCallHandlerFromAnyThread);
+    Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("module"), injectedScriptManager->inspectorEnvironment().functionCallHandler());
     function.appendArgument(name());
     bool hadException = false;
     Deprecated::ScriptValue resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException);
     ASSERT(!hadException);
     if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) {
-        Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), "injectModule", WebCore::functionCallHandlerFromAnyThread);
+        Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("injectModule"), injectedScriptManager->inspectorEnvironment().functionCallHandler());
         function.appendArgument(name());
         function.appendArgument(source());
         function.appendArgument(host(injectedScriptManager, injectedScript.scriptState()));
@@ -81,10 +82,10 @@ void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptM
 
     if (returnsObject()) {
         Deprecated::ScriptObject moduleObject(injectedScript.scriptState(), resultValue);
-        initialize(moduleObject, injectedScriptManager->inspectedStateAccessCheck());
+        initialize(moduleObject, &injectedScriptManager->inspectorEnvironment());
     }
 }
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -31,9 +32,7 @@
 #ifndef InjectedScriptModule_h
 #define InjectedScriptModule_h
 
-#include "InjectedScript.h"
 #include "InjectedScriptBase.h"
-#include "ScriptState.h"
 #include <wtf/text/WTFString.h>
 
 #if ENABLE(INSPECTOR)
@@ -42,12 +41,14 @@ namespace JSC {
 class JSValue;
 }
 
-namespace WebCore {
+namespace Inspector {
 
+class InjectedScript;
 class InjectedScriptManager;
 
-class InjectedScriptModule : public InjectedScriptBase {
+class JS_EXPORT_PRIVATE InjectedScriptModule : public InjectedScriptBase {
 public:
+    virtual ~InjectedScriptModule();
     virtual String source() const = 0;
     virtual JSC::JSValue host(InjectedScriptManager*, JSC::ExecState*) const = 0;
     virtual bool returnsObject() const = 0;
@@ -61,8 +62,8 @@ protected:
     void ensureInjected(InjectedScriptManager*, InjectedScript);
 };
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
 
-#endif
+#endif // InjectedScriptModule_h
diff --git a/Source/JavaScriptCore/inspector/InspectorEnvironment.h b/Source/JavaScriptCore/inspector/InspectorEnvironment.h
new file mode 100644 (file)
index 0000000..327a9f8
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorEnvironment_h
+#define InspectorEnvironment_h
+
+#include "CallData.h"
+
+namespace JSC {
+class SourceCode;
+}
+
+namespace Inspector {
+
+typedef JSC::JSValue (*InspectorFunctionCallHandler)(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData& callData, JSC::JSValue thisValue, const JSC::ArgList& args);
+typedef JSC::JSValue (*InspectorEvaluateHandler)(JSC::ExecState*, const JSC::SourceCode&, JSC::JSValue thisValue, JSC::JSValue* exception);
+
+class InspectorEnvironment {
+public:
+    virtual ~InspectorEnvironment() { }
+    virtual bool developerExtrasEnabled() const = 0;
+    virtual bool canAccessInspectedScriptState(JSC::ExecState*) const = 0;
+    virtual InspectorFunctionCallHandler functionCallHandler() const = 0;
+    virtual InspectorEvaluateHandler evaluateHandler() const = 0;
+    virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) = 0;
+    virtual void didCallInjectedScriptFunction() = 0;
+};
+
+} // namespace Inspector
+
+#endif // !defined(InspectorEnvironment_h)
@@ -1,63 +1,93 @@
 /*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2010-2011 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:
+ * 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.
  *
- *     * 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
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
+#include "JSInjectedScriptHost.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "JSInjectedScriptHost.h"
-
-#include "ExceptionCode.h"
+#include "DateInstance.h"
+#include "Error.h"
 #include "InjectedScriptHost.h"
-#include "JSHTMLAllCollection.h"
-#include "JSHTMLCollection.h"
-#include "JSNode.h"
-#include "JSNodeList.h"
-#include <bindings/ScriptValue.h>
-#include <parser/SourceCode.h>
-#include <runtime/DateInstance.h>
-#include <runtime/Error.h>
-#include <runtime/JSArray.h>
-#include <runtime/JSFunction.h>
-#include <runtime/JSLock.h>
-#include <runtime/JSTypedArrays.h>
-#include <runtime/ObjectConstructor.h>
-#include <runtime/Operations.h>
-#include <runtime/RegExpObject.h>
-#include <runtime/TypedArrayInlines.h>
+#include "JSArray.h"
+#include "JSFunction.h"
+#include "JSInjectedScriptHostPrototype.h"
+#include "JSTypedArrays.h"
+#include "ObjectConstructor.h"
+#include "Operations.h"
+#include "RegExpObject.h"
+#include "SourceCode.h"
+#include "TypedArrayInlines.h"
 
 using namespace JSC;
 
-namespace WebCore {
+namespace Inspector {
+
+const ClassInfo JSInjectedScriptHost::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHost) };
+
+JSInjectedScriptHost::JSInjectedScriptHost(VM& vm, Structure* structure, PassRefPtr<InjectedScriptHost> impl)
+    : JSDestructibleObject(vm, structure)
+    , m_impl(impl.leakRef())
+{
+}
+
+void JSInjectedScriptHost::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+}
+
+JSObject* JSInjectedScriptHost::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return JSInjectedScriptHostPrototype::create(vm, globalObject, JSInjectedScriptHostPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+void JSInjectedScriptHost::destroy(JSC::JSCell* cell)
+{
+    JSInjectedScriptHost* thisObject = static_cast<JSInjectedScriptHost*>(cell);
+    thisObject->JSInjectedScriptHost::~JSInjectedScriptHost();
+}
+
+void JSInjectedScriptHost::releaseImpl()
+{
+    if (m_impl) {
+        m_impl->deref();
+        m_impl = nullptr;
+    }
+}
+
+JSInjectedScriptHost::~JSInjectedScriptHost()
+{
+    releaseImpl();
+}
+
+JSValue JSInjectedScriptHost::evaluate(ExecState* exec) const
+{
+    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
+    return globalObject->evalFunction();
+}
 
 JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec)
 {
@@ -66,7 +96,7 @@ JSValue JSInjectedScriptHost::internalConstructorName(ExecState* exec)
 
     JSObject* thisObject = jsCast<JSObject*>(exec->uncheckedArgument(0).toThis(exec, NotStrictMode));
     String result = thisObject->methodTable()->className(thisObject);
-    return jsStringWithCache(exec, result);
+    return jsString(exec, result);
 }
 
 JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec)
@@ -75,7 +105,7 @@ JSValue JSInjectedScriptHost::isHTMLAllCollection(ExecState* exec)
         return jsUndefined();
 
     JSValue value = exec->uncheckedArgument(0);
-    return jsBoolean(value.inherits(JSHTMLAllCollection::info()));
+    return jsBoolean(impl().isHTMLAllCollection(value));
 }
 
 JSValue JSInjectedScriptHost::type(ExecState* exec)
@@ -86,22 +116,17 @@ JSValue JSInjectedScriptHost::type(ExecState* exec)
     JSValue value = exec->uncheckedArgument(0);
     if (value.isString())
         return exec->vm().smallStrings.stringString();
-    if (value.inherits(JSArray::info()))
-        return jsNontrivialString(exec, ASCIILiteral("array"));
     if (value.isBoolean())
         return exec->vm().smallStrings.booleanString();
     if (value.isNumber())
         return exec->vm().smallStrings.numberString();
+
+    if (value.inherits(JSArray::info()))
+        return jsNontrivialString(exec, ASCIILiteral("array"));
     if (value.inherits(DateInstance::info()))
         return jsNontrivialString(exec, ASCIILiteral("date"));
     if (value.inherits(RegExpObject::info()))
         return jsNontrivialString(exec, ASCIILiteral("regexp"));
-    if (value.inherits(JSNode::info()))
-        return jsNontrivialString(exec, ASCIILiteral("node"));
-    if (value.inherits(JSNodeList::info()))
-        return jsNontrivialString(exec, ASCIILiteral("array"));
-    if (value.inherits(JSHTMLCollection::info()))
-        return jsNontrivialString(exec, ASCIILiteral("array"));
     if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info()))
         return jsNontrivialString(exec, ASCIILiteral("array"));
     if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info()))
@@ -109,55 +134,72 @@ JSValue JSInjectedScriptHost::type(ExecState* exec)
     if (value.inherits(JSFloat32Array::info()) || value.inherits(JSFloat64Array::info()))
         return jsNontrivialString(exec, ASCIILiteral("array"));
 
-    return jsUndefined();
+    return impl().type(exec, value);
 }
 
 JSValue JSInjectedScriptHost::functionDetails(ExecState* exec)
 {
     if (exec->argumentCount() < 1)
         return jsUndefined();
+
     JSValue value = exec->uncheckedArgument(0);
     if (!value.asCell()->inherits(JSFunction::info()))
         return jsUndefined();
-    JSFunction* function = jsCast<JSFunction*>(value);
 
+    JSFunction* function = jsCast<JSFunction*>(value);
     const SourceCode* sourceCode = function->sourceCode();
     if (!sourceCode)
         return jsUndefined();
+
     int lineNumber = sourceCode->firstLine();
     if (lineNumber)
         lineNumber -= 1; // In the inspector protocol all positions are 0-based while in SourceCode they are 1-based
-    String scriptID = String::number(sourceCode->provider()->asID());
 
+    String scriptID = String::number(sourceCode->provider()->asID());
     JSObject* location = constructEmptyObject(exec);
     location->putDirect(exec->vm(), Identifier(exec, "lineNumber"), jsNumber(lineNumber));
     location->putDirect(exec->vm(), Identifier(exec, "scriptId"), jsString(exec, scriptID));
 
     JSObject* result = constructEmptyObject(exec);
     result->putDirect(exec->vm(), Identifier(exec, "location"), location);
+
     String name = function->name(exec);
     if (!name.isEmpty())
-        result->putDirect(exec->vm(), Identifier(exec, "name"), jsStringWithCache(exec, name));
+        result->putDirect(exec->vm(), Identifier(exec, "name"), jsString(exec, name));
+
     String displayName = function->displayName(exec);
     if (!displayName.isEmpty())
-        result->putDirect(exec->vm(), Identifier(exec, "displayName"), jsStringWithCache(exec, displayName));
+        result->putDirect(exec->vm(), Identifier(exec, "displayName"), jsString(exec, displayName));
+
     // FIXME: provide function scope data in "scopesRaw" property when JSC supports it.
-    //     https://bugs.webkit.org/show_bug.cgi?id=87192
+    // <https://webkit.org/b/87192> [JSC] expose function (closure) inner context to debugger
+
     return result;
 }
 
 JSValue JSInjectedScriptHost::getInternalProperties(ExecState*)
 {
-    // FIXME: implement this. https://bugs.webkit.org/show_bug.cgi?id=94533
+    // FIXME: <https://webkit.org/b/94533> [JSC] expose object inner properties to debugger
     return jsUndefined();
 }
 
-JSValue JSInjectedScriptHost::evaluate(ExecState* exec) const
+JSValue toJS(ExecState* exec, JSGlobalObject* globalObject, InjectedScriptHost* impl)
 {
-    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
-    return globalObject->evalFunction();
+    if (!impl)
+        return jsNull();
+
+    JSObject* prototype = JSInjectedScriptHost::createPrototype(exec->vm(), globalObject);
+    Structure* structure = JSInjectedScriptHost::createStructure(exec->vm(), globalObject, prototype);
+    JSInjectedScriptHost* injectedScriptHost = JSInjectedScriptHost::create(exec->vm(), structure, impl);
+
+    return injectedScriptHost;
+}
+
+JSInjectedScriptHost* toJSInjectedScriptHost(JSValue value)
+{
+    return value.inherits(JSInjectedScriptHost::info()) ? jsCast<JSInjectedScriptHost*>(value) : nullptr;
 }
 
-} // namespace WebCore
+} // namespace Inspector
 
 #endif // ENABLE(INSPECTOR)
diff --git a/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h b/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h
new file mode 100644 (file)
index 0000000..199dfca
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSInjectedScriptHost_h
+#define JSInjectedScriptHost_h
+
+#if ENABLE(INSPECTOR)
+
+#include "JSDestructibleObject.h"
+
+namespace Inspector {
+
+class InjectedScriptHost;
+
+class JSInjectedScriptHost : public JSC::JSDestructibleObject {
+public:
+    typedef JSC::JSDestructibleObject Base;
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+    static JSInjectedScriptHost* create(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<InjectedScriptHost> impl)
+    {
+        JSInjectedScriptHost* instance = new (NotNull, JSC::allocateCell<JSInjectedScriptHost>(vm.heap)) JSInjectedScriptHost(vm, structure, impl);
+        instance->finishCreation(vm);
+        return instance;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+    static void destroy(JSC::JSCell*);
+
+    InjectedScriptHost& impl() const { return *m_impl; }
+    void releaseImpl();
+
+    // Attributes.
+    JSC::JSValue evaluate(JSC::ExecState*) const;
+
+    // Functions.
+    JSC::JSValue internalConstructorName(JSC::ExecState*);
+    JSC::JSValue isHTMLAllCollection(JSC::ExecState*);
+    JSC::JSValue type(JSC::ExecState*);
+    JSC::JSValue functionDetails(JSC::ExecState*);
+    JSC::JSValue getInternalProperties(JSC::ExecState*);
+
+protected:
+    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags;
+
+    void finishCreation(JSC::VM&);
+
+private:
+    JSInjectedScriptHost(JSC::VM&, JSC::Structure*, PassRefPtr<InjectedScriptHost>);
+    ~JSInjectedScriptHost();
+
+    InjectedScriptHost* m_impl;
+};
+
+JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, InjectedScriptHost*);
+JSInjectedScriptHost* toJSInjectedScriptHost(JSC::JSValue);
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(JSInjectedScriptHost_h)
diff --git a/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp b/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp
new file mode 100644 (file)
index 0000000..12c7a50
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSInjectedScriptHostPrototype.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Error.h"
+#include "GetterSetter.h"
+#include "Identifier.h"
+#include "InjectedScriptHost.h"
+#include "JSCJSValueInlines.h"
+#include "JSFunction.h"
+#include "JSInjectedScriptHost.h"
+
+using namespace JSC;
+
+namespace Inspector {
+
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState*);
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState*);
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*);
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*);
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*);
+
+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*);
+
+const ClassInfo JSInjectedScriptHostPrototype::s_info = { "InjectedScriptHost", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSInjectedScriptHostPrototype) };
+
+void JSInjectedScriptHostPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+    vm.prototypeMap.addPrototype(this);
+
+    JSC_NATIVE_FUNCTION("type", jsInjectedScriptHostPrototypeFunctionType, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("functionDetails", jsInjectedScriptHostPrototypeFunctionFunctionDetails, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("getInternalProperties", jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("internalConstructorName", jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1);
+    JSC_NATIVE_FUNCTION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1);
+
+    Identifier evaluateIdentifier(&vm, "evaluate");
+    GetterSetter* accessor = GetterSetter::create(vm);
+    JSFunction* function = JSFunction::create(vm, globalObject, 0, evaluateIdentifier.string(), jsInjectedScriptHostPrototypeAttributeEvaluate);
+    accessor->setGetter(vm, function);
+    putDirectNonIndexAccessor(vm, evaluateIdentifier, accessor, DontEnum | Accessor);
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->evaluate(exec));
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->internalConstructorName(exec));
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->isHTMLAllCollection(exec));
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionType(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->type(exec));
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->functionDetails(exec));
+}
+
+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis->getInternalProperties(exec));
+}
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h b/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.h
new file mode 100644 (file)
index 0000000..9d0b7b6
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSInjectedScriptHostPrototype_h
+#define JSInjectedScriptHostPrototype_h
+
+#if ENABLE(INSPECTOR)
+
+#include "JSObject.h"
+
+namespace Inspector {
+
+class JSInjectedScriptHostPrototype : public JSC::JSNonFinalObject {
+public:
+    typedef JSC::JSNonFinalObject Base;
+
+    DECLARE_INFO;
+
+    static JSInjectedScriptHostPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSInjectedScriptHostPrototype* ptr = new (NotNull, JSC::allocateCell<JSInjectedScriptHostPrototype>(vm.heap)) JSInjectedScriptHostPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm, globalObject);
+        return ptr;
+    }
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+protected:
+    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+
+private:
+    JSInjectedScriptHostPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+    void finishCreation(JSC::VM&, JSC::JSGlobalObject*);
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(JSInjectedScriptHostPrototype_h)
index fbbfff2..9a870c0 100755 (executable)
@@ -1876,6 +1876,7 @@ class Generator:
     backend_js_domain_initializer_list = []
 
     backend_handler_interface_list = []
+    backend_handler_implementation_list = []
     backend_dispatcher_interface_list = []
     type_builder_fragments = []
     type_builder_forwards = []
@@ -1890,6 +1891,7 @@ class Generator:
         first_cycle_guardable_list_list = [
             Generator.backend_method_implementation_list,
             Generator.backend_handler_interface_list,
+            Generator.backend_handler_implementation_list,
             Generator.backend_dispatcher_interface_list]
 
         for json_domain in json_api["domains"]:
@@ -1961,9 +1963,11 @@ class Generator:
                     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("    virtual ~%s();\n" % agent_interface_name)
                 Generator.backend_handler_interface_list.append("};\n\n")
 
+                Generator.backend_handler_implementation_list.append("%s::~%s() { }\n" % (agent_interface_name, agent_interface_name))
+
                 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)
@@ -2471,6 +2475,7 @@ backend_h_file.write(Templates.backend_h.substitute(None,
 
 backend_cpp_file.write(Templates.backend_cpp.substitute(None,
     outputFileNamePrefix=output_file_name_prefix,
+    handlerImplementations="".join(flatten_list(Generator.backend_handler_implementation_list)),
     methods="\n".join(Generator.backend_method_implementation_list)))
 
 frontend_h_file.write(Templates.frontend_h.substitute(None,
index a6ee8a3..f13be8a 100644 (file)
@@ -531,7 +531,6 @@ set(WebCore_IDL_FILES
     html/canvas/WebGLVertexArrayObjectOES.idl
 
     inspector/CommandLineAPIHost.idl
-    inspector/InjectedScriptHost.idl
     inspector/InspectorFrontendHost.idl
     inspector/JavaScriptCallFrame.idl
     inspector/ScriptProfile.idl
@@ -1583,12 +1582,7 @@ set(WebCore_SOURCES
     inspector/DOMEditor.cpp
     inspector/DOMPatchSupport.cpp
     inspector/IdentifiersFactory.cpp
-    inspector/InjectedScript.cpp
-    inspector/InjectedScriptBase.cpp
     inspector/InjectedScriptCanvasModule.cpp
-    inspector/InjectedScriptHost.cpp
-    inspector/InjectedScriptManager.cpp
-    inspector/InjectedScriptModule.cpp
     inspector/InspectorAgent.cpp
     inspector/InspectorApplicationCacheAgent.cpp
     inspector/InspectorCSSAgent.cpp
@@ -1610,6 +1604,7 @@ set(WebCore_SOURCES
     inspector/InspectorIndexedDBAgent.cpp
     inspector/InspectorInputAgent.cpp
     inspector/InspectorInstrumentation.cpp
+    inspector/InspectorInstrumentationCookie.cpp
     inspector/InspectorLayerTreeAgent.cpp
     inspector/InspectorMemoryAgent.cpp
     inspector/InspectorNodeFinder.cpp
@@ -1626,6 +1621,7 @@ set(WebCore_SOURCES
     inspector/NetworkResourcesData.cpp
     inspector/PageConsoleAgent.cpp
     inspector/PageDebuggerAgent.cpp
+    inspector/PageInjectedScriptHost.cpp
     inspector/PageInjectedScriptManager.cpp
     inspector/PageRuntimeAgent.cpp
     inspector/ScriptArguments.cpp
@@ -3085,32 +3081,21 @@ list(APPEND WebCore_SOURCES
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html
     MAIN_DEPENDENCY inspector/InspectorOverlayPage.html
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py
+    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${WebCore_INSPECTOR_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py
     DEPENDS inspector/InspectorOverlayPage.css inspector/InspectorOverlayPage.js
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py ${WEBCORE_DIR}/inspector/InspectorOverlayPage.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InspectorOverlayPage_html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h
+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/inline-and-minify-stylesheets-and-scripts.py ${WEBCORE_DIR}/inspector/InspectorOverlayPage.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html
+    COMMAND ${PERL_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InspectorOverlayPage_html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.combined.html ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h
     VERBATIM)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorOverlayPage.h)
 
 
-# Generate InjectedScriptSource.h
-add_custom_command(
-    OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.h ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.min.js
-    MAIN_DEPENDENCY inspector/InjectedScriptSource.js
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/jsmin.py
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/jsmin.py < ${WEBCORE_DIR}/inspector/InjectedScriptSource.js > ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.min.js
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InjectedScriptSource_js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.h
-    VERBATIM)
-list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptSource.h)
-
-
 # Generate CommandLineAPIModuleSource.h
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.h ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js
     MAIN_DEPENDENCY inspector/CommandLineAPIModuleSource.js
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/jsmin.py
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/jsmin.py < ${WEBCORE_DIR}/inspector/CommandLineAPIModuleSource.js > ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl CommandLineAPIModuleSource_js ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.h
+    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${WEBCORE_DIR}/inspector/CommandLineAPIModuleSource.js > ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js
+    COMMAND ${PERL_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl CommandLineAPIModuleSource_js ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.h
     VERBATIM)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleSource.h)
 
@@ -3119,9 +3104,9 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/CommandLineAPIModuleS
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.min.js
     MAIN_DEPENDENCY inspector/InjectedScriptCanvasModuleSource.js
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/jsmin.py
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/jsmin.py < ${WEBCORE_DIR}/inspector/InjectedScriptCanvasModuleSource.js > ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.min.js
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl InjectedScriptCanvasModuleSource_js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h
+    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${WEBCORE_DIR}/inspector/InjectedScriptCanvasModuleSource.js > ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.min.js
+    COMMAND ${PERL_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl InjectedScriptCanvasModuleSource_js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h
     VERBATIM)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/InjectedScriptCanvasModuleSource.h)
 
@@ -3134,9 +3119,9 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/ColorData.cpp)
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerCSS.h ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.css
     MAIN_DEPENDENCY xml/XMLViewer.css
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/cssmin.py
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/cssmin.py < ${WEBCORE_DIR}/xml/XMLViewer.css > ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.css
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl XMLViewer_css ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.css ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerCSS.h
+    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${WebCore_INSPECTOR_SCRIPTS_DIR}/cssmin.py
+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/cssmin.py < ${WEBCORE_DIR}/xml/XMLViewer.css > ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.css
+    COMMAND ${PERL_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl XMLViewer_css ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.css ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerCSS.h
     VERBATIM)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerCSS.h)
 
@@ -3145,9 +3130,9 @@ list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerCSS.h)
 add_custom_command(
     OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerJS.h ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.js
     MAIN_DEPENDENCY xml/XMLViewer.js
-    DEPENDS ${WEBCORE_DIR}/inspector/xxd.pl ${WEBCORE_DIR}/inspector/Scripts/jsmin.py
-    COMMAND ${PYTHON_EXECUTABLE} ${WEBCORE_DIR}/inspector/Scripts/jsmin.py < ${WEBCORE_DIR}/xml/XMLViewer.js > ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.js
-    COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/inspector/xxd.pl XMLViewer_js ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerJS.h
+    DEPENDS ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py
+    COMMAND ${PYTHON_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/jsmin.py < ${WEBCORE_DIR}/xml/XMLViewer.js > ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.js
+    COMMAND ${PERL_EXECUTABLE} ${WebCore_INSPECTOR_SCRIPTS_DIR}/xxd.pl XMLViewer_js ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewer.min.js ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerJS.h
     VERBATIM)
 list(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/XMLViewerJS.h)
 
index b8b15ec..f1caf4c 100644 (file)
@@ -1,3 +1,176 @@
+2014-01-09  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Move InjectedScript classes into JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=126598
+
+        Part 6: Put it all together. Make WebCore use the JavaScriptCore InjectedScript files.
+
+        Reviewed by Timothy Hatcher.
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.list.am:
+        * UseJSC.cmake:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        Remove old InjectedScript files.
+
+        * ForwardingHeaders/inspector/InjectedScript.h: Added.
+        * ForwardingHeaders/inspector/InjectedScriptBase.h: Added.
+        * ForwardingHeaders/inspector/InjectedScriptHost.h: Added.
+        * ForwardingHeaders/inspector/InjectedScriptManager.h: Added.
+        * ForwardingHeaders/inspector/InjectedScriptModule.h: Added.
+        * ForwardingHeaders/inspector/InspectorEnvironment.h: Added.
+        Expose headers to WebCore.
+
+        * inspector/InspectorController.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::developerExtrasEnabled):
+        (WebCore::InspectorController::canAccessInspectedScriptState):
+        (WebCore::InspectorController::functionCallHandler):
+        (WebCore::InspectorController::evaluateHandler):
+        (WebCore::InspectorController::willCallInjectedScriptFunction):
+        (WebCore::InspectorController::didCallInjectedScriptFunction):
+        * inspector/WorkerInspectorController.h:
+        * inspector/WorkerInspectorController.cpp:
+        (WebCore::WorkerInspectorController::WorkerInspectorController):
+        (WebCore::WorkerInspectorController::functionCallHandler):
+        (WebCore::WorkerInspectorController::evaluateHandler):
+        (WebCore::WorkerInspectorController::willCallInjectedScriptFunction):
+        (WebCore::WorkerInspectorController::didCallInjectedScriptFunction):
+        Make both InspectorControllers in WebCore be InspectorEnvironments.
+
+        * bindings/js/JSMainThreadExecState.h:
+        * bindings/js/JSMainThreadExecState.cpp:
+        (WebCore::evaluateHandlerFromAnyThread):
+        Make JSC::evaluate wrapper like the existing JSC::call wrapper.
+        These will be the ScriptFunctionCall implementations when debugging
+        a WebCore::Page or worker, instead of the pure JSC versions.
+
+        * inspector/PageInjectedScriptHost.h: Copied from Source/WebCore/inspector/CommandLineAPIModule.h.
+        * inspector/PageInjectedScriptHost.cpp: Copied from Source/WebCore/inspector/PageInjectedScriptManager.cpp.
+        (WebCore::PageInjectedScriptHost::type):
+        (WebCore::PageInjectedScriptHost::isHTMLAllCollection):
+        WebCore InjectedScriptHost implementation for DOM type handling.
+
+        * inspector/PageInjectedScriptManager.h:
+        * inspector/PageInjectedScriptManager.cpp:
+        (WebCore::PageInjectedScriptManager::PageInjectedScriptManager):
+        (WebCore::PageInjectedScriptManager::discardInjectedScriptsFor):
+        WebCore InjectedScriptManager implementation for CommandLineAPI and
+        specialized DOMWindow injected script management.
+
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * inspector/CommandLineAPIHost.cpp:
+        * inspector/CommandLineAPIHost.h:
+        * inspector/CommandLineAPIModule.cpp:
+        (WebCore::CommandLineAPIModule::host):
+        * inspector/CommandLineAPIModule.h:
+        * inspector/ConsoleMessage.cpp:
+        (WebCore::ConsoleMessage::addToFrontend):
+        * inspector/ConsoleMessage.h:
+        * inspector/InjectedScriptCanvasModule.cpp:
+        (WebCore::InjectedScriptCanvasModule::InjectedScriptCanvasModule):
+        * inspector/InjectedScriptCanvasModule.h:
+        * inspector/InspectorAllInOne.cpp:
+        * inspector/InspectorCanvasAgent.cpp:
+        * inspector/InspectorCanvasAgent.h:
+        (WebCore::InspectorCanvasAgent::create):
+        * inspector/InspectorConsoleAgent.cpp:
+        (WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
+        * inspector/InspectorConsoleAgent.h:
+        * inspector/InspectorDOMAgent.cpp:
+        * inspector/InspectorDOMAgent.h:
+        (WebCore::InspectorDOMAgent::create):
+        * inspector/InspectorDebuggerAgent.cpp:
+        * inspector/InspectorDebuggerAgent.h:
+        (WebCore::InspectorDebuggerAgent::injectedScriptManager):
+        * inspector/InspectorHeapProfilerAgent.cpp:
+        (WebCore::InspectorHeapProfilerAgent::create):
+        (WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
+        * inspector/InspectorHeapProfilerAgent.h:
+        * inspector/InspectorIndexedDBAgent.cpp:
+        * inspector/InspectorIndexedDBAgent.h:
+        (WebCore::InspectorIndexedDBAgent::create):
+        * inspector/InspectorPageAgent.cpp:
+        * inspector/InspectorPageAgent.h:
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::PageProfilerAgent::PageProfilerAgent):
+        (WebCore::InspectorProfilerAgent::create):
+        (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
+        (WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
+        * inspector/InspectorProfilerAgent.h:
+        * inspector/InspectorRuntimeAgent.cpp:
+        * inspector/InspectorRuntimeAgent.h:
+        (WebCore::InspectorRuntimeAgent::injectedScriptManager):
+        * inspector/PageConsoleAgent.cpp:
+        (WebCore::PageConsoleAgent::PageConsoleAgent):
+        * inspector/PageConsoleAgent.h:
+        (WebCore::PageConsoleAgent::create):
+        * inspector/PageDebuggerAgent.cpp:
+        * inspector/PageDebuggerAgent.h:
+        * inspector/PageRuntimeAgent.cpp:
+        * inspector/PageRuntimeAgent.h:
+        (WebCore::PageRuntimeAgent::create):
+        * inspector/WorkerConsoleAgent.cpp:
+        (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
+        * inspector/WorkerConsoleAgent.h:
+        (WebCore::WorkerConsoleAgent::create):
+        * inspector/WorkerDebuggerAgent.cpp:
+        * inspector/WorkerDebuggerAgent.h:
+        * inspector/WorkerRuntimeAgent.cpp:
+        * inspector/WorkerRuntimeAgent.h:
+        (WebCore::WorkerRuntimeAgent::create):
+        Switch to using the Inspector namespace and JSC InjectedScript files.
+
+        * bindings/js/JSInjectedScriptManager.cpp: Removed.
+        * inspector/InjectedScript.h: Removed.
+        * inspector/InjectedScriptHost.cpp: Removed.
+        * inspector/InjectedScriptHost.h: Removed.
+        * inspector/InjectedScriptHost.idl: Removed.
+
+
+        Part 4: Move all inspector scripts into JavaScriptCore and update generators.
+
+        With the updated location switch to using the appropriate INSPECTOR_SCRIPTS_DIR
+        variable which defines where the scripts are.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
+
+        Part 1: Extract InspectorInstrumentationCookie class from InspectorInstrumentation.
+
+        Currently InjectedScriptBase uses InspectorInstrumentation directly
+        to track calling into JavaScript for timeline purposes. We will remove
+        the direct call from InjectedScriptBase and extracting the Cookie class
+        will make that easier.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/InspectorAllInOne.cpp:
+        * inspector/InspectorInstrumentation.cpp:
+        * inspector/InspectorInstrumentation.h:
+        * inspector/InspectorInstrumentationCookie.cpp: Added.
+        (WebCore::InspectorInstrumentationCookie::InspectorInstrumentationCookie):
+        (WebCore::InspectorInstrumentationCookie::operator=):
+        (WebCore::InspectorInstrumentationCookie::~InspectorInstrumentationCookie):
+        * inspector/InspectorInstrumentationCookie.h: Added.
+        (WebCore::InspectorInstrumentationCookie::isValid):
+        (WebCore::InspectorInstrumentationCookie::instrumentingAgents):
+        (WebCore::InspectorInstrumentationCookie::hasMatchingTimelineAgentId):
+
 2014-01-09  Pascal Jacquemart  <p.jacquemart@samsung.com>
 
         Cannot select multiple non-adjacent items in a multiple select control with the keyboard only
index 3b9981f..987685d 100644 (file)
 #include "JSIDBRequest.cpp"
 #include "JSIDBTransaction.cpp"
 #include "JSImageData.cpp"
-#include "JSInjectedScriptHost.cpp"
 #include "JSInspectorFrontendHost.cpp"
 #include "JSJavaScriptCallFrame.cpp"
 #include "JSKeyboardEvent.cpp"
index c49c7a7..9334daa 100644 (file)
@@ -453,7 +453,6 @@ BINDING_IDLS = \
     $(WebCore)/html/track/VideoTrack.idl \
     $(WebCore)/html/track/VideoTrackList.idl \
     $(WebCore)/inspector/CommandLineAPIHost.idl \
-    $(WebCore)/inspector/InjectedScriptHost.idl \
     $(WebCore)/inspector/InspectorFrontendHost.idl \
     $(WebCore)/inspector/ScriptProfile.idl \
     $(WebCore)/inspector/ScriptProfileNode.idl \
@@ -773,8 +772,8 @@ CSSValueKeywords.h : $(WEBCORE_CSS_VALUE_KEYWORDS) css/makevalues.pl $(PLATFORM_
 all : XMLViewerCSS.h
 
 XMLViewerCSS.h : xml/XMLViewer.css
-       python "$(WebCore)/inspector/Scripts/cssmin.py" <"$(WebCore)/xml/XMLViewer.css" > ./XMLViewer.min.css
-       perl $(WebCore)/inspector/xxd.pl XMLViewer_css ./XMLViewer.min.css XMLViewerCSS.h
+       python $(InspectorScripts)/cssmin.py <"$(WebCore)/xml/XMLViewer.css" > ./XMLViewer.min.css
+       perl $(InspectorScripts)/xxd.pl XMLViewer_css ./XMLViewer.min.css XMLViewerCSS.h
        rm -f ./XMLViewer.min.css
 
 # --------
@@ -784,8 +783,8 @@ XMLViewerCSS.h : xml/XMLViewer.css
 all : XMLViewerJS.h
 
 XMLViewerJS.h : xml/XMLViewer.js
-       python "$(WebCore)/inspector/Scripts/jsmin.py" <"$(WebCore)/xml/XMLViewer.js" > ./XMLViewer.min.js
-       perl $(WebCore)/inspector/xxd.pl XMLViewer_js ./XMLViewer.min.js XMLViewerJS.h
+       python $(InspectorScripts)/jsmin.py <"$(WebCore)/xml/XMLViewer.js" > ./XMLViewer.min.js
+       perl $(InspectorScripts)/xxd.pl XMLViewer_js ./XMLViewer.min.js XMLViewerJS.h
        rm -f ./XMLViewer.min.js
 
 # --------
@@ -1114,29 +1113,22 @@ InspectorWebFrontendDispatchers.h : InspectorWeb.json $(InspectorScripts)/Inspec
 all : InspectorOverlayPage.h
 
 InspectorOverlayPage.h : InspectorOverlayPage.html InspectorOverlayPage.css InspectorOverlayPage.js
-       python "$(WebCore)/inspector/Scripts/inline-and-minify-stylesheets-and-scripts.py" "$(WebCore)/inspector/InspectorOverlayPage.html" ./InspectorOverlayPage.combined.html
-       perl "$(WebCore)/inspector/xxd.pl" InspectorOverlayPage_html ./InspectorOverlayPage.combined.html InspectorOverlayPage.h
+       python $(InspectorScripts)/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html ./InspectorOverlayPage.combined.html
+       perl $(InspectorScripts)/xxd.pl InspectorOverlayPage_html ./InspectorOverlayPage.combined.html InspectorOverlayPage.h
        rm -f ./InspectorOverlayPage.combined.html
 
-all : InjectedScriptSource.h
-
-InjectedScriptSource.h : InjectedScriptSource.js
-       python "$(WebCore)/inspector/Scripts/jsmin.py" <"$(WebCore)/inspector/InjectedScriptSource.js" > ./InjectedScriptSource.min.js
-       perl "$(WebCore)/inspector/xxd.pl" InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
-       rm -f ./InjectedScriptSource.min.js
-
 all : CommandLineAPIModuleSource.h
 
 CommandLineAPIModuleSource.h : CommandLineAPIModuleSource.js
-       python "$(WebCore)/inspector/Scripts/jsmin.py" <"$(WebCore)/inspector/CommandLineAPIModuleSource.js" > ./CommandLineAPIModuleSource.min.js
-       perl "$(WebCore)/inspector/xxd.pl" CommandLineAPIModuleSource_js ./CommandLineAPIModuleSource.min.js CommandLineAPIModuleSource.h
+       python $(InspectorScripts)/jsmin.py <$(WebCore)/inspector/CommandLineAPIModuleSource.js > ./CommandLineAPIModuleSource.min.js
+       perl $(InspectorScripts)/xxd.pl CommandLineAPIModuleSource_js ./CommandLineAPIModuleSource.min.js CommandLineAPIModuleSource.h
        rm -f ./CommandLineAPIModuleSource.min.js
 
 all : InjectedScriptCanvasModuleSource.h
 
 InjectedScriptCanvasModuleSource.h : InjectedScriptCanvasModuleSource.js
-       python "$(WebCore)/inspector/Scripts/jsmin.py" <"$(WebCore)/inspector/InjectedScriptCanvasModuleSource.js" > ./InjectedScriptCanvasModuleSource.min.js
-       perl "$(WebCore)/inspector/xxd.pl" InjectedScriptCanvasModuleSource_js ./InjectedScriptCanvasModuleSource.min.js InjectedScriptCanvasModuleSource.h
+       python $(InspectorScripts)/jsmin.py <$(WebCore)/inspector/InjectedScriptCanvasModuleSource.js > ./InjectedScriptCanvasModuleSource.min.js
+       perl $(InspectorScripts)/xxd.pl InjectedScriptCanvasModuleSource_js ./InjectedScriptCanvasModuleSource.min.js InjectedScriptCanvasModuleSource.h
        rm -f ./InjectedScriptCanvasModuleSource.min.js
 
 -include $(JS_DOM_HEADERS:.h=.dep)
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InjectedScript.h b/Source/WebCore/ForwardingHeaders/inspector/InjectedScript.h
new file mode 100644 (file)
index 0000000..1e40c1e
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InjectedScript_h
+#define WebCore_FWD_InjectedScript_h
+#include <JavaScriptCore/InjectedScript.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptBase.h b/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptBase.h
new file mode 100644 (file)
index 0000000..ca8b426
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InjectedScriptBase_h
+#define WebCore_FWD_InjectedScriptBase_h
+#include <JavaScriptCore/InjectedScriptBase.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptHost.h b/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptHost.h
new file mode 100644 (file)
index 0000000..acc72a0
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InjectedScriptHost_h
+#define WebCore_FWD_InjectedScriptHost_h
+#include <JavaScriptCore/InjectedScriptHost.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptManager.h b/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptManager.h
new file mode 100644 (file)
index 0000000..e5ecb3f
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InjectedScriptManager_h
+#define WebCore_FWD_InjectedScriptManager_h
+#include <JavaScriptCore/InjectedScriptManager.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptModule.h b/Source/WebCore/ForwardingHeaders/inspector/InjectedScriptModule.h
new file mode 100644 (file)
index 0000000..16f1e4e
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InjectedScriptModule_h
+#define WebCore_FWD_InjectedScriptModule_h
+#include <JavaScriptCore/InjectedScriptModule.h>
+#endif
diff --git a/Source/WebCore/ForwardingHeaders/inspector/InspectorEnvironment.h b/Source/WebCore/ForwardingHeaders/inspector/InspectorEnvironment.h
new file mode 100644 (file)
index 0000000..0af5744
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef WebCore_FWD_InspectorEnvironment_h
+#define WebCore_FWD_InspectorEnvironment_h
+#include <JavaScriptCore/InspectorEnvironment.h>
+#endif
index 170f07b..c9be418 100644 (file)
@@ -246,13 +246,13 @@ DerivedSources/WebCore/CSSValueKeywords.h: $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCo
 
 # XML Viewer CSS
 DerivedSources/WebCore/XMLViewerCSS.h: $(WebCore)/xml/XMLViewer.css
-       $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/cssmin.py <$(WebCore)/xml/XMLViewer.css > $(GENSOURCES_WEBCORE)/XMLViewer.min.css
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl XMLViewer_css $(GENSOURCES_WEBCORE)/XMLViewer.min.css $(GENSOURCES_WEBCORE)/XMLViewerCSS.h
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/cssmin.py <$(WebCore)/xml/XMLViewer.css > $(GENSOURCES_WEBCORE)/XMLViewer.min.css
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl XMLViewer_css $(GENSOURCES_WEBCORE)/XMLViewer.min.css $(GENSOURCES_WEBCORE)/XMLViewerCSS.h
 
 # XML Viewer JS
 DerivedSources/WebCore/XMLViewerJS.h: $(WebCore)/xml/XMLViewer.js
-       $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/jsmin.py <$(WebCore)/xml/XMLViewer.js > $(GENSOURCES_WEBCORE)/XMLViewer.min.js
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl XMLViewer_js $(GENSOURCES_WEBCORE)/XMLViewer.min.js $(GENSOURCES_WEBCORE)/XMLViewerJS.h
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py <$(WebCore)/xml/XMLViewer.js > $(GENSOURCES_WEBCORE)/XMLViewer.min.js
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl XMLViewer_js $(GENSOURCES_WEBCORE)/XMLViewer.min.js $(GENSOURCES_WEBCORE)/XMLViewerJS.h
 
 # HTML entity names
 DerivedSources/WebCore/HTMLEntityTable.cpp: $(WebCore)/html/parser/HTMLEntityNames.in $(WebCore)/html/parser/create-html-entity-table
@@ -369,20 +369,16 @@ DerivedSources/WebCore/InspectorWebBackendCommands.js: DerivedSources/WebCore/In
 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
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InspectorOverlayPage_html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.combined.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.h
-
-DerivedSources/WebCore/InjectedScriptSource.h: $(WebCore)/inspector/InjectedScriptSource.js
-       $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/jsmin.py <$(WebCore)/inspector/InjectedScriptSource.js > $(GENSOURCES_WEBCORE)/InjectedScriptSource.min.js
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptSource_js $(GENSOURCES_WEBCORE)/InjectedScriptSource.min.js $(GENSOURCES_WEBCORE)/InjectedScriptSource.h
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/inline-and-minify-stylesheets-and-scripts.py $(WebCore)/inspector/InspectorOverlayPage.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.combined.html
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InspectorOverlayPage_html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.combined.html $(GENSOURCES_WEBCORE)/InspectorOverlayPage.h
 
 DerivedSources/WebCore/CommandLineAPIModuleSource.h: $(WebCore)/inspector/CommandLineAPIModuleSource.js
-       $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/jsmin.py <$(WebCore)/inspector/CommandLineAPIModuleSource.js > $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.min.js
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl CommandLineAPIModuleSource_js $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.min.js $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.h
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py <$(WebCore)/inspector/CommandLineAPIModuleSource.js > $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.min.js
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl CommandLineAPIModuleSource_js $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.min.js $(GENSOURCES_WEBCORE)/CommandLineAPIModuleSource.h
 
 DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h: $(WebCore)/inspector/InjectedScriptCanvasModuleSource.js
-       $(AM_V_GEN)$(PYTHON) $(WebCore)/inspector/Scripts/jsmin.py <$(WebCore)/inspector/InjectedScriptCanvasModuleSource.js > $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.min.js
-       $(AM_V_GEN)$(PERL) $(WebCore)/inspector/xxd.pl InjectedScriptCanvasModuleSource_js $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.min.js $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.h
+       $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py <$(WebCore)/inspector/InjectedScriptCanvasModuleSource.js > $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.min.js
+       $(AM_V_GEN)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InjectedScriptCanvasModuleSource_js $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.min.js $(GENSOURCES_WEBCORE)/InjectedScriptCanvasModuleSource.h
 
 if ENABLE_WEB_AUDIO
 # Installing HRTF database wav files
@@ -657,7 +653,6 @@ EXTRA_DIST += \
        $(wildcard $(srcdir)/Source/WebCore/inspector/*.idl) \
        $(wildcard $(srcdir)/Source/WebCore/inspector/*.css) \
        $(wildcard $(srcdir)/Source/WebCore/inspector/*.js) \
-       $(wildcard $(srcdir)/Source/WebCore/inspector/Scripts/*.py) \
        $(wildcard $(srcdir)/Source/WebCore/loader/appcache/*.idl) \
        $(wildcard $(srcdir)/Source/WebCore/page/*.idl) \
        $(wildcard $(srcdir)/Source/WebCore/plugins/*.idl) \
@@ -716,9 +711,7 @@ EXTRA_DIST += \
        Source/WebCore/html/parser/HTMLEntityNames.in \
        Source/WebCore/icu/LICENSE \
        Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js \
-       Source/WebCore/inspector/InjectedScriptSource.js \
        Source/WebCore/inspector/InspectorOverlayPage.html \
-       Source/WebCore/inspector/xxd.pl \
        Source/WebCore/LICENSE-APPLE \
        Source/WebCore/LICENSE-LGPL-2 \
        Source/WebCore/LICENSE-LGPL-2.1 \
index 45b876e..9696758 100644 (file)
@@ -21,7 +21,6 @@ webcore_built_sources += \
        DerivedSources/WebCore/HTMLNames.cpp \
        DerivedSources/WebCore/HTMLNames.h \
        DerivedSources/WebCore/InjectedScriptCanvasModuleSource.h \
-       DerivedSources/WebCore/InjectedScriptSource.h \
        DerivedSources/WebCore/InspectorOverlayPage.h \
        DerivedSources/WebCore/InspectorWebBackendDispatchers.cpp \
        DerivedSources/WebCore/InspectorWebBackendDispatchers.h \
@@ -452,8 +451,6 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSIDBVersionChangeEvent.h \
        DerivedSources/WebCore/JSImageData.cpp \
        DerivedSources/WebCore/JSImageData.h \
-       DerivedSources/WebCore/JSInjectedScriptHost.cpp \
-       DerivedSources/WebCore/JSInjectedScriptHost.h \
        DerivedSources/WebCore/JSInspectorFrontendHost.cpp \
        DerivedSources/WebCore/JSInspectorFrontendHost.h \
        DerivedSources/WebCore/JSScriptProcessorNode.cpp \
@@ -1551,7 +1548,6 @@ dom_binding_idls += \
        $(WebCore)/html/track/VideoTrack.idl \
        $(WebCore)/html/track/VideoTrackList.idl \
        $(WebCore)/inspector/CommandLineAPIHost.idl \
-       $(WebCore)/inspector/InjectedScriptHost.idl \
        $(WebCore)/inspector/InspectorFrontendHost.idl \
        $(WebCore)/inspector/JavaScriptCallFrame.idl \
        $(WebCore)/inspector/ScriptProfile.idl \
@@ -2368,8 +2364,6 @@ webcore_sources += \
        Source/WebCore/bindings/js/JSImageConstructor.cpp \
        Source/WebCore/bindings/js/JSImageConstructor.h \
        Source/WebCore/bindings/js/JSImageDataCustom.cpp \
-       Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp \
-       Source/WebCore/bindings/js/JSInjectedScriptManager.cpp \
        Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp \
        Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp \
        Source/WebCore/bindings/js/JSLazyEventListener.cpp \
@@ -3790,18 +3784,8 @@ webcore_sources += \
        Source/WebCore/inspector/DOMPatchSupport.h \
        Source/WebCore/inspector/IdentifiersFactory.cpp \
        Source/WebCore/inspector/IdentifiersFactory.h \
-       Source/WebCore/inspector/InjectedScript.cpp \
-       Source/WebCore/inspector/InjectedScript.h \
-       Source/WebCore/inspector/InjectedScriptBase.cpp \
-       Source/WebCore/inspector/InjectedScriptBase.h \
        Source/WebCore/inspector/InjectedScriptCanvasModule.cpp \
        Source/WebCore/inspector/InjectedScriptCanvasModule.h \
-       Source/WebCore/inspector/InjectedScriptHost.cpp \
-       Source/WebCore/inspector/InjectedScriptHost.h \
-       Source/WebCore/inspector/InjectedScriptManager.cpp \
-       Source/WebCore/inspector/InjectedScriptManager.h \
-       Source/WebCore/inspector/InjectedScriptModule.cpp \
-       Source/WebCore/inspector/InjectedScriptModule.h \
        Source/WebCore/inspector/InspectorAgent.cpp \
        Source/WebCore/inspector/InspectorAgent.h \
        Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp \
@@ -3849,6 +3833,8 @@ webcore_sources += \
        Source/WebCore/inspector/InspectorInputAgent.h \
        Source/WebCore/inspector/InspectorInstrumentation.cpp \
        Source/WebCore/inspector/InspectorInstrumentation.h \
+       Source/WebCore/inspector/InspectorInstrumentationCookie.cpp \
+       Source/WebCore/inspector/InspectorInstrumentationCookie.h \
        Source/WebCore/inspector/InspectorLayerTreeAgent.cpp \
        Source/WebCore/inspector/InspectorLayerTreeAgent.h \
        Source/WebCore/inspector/InspectorMemoryAgent.cpp \
@@ -3883,6 +3869,8 @@ webcore_sources += \
        Source/WebCore/inspector/PageConsoleAgent.h \
        Source/WebCore/inspector/PageDebuggerAgent.cpp \
        Source/WebCore/inspector/PageDebuggerAgent.h \
+       Source/WebCore/inspector/PageInjectedScriptHost.cpp \
+       Source/WebCore/inspector/PageInjectedScriptHost.h \
        Source/WebCore/inspector/PageInjectedScriptManager.cpp \
        Source/WebCore/inspector/PageInjectedScriptManager.h \
        Source/WebCore/inspector/PageRuntimeAgent.cpp \
index 40d5a17..105af88 100644 (file)
@@ -106,8 +106,6 @@ list(APPEND WebCore_SOURCES
     bindings/js/JSIDBObjectStoreCustom.cpp
     bindings/js/JSImageConstructor.cpp
     bindings/js/JSImageDataCustom.cpp
-    bindings/js/JSInjectedScriptHostCustom.cpp
-    bindings/js/JSInjectedScriptManager.cpp
     bindings/js/JSInspectorFrontendHostCustom.cpp
     bindings/js/JSJavaScriptCallFrameCustom.cpp
     bindings/js/JSLazyEventListener.cpp
index 796e3a0..92fc533 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInjectedScriptHost.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSInjectedScriptHostCustom.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\bindings\js\JSInjectedScriptManager.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSInspectorFrontendHostCustom.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScript.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptBase.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\inspector\InjectedScriptCanvasModule.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptHost.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptManager.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptModule.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\inspector\InspectorAgent.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\inspector\InspectorInstrumentationCookie.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\inspector\InspectorLayerTreeAgent.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </ClCompile>
+    <ClCompile Include="..\inspector\PageInjectedScriptHost.cpp">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+    </ClCompile>
     <ClCompile Include="..\inspector\PageInjectedScriptManager.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\HTMLElementTypeHelpers.h" />
     <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\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\JSIDBRequest.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSIDBTransaction.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSImageData.h" />
-    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInjectedScriptHost.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSJavaScriptCallFrame.h" />
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSKeyboardEvent.h" />
     <ClInclude Include="..\ForwardingHeaders\heap\SlotVisitor.h" />
     <ClInclude Include="..\ForwardingHeaders\heap\StrongInlines.h" />
     <ClInclude Include="..\ForwardingHeaders\heap\Weak.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScript.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptBase.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptHost.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptManager.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptModule.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentBase.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentRegistry.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatcher.h" />
+    <ClInclude Include="..\ForwardingHeaders\inspector\InspectorEnvironment.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendChannel.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSBackendDispatchers.h" />
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorJSFrontendDispatchers.h" />
     <ClInclude Include="..\inspector\DOMEditor.h" />
     <ClInclude Include="..\inspector\DOMPatchSupport.h" />
     <ClInclude Include="..\inspector\IdentifiersFactory.h" />
-    <ClInclude Include="..\inspector\InjectedScript.h" />
-    <ClInclude Include="..\inspector\InjectedScriptBase.h" />
     <ClInclude Include="..\inspector\InjectedScriptCanvasModule.h" />
-    <ClInclude Include="..\inspector\InjectedScriptHost.h" />
-    <ClInclude Include="..\inspector\InjectedScriptManager.h" />
-    <ClInclude Include="..\inspector\InjectedScriptModule.h" />
     <ClInclude Include="..\inspector\InspectorAgent.h" />
     <ClInclude Include="..\inspector\InspectorApplicationCacheAgent.h" />
     <ClInclude Include="..\inspector\InspectorCanvasAgent.h" />
     <ClInclude Include="..\inspector\InspectorIndexedDBAgent.h" />
     <ClInclude Include="..\inspector\InspectorInputAgent.h" />
     <ClInclude Include="..\inspector\InspectorInstrumentation.h" />
+    <ClInclude Include="..\inspector\InspectorInstrumentationCookie.h" />
     <ClInclude Include="..\inspector\InspectorLayerTreeAgent.h" />
     <ClInclude Include="..\inspector\InspectorMemoryAgent.h" />
     <ClInclude Include="..\inspector\InspectorNodeFinder.h" />
     <ClInclude Include="..\inspector\NetworkResourcesData.h" />
     <ClInclude Include="..\inspector\PageConsoleAgent.h" />
     <ClInclude Include="..\inspector\PageDebuggerAgent.h" />
+    <ClInclude Include="..\inspector\PageInjectedScriptHost.h" />
     <ClInclude Include="..\inspector\PageInjectedScriptManager.h" />
     <ClInclude Include="..\inspector\PageRuntimeAgent.h" />
     <ClInclude Include="..\inspector\ScriptArguments.h" />
index a76ea04..42267d7 100644 (file)
     <ClCompile Include="..\bindings\js\JSImageDataCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
-    <ClCompile Include="..\bindings\js\JSInjectedScriptHostCustom.cpp">
-      <Filter>bindings\js</Filter>
-    </ClCompile>
-    <ClCompile Include="..\bindings\js\JSInjectedScriptManager.cpp">
-      <Filter>bindings\js</Filter>
-    </ClCompile>
     <ClCompile Include="..\bindings\js\JSInspectorFrontendHostCustom.cpp">
       <Filter>bindings\js</Filter>
     </ClCompile>
     <ClCompile Include="..\inspector\IdentifiersFactory.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScript.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptBase.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
     <ClCompile Include="..\inspector\InjectedScriptCanvasModule.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptHost.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptManager.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
-    <ClCompile Include="..\inspector\InjectedScriptModule.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
     <ClCompile Include="..\inspector\InspectorAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
     <ClCompile Include="..\inspector\InspectorInstrumentation.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
+    <ClCompile Include="..\inspector\InspectorInstrumentationCookie.cpp">
+      <Filter>inspector</Filter>
+    </ClCompile>
     <ClCompile Include="..\inspector\InspectorLayerTreeAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
     <ClCompile Include="..\inspector\PageDebuggerAgent.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
+    <ClCompile Include="..\inspector\PageInjectedScriptHost.cpp">
+      <Filter>inspector</Filter>
+    </ClCompile>
     <ClCompile Include="..\inspector\PageInjectedScriptManager.cpp">
       <Filter>inspector</Filter>
     </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSImageData.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
-    <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInjectedScriptHost.cpp">
-      <Filter>DerivedSources</Filter>
-    </ClCompile>
     <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp">
       <Filter>DerivedSources</Filter>
     </ClCompile>
     <ClInclude Include="..\ForwardingHeaders\heap\Strong.h">
       <Filter>ForwardingHeaders\heap</Filter>
     </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScript.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptBase.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptHost.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptManager.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InjectedScriptModule.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude>
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorAgentBase.h">
       <Filter>ForwardingHeaders\inspector</Filter>
     </ClInclude>
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorBackendDispatcher.h">
       <Filter>ForwardingHeaders\inspector</Filter>
     </ClInclude>
+    <ClInclude Include="..\ForwardingHeaders\inspector\InspectorEnvironment.h">
+      <Filter>ForwardingHeaders\inspector</Filter>
+    </ClInclude
     <ClInclude Include="..\ForwardingHeaders\inspector\InspectorFrontendChannel.h">
       <Filter>ForwardingHeaders\inspector</Filter>
     </ClInclude>
     <ClInclude Include="..\inspector\IdentifiersFactory.h">
       <Filter>inspector</Filter>
     </ClInclude>
-    <ClInclude Include="..\inspector\InjectedScript.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
-    <ClInclude Include="..\inspector\InjectedScriptBase.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
     <ClInclude Include="..\inspector\InjectedScriptCanvasModule.h">
       <Filter>inspector</Filter>
     </ClInclude>
-    <ClInclude Include="..\inspector\InjectedScriptHost.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
-    <ClInclude Include="..\inspector\InjectedScriptManager.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
-    <ClInclude Include="..\inspector\InjectedScriptModule.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
     <ClInclude Include="..\inspector\InspectorAgent.h">
       <Filter>inspector</Filter>
     </ClInclude>
     <ClInclude Include="..\inspector\InspectorInstrumentation.h">
       <Filter>inspector</Filter>
     </ClInclude>
+    <ClInclude Include="..\inspector\InspectorInstrumentationCookie.h">
+      <Filter>inspector</Filter>
+    </ClInclude>
     <ClInclude Include="..\inspector\InspectorLayerTreeAgent.h">
       <Filter>inspector</Filter>
     </ClInclude>
     <ClInclude Include="..\inspector\PageDebuggerAgent.h">
       <Filter>inspector</Filter>
     </ClInclude>
+    <ClInclude Include="..\inspector\PageInjectedScriptHost.h">
+      <Filter>inspector</Filter>
+    </ClInclude>
     <ClInclude Include="..\inspector\PageInjectedScriptManager.h">
       <Filter>inspector</Filter>
     </ClInclude>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptCanvasModuleSource.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
-    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InjectedScriptSource.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\JSImageData.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
-    <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInjectedScriptHost.h">
-      <Filter>DerivedSources</Filter>
-    </ClInclude>
     <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.h">
       <Filter>DerivedSources</Filter>
     </ClInclude>
index 15e73ce..744767d 100644 (file)
                79AC9219109945C80021266E /* JSCompositionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AC9217109945C80021266E /* JSCompositionEvent.h */; };
                79F2F5A11091939A000D87CB /* CompositionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 79F2F59E1091939A000D87CB /* CompositionEvent.cpp */; };
                79F2F5A21091939A000D87CB /* CompositionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F2F59F1091939A000D87CB /* CompositionEvent.h */; };
-               7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E76D410BF050700A0276E /* JSInjectedScriptHostCustom.cpp */; };
-               7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */; };
-               7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */; };
-               7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */; };
-               7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */; };
                7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */; };
                7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */; };
                7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */; };
                A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
                A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
                A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = A5732B09136A161D005C8D7C /* DateComponents.h */; };
+               A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */; };
+               A5840E1D187B74D500843B10 /* InspectorInstrumentationCookie.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A5840E24187B8AC200843B10 /* PageInjectedScriptHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5840E22187B8AC200843B10 /* PageInjectedScriptHost.cpp */; };
+               A5840E25187B8AC200843B10 /* PageInjectedScriptHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A5840E23187B8AC200843B10 /* PageInjectedScriptHost.h */; };
                A584FE2618637DAB00843B10 /* CommandLineAPIModuleSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A584FE2518637DAB00843B10 /* CommandLineAPIModuleSource.h */; };
                A584FE2B1863870F00843B10 /* CommandLineAPIModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A584FE291863870F00843B10 /* CommandLineAPIModule.cpp */; };
                A584FE2C1863870F00843B10 /* CommandLineAPIModule.h in Headers */ = {isa = PBXBuildFile; fileRef = A584FE2A1863870F00843B10 /* CommandLineAPIModule.h */; };
                AAA728F716D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = AAA728F116D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h */; };
                AAA728F816D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAA728F216D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm */; };
                AAA728F916D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAA728F316D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm */; };
-               AAB6054E15874C58007B5031 /* InjectedScriptBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */; };
-               AAB6054F15874C58007B5031 /* InjectedScriptBase.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB6054B15874C58007B5031 /* InjectedScriptBase.h */; };
-               AAB6055015874C58007B5031 /* InjectedScriptModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */; };
-               AAB6055115874C58007B5031 /* InjectedScriptModule.h in Headers */ = {isa = PBXBuildFile; fileRef = AAB6054D15874C58007B5031 /* InjectedScriptModule.h */; };
                AAC08CEF15F933D600F1E188 /* SVGImageChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC08CED15F933D600F1E188 /* SVGImageChromeClient.h */; };
                AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */; };
                AAD766EB157E502F00E85423 /* InspectorCanvasAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AAD766E8157E502F00E85423 /* InspectorCanvasAgent.cpp */; };
                F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F12171F316A8BC63000053CA /* WebVTTElement.cpp */; };
                F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F12171F416A8BC63000053CA /* WebVTTElement.h */; };
                F293B27E56C112F373FFF27E /* DNSResolveQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C60128060078BB70E367A95 /* DNSResolveQueue.cpp */; };
-               F316396B1329481A00A649CB /* InjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F31639691329481A00A649CB /* InjectedScriptManager.cpp */; };
-               F316396C1329481A00A649CB /* InjectedScriptManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F316396A1329481A00A649CB /* InjectedScriptManager.h */; };
-               F316396E1329487600A649CB /* JSInjectedScriptManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F316396D1329487600A649CB /* JSInjectedScriptManager.cpp */; };
                F325A40A14EE36FA007324E2 /* InspectorCounters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F325A40814EE36FA007324E2 /* InspectorCounters.cpp */; };
                F325A40B14EE36FA007324E2 /* InspectorCounters.h in Headers */ = {isa = PBXBuildFile; fileRef = F325A40914EE36FA007324E2 /* InspectorCounters.h */; settings = {ATTRIBUTES = (Private, ); }; };
                F3335BF812E07DC300D33011 /* InspectorConsoleAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */; };
                F34742E81343635000531BC2 /* WorkerScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F34742E61343635000531BC2 /* WorkerScriptDebugServer.cpp */; };
                F34742E91343635000531BC2 /* WorkerScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = F34742E71343635000531BC2 /* WorkerScriptDebugServer.h */; };
                F350B73513F1377D00880C43 /* InstrumentingAgents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F350B73413F1377D00880C43 /* InstrumentingAgents.cpp */; };
-               F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F3644AFD1119805900E0D537 /* InjectedScript.cpp */; };
-               F3644B001119805900E0D537 /* InjectedScript.h in Headers */ = {isa = PBXBuildFile; fileRef = F3644AFE1119805900E0D537 /* InjectedScript.h */; };
                F36E07A41358A8BE00AACBC9 /* WorkerInspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F36E07A21358A8BE00AACBC9 /* WorkerInspectorController.cpp */; };
                F36E07A51358A8BE00AACBC9 /* WorkerInspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = F36E07A31358A8BE00AACBC9 /* WorkerInspectorController.h */; };
                F375CC071150D300008DDB81 /* InspectorWorkerResource.h in Headers */ = {isa = PBXBuildFile; fileRef = F375CC061150D300008DDB81 /* InspectorWorkerResource.h */; };
                79F2F59E1091939A000D87CB /* CompositionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompositionEvent.cpp; sourceTree = "<group>"; };
                79F2F59F1091939A000D87CB /* CompositionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompositionEvent.h; sourceTree = "<group>"; };
                79F2F5A01091939A000D87CB /* CompositionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CompositionEvent.idl; sourceTree = "<group>"; };
-               7A0E76D410BF050700A0276E /* JSInjectedScriptHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHostCustom.cpp; sourceTree = "<group>"; };
-               7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptHost.cpp; sourceTree = "<group>"; };
-               7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInjectedScriptHost.h; sourceTree = "<group>"; };
-               7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptHost.cpp; sourceTree = "<group>"; };
-               7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptHost.h; sourceTree = "<group>"; };
-               7A0E76F810BF08ED00A0276E /* InjectedScriptHost.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InjectedScriptHost.idl; sourceTree = "<group>"; };
                7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendHost.cpp; sourceTree = "<group>"; };
                7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendHost.h; sourceTree = "<group>"; };
                7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorFrontendHost.idl; sourceTree = "<group>"; };
                7A54857E14E02D51006AE05A /* InspectorHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHistory.h; sourceTree = "<group>"; };
                7A54881514E432A1006AE05A /* DOMPatchSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPatchSupport.h; sourceTree = "<group>"; };
                7A54881614E432A1006AE05A /* DOMPatchSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPatchSupport.cpp; sourceTree = "<group>"; };
-               7A563E5412DE32B000F4536D /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = "<group>"; };
-               7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedScriptSource.js; sourceTree = "<group>"; };
                7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
                7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
                7A7256B915EB9F5B007323A7 /* InspectorOverlayPage.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = InspectorOverlayPage.html; sourceTree = "<group>"; };
                A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNodePrivate.h; sourceTree = "<group>"; };
                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>"; };
+               A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentationCookie.cpp; sourceTree = "<group>"; };
+               A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentationCookie.h; sourceTree = "<group>"; };
+               A5840E22187B8AC200843B10 /* PageInjectedScriptHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageInjectedScriptHost.cpp; sourceTree = "<group>"; };
+               A5840E23187B8AC200843B10 /* PageInjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageInjectedScriptHost.h; sourceTree = "<group>"; };
                A584FE2518637DAB00843B10 /* CommandLineAPIModuleSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLineAPIModuleSource.h; sourceTree = "<group>"; };
                A584FE2718637DCA00843B10 /* CommandLineAPIModuleSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = CommandLineAPIModuleSource.js; sourceTree = "<group>"; };
                A584FE291863870F00843B10 /* CommandLineAPIModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineAPIModule.cpp; sourceTree = "<group>"; };
                AAA728F116D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAccessibilityObjectWrapperIOS.h; sourceTree = "<group>"; };
                AAA728F216D1D8BC00D3BBC6 /* WebAccessibilityObjectWrapperIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebAccessibilityObjectWrapperIOS.mm; sourceTree = "<group>"; };
                AAA728F316D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AXObjectCacheIOS.mm; sourceTree = "<group>"; };
-               AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptBase.cpp; sourceTree = "<group>"; };
-               AAB6054B15874C58007B5031 /* InjectedScriptBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptBase.h; sourceTree = "<group>"; };
-               AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptModule.cpp; sourceTree = "<group>"; };
-               AAB6054D15874C58007B5031 /* InjectedScriptModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptModule.h; sourceTree = "<group>"; };
                AAC08CED15F933D600F1E188 /* SVGImageChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageChromeClient.h; sourceTree = "<group>"; };
                AAC08CF015F941FC00F1E188 /* AccessibilitySVGRoot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGRoot.cpp; sourceTree = "<group>"; };
                AAC08CF115F941FC00F1E188 /* AccessibilitySVGRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGRoot.h; sourceTree = "<group>"; };
                EDEC98020AED7E170059137F /* WebCorePrefix.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCorePrefix.h; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; };
                F12171F316A8BC63000053CA /* WebVTTElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebVTTElement.cpp; sourceTree = "<group>"; };
                F12171F416A8BC63000053CA /* WebVTTElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTElement.h; sourceTree = "<group>"; };
-               F31639691329481A00A649CB /* InjectedScriptManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScriptManager.cpp; sourceTree = "<group>"; };
-               F316396A1329481A00A649CB /* InjectedScriptManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptManager.h; sourceTree = "<group>"; };
-               F316396D1329487600A649CB /* JSInjectedScriptManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInjectedScriptManager.cpp; sourceTree = "<group>"; };
                F325A40814EE36FA007324E2 /* InspectorCounters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCounters.cpp; sourceTree = "<group>"; };
                F325A40914EE36FA007324E2 /* InspectorCounters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCounters.h; sourceTree = "<group>"; };
                F3335BF612E07DC300D33011 /* InspectorConsoleAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorConsoleAgent.cpp; sourceTree = "<group>"; };
                F34742E61343635000531BC2 /* WorkerScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerScriptDebugServer.cpp; sourceTree = "<group>"; };
                F34742E71343635000531BC2 /* WorkerScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerScriptDebugServer.h; sourceTree = "<group>"; };
                F350B73413F1377D00880C43 /* InstrumentingAgents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InstrumentingAgents.cpp; sourceTree = "<group>"; };
-               F3644AFD1119805900E0D537 /* InjectedScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedScript.cpp; sourceTree = "<group>"; };
-               F3644AFE1119805900E0D537 /* InjectedScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScript.h; sourceTree = "<group>"; };
                F36E07A21358A8BE00AACBC9 /* WorkerInspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerInspectorController.cpp; sourceTree = "<group>"; };
                F36E07A31358A8BE00AACBC9 /* WorkerInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerInspectorController.h; sourceTree = "<group>"; };
                F375CC061150D300008DDB81 /* InspectorWorkerResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorWorkerResource.h; sourceTree = "<group>"; };
                        children = (
                                A584FE2518637DAB00843B10 /* CommandLineAPIModuleSource.h */,
                                AA912750157E35A500454E54 /* InjectedScriptCanvasModuleSource.h */,
-                               7A563E5412DE32B000F4536D /* InjectedScriptSource.h */,
                                4F707A9711EF679400ACDA69 /* InspectorWebBackendDispatchers.cpp */,
                                4F707A9811EF679400ACDA69 /* InspectorWebBackendDispatchers.h */,
                                4F4F5FFA11CBD2D200A186BF /* InspectorWebFrontendDispatchers.cpp */,
                                573D134614CE39FF0057ABCA /* InspectorWebTypeBuilders.h */,
                                A584FE391864E2D800843B10 /* JSCommandLineAPIHost.cpp */,
                                A584FE3A1864E2D800843B10 /* JSCommandLineAPIHost.h */,
-                               7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */,
-                               7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */,
                                7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */,
                                7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
                                1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */,
                                7A54881514E432A1006AE05A /* DOMPatchSupport.h */,
                                5913A23F13D49EBA00F5B05C /* IdentifiersFactory.cpp */,
                                5913A24013D49EBA00F5B05C /* IdentifiersFactory.h */,
-                               F3644AFD1119805900E0D537 /* InjectedScript.cpp */,
-                               F3644AFE1119805900E0D537 /* InjectedScript.h */,
-                               AAB6054A15874C58007B5031 /* InjectedScriptBase.cpp */,
-                               AAB6054B15874C58007B5031 /* InjectedScriptBase.h */,
                                AA73183C159255B900A93E6E /* InjectedScriptCanvasModule.cpp */,
                                AA73183D159255B900A93E6E /* InjectedScriptCanvasModule.h */,
                                AA9030FE157E16A000276247 /* InjectedScriptCanvasModuleSource.js */,
-                               7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */,
-                               7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */,
-                               7A0E76F810BF08ED00A0276E /* InjectedScriptHost.idl */,
-                               F31639691329481A00A649CB /* InjectedScriptManager.cpp */,
-                               F316396A1329481A00A649CB /* InjectedScriptManager.h */,
-                               AAB6054C15874C58007B5031 /* InjectedScriptModule.cpp */,
-                               AAB6054D15874C58007B5031 /* InjectedScriptModule.h */,
-                               7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */,
                                4F2D205312EAE7B3005C2874 /* InspectorAgent.cpp */,
                                4F2D205212EAE7B3005C2874 /* InspectorAgent.h */,
                                B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */,
                                7ACD88D214C08BD60084EDD2 /* InspectorIndexedDBAgent.h */,
                                4D273CF71669420800259CA1 /* InspectorInputAgent.cpp */,
                                4D273CF81669420800259CA1 /* InspectorInputAgent.h */,
+                               A5840E1A187B74D500843B10 /* InspectorInstrumentationCookie.cpp */,
+                               A5840E1B187B74D500843B10 /* InspectorInstrumentationCookie.h */,
                                20D629241253690B00081543 /* InspectorInstrumentation.cpp */,
                                20D629251253690B00081543 /* InspectorInstrumentation.h */,
                                71B1E123164048CC00B1880A /* InspectorLayerTreeAgent.cpp */,
                                F382088B147D35F90010BC06 /* PageConsoleAgent.h */,
                                F34742DA134362F000531BC2 /* PageDebuggerAgent.cpp */,
                                F34742DB134362F000531BC2 /* PageDebuggerAgent.h */,
+                               A5840E22187B8AC200843B10 /* PageInjectedScriptHost.cpp */,
+                               A5840E23187B8AC200843B10 /* PageInjectedScriptHost.h */,
                                A584FE2D1864CB8400843B10 /* PageInjectedScriptManager.cpp */,
                                A584FE2E1864CB8400843B10 /* PageInjectedScriptManager.h */,
                                F382088C147D35F90010BC06 /* PageRuntimeAgent.cpp */,
                                511EF2CD17F0FDF100E4FA16 /* JSIDBDatabaseCustom.cpp */,
                                511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */,
                                A7D0318D0E93540300E24ACD /* JSImageDataCustom.cpp */,
-                               7A0E76D410BF050700A0276E /* JSInjectedScriptHostCustom.cpp */,
-                               F316396D1329487600A649CB /* JSInjectedScriptManager.cpp */,
                                7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
                                1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */,
                                BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
                                BC2272AD0E82E8F300E7F975 /* CursorList.h in Headers */,
                                62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */,
                                15B3FC1915FB217800A81BCB /* CustomFilterArrayParameter.h in Headers */,
+                               A5840E1D187B74D500843B10 /* InspectorInstrumentationCookie.h in Headers */,
                                50D40612147D49DE00D30BB5 /* CustomFilterCompiledProgram.h in Headers */,
                                A2B2AE7C16375EE500CFA50B /* CustomFilterConstants.h in Headers */,
                                50987C27157D676D00BDA835 /* CustomFilterGlobalContext.h in Headers */,
                                85909CDD0ACC7A7E00DF01F1 /* DOMCSSFontFaceRuleInternal.h in Headers */,
                                B562DB6117D3CD660010AF96 /* SVGElementTypeHelpers.h in Headers */,
                                85032DDB0AA8C9BE007D3B7D /* DOMCSSImportRule.h in Headers */,
+                               A5840E25187B8AC200843B10 /* PageInjectedScriptHost.h in Headers */,
                                85909CDE0ACC7A7E00DF01F1 /* DOMCSSImportRuleInternal.h in Headers */,
                                85032DDD0AA8C9BE007D3B7D /* DOMCSSMediaRule.h in Headers */,
                                85909CDF0ACC7A7E00DF01F1 /* DOMCSSMediaRuleInternal.h in Headers */,
                                07CE77D516712A6A00C55A47 /* InbandTextTrackPrivateClient.h in Headers */,
                                07367DDF172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h in Headers */,
                                DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */,
-                               F3644B001119805900E0D537 /* InjectedScript.h in Headers */,
-                               AAB6054F15874C58007B5031 /* InjectedScriptBase.h in Headers */,
                                AA73183F159255B900A93E6E /* InjectedScriptCanvasModule.h in Headers */,
-                               7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */,
-                               F316396C1329481A00A649CB /* InjectedScriptManager.h in Headers */,
-                               AAB6055115874C58007B5031 /* InjectedScriptModule.h in Headers */,
                                A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
                                A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
                                BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
                                269239961505E1AA009E57FC /* JSIDBVersionChangeEvent.h in Headers */,
                                BC6C49F40D7DBA0500FFA558 /* JSImageConstructor.h in Headers */,
                                A77979290D6B9E64003851B9 /* JSImageData.h in Headers */,
-                               7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
                                7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
                                1C5FAED20DCFD90100D58F78 /* JSJavaScriptCallFrame.h in Headers */,
                                A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
                                07AA6B6B166D2C0700D45671 /* InbandTextTrackPrivateAVFObjC.mm in Sources */,
                                07367DE0172CA68200D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm in Sources */,
                                DB23C2CB0A508D29002489EB /* IndentOutdentCommand.cpp in Sources */,
-                               F3644AFF1119805900E0D537 /* InjectedScript.cpp in Sources */,
-                               AAB6054E15874C58007B5031 /* InjectedScriptBase.cpp in Sources */,
                                AA73183E159255B900A93E6E /* InjectedScriptCanvasModule.cpp in Sources */,
-                               7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */,
-                               F316396B1329481A00A649CB /* InjectedScriptManager.cpp in Sources */,
-                               AAB6055015874C58007B5031 /* InjectedScriptModule.cpp in Sources */,
                                A8CFF5E60A155A05000A4234 /* InlineBox.cpp in Sources */,
                                A8CFF5E40A155A05000A4234 /* InlineFlowBox.cpp in Sources */,
                                BCEA4859097D93020094C9E4 /* InlineTextBox.cpp in Sources */,
                                BC6C49F30D7DBA0500FFA558 /* JSImageConstructor.cpp in Sources */,
                                A77979280D6B9E64003851B9 /* JSImageData.cpp in Sources */,
                                A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
-                               7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */,
-                               7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */,
-                               F316396E1329487600A649CB /* JSInjectedScriptManager.cpp in Sources */,
                                7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
                                7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
                                1C5FAED10DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp in Sources */,
                                514C76530CE9234E007EF3CD /* ResourceRequestMac.mm in Sources */,
                                514C767E0CE923A1007EF3CD /* ResourceResponseBase.cpp in Sources */,
                                7EE6847112D26E3800E79415 /* ResourceResponseCFNet.cpp in Sources */,
+                               A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */,
                                514C76550CE9234F007EF3CD /* ResourceResponseMac.mm in Sources */,
                                FD3160A412B026F700C1A359 /* Reverb.cpp in Sources */,
                                FD3160A612B026F700C1A359 /* ReverbAccumulationBuffer.cpp in Sources */,
                                9393E604151A9A1800066F06 /* StyleCachedImageSet.cpp in Sources */,
                                5038BE2F1472AD230095E0D1 /* StyleCachedShader.cpp in Sources */,
                                50E18CD816F9285800C65486 /* StyleCustomFilterProgram.cpp in Sources */,
+                               A5840E24187B8AC200843B10 /* PageInjectedScriptHost.cpp in Sources */,
                                50E18CD916F9285800C65486 /* StyleCustomFilterProgramCache.cpp in Sources */,
                                A8C4A7FE09D563270003AC8D /* StyledElement.cpp in Sources */,
                                BC5EB8B80E8201BD00B25965 /* StyleDeprecatedFlexibleBoxData.cpp in Sources */,
index 234259c..a2c819c 100644 (file)
@@ -95,7 +95,6 @@
 #include "JSImageConstructor.cpp"
 #include "JSImageDataCustom.cpp"
 #include "JSInjectedScriptHostCustom.cpp"
-#include "JSInjectedScriptManager.cpp"
 #include "JSInspectorFrontendHostCustom.cpp"
 #include "JSJavaScriptCallFrameCustom.cpp"
 #include "JSLazyEventListener.cpp"
diff --git a/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp b/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
deleted file mode 100644 (file)
index a6da642..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "InjectedScriptManager.h"
-
-#include "ExceptionCode.h"
-#include "JSDOMWindow.h"
-#include "JSDOMWindowCustom.h"
-#include "JSInjectedScriptHost.h"
-#include "JSMainThreadExecState.h"
-#include <bindings/ScriptObject.h>
-#include <parser/SourceCode.h>
-#include <runtime/JSLock.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-Deprecated::ScriptObject InjectedScriptManager::createInjectedScript(const String& source, JSC::ExecState* scriptState, int id)
-{
-    JSLockHolder lock(scriptState);
-
-    SourceCode sourceCode = makeSource(source);
-    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
-    JSValue globalThisValue = scriptState->globalThisValue();
-
-    JSValue evaluationException;
-    JSValue evaluationReturnValue;
-    if (isMainThread())
-        evaluationReturnValue = JSMainThreadExecState::evaluate(scriptState, sourceCode, globalThisValue, &evaluationException);
-    else {
-        JSC::JSLockHolder lock(scriptState);
-        evaluationReturnValue = JSC::evaluate(scriptState, sourceCode, globalThisValue, &evaluationException);
-    }
-    if (evaluationException)
-        return Deprecated::ScriptObject();
-
-    JSValue functionValue = evaluationReturnValue;
-    CallData callData;
-    CallType callType = getCallData(functionValue, callData);
-    if (callType == CallTypeNone)
-        return Deprecated::ScriptObject();
-
-    MarkedArgumentBuffer args;
-    args.append(toJS(scriptState, globalObject, m_injectedScriptHost.get()));
-    args.append(globalThisValue);
-    args.append(jsNumber(id));
-
-    JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
-    if (result.isObject())
-        return Deprecated::ScriptObject(scriptState, result.getObject());
-    return Deprecated::ScriptObject();
-}
-
-bool InjectedScriptManager::canAccessInspectedWindow(JSC::ExecState* scriptState)
-{
-    JSLockHolder lock(scriptState);
-    JSDOMWindow* inspectedWindow = toJSDOMWindow(scriptState->lexicalGlobalObject());
-    if (!inspectedWindow)
-        return false;
-    return BindingSecurity::shouldAllowAccessToDOMWindow(scriptState, inspectedWindow->impl(), DoNotReportSecurityError);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
index a58c8f4..779b96a 100644 (file)
@@ -50,8 +50,14 @@ JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState* exec, JSC::JSValue
 {
     if (isMainThread())
         return JSMainThreadExecState::call(exec, functionObject, callType, callData, thisValue, args);
-    else
-        return JSC::call(exec, functionObject, callType, callData, thisValue, args);
+    return JSC::call(exec, functionObject, callType, callData, thisValue, args);
+}
+
+JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState* exec, const JSC::SourceCode& source, JSC::JSValue thisValue, JSC::JSValue* exception)
+{
+    if (isMainThread())
+        return JSMainThreadExecState::evaluate(exec, source, thisValue, exception);
+    return JSC::evaluate(exec, source, thisValue, exception);
 }
 
 } // namespace WebCore
index 2fa6629..99602f6 100644 (file)
@@ -108,7 +108,8 @@ private:
     JSC::ExecState* m_previousState;
 };
 
-JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState* exec, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData& callData, JSC::JSValue thisValue, const JSC::ArgList& args);
+JSC::JSValue functionCallHandlerFromAnyThread(JSC::ExecState*, JSC::JSValue functionObject, JSC::CallType callType, const JSC::CallData& callData, JSC::JSValue thisValue, const JSC::ArgList& args);
+JSC::JSValue evaluateHandlerFromAnyThread(JSC::ExecState*, const JSC::SourceCode&, JSC::JSValue thisValue, JSC::JSValue* exception);
 
 } // namespace WebCore
 
index 107242a..5f76602 100644 (file)
@@ -37,7 +37,6 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLFrameOwnerElement.h"
-#include "InjectedScript.h"
 #include "InspectorAgent.h"
 #include "InspectorClient.h"
 #include "InspectorConsoleAgent.h"
index bc3fd2c..3b05600 100644 (file)
@@ -48,7 +48,6 @@ class InspectorValue;
 namespace WebCore {
 
 class Database;
-class InjectedScript;
 class InspectorAgent;
 class InspectorConsoleAgent;
 class InspectorDOMAgent;
index 95339e1..90af650 100644 (file)
 
 #include "CommandLineAPIModuleSource.h"
 #include "JSCommandLineAPIHost.h"
+#include "PageInjectedScriptManager.h"
+#include <inspector/InjectedScript.h>
 
 using namespace JSC;
+using namespace Inspector;
 
 namespace WebCore {
 
@@ -53,9 +56,11 @@ String CommandLineAPIModule::source() const
 
 JSC::JSValue CommandLineAPIModule::host(InjectedScriptManager* injectedScriptManager, JSC::ExecState* exec) const
 {
-    ASSERT(injectedScriptManager->commandLineAPIHost());
+    // CommandLineAPIModule should only ever be used by a PageInjectedScriptManager.
+    PageInjectedScriptManager* pageInjectedScriptManager = static_cast<PageInjectedScriptManager*>(injectedScriptManager);
+    ASSERT(pageInjectedScriptManager->commandLineAPIHost());
     JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
-    return toJS(exec, globalObject, injectedScriptManager->commandLineAPIHost());
+    return toJS(exec, globalObject, pageInjectedScriptManager->commandLineAPIHost());
 }
 
 } // namespace WebCore
index b4a5af4..ac69d7b 100644 (file)
 #ifndef CommandLineAPIModule_h
 #define CommandLineAPIModule_h
 
-#include "InjectedScriptModule.h"
+#include <inspector/InjectedScriptModule.h>
 
 #if ENABLE(INSPECTOR)
 
 namespace WebCore {
 
-class CommandLineAPIModule FINAL : public InjectedScriptModule {
+class CommandLineAPIModule FINAL : public Inspector::InjectedScriptModule {
 public:
     CommandLineAPIModule();
 
     virtual String source() const OVERRIDE;
-    virtual JSC::JSValue host(InjectedScriptManager*, JSC::ExecState*) const OVERRIDE;
+    virtual JSC::JSValue host(Inspector::InjectedScriptManager*, JSC::ExecState*) const OVERRIDE;
     virtual bool returnsObject() const OVERRIDE { return false; }
 
-    static void injectIfNeeded(InjectedScriptManager*, InjectedScript);
+    static void injectIfNeeded(Inspector::InjectedScriptManager*, Inspector::InjectedScript);
 };
 
 } // namespace WebCore
index 6fb85d0..cc8ccf0 100644 (file)
  */
 
 #include "config.h"
+#include "ConsoleMessage.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "ConsoleMessage.h"
-
 #include "Console.h"
 #include "IdentifiersFactory.h"
-#include "InjectedScript.h"
-#include "InjectedScriptManager.h"
 #include "ScriptArguments.h"
 #include "ScriptCallFrame.h"
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 #include <bindings/ScriptValue.h>
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorValues.h>
 #include <wtf/MainThread.h>
 
@@ -189,7 +188,7 @@ static Inspector::TypeBuilder::Console::ConsoleMessage::Level::Enum messageLevel
     return Inspector::TypeBuilder::Console::ConsoleMessage::Level::Log;
 }
 
-void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFrontendDispatcher, InjectedScriptManager* injectedScriptManager, bool generatePreview)
+void ConsoleMessage::addToFrontend(InspectorConsoleFrontendDispatcher* consoleFrontendDispatcher, Inspector::InjectedScriptManager* injectedScriptManager, bool generatePreview)
 {
     RefPtr<Inspector::TypeBuilder::Console::ConsoleMessage> jsonObj = Inspector::TypeBuilder::Console::ConsoleMessage::create()
         .setSource(messageSourceValue(m_source))
index 16ccf1e..122a4e0 100644 (file)
 #include <wtf/Vector.h>
 
 namespace Inspector {
+class InjectedScriptManager;
 class InspectorObject;
 }
 
 namespace WebCore {
 
 class DOMWindow;
-class InjectedScriptManager;
 class ScriptArguments;
 class ScriptCallFrame;
 class ScriptCallStack;
@@ -59,7 +59,7 @@ public:
     ConsoleMessage(bool canGenerateCallStack, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, JSC::ExecState*, unsigned long requestIdentifier = 0);
     ~ConsoleMessage();
 
-    void addToFrontend(Inspector::InspectorConsoleFrontendDispatcher*, InjectedScriptManager*, bool generatePreview);
+    void addToFrontend(Inspector::InspectorConsoleFrontendDispatcher*, Inspector::InjectedScriptManager*, bool generatePreview);
     void updateRepeatCountInConsole(Inspector::InspectorConsoleFrontendDispatcher*);
     void incrementCount() { ++m_repeatCount; }
     bool isEqual(ConsoleMessage* msg) const;
diff --git a/Source/WebCore/inspector/InjectedScript.h b/Source/WebCore/inspector/InjectedScript.h
deleted file mode 100644 (file)
index adfe4e0..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InjectedScript_h
-#define InjectedScript_h
-
-#include "InjectedScriptBase.h"
-#include "InjectedScriptManager.h"
-#include "InspectorWebTypeBuilders.h"
-#include "ScriptArguments.h"
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-
-namespace Deprecated {
-class ScriptObject;
-}
-
-namespace WebCore {
-
-class InjectedScriptModule;
-class Node;
-
-#if ENABLE(INSPECTOR)
-
-class InjectedScript : public InjectedScriptBase {
-public:
-    InjectedScript();
-    ~InjectedScript() { }
-
-    void evaluate(ErrorString*,
-                  const String& expression,
-                  const String& objectGroup,
-                  bool includeCommandLineAPI,
-                  bool returnByValue,
-                  bool generatePreview,
-                  RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result,
-                  Inspector::TypeBuilder::OptOutput<bool>* wasThrown);
-    void callFunctionOn(ErrorString*,
-                        const String& objectId,
-                        const String& expression,
-                        const String& arguments,
-                        bool returnByValue,
-                        bool generatePreview,
-                        RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result,
-                        Inspector::TypeBuilder::OptOutput<bool>* wasThrown);
-    void evaluateOnCallFrame(ErrorString*,
-                             const Deprecated::ScriptValue& callFrames,
-                             const String& callFrameId,
-                             const String& expression,
-                             const String& objectGroup,
-                             bool includeCommandLineAPI,
-                             bool returnByValue,
-                             bool generatePreview,
-                             RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>* result,
-                             Inspector::TypeBuilder::OptOutput<bool>* wasThrown);
-    void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<Inspector::TypeBuilder::Debugger::FunctionDetails>* result);
-    void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>* result);
-    void getInternalProperties(ErrorString*, const String& objectId, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>* result);
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Debugger::CallFrame>> wrapCallFrames(const Deprecated::ScriptValue&);
-#endif
-    PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> wrapObject(const Deprecated::ScriptValue&, const String& groupName, bool generatePreview = false) const;
-    PassRefPtr<Inspector::TypeBuilder::Runtime::RemoteObject> wrapTable(const Deprecated::ScriptValue& table, const Deprecated::ScriptValue& columns) const;
-
-    Deprecated::ScriptValue findObjectById(const String& objectId) const;
-    void inspectObject(Deprecated::ScriptValue);
-
-    void releaseObject(const String& objectId);
-    void releaseObjectGroup(const String& objectGroup);
-
-private:
-    friend class InjectedScriptModule;
-    friend InjectedScript InjectedScriptManager::injectedScriptFor(JSC::ExecState*);
-    InjectedScript(Deprecated::ScriptObject, InspectedStateAccessCheck);
-};
-
-#endif
-
-} // namespace WebCore
-
-#endif
index f250214..08d2c8f 100644 (file)
 
 #include "InjectedScriptCanvasModule.h"
 
-#include "InjectedScript.h"
 #include "InjectedScriptCanvasModuleSource.h"
-#include "InjectedScriptManager.h"
 #include "JSMainThreadExecState.h"
 #include <bindings/ScriptFunctionCall.h>
 #include <bindings/ScriptObject.h>
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorValues.h>
 
 using Inspector::TypeBuilder::Array;
@@ -55,7 +55,7 @@ using namespace Inspector;
 namespace WebCore {
 
 InjectedScriptCanvasModule::InjectedScriptCanvasModule()
-    : InjectedScriptModule("InjectedScriptCanvasModule")
+    : Inspector::InjectedScriptModule("InjectedScriptCanvasModule")
 {
 }
 
index 2c44369..fa72f0a 100644 (file)
@@ -31,8 +31,9 @@
 #ifndef InjectedScriptCanvasModule_h
 #define InjectedScriptCanvasModule_h
 
-#include "InjectedScriptModule.h"
+#include "InspectorWebTypeBuilders.h"
 #include "ScriptState.h"
+#include <inspector/InjectedScriptModule.h>
 #include <wtf/text/WTFString.h>
 
 namespace Deprecated {
@@ -41,19 +42,19 @@ class ScriptObject;
 
 namespace WebCore {
 
-class InjectedScriptManager;
+typedef String ErrorString;
 
 #if ENABLE(INSPECTOR)
 
-class InjectedScriptCanvasModule FINAL : public InjectedScriptModule {
+class InjectedScriptCanvasModule FINAL : public Inspector::InjectedScriptModule {
 public:
     InjectedScriptCanvasModule();
     
     virtual String source() const OVERRIDE;
-    virtual JSC::JSValue host(InjectedScriptManager*, JSC::ExecState*) const OVERRIDE;
+    virtual JSC::JSValue host(Inspector::InjectedScriptManager*, JSC::ExecState*) const OVERRIDE;
     virtual bool returnsObject() const OVERRIDE { return true; }
 
-    static InjectedScriptCanvasModule moduleForState(InjectedScriptManager*, JSC::ExecState*);
+    static InjectedScriptCanvasModule moduleForState(Inspector::InjectedScriptManager*, JSC::ExecState*);
 
     Deprecated::ScriptObject wrapCanvas2DContext(const Deprecated::ScriptObject&);
 #if ENABLE(WEBGL)
diff --git a/Source/WebCore/inspector/InjectedScriptHost.cpp b/Source/WebCore/inspector/InjectedScriptHost.cpp
deleted file mode 100644 (file)
index c2399e0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InjectedScriptHost.h"
-
-#if ENABLE(INSPECTOR)
-
-namespace WebCore {
-
-PassRefPtr<InjectedScriptHost> InjectedScriptHost::create()
-{
-    return adoptRef(new InjectedScriptHost);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InjectedScriptHost.h b/Source/WebCore/inspector/InjectedScriptHost.h
deleted file mode 100644 (file)
index 3bb6cdc..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2007, 2013 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef InjectedScriptHost_h
-#define InjectedScriptHost_h
-
-#include "ScriptState.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-
-namespace Deprecated {
-class ScriptValue;
-}
-
-namespace WebCore {
-
-class Node;
-
-class InjectedScriptHost : public RefCounted<InjectedScriptHost> {
-public:
-    static PassRefPtr<InjectedScriptHost> create();
-    ~InjectedScriptHost() { }
-
-private:
-    InjectedScriptHost() { }
-};
-
-} // namespace WebCore
-
-#endif // !defined(InjectedScriptHost_h)
diff --git a/Source/WebCore/inspector/InjectedScriptHost.idl b/Source/WebCore/inspector/InjectedScriptHost.idl
deleted file mode 100644 (file)
index 6a88a6b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    NoInterfaceObject,
-    Conditional=INSPECTOR,
-    ImplementationLacksVTable
-] interface InjectedScriptHost {
-    [Custom] any internalConstructorName(any object);
-    [Custom] boolean isHTMLAllCollection(any object);
-    [Custom] DOMString type(any object);
-    [Custom] any functionDetails(any object);
-    [Custom] Array getInternalProperties(any object);
-
-    [Custom] readonly attribute any evaluate;
-};
index 0b95d8a..1a86626 100644 (file)
 #include "DOMEditor.cpp"
 #include "DOMPatchSupport.cpp"
 #include "IdentifiersFactory.cpp"
-#include "InjectedScript.cpp"
-#include "InjectedScriptBase.cpp"
 #include "InjectedScriptCanvasModule.cpp"
-#include "InjectedScriptHost.cpp"
-#include "InjectedScriptManager.cpp"
-#include "InjectedScriptModule.cpp"
 #include "InspectorAgent.cpp"
 #include "InspectorApplicationCacheAgent.cpp"
 #include "InspectorCSSAgent.cpp"
@@ -59,6 +54,7 @@
 #include "InspectorIndexedDBAgent.cpp"
 #include "InspectorInputAgent.cpp"
 #include "InspectorInstrumentation.cpp"
+#include "InspectorInstrumentationCookie.cpp"
 #include "InspectorLayerTreeAgent.cpp"
 #include "InspectorMemoryAgent.cpp"
 #include "InspectorNodeFinder.cpp"
@@ -75,6 +71,7 @@
 #include "NetworkResourcesData.cpp"
 #include "PageConsoleAgent.cpp"
 #include "PageDebuggerAgent.cpp"
+#include "PageInjectedScriptHost.cpp"
 #include "PageInjectedScriptManager.cpp"
 #include "PageRuntimeAgent.cpp"
 #include "ScriptArguments.cpp"
index f5abcfa..6d82332 100644 (file)
@@ -37,9 +37,7 @@
 #include "DOMWindow.h"
 #include "HTMLCanvasElement.h"
 #include "HTMLNames.h"
-#include "InjectedScript.h"
 #include "InjectedScriptCanvasModule.h"
-#include "InjectedScriptManager.h"
 #include "InspectorPageAgent.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InstrumentingAgents.h"
@@ -49,6 +47,8 @@
 #include "ScriptProfiler.h"
 #include "ScriptState.h"
 #include <bindings/ScriptObject.h>
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 
 using Inspector::TypeBuilder::Array;
 using Inspector::TypeBuilder::Canvas::ResourceId;
index bb912ba..e398cf3 100644 (file)
@@ -47,11 +47,14 @@ namespace Deprecated {
 class ScriptObject;
 }
 
+namespace Inspector {
+class InjectedScriptManager;
+}
+
 namespace WebCore {
 
 class Frame;
 class InjectedScriptCanvasModule;
-class InjectedScriptManager;
 class InspectorPageAgent;
 class InstrumentingAgents;
 
@@ -59,7 +62,7 @@ typedef String ErrorString;
 
 class InspectorCanvasAgent : public InspectorAgentBase, public Inspector::InspectorCanvasBackendDispatcherHandler {
 public:
-    static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager)
+    static PassOwnPtr<InspectorCanvasAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, Inspector::InjectedScriptManager* injectedScriptManager)
     {
         return adoptPtr(new InspectorCanvasAgent(instrumentingAgents, pageAgent, injectedScriptManager));
     }
@@ -92,7 +95,7 @@ public:
     virtual void getResourceState(ErrorString*, const Inspector::TypeBuilder::Canvas::TraceLogId&, const Inspector::TypeBuilder::Canvas::ResourceId&, RefPtr<Inspector::TypeBuilder::Canvas::ResourceState>&);
 
 private:
-    InspectorCanvasAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*);
+    InspectorCanvasAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*);
 
     InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, JSC::ExecState*);
     InjectedScriptCanvasModule injectedScriptCanvasModule(ErrorString*, const Deprecated::ScriptObject&);
@@ -103,7 +106,7 @@ private:
     Deprecated::ScriptObject notifyRenderingContextWasWrapped(const Deprecated::ScriptObject&);
 
     InspectorPageAgent* m_pageAgent;
-    InjectedScriptManager* m_injectedScriptManager;
+    Inspector::InjectedScriptManager* m_injectedScriptManager;
     std::unique_ptr<Inspector::InspectorCanvasFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorCanvasBackendDispatcher> m_backendDispatcher;
     bool m_enabled;
index 28a409e..d609587 100644 (file)
@@ -33,9 +33,9 @@
 #include "Console.h"
 #include "ConsoleMessage.h"
 #include "DOMWindow.h"
-#include "InjectedScriptManager.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InstrumentingAgents.h"
+#include "PageInjectedScriptManager.h"
 #include "ResourceError.h"
 #include "ResourceResponse.h"
 #include "ScriptArguments.h"
@@ -60,7 +60,7 @@ static const int expireConsoleMessagesStep = 100;
 
 int InspectorConsoleAgent::s_enabledAgentCount = 0;
 
-InspectorConsoleAgent::InspectorConsoleAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
+InspectorConsoleAgent::InspectorConsoleAgent(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
     : InspectorAgentBase(ASCIILiteral("Console"), instrumentingAgents)
     , m_injectedScriptManager(injectedScriptManager)
     , m_previousMessage(0)
index 90d0f1a..f723803 100644 (file)
@@ -43,8 +43,8 @@ namespace WebCore {
 
 class ConsoleMessage;
 class DOMWindow;
-class InjectedScriptManager;
 class InstrumentingAgents;
+class PageInjectedScriptManager;
 class ResourceError;
 class ResourceResponse;
 class ScriptArguments;
@@ -56,7 +56,7 @@ typedef String ErrorString;
 class InspectorConsoleAgent : public InspectorAgentBase, public Inspector::InspectorConsoleBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent);
 public:
-    InspectorConsoleAgent(InstrumentingAgents*, InjectedScriptManager*);
+    InspectorConsoleAgent(InstrumentingAgents*, PageInjectedScriptManager*);
     virtual ~InspectorConsoleAgent();
 
     virtual void enable(ErrorString*);
@@ -100,7 +100,7 @@ protected:
 
     virtual bool developerExtrasEnabled() = 0;
 
-    InjectedScriptManager* m_injectedScriptManager;
+    PageInjectedScriptManager* m_injectedScriptManager;
     std::unique_ptr<Inspector::InspectorConsoleFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorConsoleBackendDispatcher> m_backendDispatcher;
     ConsoleMessage* m_previousMessage;
index 60bbe68..f2847a2 100644 (file)
  */
 
 #include "config.h"
+#include "InspectorController.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "InspectorController.h"
-
 #include "CommandLineAPIHost.h"
 #include "DOMWrapperWorld.h"
 #include "GraphicsContext.h"
 #include "IdentifiersFactory.h"
-#include "InjectedScriptHost.h"
-#include "InjectedScriptManager.h"
 #include "InspectorAgent.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InspectorWorkerAgent.h"
 #include "InstrumentingAgents.h"
+#include "JSDOMWindow.h"
+#include "JSDOMWindowCustom.h"
+#include "JSMainThreadExecState.h"
 #include "MainFrame.h"
 #include "Page.h"
 #include "PageConsoleAgent.h"
 #include "PageDebuggerAgent.h"
+#include "PageInjectedScriptHost.h"
+#include "PageInjectedScriptManager.h"
 #include "PageRuntimeAgent.h"
 #include "Settings.h"
 #include <inspector/InspectorBackendDispatcher.h>
+#include <runtime/JSLock.h>
 
+using namespace JSC;
 using namespace Inspector;
 
 namespace WebCore {
 
 InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient)
     : m_instrumentingAgents(InstrumentingAgents::create())
-    , m_injectedScriptManager(InjectedScriptManager::createForPage())
+    , m_injectedScriptManager(std::make_unique<PageInjectedScriptManager>(*this, PageInjectedScriptHost::create()))
     , m_overlay(InspectorOverlay::create(page, inspectorClient))
     , m_inspectorFrontendChannel(nullptr)
     , m_page(page)
@@ -96,7 +100,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* inspectorC
     m_inspectorAgent = inspectorAgentPtr.get();
     m_agents.append(inspectorAgentPtr.release());
 
-    OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, m_injectedScriptManager.get(), inspectorClient, m_overlay.get()));
+    OwnPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_inspectorAgent, inspectorClient, m_overlay.get()));
     InspectorPageAgent* pageAgent = pageAgentPtr.get();
     m_pageAgent = pageAgentPtr.get();
     m_agents.append(pageAgentPtr.release());
@@ -238,6 +242,9 @@ void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWo
     if (&world != &mainThreadNormalWorld())
         return;
 
+    if (frame->isMainFrame())
+        m_injectedScriptManager->discardInjectedScripts();
+
     // If the page is supposed to serve as InspectorFrontend notify inspector frontend
     // client that it's cleared so that the client can expose inspector bindings.
     if (m_inspectorFrontendClient && frame->isMainFrame())
@@ -444,6 +451,48 @@ void InspectorController::didComposite()
         timelineAgent->didComposite();
 }
 
+bool InspectorController::developerExtrasEnabled() const
+{
+    if (!m_page)
+        return false;
+
+    return m_page->settings().developerExtrasEnabled();
+}
+
+bool InspectorController::canAccessInspectedScriptState(JSC::ExecState* scriptState) const
+{
+    JSLockHolder lock(scriptState);
+    JSDOMWindow* inspectedWindow = toJSDOMWindow(scriptState->lexicalGlobalObject());
+    if (!inspectedWindow)
+        return false;
+
+    return BindingSecurity::shouldAllowAccessToDOMWindow(scriptState, inspectedWindow->impl(), DoNotReportSecurityError);
+}
+
+InspectorFunctionCallHandler InspectorController::functionCallHandler() const
+{
+    return WebCore::functionCallHandlerFromAnyThread;
+}
+
+InspectorEvaluateHandler InspectorController::evaluateHandler() const
+{
+    return WebCore::evaluateHandlerFromAnyThread;
+}
+
+void InspectorController::willCallInjectedScriptFunction(JSC::ExecState* scriptState, const String& scriptName, int scriptLine)
+{
+    ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextFromExecState(scriptState);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFunction(scriptExecutionContext, scriptName, scriptLine);
+    m_injectedScriptInstrumentationCookies.append(cookie);
+}
+
+void InspectorController::didCallInjectedScriptFunction()
+{
+    ASSERT(!m_injectedScriptInstrumentationCookies.isEmpty());
+    InspectorInstrumentationCookie cookie = m_injectedScriptInstrumentationCookies.takeLast();
+    InspectorInstrumentation::didCallFunction(cookie);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index 2ad528a..ccfde2c 100644 (file)
 
 #if ENABLE(INSPECTOR)
 
+#include "InspectorInstrumentationCookie.h"
 #include <inspector/InspectorAgentRegistry.h>
+#include <inspector/InspectorEnvironment.h>
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
 namespace Inspector {
@@ -50,7 +53,6 @@ namespace WebCore {
 class DOMWrapperWorld;
 class Frame;
 class GraphicsContext;
-class InjectedScriptManager;
 class InspectorAgent;
 class InspectorApplicationCacheAgent;
 class InspectorClient;
@@ -66,15 +68,16 @@ class InspectorResourceAgent;
 class InstrumentingAgents;
 class IntSize;
 class Page;
+class PageInjectedScriptManager;
 class Node;
 
 struct Highlight;
 
-class InspectorController {
+class InspectorController FINAL : public Inspector::InspectorEnvironment {
     WTF_MAKE_NONCOPYABLE(InspectorController);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    ~InspectorController();
+    virtual ~InspectorController();
 
     static PassOwnPtr<InspectorController> create(Page*, InspectorClient*);
     void inspectedPageDestroyed();
@@ -133,13 +136,20 @@ public:
     void willComposite();
     void didComposite();
 
+    virtual bool developerExtrasEnabled() const OVERRIDE;
+    virtual bool canAccessInspectedScriptState(JSC::ExecState*) const OVERRIDE;
+    virtual Inspector::InspectorFunctionCallHandler functionCallHandler() const OVERRIDE;
+    virtual Inspector::InspectorEvaluateHandler evaluateHandler() const OVERRIDE;
+    virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) OVERRIDE;
+    virtual void didCallInjectedScriptFunction() OVERRIDE;
+
 private:
     InspectorController(Page*, InspectorClient*);
 
     friend InstrumentingAgents* instrumentationForPage(Page*);
 
     RefPtr<InstrumentingAgents> m_instrumentingAgents;
-    OwnPtr<InjectedScriptManager> m_injectedScriptManager;
+    std::unique_ptr<PageInjectedScriptManager> m_injectedScriptManager;
     OwnPtr<InspectorOverlay> m_overlay;
 
     InspectorAgent* m_inspectorAgent;
@@ -159,6 +169,7 @@ private:
     Page* m_page;
     InspectorClient* m_inspectorClient;
     Inspector::InspectorAgentRegistry m_agents;
+    Vector<InspectorInstrumentationCookie, 2> m_injectedScriptInstrumentationCookies;
     bool m_isUnderTest;
 
 #if ENABLE(REMOTE_INSPECTOR)
index d0e775e..de79d2a 100644 (file)
@@ -64,7 +64,6 @@
 #include "HTMLTemplateElement.h"
 #include "HitTestResult.h"
 #include "IdentifiersFactory.h"
-#include "InjectedScriptManager.h"
 #include "InspectorHistory.h"
 #include "InspectorNodeFinder.h"
 #include "InspectorOverlay.h"
@@ -79,7 +78,6 @@
 #include "Node.h"
 #include "NodeList.h"
 #include "Page.h"
-#include "PageInjectedScriptManager.h"
 #include "Pasteboard.h"
 #include "RenderStyle.h"
 #include "RenderStyleConstants.h"
@@ -93,6 +91,8 @@
 #include "XPathResult.h"
 #include "htmlediting.h"
 #include "markup.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <wtf/HashSet.h>
 #include <wtf/OwnPtr.h>
 #include <wtf/Vector.h>
index 1c0f0c2..a7285f9 100644 (file)
@@ -31,8 +31,6 @@
 #define InspectorDOMAgent_h
 
 #include "EventTarget.h"
-#include "InjectedScript.h"
-#include "InjectedScriptManager.h"
 #include "InspectorOverlay.h"
 #include "InspectorWebAgentBase.h"
 #include "InspectorWebBackendDispatchers.h"
@@ -53,6 +51,10 @@ namespace Deprecated {
 class ScriptValue;
 }
 
+namespace Inspector {
+class InjectedScriptManager;
+}
+
 namespace WebCore {
 
 class ContainerNode;
@@ -104,7 +106,7 @@ public:
         virtual void didModifyDOMAttr(Element*) = 0;
     };
 
-    static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
+    static PassOwnPtr<InspectorDOMAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, Inspector::InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
     {
         return adoptPtr(new InspectorDOMAgent(instrumentingAgents, pageAgent, injectedScriptManager, overlay));
     }
@@ -213,7 +215,7 @@ public:
     InspectorPageAgent* pageAgent() { return m_pageAgent; }
 
 private:
-    InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
+    InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
 
     void setSearchingForNode(ErrorString*, bool enabled, Inspector::InspectorObject* highlightConfig);
     PassOwnPtr<HighlightConfig> highlightConfigFromInspectorObject(ErrorString*, Inspector::InspectorObject* highlightInspectorObject);
@@ -246,7 +248,7 @@ private:
     void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<Inspector::InspectorObject>* color, const RefPtr<Inspector::InspectorObject>* outlineColor, const bool* usePageCoordinates);
 
     InspectorPageAgent* m_pageAgent;
-    InjectedScriptManager* m_injectedScriptManager;
+    Inspector::InjectedScriptManager* m_injectedScriptManager;
     InspectorOverlay* m_overlay;
     std::unique_ptr<Inspector::InspectorDOMFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorDOMBackendDispatcher> m_backendDispatcher;
index f2e34f8..ea6c067 100644 (file)
 
 #include "CachedResource.h"
 #include "ContentSearchUtils.h"
-#include "InjectedScript.h"
-#include "InjectedScriptManager.h"
 #include "InspectorPageAgent.h"
 #include "InstrumentingAgents.h"
 #include "RegularExpression.h"
 #include "ScriptDebugServer.h"
 #include <bindings/ScriptObject.h>
 #include <bindings/ScriptValue.h>
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorValues.h>
 #include <wtf/text/WTFString.h>
 
index 27c1264..3d4b1a9 100644 (file)
 
 #include "ConsoleAPITypes.h"
 #include "ConsoleTypes.h"
-#include "InjectedScript.h"
 #include "InspectorWebAgentBase.h"
 #include "ScriptBreakpoint.h"
 #include "ScriptDebugListener.h"
+#include <bindings/ScriptValue.h>
 #include <debugger/Debugger.h>
 #include <inspector/InspectorJSBackendDispatchers.h>
 #include <inspector/InspectorJSFrontendDispatchers.h>
 #include <wtf/Vector.h>
 #include <wtf/text/StringHash.h>
 
-namespace Deprecated {
-class ScriptValue;
-}
-
 namespace Inspector {
+class InjectedScript;
+class InjectedScriptManager;
 class InspectorArray;
 class InspectorObject;
 class InspectorValue;
@@ -60,7 +58,6 @@ class InspectorValue;
 
 namespace WebCore {
 
-class InjectedScriptManager;
 class InstrumentingAgents;
 class ScriptDebugServer;
 
@@ -136,14 +133,14 @@ public:
     virtual ScriptDebugServer& scriptDebugServer() = 0;
 
 protected:
-    InspectorDebuggerAgent(InstrumentingAgents*, InjectedScriptManager*);
+    InspectorDebuggerAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*);
 
     virtual void startListeningScriptDebugServer() = 0;
     virtual void stopListeningScriptDebugServer() = 0;
     virtual void muteConsole() = 0;
     virtual void unmuteConsole() = 0;
-    InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
-    virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
+    Inspector::InjectedScriptManager* injectedScriptManager() const { return m_injectedScriptManager; }
+    virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
 
     virtual void enable();
     virtual void disable();
@@ -168,7 +165,7 @@ private:
     typedef HashMap<String, Vector<JSC::BreakpointID>> BreakpointIdentifierToDebugServerBreakpointIDsMap;
     typedef HashMap<String, RefPtr<Inspector::InspectorObject>> BreakpointIdentifierToBreakpointMap;
 
-    InjectedScriptManager* m_injectedScriptManager;
+    Inspector::InjectedScriptManager* m_injectedScriptManager;
     std::unique_ptr<Inspector::InspectorDebuggerFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorDebuggerBackendDispatcher> m_backendDispatcher;
     JSC::ExecState* m_pausedScriptState;
index 25c9738..c7444d2 100644 (file)
 #if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
 
 #include "CommandLineAPIHost.h"
-#include "InjectedScript.h"
-#include "InjectedScriptHost.h"
 #include "InstrumentingAgents.h"
+#include "PageInjectedScriptManager.h"
 #include "ScriptProfiler.h"
+#include <inspector/InjectedScript.h>
 
 using namespace Inspector;
 
@@ -45,12 +45,12 @@ namespace WebCore {
 
 static const char* const UserInitiatedProfileNameHeap = "org.webkit.profiles.user-initiated";
 
-PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
+PassOwnPtr<InspectorHeapProfilerAgent> InspectorHeapProfilerAgent::create(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
 {
     return adoptPtr(new InspectorHeapProfilerAgent(instrumentingAgents, injectedScriptManager));
 }
 
-InspectorHeapProfilerAgent::InspectorHeapProfilerAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
+InspectorHeapProfilerAgent::InspectorHeapProfilerAgent(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
     : InspectorAgentBase(ASCIILiteral("HeapProfiler"), instrumentingAgents)
     , m_injectedScriptManager(injectedScriptManager)
     , m_nextUserInitiatedHeapSnapshotNumber(1)
index 4a67612..212fdbb 100644 (file)
@@ -44,7 +44,7 @@
 
 namespace WebCore {
 
-class InjectedScriptManager;
+class PageInjectedScriptManager;
 class ScriptHeapSnapshot;
 class ScriptProfile;
 
@@ -53,7 +53,7 @@ typedef String ErrorString;
 class InspectorHeapProfilerAgent : public InspectorAgentBase, public Inspector::InspectorHeapProfilerBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorHeapProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<InspectorHeapProfilerAgent> create(InstrumentingAgents*, InjectedScriptManager*);
+    static PassOwnPtr<InspectorHeapProfilerAgent> create(InstrumentingAgents*, PageInjectedScriptManager*);
     virtual ~InspectorHeapProfilerAgent();
 
     virtual void collectGarbage(ErrorString*);
@@ -75,7 +75,7 @@ public:
     virtual void getHeapObjectId(ErrorString*, const String& objectId, String* heapSnapshotObjectId);
 
 private:
-    InspectorHeapProfilerAgent(InstrumentingAgents*, InjectedScriptManager*);
+    InspectorHeapProfilerAgent(InstrumentingAgents*, PageInjectedScriptManager*);
 
     typedef HashMap<unsigned, RefPtr<ScriptHeapSnapshot>> IdToHeapSnapshotMap;
 
@@ -83,7 +83,7 @@ private:
 
     PassRefPtr<Inspector::TypeBuilder::HeapProfiler::ProfileHeader> createSnapshotHeader(const ScriptHeapSnapshot&);
 
-    InjectedScriptManager* m_injectedScriptManager;
+    PageInjectedScriptManager* m_injectedScriptManager;
     std::unique_ptr<Inspector::InspectorHeapProfilerFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorHeapProfilerBackendDispatcher> m_backendDispatcher;
     unsigned m_nextUserInitiatedHeapSnapshotNumber;
index 77eb794..b4d7da5 100644 (file)
 #include "IDBPendingTransactionMonitor.h"
 #include "IDBRequest.h"
 #include "IDBTransaction.h"
-#include "InjectedScript.h"
 #include "InspectorPageAgent.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InstrumentingAgents.h"
 #include "SecurityOrigin.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorValues.h>
 #include <wtf/Vector.h>
 
index 8cdc5c5..aa0e56e 100644 (file)
 #include <wtf/PassOwnPtr.h>
 #include <wtf/text/WTFString.h>
 
+namespace Inspector {
+class InjectedScriptManager;
+}
+
 namespace WebCore {
 
-class InjectedScriptManager;
 class InspectorPageAgent;
 
 typedef String ErrorString;
 
 class InspectorIndexedDBAgent : public InspectorAgentBase, public Inspector::InspectorIndexedDBBackendDispatcherHandler {
 public:
-    static PassOwnPtr<InspectorIndexedDBAgent> create(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, InspectorPageAgent* pageAgent)
+    static PassOwnPtr<InspectorIndexedDBAgent> create(InstrumentingAgents* instrumentingAgents, Inspector::InjectedScriptManager* injectedScriptManager, InspectorPageAgent* pageAgent)
     {
         return adoptPtr(new InspectorIndexedDBAgent(instrumentingAgents, injectedScriptManager, pageAgent));
     }
@@ -65,9 +68,9 @@ public:
     virtual void clearObjectStore(ErrorString*, const String& in_securityOrigin, const String& in_databaseName, const String& in_objectStoreName, PassRefPtr<ClearObjectStoreCallback>);
 
 private:
-    InspectorIndexedDBAgent(InstrumentingAgents*, InjectedScriptManager*, InspectorPageAgent*);
+    InspectorIndexedDBAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, InspectorPageAgent*);
 
-    InjectedScriptManager* m_injectedScriptManager;
+    Inspector::InjectedScriptManager* m_injectedScriptManager;
     InspectorPageAgent* m_pageAgent;
     RefPtr<Inspector::InspectorIndexedDBBackendDispatcher> m_backendDispatcher;
 };
index 855996c..8e586c8 100644 (file)
@@ -105,37 +105,6 @@ static Frame* frameForScriptExecutionContext(ScriptExecutionContext* context)
     return frame;
 }
 
-InspectorInstrumentationCookie::InspectorInstrumentationCookie()
-    : m_instrumentingAgents(0)
-    , m_timelineAgentId(0)
-{
-}
-
-InspectorInstrumentationCookie::InspectorInstrumentationCookie(InstrumentingAgents* agents, int timelineAgentId)
-    : m_instrumentingAgents(agents)
-    , m_timelineAgentId(timelineAgentId)
-{
-}
-
-InspectorInstrumentationCookie::InspectorInstrumentationCookie(const InspectorInstrumentationCookie& other)
-    : m_instrumentingAgents(other.m_instrumentingAgents)
-    , m_timelineAgentId(other.m_timelineAgentId)
-{
-}
-
-InspectorInstrumentationCookie& InspectorInstrumentationCookie::operator=(const InspectorInstrumentationCookie& other)
-{
-    if (this != &other) {
-        m_instrumentingAgents = other.m_instrumentingAgents;
-        m_timelineAgentId = other.m_timelineAgentId;
-    }
-    return *this;
-}
-
-InspectorInstrumentationCookie::~InspectorInstrumentationCookie()
-{
-}
-
 void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, DOMWrapperWorld& world)
 {
     InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent();
index 6bf34a8..911bd95 100644 (file)
@@ -38,6 +38,7 @@
 #include "FormData.h"
 #include "Frame.h"
 #include "HitTestResult.h"
+#include "InspectorInstrumentationCookie.h"
 #include "Page.h"
 #include "ScriptExecutionContext.h"
 #include "ScriptState.h"
@@ -92,26 +93,6 @@ class XMLHttpRequest;
 
 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!hasFrontends())) return value;
 
-class InspectorInstrumentationCookie {
-#if ENABLE(INSPECTOR)
-public:
-    InspectorInstrumentationCookie();
-    InspectorInstrumentationCookie(InstrumentingAgents*, int);
-    InspectorInstrumentationCookie(const InspectorInstrumentationCookie&);
-    InspectorInstrumentationCookie& operator=(const InspectorInstrumentationCookie&);
-    ~InspectorInstrumentationCookie();
-
-private:
-    friend class InspectorInstrumentation;
-    InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents.get(); }
-    bool isValid() const { return !!m_instrumentingAgents; }
-    bool hasMatchingTimelineAgentId(int id) const { return m_timelineAgentId == id; }
-
-    RefPtr<InstrumentingAgents> m_instrumentingAgents;
-    int m_timelineAgentId;
-#endif
-};
-
 class InspectorInstrumentation {
 public:
     static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
diff --git a/Source/WebCore/inspector/InspectorInstrumentationCookie.cpp b/Source/WebCore/inspector/InspectorInstrumentationCookie.cpp
new file mode 100644 (file)
index 0000000..7f00deb
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+* Copyright (C) 2011 Google Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*
+*     * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*     * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following disclaimer
+* in the documentation and/or other materials provided with the
+* distribution.
+*     * Neither the name of Google Inc. nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config.h"
+#include "InspectorInstrumentationCookie.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InstrumentingAgents.h"
+
+namespace WebCore {
+
+InspectorInstrumentationCookie::InspectorInstrumentationCookie()
+    : m_instrumentingAgents(nullptr)
+    , m_timelineAgentId(0)
+{
+}
+
+InspectorInstrumentationCookie::InspectorInstrumentationCookie(InstrumentingAgents* agents, int timelineAgentId)
+    : m_instrumentingAgents(agents)
+    , m_timelineAgentId(timelineAgentId)
+{
+}
+
+InspectorInstrumentationCookie::InspectorInstrumentationCookie(const InspectorInstrumentationCookie& other)
+    : m_instrumentingAgents(other.m_instrumentingAgents)
+    , m_timelineAgentId(other.m_timelineAgentId)
+{
+}
+
+InspectorInstrumentationCookie& InspectorInstrumentationCookie::operator=(const InspectorInstrumentationCookie& other)
+{
+    if (this != &other) {
+        m_instrumentingAgents = other.m_instrumentingAgents;
+        m_timelineAgentId = other.m_timelineAgentId;
+    }
+
+    return *this;
+}
+
+InspectorInstrumentationCookie::~InspectorInstrumentationCookie()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/InspectorInstrumentationCookie.h b/Source/WebCore/inspector/InspectorInstrumentationCookie.h
new file mode 100644 (file)
index 0000000..6db514f
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+* Copyright (C) 2010 Google Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are
+* met:
+*
+*     * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*     * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following disclaimer
+* in the documentation and/or other materials provided with the
+* distribution.
+*     * Neither the name of Google Inc. nor the names of its
+* contributors may be used to endorse or promote products derived from
+* this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef InspectorInstrumentationCookie_h
+#define InspectorInstrumentationCookie_h
+
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class InspectorInstrumentation;
+class InstrumentingAgents;
+
+class InspectorInstrumentationCookie {
+#if ENABLE(INSPECTOR)
+public:
+    InspectorInstrumentationCookie();
+    InspectorInstrumentationCookie(InstrumentingAgents*, int);
+    InspectorInstrumentationCookie(const InspectorInstrumentationCookie&);
+    InspectorInstrumentationCookie& operator=(const InspectorInstrumentationCookie&);
+    ~InspectorInstrumentationCookie();
+
+    bool isValid() const { return !!m_instrumentingAgents; }
+    InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents.get(); }
+    bool hasMatchingTimelineAgentId(int id) const { return m_timelineAgentId == id; }
+
+private:
+    RefPtr<InstrumentingAgents> m_instrumentingAgents;
+    int m_timelineAgentId;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // InspectorInstrumentationCookie_h
index 10835c4..787fa73 100644 (file)
@@ -56,7 +56,6 @@
 #include "HTMLNames.h"
 #include "IdentifiersFactory.h"
 #include "ImageBuffer.h"
-#include "InjectedScriptManager.h"
 #include "InspectorAgent.h"
 #include "InspectorClient.h"
 #include "InspectorDOMAgent.h"
@@ -227,9 +226,9 @@ bool InspectorPageAgent::dataContent(const char* data, unsigned size, const Stri
     return decodeBuffer(data, size, textEncodingName, result);
 }
 
-PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InjectedScriptManager* injectedScriptManager, InspectorClient* client, InspectorOverlay* overlay)
+PassOwnPtr<InspectorPageAgent> InspectorPageAgent::create(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InspectorClient* client, InspectorOverlay* overlay)
 {
-    return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, inspectorAgent, injectedScriptManager, client, overlay));
+    return adoptPtr(new InspectorPageAgent(instrumentingAgents, page, inspectorAgent, client, overlay));
 }
 
 // static
@@ -349,11 +348,10 @@ Inspector::TypeBuilder::Page::ResourceType::Enum InspectorPageAgent::cachedResou
     return resourceTypeJson(cachedResourceType(cachedResource));
 }
 
-InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InjectedScriptManager* injectedScriptManager, InspectorClient* client, InspectorOverlay* overlay)
+InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorAgent* inspectorAgent, InspectorClient* client, InspectorOverlay* overlay)
     : InspectorAgentBase(ASCIILiteral("Page"), instrumentingAgents)
     , m_page(page)
     , m_inspectorAgent(inspectorAgent)
-    , m_injectedScriptManager(injectedScriptManager)
     , m_client(client)
     , m_overlay(overlay)
     , m_lastScriptIdentifier(0)
@@ -757,9 +755,6 @@ void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWor
     if (&world != &mainThreadNormalWorld())
         return;
 
-    if (frame->isMainFrame())
-        m_injectedScriptManager->discardInjectedScripts();
-
     if (!m_frontendDispatcher)
         return;
 
index 7086b85..0ba6325 100644 (file)
@@ -56,7 +56,6 @@ class DocumentLoader;
 class Frame;
 class Frontend;
 class GraphicsContext;
-class InjectedScriptManager;
 class InspectorAgent;
 class InspectorClient;
 class InspectorOverlay;
@@ -83,7 +82,7 @@ public:
         OtherResource
     };
 
-    static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorAgent*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
+    static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InspectorAgent*, InspectorClient*, InspectorOverlay*);
 
     static bool cachedResourceContent(CachedResource*, String* result, bool* base64Encoded);
     static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& textEncodingName, bool withBase64Encode, String* result);
@@ -166,7 +165,7 @@ public:
     static DocumentLoader* assertDocumentLoader(ErrorString*, Frame*);
 
 private:
-    InspectorPageAgent(InstrumentingAgents*, Page*, InspectorAgent*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
+    InspectorPageAgent(InstrumentingAgents*, Page*, InspectorAgent*, InspectorClient*, InspectorOverlay*);
 #if ENABLE(TOUCH_EVENTS)
     void updateTouchEventEmulationInPage(bool);
 #endif
@@ -178,7 +177,6 @@ private:
     PassRefPtr<Inspector::TypeBuilder::Page::FrameResourceTree> buildObjectForFrameTree(Frame*);
     Page* m_page;
     InspectorAgent* m_inspectorAgent;
-    InjectedScriptManager* m_injectedScriptManager;
     InspectorClient* m_client;
     std::unique_ptr<Inspector::InspectorPageFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorPageBackendDispatcher> m_backendDispatcher;
index aa786dd..7f7e6c1 100644 (file)
 #include "Console.h"
 #include "ConsoleAPITypes.h"
 #include "ConsoleTypes.h"
-#include "InjectedScript.h"
-#include "InjectedScriptHost.h"
 #include "InspectorConsoleAgent.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InstrumentingAgents.h"
 #include "URL.h"
 #include "Page.h"
+#include "PageInjectedScriptManager.h"
 #include "PageScriptDebugServer.h"
 #include "ScriptHeapSnapshot.h"
 #include "ScriptProfile.h"
 #include "ScriptProfiler.h"
 #include "WorkerScriptDebugServer.h"
 #include <bindings/ScriptObject.h>
+#include <inspector/InjectedScript.h>
 #include <inspector/InspectorValues.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/OwnPtr.h>
@@ -66,7 +66,7 @@ static const char* const HeapProfileType = "HEAP";
 
 class PageProfilerAgent : public InspectorProfilerAgent {
 public:
-    PageProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, Page* inspectedPage, InjectedScriptManager* injectedScriptManager)
+    PageProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, Page* inspectedPage, PageInjectedScriptManager* injectedScriptManager)
         : InspectorProfilerAgent(instrumentingAgents, consoleAgent, injectedScriptManager), m_inspectedPage(inspectedPage) { }
     virtual ~PageProfilerAgent() { }
 
@@ -89,14 +89,14 @@ private:
     Page* m_inspectedPage;
 };
 
-PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, Page* inspectedPage, InjectedScriptManager* injectedScriptManager)
+PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, Page* inspectedPage, PageInjectedScriptManager* injectedScriptManager)
 {
     return adoptPtr(new PageProfilerAgent(instrumentingAgents, consoleAgent, inspectedPage, injectedScriptManager));
 }
 
 class WorkerProfilerAgent : public InspectorProfilerAgent {
 public:
-    WorkerProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, WorkerGlobalScope* workerGlobalScope, InjectedScriptManager* injectedScriptManager)
+    WorkerProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, WorkerGlobalScope* workerGlobalScope, PageInjectedScriptManager* injectedScriptManager)
         : InspectorProfilerAgent(instrumentingAgents, consoleAgent, injectedScriptManager), m_workerGlobalScope(workerGlobalScope) { }
     virtual ~WorkerProfilerAgent() { }
 
@@ -116,12 +116,12 @@ private:
     WorkerGlobalScope* m_workerGlobalScope;
 };
 
-PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, WorkerGlobalScope* workerGlobalScope, InjectedScriptManager* injectedScriptManager)
+PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, WorkerGlobalScope* workerGlobalScope, PageInjectedScriptManager* injectedScriptManager)
 {
     return adoptPtr(new WorkerProfilerAgent(instrumentingAgents, consoleAgent, workerGlobalScope, injectedScriptManager));
 }
 
-InspectorProfilerAgent::InspectorProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, InjectedScriptManager* injectedScriptManager)
+InspectorProfilerAgent::InspectorProfilerAgent(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, PageInjectedScriptManager* injectedScriptManager)
     : InspectorAgentBase(ASCIILiteral("Profiler"), instrumentingAgents)
     , m_consoleAgent(consoleAgent)
     , m_injectedScriptManager(injectedScriptManager)
index bace5c9..4266284 100644 (file)
@@ -48,10 +48,10 @@ class InspectorObject;
 
 namespace WebCore {
 
-class InjectedScriptManager;
 class InspectorConsoleAgent;
 class InstrumentingAgents;
 class Page;
+class PageInjectedScriptManager;
 class ScriptHeapSnapshot;
 class ScriptProfile;
 class WorkerGlobalScope;
@@ -61,8 +61,8 @@ typedef String ErrorString;
 class InspectorProfilerAgent : public InspectorAgentBase, public Inspector::InspectorProfilerBackendDispatcherHandler {
     WTF_MAKE_NONCOPYABLE(InspectorProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, Page*, InjectedScriptManager*);
-    static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, WorkerGlobalScope*, InjectedScriptManager*);
+    static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, Page*, PageInjectedScriptManager*);
+    static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, WorkerGlobalScope*, PageInjectedScriptManager*);
 
     virtual ~InspectorProfilerAgent();
 
@@ -102,7 +102,7 @@ public:
     virtual void getHeapObjectId(ErrorString*, const String& objectId, String* heapSnapshotObjectId);
 
 protected:
-    InspectorProfilerAgent(InstrumentingAgents*, InspectorConsoleAgent*, InjectedScriptManager*);
+    InspectorProfilerAgent(InstrumentingAgents*, InspectorConsoleAgent*, PageInjectedScriptManager*);
     virtual void startProfiling(const String& title) = 0;
     virtual PassRefPtr<ScriptProfile> stopProfiling(const String& title) = 0;
 
@@ -117,7 +117,7 @@ private:
     PassRefPtr<Inspector::TypeBuilder::Profiler::ProfileHeader> createSnapshotHeader(const ScriptHeapSnapshot&);
 
     InspectorConsoleAgent* m_consoleAgent;
-    InjectedScriptManager* m_injectedScriptManager;
+    PageInjectedScriptManager* m_injectedScriptManager;
     std::unique_ptr<Inspector::InspectorProfilerFrontendDispatcher> m_frontendDispatcher;
     RefPtr<Inspector::InspectorProfilerBackendDispatcher> m_backendDispatcher;
     bool m_enabled;
index ad8c435..b47d836 100644 (file)
@@ -34,9 +34,9 @@
 
 #include "InspectorRuntimeAgent.h"
 
-#include "InjectedScript.h"
-#include "InjectedScriptManager.h"
 #include "JSDOMWindowBase.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <inspector/InspectorValues.h>
 #include <parser/ParserError.h>
 #include <parser/SourceCode.h>
index 53e836c..ca8745e 100644 (file)
 
 #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>
 
 namespace Inspector {
+class InjectedScript;
+class InjectedScriptManager;
 class InspectorArray;
 class InspectorObject;
 class InspectorValue;
@@ -49,8 +50,6 @@ class InspectorValue;
 
 namespace WebCore {
 
-class InjectedScript;
-class InjectedScriptManager;
 class InstrumentingAgents;
 class ScriptDebugServer;
 class WorkerGlobalScope;
@@ -95,17 +94,17 @@ public:
 #endif
 
 protected:
-    InspectorRuntimeAgent(InstrumentingAgents*, InjectedScriptManager*);
-    virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
+    InspectorRuntimeAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*);
+    virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
 
     virtual void muteConsole() = 0;
     virtual void unmuteConsole() = 0;
 
-    InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
+    Inspector::InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
     bool m_enabled;
 
 private:
-    InjectedScriptManager* m_injectedScriptManager;
+    Inspector::InjectedScriptManager* m_injectedScriptManager;
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     ScriptDebugServer* m_scriptDebugServer;
 #endif
index f3733dd..c1dbb2a 100644 (file)
  */
 
 #include "config.h"
+#include "PageConsoleAgent.h"
 
 #if ENABLE(INSPECTOR)
 
-#include "PageConsoleAgent.h"
-
 #include "CommandLineAPIHost.h"
 #include "DOMWindow.h"
-#include "InjectedScriptHost.h"
-#include "InjectedScriptManager.h"
 #include "InspectorAgent.h"
 #include "InspectorDOMAgent.h"
 #include "Node.h"
+#include "PageInjectedScriptManager.h"
 
 using namespace Inspector;
 
 namespace WebCore {
 
-PageConsoleAgent::PageConsoleAgent(InstrumentingAgents* instrumentingAgents, InspectorAgent* inspectorAgent, InjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
+PageConsoleAgent::PageConsoleAgent(InstrumentingAgents* instrumentingAgents, InspectorAgent* inspectorAgent, PageInjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
     : InspectorConsoleAgent(instrumentingAgents, injectedScriptManager)
     , m_inspectorAgent(inspectorAgent)
     , m_inspectorDOMAgent(domAgent)
index e193195..bdc1975 100644 (file)
@@ -44,7 +44,7 @@ class InspectorDOMAgent;
 class PageConsoleAgent : public InspectorConsoleAgent {
     WTF_MAKE_NONCOPYABLE(PageConsoleAgent);
 public:
-    static PassOwnPtr<PageConsoleAgent> create(InstrumentingAgents* instrumentingAgents, InspectorAgent* agent, InjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
+    static PassOwnPtr<PageConsoleAgent> create(InstrumentingAgents* instrumentingAgents, InspectorAgent* agent, PageInjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
     {
         return adoptPtr(new PageConsoleAgent(instrumentingAgents, agent, injectedScriptManager, domAgent));
     }
@@ -53,7 +53,7 @@ public:
     virtual bool isWorkerAgent() OVERRIDE { return false; }
 
 private:
-    PageConsoleAgent(InstrumentingAgents*, InspectorAgent*, InjectedScriptManager*, InspectorDOMAgent*);
+    PageConsoleAgent(InstrumentingAgents*, InspectorAgent*, PageInjectedScriptManager*, InspectorDOMAgent*);
     virtual void clearMessages(ErrorString*);
     virtual void addInspectedNode(ErrorString*, int nodeId);
     virtual bool developerExtrasEnabled();
index 08e333c..57bc124 100644 (file)
@@ -41,6 +41,8 @@
 #include "PageConsole.h"
 #include "PageScriptDebugServer.h"
 #include "ScriptState.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 
 using namespace Inspector;
 
index a5f8187..7518394 100644 (file)
@@ -47,7 +47,7 @@ class PageDebuggerAgent : public InspectorDebuggerAgent {
     WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<PageDebuggerAgent> create(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
+    static PassOwnPtr<PageDebuggerAgent> create(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
     virtual ~PageDebuggerAgent();
 
     void didClearMainFrameWindowObject();
@@ -63,10 +63,10 @@ private:
     virtual void muteConsole();
     virtual void unmuteConsole();
 
-    virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
+    virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
     virtual void setOverlayMessage(ErrorString*, const String*);
 
-    PageDebuggerAgent(InstrumentingAgents*, InspectorPageAgent*, InjectedScriptManager*, InspectorOverlay*);
+    PageDebuggerAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
     InspectorPageAgent* m_pageAgent;
     InspectorOverlay* m_overlay;
 };
diff --git a/Source/WebCore/inspector/PageInjectedScriptHost.cpp b/Source/WebCore/inspector/PageInjectedScriptHost.cpp
new file mode 100644 (file)
index 0000000..f6a5e65
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PageInjectedScriptHost.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "JSHTMLAllCollection.h"
+#include "JSHTMLCollection.h"
+#include "JSNode.h"
+#include "JSNodeList.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue PageInjectedScriptHost::type(JSC::ExecState* exec, JSC::JSValue value)
+{
+    if (value.inherits(JSNode::info()))
+        return jsNontrivialString(exec, ASCIILiteral("node"));
+    if (value.inherits(JSNodeList::info()))
+        return jsNontrivialString(exec, ASCIILiteral("array"));
+    if (value.inherits(JSHTMLCollection::info()))
+        return jsNontrivialString(exec, ASCIILiteral("array"));
+
+    return jsUndefined();
+}
+
+bool PageInjectedScriptHost::isHTMLAllCollection(JSC::JSValue value)
+{
+    return value.inherits(JSHTMLAllCollection::info());
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/PageInjectedScriptHost.h b/Source/WebCore/inspector/PageInjectedScriptHost.h
new file mode 100644 (file)
index 0000000..7fff29a
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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. ``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
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PageInjectedScriptHost_h
+#define PageInjectedScriptHost_h
+
+#if ENABLE(INSPECTOR)
+
+#include <inspector/InjectedScriptHost.h>
+
+namespace WebCore {
+
+class PageInjectedScriptHost FINAL : public Inspector::InjectedScriptHost {
+public:
+    static PassRefPtr<PageInjectedScriptHost> create() { return adoptRef(new PageInjectedScriptHost); }
+
+    virtual JSC::JSValue type(JSC::ExecState*, JSC::JSValue) OVERRIDE;
+    virtual bool isHTMLAllCollection(JSC::JSValue) OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
+
+#endif // !defined(PageInjectedScriptHost_h)
index 3432b0c..60c66f7 100644 (file)
 #if ENABLE(INSPECTOR)
 
 #include "CommandLineAPIModule.h"
+#include "ScriptState.h"
+
+using namespace Inspector;
 
 namespace WebCore {
-    
-PageInjectedScriptManager::PageInjectedScriptManager(InspectedStateAccessCheck accessCheck)
-    : InjectedScriptManager(accessCheck)
+
+PageInjectedScriptManager::PageInjectedScriptManager(InspectorEnvironment& environment, PassRefPtr<InjectedScriptHost> host)
+    : InjectedScriptManager(environment, host)
     , m_commandLineAPIHost(CommandLineAPIHost::create())
 {
 }
@@ -51,6 +54,35 @@ void PageInjectedScriptManager::didCreateInjectedScript(InjectedScript injectedS
     CommandLineAPIModule::injectIfNeeded(this, injectedScript);
 }
 
+void PageInjectedScriptManager::discardInjectedScriptsFor(DOMWindow* window)
+{
+    if (m_scriptStateToId.isEmpty())
+        return;
+
+    Vector<long> idsToRemove;
+    for (auto it = m_idToInjectedScript.begin(), end = m_idToInjectedScript.end(); it != end; ++it) {
+        JSC::ExecState* scriptState = it->value.scriptState();
+        if (window != domWindowFromExecState(scriptState))
+            continue;
+        m_scriptStateToId.remove(scriptState);
+        idsToRemove.append(it->key);
+    }
+
+    for (size_t i = 0; i < idsToRemove.size(); i++)
+        m_idToInjectedScript.remove(idsToRemove[i]);
+
+    // Now remove script states that have id but no injected script.
+    Vector<JSC::ExecState*> scriptStatesToRemove;
+    for (auto it = m_scriptStateToId.begin(), end = m_scriptStateToId.end(); it != end; ++it) {
+        JSC::ExecState* scriptState = it->key;
+        if (window == domWindowFromExecState(scriptState))
+            scriptStatesToRemove.append(scriptState);
+    }
+
+    for (size_t i = 0; i < scriptStatesToRemove.size(); i++)
+        m_scriptStateToId.remove(scriptStatesToRemove[i]);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index 884b3ac..f1880b3 100644 (file)
 #define PageInjectedScriptManager_h
 
 #include "CommandLineAPIHost.h"
-#include "InjectedScriptManager.h"
+#include <inspector/InjectedScriptManager.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class PageInjectedScriptManager FINAL : public InjectedScriptManager {
+class DOMWindow;
+
+class PageInjectedScriptManager FINAL : public Inspector::InjectedScriptManager {
 public:
-    explicit PageInjectedScriptManager(InspectedStateAccessCheck);
+    PageInjectedScriptManager(Inspector::InspectorEnvironment&, PassRefPtr<Inspector::InjectedScriptHost>);
     virtual ~PageInjectedScriptManager() { }
 
+    CommandLineAPIHost* commandLineAPIHost() const { return m_commandLineAPIHost.get(); }
+
     virtual void disconnect() OVERRIDE;
-    virtual CommandLineAPIHost* commandLineAPIHost() const OVERRIDE { return m_commandLineAPIHost.get(); }
+
+    void discardInjectedScriptsFor(DOMWindow*);
 
 protected:
-    virtual void didCreateInjectedScript(InjectedScript) OVERRIDE;
+    virtual void didCreateInjectedScript(Inspector::InjectedScript) OVERRIDE;
 
 private:
     RefPtr<CommandLineAPIHost> m_commandLineAPIHost;
index dd059f0..dd12f2e 100644 (file)
@@ -35,8 +35,6 @@
 #include "PageRuntimeAgent.h"
 
 #include "Document.h"
-#include "InjectedScript.h"
-#include "InjectedScriptManager.h"
 #include "InspectorPageAgent.h"
 #include "InstrumentingAgents.h"
 #include "MainFrame.h"
@@ -44,6 +42,8 @@
 #include "PageConsole.h"
 #include "ScriptController.h"
 #include "SecurityOrigin.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 
 using Inspector::TypeBuilder::Runtime::ExecutionContextDescription;
 
index 94b6543..76a04c1 100644 (file)
 #include "ScriptState.h"
 #include <wtf/PassOwnPtr.h>
 
+namespace Inspector {
+class InjectedScriptManager;
+}
+
 namespace WebCore {
 
 class InspectorPageAgent;
@@ -46,7 +50,7 @@ class SecurityOrigin;
 
 class PageRuntimeAgent : public InspectorRuntimeAgent {
 public:
-    static PassOwnPtr<PageRuntimeAgent> create(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
+    static PassOwnPtr<PageRuntimeAgent> create(InstrumentingAgents* instrumentingAgents, Inspector::InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
     {
         return adoptPtr(new PageRuntimeAgent(instrumentingAgents, injectedScriptManager, page, pageAgent));
     }
@@ -60,9 +64,9 @@ public:
     void didCreateIsolatedContext(Frame*, JSC::ExecState*, SecurityOrigin*);
 
 private:
-    PageRuntimeAgent(InstrumentingAgents*, InjectedScriptManager*, Page*, InspectorPageAgent*);
+    PageRuntimeAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*);
 
-    virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
+    virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
     virtual void muteConsole();
     virtual void unmuteConsole();
     void reportExecutionContextCreation();
index 666a8df..a59ce45 100644 (file)
@@ -38,7 +38,7 @@ using namespace Inspector;
 
 namespace WebCore {
 
-WorkerConsoleAgent::WorkerConsoleAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
+WorkerConsoleAgent::WorkerConsoleAgent(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
     : InspectorConsoleAgent(instrumentingAgents, injectedScriptManager)
 {
 }
index 1e9c10c..2b9ce30 100644 (file)
@@ -41,7 +41,7 @@ namespace WebCore {
 class WorkerConsoleAgent : public InspectorConsoleAgent {
     WTF_MAKE_NONCOPYABLE(WorkerConsoleAgent);
 public:
-    static PassOwnPtr<WorkerConsoleAgent> create(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager)
+    static PassOwnPtr<WorkerConsoleAgent> create(InstrumentingAgents* instrumentingAgents, PageInjectedScriptManager* injectedScriptManager)
     {
         return adoptPtr(new WorkerConsoleAgent(instrumentingAgents, injectedScriptManager));
     }
@@ -50,7 +50,7 @@ public:
     virtual bool isWorkerAgent() OVERRIDE { return true; }
 
 private:
-    WorkerConsoleAgent(InstrumentingAgents*, InjectedScriptManager*);
+    WorkerConsoleAgent(InstrumentingAgents*, PageInjectedScriptManager*);
     virtual void addInspectedNode(ErrorString*, int nodeId);
     virtual bool developerExtrasEnabled();
 };
index 97d00e0..2e7a00b 100644 (file)
@@ -36,6 +36,8 @@
 #include "ScriptDebugServer.h"
 #include "WorkerGlobalScope.h"
 #include "WorkerThread.h"
+#include <inspector/InjectedScript.h>
+#include <inspector/InjectedScriptManager.h>
 #include <wtf/MessageQueue.h>
 
 using namespace Inspector;
index e5eb6f0..9194160 100644 (file)
@@ -44,19 +44,19 @@ class WorkerDebuggerAgent : public InspectorDebuggerAgent {
     WTF_MAKE_NONCOPYABLE(WorkerDebuggerAgent);
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<WorkerDebuggerAgent> create(InstrumentingAgents*, WorkerGlobalScope*, InjectedScriptManager*);
+    static PassOwnPtr<WorkerDebuggerAgent> create(InstrumentingAgents*, WorkerGlobalScope*, Inspector::InjectedScriptManager*);
     virtual ~WorkerDebuggerAgent();
 
     static const char* debuggerTaskMode;
     static void interruptAndDispatchInspectorCommands(WorkerThread*);
 
 private:
-    WorkerDebuggerAgent(InstrumentingAgents*, WorkerGlobalScope*, InjectedScriptManager*);
+    WorkerDebuggerAgent(InstrumentingAgents*, WorkerGlobalScope*, Inspector::InjectedScriptManager*);
 
     virtual void startListeningScriptDebugServer();
     virtual void stopListeningScriptDebugServer();
     virtual WorkerScriptDebugServer& scriptDebugServer();
-    virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
+    virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
     virtual void muteConsole();
     virtual void unmuteConsole();
 
index e4fb554..8f923c3 100644 (file)
 #include "WorkerInspectorController.h"
 
 #include "CommandLineAPIHost.h"
-#include "InjectedScriptHost.h"
-#include "InjectedScriptManager.h"
 #include "InspectorClient.h"
 #include "InspectorConsoleAgent.h"
 #include "InspectorForwarding.h"
 #include "InspectorHeapProfilerAgent.h"
+#include "InspectorInstrumentation.h"
 #include "InspectorProfilerAgent.h"
 #include "InspectorTimelineAgent.h"
 #include "InspectorWebBackendDispatchers.h"
 #include "InspectorWebFrontendDispatchers.h"
 #include "InstrumentingAgents.h"
+#include "JSMainThreadExecState.h"
+#include "PageInjectedScriptHost.h"
+#include "PageInjectedScriptManager.h"
 #include "WorkerConsoleAgent.h"
 #include "WorkerDebuggerAgent.h"
 #include "WorkerGlobalScope.h"
@@ -80,7 +82,7 @@ private:
 WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGlobalScope)
     : m_workerGlobalScope(workerGlobalScope)
     , m_instrumentingAgents(InstrumentingAgents::create())
-    , m_injectedScriptManager(InjectedScriptManager::createForWorker())
+    , m_injectedScriptManager(std::make_unique<PageInjectedScriptManager>(*this, PageInjectedScriptHost::create()))
     , m_runtimeAgent(0)
 {
     OwnPtr<InspectorRuntimeAgent> runtimeAgent = WorkerRuntimeAgent::create(m_instrumentingAgents.get(), m_injectedScriptManager.get(), workerGlobalScope);
@@ -149,6 +151,30 @@ void WorkerInspectorController::resume()
 }
 #endif
 
+InspectorFunctionCallHandler WorkerInspectorController::functionCallHandler() const
+{
+    return WebCore::functionCallHandlerFromAnyThread;
 }
 
-#endif
+InspectorEvaluateHandler WorkerInspectorController::evaluateHandler() const
+{
+    return WebCore::evaluateHandlerFromAnyThread;
+}
+
+void WorkerInspectorController::willCallInjectedScriptFunction(JSC::ExecState* scriptState, const String& scriptName, int scriptLine)
+{
+    ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextFromExecState(scriptState);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willCallFunction(scriptExecutionContext, scriptName, scriptLine);
+    m_injectedScriptInstrumentationCookies.append(cookie);
+}
+
+void WorkerInspectorController::didCallInjectedScriptFunction()
+{
+    ASSERT(!m_injectedScriptInstrumentationCookies.isEmpty());
+    InspectorInstrumentationCookie cookie = m_injectedScriptInstrumentationCookies.takeLast();
+    InspectorInstrumentation::didCallFunction(cookie);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTO