[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
pfeldman at chromium.org
pfeldman at chromium.org
Tue Jan 5 23:39:36 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 32ef2b61293a38b9663e1848f5d34c64a0b0ca5d
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 1 08:07:16 2009 +0000
2009-11-27 Pavel Feldman <pfeldman at dhcp-172-28-174-220.spb.corp.google.com>
Reviewed by Timothy Hatcher.
Web Inspector: Split InspectorBackend into three parts: backend,
injected script host and frontend host.
https://bugs.webkit.org/show_bug.cgi?id=31888
* DerivedSources.make:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSInspectorBackendCustom.cpp: Removed.
* bindings/js/JSInspectorFrontendHostCustom.cpp: Added.
(WebCore::JSInspectorFrontendHost::search):
(WebCore::JSInspectorFrontendHost::setting):
(WebCore::JSInspectorFrontendHost::setSetting):
* bindings/js/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/ScriptObject.h:
* bindings/v8/DOMObjectsInclude.h:
* bindings/v8/DerivedSourcesAllInOne.cpp:
* bindings/v8/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/v8/ScriptObject.h:
* bindings/v8/V8Index.cpp:
* bindings/v8/V8Index.h:
* bindings/v8/custom/V8CustomBinding.h:
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp: Added.
(WebCore::CALLBACK_FUNC_DECL):
* bindings/v8/custom/V8InspectorBackendCustom.cpp: Removed.
* bindings/v8/custom/V8InspectorFrontendHostCustom.cpp: Added.
(WebCore::CALLBACK_FUNC_DECL):
* inspector/InjectedScriptHost.cpp: Added.
(WebCore::InjectedScriptHost::InjectedScriptHost):
(WebCore::InjectedScriptHost::~InjectedScriptHost):
(WebCore::InjectedScriptHost::copyText):
(WebCore::InjectedScriptHost::nodeForId):
(WebCore::InjectedScriptHost::wrapObject):
(WebCore::InjectedScriptHost::unwrapObject):
(WebCore::InjectedScriptHost::pushNodePathToFrontend):
(WebCore::InjectedScriptHost::addNodesToSearchResult):
(WebCore::InjectedScriptHost::currentCallFrame):
(WebCore::InjectedScriptHost::databaseForId):
(WebCore::InjectedScriptHost::selectDatabase):
(WebCore::InjectedScriptHost::selectDOMStorage):
(WebCore::InjectedScriptHost::reportDidDispatchOnInjectedScript):
(WebCore::InjectedScriptHost::inspectorDOMAgent):
(WebCore::InjectedScriptHost::inspectorFrontend):
* inspector/InjectedScriptHost.h: Added.
(WebCore::InjectedScriptHost::create):
(WebCore::InjectedScriptHost::inspectorController):
(WebCore::InjectedScriptHost::disconnectController):
* inspector/InjectedScriptHost.idl: Added.
* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::InspectorBackend):
(WebCore::InspectorBackend::storeLastActivePanel):
(WebCore::InspectorBackend::toggleNodeSearch):
(WebCore::InspectorBackend::resourceTrackingEnabled):
(WebCore::InspectorBackend::debuggerEnabled):
(WebCore::InspectorBackend::enableDebugger):
(WebCore::InspectorBackend::disableDebugger):
(WebCore::InspectorBackend::addBreakpoint):
(WebCore::InspectorBackend::updateBreakpoint):
(WebCore::InspectorBackend::removeBreakpoint):
(WebCore::InspectorBackend::pauseInDebugger):
(WebCore::InspectorBackend::resumeDebugger):
(WebCore::InspectorBackend::stepOverStatementInDebugger):
(WebCore::InspectorBackend::stepIntoStatementInDebugger):
(WebCore::InspectorBackend::stepOutOfFunctionInDebugger):
(WebCore::InspectorBackend::pauseOnExceptions):
(WebCore::InspectorBackend::setPauseOnExceptions):
(WebCore::InspectorBackend::profilerEnabled):
(WebCore::InspectorBackend::enableProfiler):
(WebCore::InspectorBackend::disableProfiler):
(WebCore::InspectorBackend::startProfiling):
(WebCore::InspectorBackend::stopProfiling):
(WebCore::InspectorBackend::getProfileHeaders):
(WebCore::InspectorBackend::getProfile):
(WebCore::InspectorBackend::currentCallFrame):
(WebCore::InspectorBackend::highlightDOMNode):
(WebCore::InspectorBackend::hideDOMNodeHighlight):
(WebCore::InspectorBackend::getCookies):
(WebCore::InspectorBackend::deleteCookie):
(WebCore::InspectorBackend::didEvaluateForTestInFrontend):
(WebCore::InspectorBackend::nodeForId):
* inspector/InspectorBackend.h:
(WebCore::InspectorBackend::create):
* inspector/InspectorBackend.idl:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::~InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
(WebCore::InspectorController::windowScriptObjectAvailable):
* inspector/InspectorController.h:
(WebCore::InspectorController::inspectorFrontendHost):
(WebCore::InspectorController::injectedScriptHost):
* inspector/InspectorFrontendHost.cpp: Added.
(WebCore::InspectorFrontendHost::InspectorFrontendHost):
(WebCore::InspectorFrontendHost::~InspectorFrontendHost):
(WebCore::InspectorFrontendHost::loaded):
(WebCore::InspectorFrontendHost::attach):
(WebCore::InspectorFrontendHost::detach):
(WebCore::InspectorFrontendHost::closeWindow):
(WebCore::InspectorFrontendHost::windowUnloading):
(WebCore::InspectorFrontendHost::setAttachedWindowHeight):
(WebCore::InspectorFrontendHost::moveWindowBy):
(WebCore::InspectorFrontendHost::localizedStringsURL):
(WebCore::InspectorFrontendHost::hiddenPanels):
(WebCore::InspectorFrontendHost::platform):
(WebCore::InspectorFrontendHost::port):
(WebCore::InspectorFrontendHost::addResourceSourceToFrame):
(WebCore::InspectorFrontendHost::addSourceToFrame):
* inspector/InspectorFrontendHost.h: Added.
(WebCore::InspectorFrontendHost::create):
(WebCore::InspectorFrontendHost::inspectorController):
(WebCore::InspectorFrontendHost::disconnectController):
* inspector/InspectorFrontendHost.idl: Added.
* inspector/front-end/Breakpoint.js:
(WebInspector.Breakpoint.prototype.set condition):
* inspector/front-end/BreakpointsSidebarPane.js:
(WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
(WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint):
(WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype.clearMessages):
* inspector/front-end/CookieItemsView.js:
(WebInspector.CookieItemsView.prototype._deleteCookieCallback):
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMAgent.prototype.getChildNodesAsync):
(WebInspector.DOMAgent.prototype.setAttributeAsync):
(WebInspector.DOMAgent.prototype.removeAttributeAsync):
(WebInspector.DOMAgent.prototype.setTextNodeValueAsync):
(WebInspector.Cookies.getCookiesAsync):
(WebInspector.EventListeners.getEventListenersForNodeAsync):
* inspector/front-end/DOMStorage.js:
(WebInspector.DOMStorage.prototype.getEntries):
(WebInspector.DOMStorage.prototype.setItem):
(WebInspector.DOMStorage.prototype.removeItem):
* inspector/front-end/Database.js:
(WebInspector.Database.prototype.getTableNames):
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
(WebInspector.ElementsPanel.prototype.hide):
(WebInspector.ElementsPanel.prototype.reset):
(WebInspector.ElementsPanel.prototype.handleCopyEvent):
(WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked):
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeOutline.prototype.set focusedDOMNode.restoreHighlightToHoveredNode):
(WebInspector.ElementsTreeOutline.prototype.set focusedDOMNode):
():
* inspector/front-end/EventListenersSidebarPane.js:
(WebInspector.EventListenersSidebarPane.prototype):
* inspector/front-end/InjectedScript.js:
(InjectedScript._evaluateAndWrap):
(InjectedScript.performSearch.addNodesToResults):
(InjectedScript.getCallFrames):
(InjectedScript._callFrameForId):
(InjectedScript._clearConsoleMessages):
(InjectedScript._inspectObject):
(InjectedScript._copy):
(InjectedScript._ensureCommandLineAPIInstalled):
(InjectedScript._window):
(InjectedScript._nodeForId):
(InjectedScript._objectForId):
(InjectedScript.pushNodeToFrontend):
(InjectedScript.executeSql):
(InjectedScript.executeSql.errorCallback):
(InjectedScript.executeSql.queryTransaction):
* inspector/front-end/InjectedScriptAccess.js:
(InjectedScriptAccess._installHandler.InjectedScriptAccess.methodName):
(InjectedScriptAccess._installHandler):
* inspector/front-end/InspectorBackendStub.js: Added.
(.WebInspector.InspectorBackendStub):
(.WebInspector.InspectorBackendStub.prototype.wrapCallback):
(.WebInspector.InspectorBackendStub.prototype.platform):
(.WebInspector.InspectorBackendStub.prototype.port):
(.WebInspector.InspectorBackendStub.prototype.closeWindow):
(.WebInspector.InspectorBackendStub.prototype.attach):
(.WebInspector.InspectorBackendStub.prototype.detach):
(.WebInspector.InspectorBackendStub.prototype.storeLastActivePanel):
(.WebInspector.InspectorBackendStub.prototype.clearMessages):
(.WebInspector.InspectorBackendStub.prototype.searchingForNode):
(.WebInspector.InspectorBackendStub.prototype.search):
(.WebInspector.InspectorBackendStub.prototype.toggleNodeSearch):
(.WebInspector.InspectorBackendStub.prototype.setAttachedWindowHeight):
(.WebInspector.InspectorBackendStub.prototype.moveByUnrestricted):
(.WebInspector.InspectorBackendStub.prototype.addResourceSourceToFrame):
(.WebInspector.InspectorBackendStub.prototype.addSourceToFrame):
(.WebInspector.InspectorBackendStub.prototype.getResourceDocumentNode):
(.WebInspector.InspectorBackendStub.prototype.highlightDOMNode):
(.WebInspector.InspectorBackendStub.prototype.hideDOMNodeHighlight):
(.WebInspector.InspectorBackendStub.prototype.inspectedWindow):
(.WebInspector.InspectorBackendStub.prototype.loaded):
(.WebInspector.InspectorBackendStub.prototype.localizedStringsURL):
(.WebInspector.InspectorBackendStub.prototype.windowUnloading):
(.WebInspector.InspectorBackendStub.prototype.hiddenPanels):
(.WebInspector.InspectorBackendStub.prototype.debuggerEnabled):
(.WebInspector.InspectorBackendStub.prototype.enableResourceTracking):
(.WebInspector.InspectorBackendStub.prototype.disableResourceTracking):
(.WebInspector.InspectorBackendStub.prototype.resourceTrackingEnabled):
(.WebInspector.InspectorBackendStub.prototype.enableDebugger):
(.WebInspector.InspectorBackendStub.prototype.disableDebugger):
(.WebInspector.InspectorBackendStub.prototype.addBreakpoint):
(.WebInspector.InspectorBackendStub.prototype.removeBreakpoint):
(.WebInspector.InspectorBackendStub.prototype.updateBreakpoint):
(.WebInspector.InspectorBackendStub.prototype.pauseInDebugger):
(.WebInspector.InspectorBackendStub.prototype.pauseOnExceptions):
(.WebInspector.InspectorBackendStub.prototype.setPauseOnExceptions):
(.WebInspector.InspectorBackendStub.prototype.resumeDebugger):
(.WebInspector.InspectorBackendStub.prototype.profilerEnabled):
(.WebInspector.InspectorBackendStub.prototype.enableProfiler):
(.WebInspector.InspectorBackendStub.prototype.disableProfiler):
(.WebInspector.InspectorBackendStub.prototype.startProfiling):
(.WebInspector.InspectorBackendStub.prototype.stopProfiling):
(.WebInspector.InspectorBackendStub.prototype.getProfileHeaders):
(.WebInspector.InspectorBackendStub.prototype.getProfile):
(.WebInspector.InspectorBackendStub.prototype.takeHeapSnapshot):
(.WebInspector.InspectorBackendStub.prototype.databaseTableNames):
(.WebInspector.InspectorBackendStub.prototype.stepIntoStatementInDebugger):
(.WebInspector.InspectorBackendStub.prototype.stepOutOfFunctionInDebugger):
(.WebInspector.InspectorBackendStub.prototype.stepOverStatementInDebugger):
(.WebInspector.InspectorBackendStub.prototype.setSetting):
(.WebInspector.InspectorBackendStub.prototype.dispatchOnInjectedScript):
(.WebInspector.InspectorBackendStub.prototype.releaseWrapperObjectGroup):
(.WebInspector.InspectorBackendStub.prototype.setting):
* inspector/front-end/InspectorControllerStub.js:
* inspector/front-end/InspectorFrontendHostStub.js: Added.
(.WebInspector.InspectorFrontendHostStub):
(.WebInspector.InspectorFrontendHostStub.prototype.platform):
(.WebInspector.InspectorFrontendHostStub.prototype.port):
(.WebInspector.InspectorFrontendHostStub.prototype.closeWindow):
(.WebInspector.InspectorFrontendHostStub.prototype.attach):
(.WebInspector.InspectorFrontendHostStub.prototype.detach):
(.WebInspector.InspectorFrontendHostStub.prototype.search):
(.WebInspector.InspectorFrontendHostStub.prototype.setAttachedWindowHeight):
(.WebInspector.InspectorFrontendHostStub.prototype.moveWindowBy):
(.WebInspector.InspectorFrontendHostStub.prototype.addResourceSourceToFrame):
(.WebInspector.InspectorFrontendHostStub.prototype.addSourceToFrame):
(.WebInspector.InspectorFrontendHostStub.prototype.loaded):
(.WebInspector.InspectorFrontendHostStub.prototype.localizedStringsURL):
(.WebInspector.InspectorFrontendHostStub.prototype.hiddenPanels):
(.WebInspector.InspectorFrontendHostStub.prototype.setSetting):
(.WebInspector.InspectorFrontendHostStub.prototype.setting):
* inspector/front-end/ProfileView.js:
(WebInspector.CPUProfileView):
(WebInspector.CPUProfileType.prototype.buttonClicked):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype._updateInterface):
(WebInspector.ProfilesPanel.prototype._enableProfiling):
(WebInspector.ProfilesPanel.prototype._toggleProfiling):
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.reset):
(WebInspector.ResourcesPanel.prototype._toggleLargerResources):
(WebInspector.ResourcesPanel.prototype._enableResourceTracking):
(WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
* inspector/front-end/ScriptView.js:
(WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.show):
(WebInspector.ScriptsPanel.prototype.addScript):
(WebInspector.ScriptsPanel.prototype.attachDebuggerWhenShown):
(WebInspector.ScriptsPanel.prototype.reset):
(WebInspector.ScriptsPanel.prototype.canShowResource):
(WebInspector.ScriptsPanel.prototype._showScriptOrResource):
(WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu):
(WebInspector.ScriptsPanel.prototype._updatePauseOnExceptionsButton):
(WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
(WebInspector.ScriptsPanel.prototype._enableDebugging):
(WebInspector.ScriptsPanel.prototype._toggleDebugging):
(WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
(WebInspector.ScriptsPanel.prototype._togglePause):
(WebInspector.ScriptsPanel.prototype._stepOverClicked):
(WebInspector.ScriptsPanel.prototype._stepIntoClicked):
(WebInspector.ScriptsPanel.prototype._stepOutClicked):
* inspector/front-end/SourceView.js:
(WebInspector.SourceView.prototype.setupSourceFrameIfNeeded):
(WebInspector.SourceView.prototype.performSearch.findSearchMatches):
(WebInspector.SourceView.prototype.performSearch):
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane.prototype._changeColorFormat):
* inspector/front-end/TestController.js:
(WebInspector.TestController.prototype.notifyDone):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSection.prototype.update):
(WebInspector.WatchExpressionsSection.prototype.loadSavedExpressions):
(WebInspector.WatchExpressionsSection.prototype.saveExpressions):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector.pendingDispatches.0.get platform):
(WebInspector.get port):
(WebInspector.set currentPanel):
(WebInspector._createPanels):
(WebInspector._loadPreferences):
(WebInspector.set attached):
(WebInspector._updateHoverHighlight):
(WebInspector.loaded):
(windowLoaded):
(WebInspector.windowUnload):
(WebInspector.close):
(WebInspector.toolbarDrag):
(WebInspector.UIString):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 32e1e2d..78e0181 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,314 @@
+2009-11-27 Pavel Feldman <pfeldman at dhcp-172-28-174-220.spb.corp.google.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Split InspectorBackend into three parts: backend,
+ injected script host and frontend host.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31888
+
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * WebCoreSources.bkl:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSInspectorBackendCustom.cpp: Removed.
+ * bindings/js/JSInspectorFrontendHostCustom.cpp: Added.
+ (WebCore::JSInspectorFrontendHost::search):
+ (WebCore::JSInspectorFrontendHost::setting):
+ (WebCore::JSInspectorFrontendHost::setSetting):
+ * bindings/js/ScriptObject.cpp:
+ (WebCore::ScriptGlobalObject::set):
+ * bindings/js/ScriptObject.h:
+ * bindings/v8/DOMObjectsInclude.h:
+ * bindings/v8/DerivedSourcesAllInOne.cpp:
+ * bindings/v8/ScriptObject.cpp:
+ (WebCore::ScriptGlobalObject::set):
+ * bindings/v8/ScriptObject.h:
+ * bindings/v8/V8Index.cpp:
+ * bindings/v8/V8Index.h:
+ * bindings/v8/custom/V8CustomBinding.h:
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: Added.
+ (WebCore::CALLBACK_FUNC_DECL):
+ * bindings/v8/custom/V8InspectorBackendCustom.cpp: Removed.
+ * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp: Added.
+ (WebCore::CALLBACK_FUNC_DECL):
+ * inspector/InjectedScriptHost.cpp: Added.
+ (WebCore::InjectedScriptHost::InjectedScriptHost):
+ (WebCore::InjectedScriptHost::~InjectedScriptHost):
+ (WebCore::InjectedScriptHost::copyText):
+ (WebCore::InjectedScriptHost::nodeForId):
+ (WebCore::InjectedScriptHost::wrapObject):
+ (WebCore::InjectedScriptHost::unwrapObject):
+ (WebCore::InjectedScriptHost::pushNodePathToFrontend):
+ (WebCore::InjectedScriptHost::addNodesToSearchResult):
+ (WebCore::InjectedScriptHost::currentCallFrame):
+ (WebCore::InjectedScriptHost::databaseForId):
+ (WebCore::InjectedScriptHost::selectDatabase):
+ (WebCore::InjectedScriptHost::selectDOMStorage):
+ (WebCore::InjectedScriptHost::reportDidDispatchOnInjectedScript):
+ (WebCore::InjectedScriptHost::inspectorDOMAgent):
+ (WebCore::InjectedScriptHost::inspectorFrontend):
+ * inspector/InjectedScriptHost.h: Added.
+ (WebCore::InjectedScriptHost::create):
+ (WebCore::InjectedScriptHost::inspectorController):
+ (WebCore::InjectedScriptHost::disconnectController):
+ * inspector/InjectedScriptHost.idl: Added.
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::InspectorBackend):
+ (WebCore::InspectorBackend::storeLastActivePanel):
+ (WebCore::InspectorBackend::toggleNodeSearch):
+ (WebCore::InspectorBackend::resourceTrackingEnabled):
+ (WebCore::InspectorBackend::debuggerEnabled):
+ (WebCore::InspectorBackend::enableDebugger):
+ (WebCore::InspectorBackend::disableDebugger):
+ (WebCore::InspectorBackend::addBreakpoint):
+ (WebCore::InspectorBackend::updateBreakpoint):
+ (WebCore::InspectorBackend::removeBreakpoint):
+ (WebCore::InspectorBackend::pauseInDebugger):
+ (WebCore::InspectorBackend::resumeDebugger):
+ (WebCore::InspectorBackend::stepOverStatementInDebugger):
+ (WebCore::InspectorBackend::stepIntoStatementInDebugger):
+ (WebCore::InspectorBackend::stepOutOfFunctionInDebugger):
+ (WebCore::InspectorBackend::pauseOnExceptions):
+ (WebCore::InspectorBackend::setPauseOnExceptions):
+ (WebCore::InspectorBackend::profilerEnabled):
+ (WebCore::InspectorBackend::enableProfiler):
+ (WebCore::InspectorBackend::disableProfiler):
+ (WebCore::InspectorBackend::startProfiling):
+ (WebCore::InspectorBackend::stopProfiling):
+ (WebCore::InspectorBackend::getProfileHeaders):
+ (WebCore::InspectorBackend::getProfile):
+ (WebCore::InspectorBackend::currentCallFrame):
+ (WebCore::InspectorBackend::highlightDOMNode):
+ (WebCore::InspectorBackend::hideDOMNodeHighlight):
+ (WebCore::InspectorBackend::getCookies):
+ (WebCore::InspectorBackend::deleteCookie):
+ (WebCore::InspectorBackend::didEvaluateForTestInFrontend):
+ (WebCore::InspectorBackend::nodeForId):
+ * inspector/InspectorBackend.h:
+ (WebCore::InspectorBackend::create):
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::~InspectorController):
+ (WebCore::InspectorController::inspectedPageDestroyed):
+ (WebCore::InspectorController::windowScriptObjectAvailable):
+ * inspector/InspectorController.h:
+ (WebCore::InspectorController::inspectorFrontendHost):
+ (WebCore::InspectorController::injectedScriptHost):
+ * inspector/InspectorFrontendHost.cpp: Added.
+ (WebCore::InspectorFrontendHost::InspectorFrontendHost):
+ (WebCore::InspectorFrontendHost::~InspectorFrontendHost):
+ (WebCore::InspectorFrontendHost::loaded):
+ (WebCore::InspectorFrontendHost::attach):
+ (WebCore::InspectorFrontendHost::detach):
+ (WebCore::InspectorFrontendHost::closeWindow):
+ (WebCore::InspectorFrontendHost::windowUnloading):
+ (WebCore::InspectorFrontendHost::setAttachedWindowHeight):
+ (WebCore::InspectorFrontendHost::moveWindowBy):
+ (WebCore::InspectorFrontendHost::localizedStringsURL):
+ (WebCore::InspectorFrontendHost::hiddenPanels):
+ (WebCore::InspectorFrontendHost::platform):
+ (WebCore::InspectorFrontendHost::port):
+ (WebCore::InspectorFrontendHost::addResourceSourceToFrame):
+ (WebCore::InspectorFrontendHost::addSourceToFrame):
+ * inspector/InspectorFrontendHost.h: Added.
+ (WebCore::InspectorFrontendHost::create):
+ (WebCore::InspectorFrontendHost::inspectorController):
+ (WebCore::InspectorFrontendHost::disconnectController):
+ * inspector/InspectorFrontendHost.idl: Added.
+ * inspector/front-end/Breakpoint.js:
+ (WebInspector.Breakpoint.prototype.set condition):
+ * inspector/front-end/BreakpointsSidebarPane.js:
+ (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
+ (WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint):
+ (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.clearMessages):
+ * inspector/front-end/CookieItemsView.js:
+ (WebInspector.CookieItemsView.prototype._deleteCookieCallback):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMAgent.prototype.getChildNodesAsync):
+ (WebInspector.DOMAgent.prototype.setAttributeAsync):
+ (WebInspector.DOMAgent.prototype.removeAttributeAsync):
+ (WebInspector.DOMAgent.prototype.setTextNodeValueAsync):
+ (WebInspector.Cookies.getCookiesAsync):
+ (WebInspector.EventListeners.getEventListenersForNodeAsync):
+ * inspector/front-end/DOMStorage.js:
+ (WebInspector.DOMStorage.prototype.getEntries):
+ (WebInspector.DOMStorage.prototype.setItem):
+ (WebInspector.DOMStorage.prototype.removeItem):
+ * inspector/front-end/Database.js:
+ (WebInspector.Database.prototype.getTableNames):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
+ (WebInspector.ElementsPanel.prototype.hide):
+ (WebInspector.ElementsPanel.prototype.reset):
+ (WebInspector.ElementsPanel.prototype.handleCopyEvent):
+ (WebInspector.ElementsPanel.prototype._nodeSearchButtonClicked):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeOutline.prototype.set focusedDOMNode.restoreHighlightToHoveredNode):
+ (WebInspector.ElementsTreeOutline.prototype.set focusedDOMNode):
+ ():
+ * inspector/front-end/EventListenersSidebarPane.js:
+ (WebInspector.EventListenersSidebarPane.prototype):
+ * inspector/front-end/InjectedScript.js:
+ (InjectedScript._evaluateAndWrap):
+ (InjectedScript.performSearch.addNodesToResults):
+ (InjectedScript.getCallFrames):
+ (InjectedScript._callFrameForId):
+ (InjectedScript._clearConsoleMessages):
+ (InjectedScript._inspectObject):
+ (InjectedScript._copy):
+ (InjectedScript._ensureCommandLineAPIInstalled):
+ (InjectedScript._window):
+ (InjectedScript._nodeForId):
+ (InjectedScript._objectForId):
+ (InjectedScript.pushNodeToFrontend):
+ (InjectedScript.executeSql):
+ (InjectedScript.executeSql.errorCallback):
+ (InjectedScript.executeSql.queryTransaction):
+ * inspector/front-end/InjectedScriptAccess.js:
+ (InjectedScriptAccess._installHandler.InjectedScriptAccess.methodName):
+ (InjectedScriptAccess._installHandler):
+ * inspector/front-end/InspectorBackendStub.js: Added.
+ (.WebInspector.InspectorBackendStub):
+ (.WebInspector.InspectorBackendStub.prototype.wrapCallback):
+ (.WebInspector.InspectorBackendStub.prototype.platform):
+ (.WebInspector.InspectorBackendStub.prototype.port):
+ (.WebInspector.InspectorBackendStub.prototype.closeWindow):
+ (.WebInspector.InspectorBackendStub.prototype.attach):
+ (.WebInspector.InspectorBackendStub.prototype.detach):
+ (.WebInspector.InspectorBackendStub.prototype.storeLastActivePanel):
+ (.WebInspector.InspectorBackendStub.prototype.clearMessages):
+ (.WebInspector.InspectorBackendStub.prototype.searchingForNode):
+ (.WebInspector.InspectorBackendStub.prototype.search):
+ (.WebInspector.InspectorBackendStub.prototype.toggleNodeSearch):
+ (.WebInspector.InspectorBackendStub.prototype.setAttachedWindowHeight):
+ (.WebInspector.InspectorBackendStub.prototype.moveByUnrestricted):
+ (.WebInspector.InspectorBackendStub.prototype.addResourceSourceToFrame):
+ (.WebInspector.InspectorBackendStub.prototype.addSourceToFrame):
+ (.WebInspector.InspectorBackendStub.prototype.getResourceDocumentNode):
+ (.WebInspector.InspectorBackendStub.prototype.highlightDOMNode):
+ (.WebInspector.InspectorBackendStub.prototype.hideDOMNodeHighlight):
+ (.WebInspector.InspectorBackendStub.prototype.inspectedWindow):
+ (.WebInspector.InspectorBackendStub.prototype.loaded):
+ (.WebInspector.InspectorBackendStub.prototype.localizedStringsURL):
+ (.WebInspector.InspectorBackendStub.prototype.windowUnloading):
+ (.WebInspector.InspectorBackendStub.prototype.hiddenPanels):
+ (.WebInspector.InspectorBackendStub.prototype.debuggerEnabled):
+ (.WebInspector.InspectorBackendStub.prototype.enableResourceTracking):
+ (.WebInspector.InspectorBackendStub.prototype.disableResourceTracking):
+ (.WebInspector.InspectorBackendStub.prototype.resourceTrackingEnabled):
+ (.WebInspector.InspectorBackendStub.prototype.enableDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.disableDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.addBreakpoint):
+ (.WebInspector.InspectorBackendStub.prototype.removeBreakpoint):
+ (.WebInspector.InspectorBackendStub.prototype.updateBreakpoint):
+ (.WebInspector.InspectorBackendStub.prototype.pauseInDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.pauseOnExceptions):
+ (.WebInspector.InspectorBackendStub.prototype.setPauseOnExceptions):
+ (.WebInspector.InspectorBackendStub.prototype.resumeDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.profilerEnabled):
+ (.WebInspector.InspectorBackendStub.prototype.enableProfiler):
+ (.WebInspector.InspectorBackendStub.prototype.disableProfiler):
+ (.WebInspector.InspectorBackendStub.prototype.startProfiling):
+ (.WebInspector.InspectorBackendStub.prototype.stopProfiling):
+ (.WebInspector.InspectorBackendStub.prototype.getProfileHeaders):
+ (.WebInspector.InspectorBackendStub.prototype.getProfile):
+ (.WebInspector.InspectorBackendStub.prototype.takeHeapSnapshot):
+ (.WebInspector.InspectorBackendStub.prototype.databaseTableNames):
+ (.WebInspector.InspectorBackendStub.prototype.stepIntoStatementInDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.stepOutOfFunctionInDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.stepOverStatementInDebugger):
+ (.WebInspector.InspectorBackendStub.prototype.setSetting):
+ (.WebInspector.InspectorBackendStub.prototype.dispatchOnInjectedScript):
+ (.WebInspector.InspectorBackendStub.prototype.releaseWrapperObjectGroup):
+ (.WebInspector.InspectorBackendStub.prototype.setting):
+ * inspector/front-end/InspectorControllerStub.js:
+ * inspector/front-end/InspectorFrontendHostStub.js: Added.
+ (.WebInspector.InspectorFrontendHostStub):
+ (.WebInspector.InspectorFrontendHostStub.prototype.platform):
+ (.WebInspector.InspectorFrontendHostStub.prototype.port):
+ (.WebInspector.InspectorFrontendHostStub.prototype.closeWindow):
+ (.WebInspector.InspectorFrontendHostStub.prototype.attach):
+ (.WebInspector.InspectorFrontendHostStub.prototype.detach):
+ (.WebInspector.InspectorFrontendHostStub.prototype.search):
+ (.WebInspector.InspectorFrontendHostStub.prototype.setAttachedWindowHeight):
+ (.WebInspector.InspectorFrontendHostStub.prototype.moveWindowBy):
+ (.WebInspector.InspectorFrontendHostStub.prototype.addResourceSourceToFrame):
+ (.WebInspector.InspectorFrontendHostStub.prototype.addSourceToFrame):
+ (.WebInspector.InspectorFrontendHostStub.prototype.loaded):
+ (.WebInspector.InspectorFrontendHostStub.prototype.localizedStringsURL):
+ (.WebInspector.InspectorFrontendHostStub.prototype.hiddenPanels):
+ (.WebInspector.InspectorFrontendHostStub.prototype.setSetting):
+ (.WebInspector.InspectorFrontendHostStub.prototype.setting):
+ * inspector/front-end/ProfileView.js:
+ (WebInspector.CPUProfileView):
+ (WebInspector.CPUProfileType.prototype.buttonClicked):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel.prototype._updateInterface):
+ (WebInspector.ProfilesPanel.prototype._enableProfiling):
+ (WebInspector.ProfilesPanel.prototype._toggleProfiling):
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.reset):
+ (WebInspector.ResourcesPanel.prototype._toggleLargerResources):
+ (WebInspector.ResourcesPanel.prototype._enableResourceTracking):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/ScriptView.js:
+ (WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype.show):
+ (WebInspector.ScriptsPanel.prototype.addScript):
+ (WebInspector.ScriptsPanel.prototype.attachDebuggerWhenShown):
+ (WebInspector.ScriptsPanel.prototype.reset):
+ (WebInspector.ScriptsPanel.prototype.canShowResource):
+ (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
+ (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu):
+ (WebInspector.ScriptsPanel.prototype._updatePauseOnExceptionsButton):
+ (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+ (WebInspector.ScriptsPanel.prototype._enableDebugging):
+ (WebInspector.ScriptsPanel.prototype._toggleDebugging):
+ (WebInspector.ScriptsPanel.prototype._togglePauseOnExceptions):
+ (WebInspector.ScriptsPanel.prototype._togglePause):
+ (WebInspector.ScriptsPanel.prototype._stepOverClicked):
+ (WebInspector.ScriptsPanel.prototype._stepIntoClicked):
+ (WebInspector.ScriptsPanel.prototype._stepOutClicked):
+ * inspector/front-end/SourceView.js:
+ (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded):
+ (WebInspector.SourceView.prototype.performSearch.findSearchMatches):
+ (WebInspector.SourceView.prototype.performSearch):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._changeColorFormat):
+ * inspector/front-end/TestController.js:
+ (WebInspector.TestController.prototype.notifyDone):
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype._toggleTimelineButtonClicked):
+ * inspector/front-end/WatchExpressionsSidebarPane.js:
+ (WebInspector.WatchExpressionsSection.prototype.update):
+ (WebInspector.WatchExpressionsSection.prototype.loadSavedExpressions):
+ (WebInspector.WatchExpressionsSection.prototype.saveExpressions):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+ (WebInspector.pendingDispatches.0.get platform):
+ (WebInspector.get port):
+ (WebInspector.set currentPanel):
+ (WebInspector._createPanels):
+ (WebInspector._loadPreferences):
+ (WebInspector.set attached):
+ (WebInspector._updateHoverHighlight):
+ (WebInspector.loaded):
+ (windowLoaded):
+ (WebInspector.windowUnload):
+ (WebInspector.close):
+ (WebInspector.toolbarDrag):
+ (WebInspector.UIString):
+
2009-11-30 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Dan Bernstein.
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index b20c0d5..9e03f13 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -200,7 +200,9 @@ DOM_CLASSES = \
HTMLVideoElement \
History \
ImageData \
+ InjectedScriptHost \
InspectorBackend \
+ InspectorFrontendHost \
KeyboardEvent \
Location \
Media \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index c637269..7d07a17 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -246,7 +246,9 @@ IDL_BINDINGS += \
WebCore/html/ValidityState.idl \
WebCore/html/VoidCallback.idl \
WebCore/inspector/JavaScriptCallFrame.idl \
+ WebCore/inspector/InjectedScriptHost.idl \
WebCore/inspector/InspectorBackend.idl \
+ WebCore/inspector/InspectorFrontendHost.idl \
WebCore/notifications/Notification.idl \
WebCore/notifications/NotificationCenter.idl \
WebCore/page/BarInfo.idl \
@@ -398,7 +400,8 @@ webcore_sources += \
WebCore/bindings/js/JSImageConstructor.cpp \
WebCore/bindings/js/JSImageConstructor.h \
WebCore/bindings/js/JSImageDataCustom.cpp \
- WebCore/bindings/js/JSInspectorBackendCustom.cpp \
+ WebCore/bindings/js/JSInjectedScriptHostCustom.cpp \
+ WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp \
WebCore/bindings/js/JSInspectedObjectWrapper.cpp \
WebCore/bindings/js/JSInspectedObjectWrapper.h \
WebCore/bindings/js/JSInspectorCallbackWrapper.cpp \
@@ -1169,6 +1172,8 @@ webcore_sources += \
WebCore/icu/unicode/uversion.h \
WebCore/inspector/ConsoleMessage.cpp \
WebCore/inspector/ConsoleMessage.h \
+ WebCore/inspector/InjectedScriptHost.cpp \
+ WebCore/inspector/InjectedScriptHost.h \
WebCore/inspector/InspectorBackend.cpp \
WebCore/inspector/InspectorBackend.h \
WebCore/inspector/InspectorDatabaseResource.cpp \
@@ -1182,6 +1187,8 @@ webcore_sources += \
WebCore/inspector/InspectorController.h \
WebCore/inspector/InspectorFrontend.cpp \
WebCore/inspector/InspectorFrontend.h \
+ WebCore/inspector/InspectorFrontendHost.cpp \
+ WebCore/inspector/InspectorFrontendHost.h \
WebCore/inspector/InspectorResource.cpp \
WebCore/inspector/InspectorResource.h \
WebCore/inspector/InspectorTimelineAgent.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 2225dee..8d98bac 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -179,7 +179,9 @@
'html/TimeRanges.idl',
'html/ValidityState.idl',
'html/VoidCallback.idl',
+ 'inspector/InjectedScriptHost.idl',
'inspector/InspectorBackend.idl',
+ 'inspector/InspectorFrontendHost.idl',
'inspector/JavaScriptCallFrame.idl',
'loader/appcache/DOMApplicationCache.idl',
'notifications/Notification.idl',
@@ -522,7 +524,8 @@
'bindings/js/JSInspectedObjectWrapper.h',
'bindings/js/JSInspectorCallbackWrapper.cpp',
'bindings/js/JSInspectorCallbackWrapper.h',
- 'bindings/js/JSInspectorBackendCustom.cpp',
+ 'bindings/js/JSInjectedScriptHostCustom.cpp',
+ 'bindings/js/JSInspectorFrontendHostCustom.cpp',
'bindings/js/JSJavaScriptCallFrameCustom.cpp',
'bindings/js/JSLazyEventListener.cpp',
'bindings/js/JSLazyEventListener.h',
@@ -698,7 +701,8 @@
'bindings/v8/custom/V8HTMLSelectElementCollectionCustom.cpp',
'bindings/v8/custom/V8HTMLSelectElementCustom.cpp',
'bindings/v8/custom/V8HTMLSelectElementCustom.h',
- 'bindings/v8/custom/V8InspectorBackendCustom.cpp',
+ 'bindings/v8/custom/V8InjectedScriptHostCustom.cpp',
+ 'bindings/v8/custom/V8InspectorFrontendHostCustom.cpp',
'bindings/v8/custom/V8LocationCustom.cpp',
'bindings/v8/custom/V8MessageChannelConstructor.cpp',
'bindings/v8/custom/V8MessageEventCustom.cpp',
@@ -1520,6 +1524,8 @@
'inspector/InspectorClient.h',
'inspector/ConsoleMessage.cpp',
'inspector/ConsoleMessage.h',
+ 'inspector/InjectedScriptHost.cpp',
+ 'inspector/InjectedScriptHost.h',
'inspector/InspectorBackend.cpp',
'inspector/InspectorBackend.h',
'inspector/InspectorController.cpp',
@@ -1532,6 +1538,8 @@
'inspector/InspectorDOMStorageResource.h',
'inspector/InspectorFrontend.cpp',
'inspector/InspectorFrontend.h',
+ 'inspector/InspectorFrontendHost.cpp',
+ 'inspector/InspectorFrontendHost.h',
'inspector/InspectorResource.cpp',
'inspector/InspectorResource.h',
'inspector/InspectorTimelineAgent.cpp',
@@ -3634,7 +3642,8 @@
'inspector/front-end/EventListenersSidebarPane.js',
'inspector/front-end/FontView.js',
'inspector/front-end/ImageView.js',
- 'inspector/front-end/InspectorControllerStub.js',
+ 'inspector/front-end/InspectorBackendStub.js',
+ 'inspector/front-end/InspectorFrontendHostStub.js',
'inspector/front-end/InjectedScript.js',
'inspector/front-end/InjectedScriptAccess.js',
'inspector/front-end/inspector.js',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 834ead8..3d0cf5c 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -466,7 +466,9 @@ IDL_BINDINGS += \
html/TimeRanges.idl \
html/ValidityState.idl \
html/VoidCallback.idl \
+ inspector/InjectedScriptHost.idl \
inspector/InspectorBackend.idl \
+ inspector/InspectorFrontendHost.idl \
inspector/JavaScriptCallFrame.idl \
loader/appcache/DOMApplicationCache.idl \
page/BarInfo.idl \
@@ -719,8 +721,9 @@ SOURCES += \
bindings/js/JSHTMLSelectElementCustom.cpp \
bindings/js/JSImageConstructor.cpp \
bindings/js/JSImageDataCustom.cpp \
+ bindings/js/JSInjectedScriptHostCustom.cpp \
bindings/js/JSInspectedObjectWrapper.cpp \
- bindings/js/JSInspectorBackendCustom.cpp \
+ bindings/js/JSInspectorFrontendHostCustom.cpp \
bindings/js/JSInspectorCallbackWrapper.cpp \
bindings/js/JSLocationCustom.cpp \
bindings/js/JSNamedNodeMapCustom.cpp \
@@ -1075,12 +1078,14 @@ SOURCES += \
html/PreloadScanner.cpp \
html/ValidityState.cpp \
inspector/ConsoleMessage.cpp \
+ inspector/InjectedScriptHost.cpp \
inspector/InspectorBackend.cpp \
inspector/InspectorController.cpp \
inspector/InspectorDatabaseResource.cpp \
inspector/InspectorDOMAgent.cpp \
inspector/InspectorDOMStorageResource.cpp \
inspector/InspectorFrontend.cpp \
+ inspector/InspectorFrontendHost.cpp \
inspector/InspectorResource.cpp \
inspector/InspectorTimelineAgent.cpp \
inspector/TimelineRecordFactory.cpp \
@@ -1757,11 +1762,13 @@ HEADERS += \
html/TimeRanges.h \
html/ValidityState.h \
inspector/ConsoleMessage.h \
+ inspector/InjectedScriptHost.h \
inspector/InspectorBackend.h \
inspector/InspectorController.h \
inspector/InspectorDatabaseResource.h \
inspector/InspectorDOMStorageResource.h \
inspector/InspectorFrontend.h \
+ inspector/InspectorFrontendHost.h \
inspector/InspectorResource.h \
inspector/InspectorTimelineAgent.h \
inspector/JavaScriptCallFrame.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index be65836..98c339e 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -7731,7 +7731,7 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInjectedScriptHost.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -7783,7 +7783,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorBackend.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInjectedScriptHost.h"
>
</File>
<File
@@ -7843,6 +7843,62 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSInspectorFrontendHost.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSJavaScriptCallFrame.cpp"
>
<FileConfiguration
@@ -37298,7 +37354,59 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSInspectorBackendCustom.cpp"
+ RelativePath="..\bindings\js\JSInjectedScriptHostCustom.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSInspectorFrontendHostCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42319,6 +42427,13 @@
>
</File>
<File
+ RelativePath="..\inspector\InjectedScriptHost.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\InjectedScriptHost.h"
+ >
+ <File
RelativePath="..\inspector\InspectorBackend.cpp"
>
</File>
@@ -42371,6 +42486,14 @@
>
</File>
<File
+ RelativePath="..\inspector\InspectorFrontendHost.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\InspectorFrontendHost.h"
+ >
+ </File>
+ <File
RelativePath="..\inspector\InspectorResource.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 264e9f0..8faa84a 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1229,6 +1229,17 @@
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 */; };
+ 7A0E76FB10BF08ED00A0276E /* InjectedScriptHost.idl in Resources */ = {isa = PBXBuildFile; fileRef = 7A0E76F810BF08ED00A0276E /* InjectedScriptHost.idl */; };
+ 7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */; };
+ 7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */; };
+ 7A0E771010C00A8800A0276E /* InspectorFrontendHost.idl in Resources */ = {isa = PBXBuildFile; fileRef = 7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */; };
+ 7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */; };
+ 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */; };
7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; };
7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; };
@@ -1237,7 +1248,7 @@
7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; };
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */; };
7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorBackend.h */; };
- 7A74ECBD101839DA00BF939E /* JSInspectorBackendCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorBackendCustom.cpp */; };
+ 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; };
7AED3E050FBB1EAA00D2B03C /* InspectorFrontend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */; };
7AED3E060FBB1EAA00D2B03C /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */; };
84224183107E77F400766A87 /* JSSVGFEMorphologyElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84224181107E77F400766A87 /* JSSVGFEMorphologyElement.cpp */; };
@@ -6550,6 +6561,17 @@
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; name = JSInjectedScriptHost.cpp; sourceTree = "<group>"; };
+ 7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 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>"; };
+ 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSInspectorFrontendHost.cpp; sourceTree = "<group>"; };
+ 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSInspectorFrontendHost.h; sourceTree = "<group>"; };
7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = "<group>"; };
7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = "<group>"; };
7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = "<group>"; };
@@ -6559,7 +6581,7 @@
7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = "<group>"; };
7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; };
7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; };
- 7A74ECBC101839DA00BF939E /* JSInspectorBackendCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorBackendCustom.cpp; sourceTree = "<group>"; };
+ 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontend.cpp; sourceTree = "<group>"; };
7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontend.h; sourceTree = "<group>"; };
84224181107E77F400766A87 /* JSSVGFEMorphologyElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFEMorphologyElement.cpp; sourceTree = "<group>"; };
@@ -10420,8 +10442,12 @@
1C5FAECA0DCFD8C900D58F78 /* Inspector */ = {
isa = PBXGroup;
children = (
+ 7A0E76D810BF059800A0276E /* JSInjectedScriptHost.cpp */,
+ 7A0E76D910BF059800A0276E /* JSInjectedScriptHost.h */,
41F060CB0F5EEB2B00A07EAC /* JSInspectorBackend.cpp */,
41F060CC0F5EEB2B00A07EAC /* JSInspectorBackend.h */,
+ 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */,
+ 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
1C5FAECF0DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp */,
1C5FAED00DCFD90100D58F78 /* JSJavaScriptCallFrame.h */,
);
@@ -10434,6 +10460,9 @@
1C81B9590E97330800266E07 /* front-end */,
41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */,
41F0618C0F5F069800A07EAC /* ConsoleMessage.h */,
+ 7A0E76F610BF08ED00A0276E /* InjectedScriptHost.cpp */,
+ 7A0E76F710BF08ED00A0276E /* InjectedScriptHost.h */,
+ 7A0E76F810BF08ED00A0276E /* InjectedScriptHost.idl */,
7A74ECB8101839A500BF939E /* InspectorBackend.cpp */,
7A74ECB9101839A600BF939E /* InspectorBackend.h */,
7A74ECB61018399A00BF939E /* InspectorBackend.idl */,
@@ -10448,6 +10477,9 @@
41F061720F5F00AC00A07EAC /* InspectorDOMStorageResource.h */,
7AED3E030FBB1EAA00D2B03C /* InspectorFrontend.cpp */,
7AED3E040FBB1EAA00D2B03C /* InspectorFrontend.h */,
+ 7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */,
+ 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */,
+ 7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
41F062000F5F0B6600A07EAC /* InspectorResource.cpp */,
41F061FF0F5F0B6600A07EAC /* InspectorResource.h */,
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
@@ -14530,7 +14562,8 @@
BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */,
AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */,
A7D0318D0E93540300E24ACD /* JSImageDataCustom.cpp */,
- 7A74ECBC101839DA00BF939E /* JSInspectorBackendCustom.cpp */,
+ 7A0E76D410BF050700A0276E /* JSInjectedScriptHostCustom.cpp */,
+ 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
1C5FAEE60DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp */,
BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
E1A5F99A0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp */,
@@ -18179,6 +18212,10 @@
9382DF5810A8D5C900925652 /* ColorSpace.h in Headers */,
AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */,
+ 7A0E76DB10BF059800A0276E /* JSInjectedScriptHost.h in Headers */,
+ 7A0E76FA10BF08ED00A0276E /* InjectedScriptHost.h in Headers */,
+ 7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
+ 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -18282,6 +18319,8 @@
1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
18C5FCA710A3991F0048438D /* WebKitSharedScript.idl in Resources */,
18C5FCB910A3C6F20048438D /* SharedScriptContext.idl in Resources */,
+ 7A0E76FB10BF08ED00A0276E /* InjectedScriptHost.idl in Resources */,
+ 7A0E771010C00A8800A0276E /* InspectorFrontendHost.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -19379,7 +19418,7 @@
A7D0318E0E93540300E24ACD /* JSImageDataCustom.cpp in Sources */,
C091588A0DB4209200E55AF4 /* JSInspectedObjectWrapper.cpp in Sources */,
41F060CD0F5EEB2B00A07EAC /* JSInspectorBackend.cpp in Sources */,
- 7A74ECBD101839DA00BF939E /* JSInspectorBackendCustom.cpp in Sources */,
+ 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
C091588C0DB4209200E55AF4 /* JSInspectorCallbackWrapper.cpp in Sources */,
1C5FAED10DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp in Sources */,
1C5FAEE70DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp in Sources */,
@@ -20329,6 +20368,11 @@
18C5FCB710A3C6F20048438D /* SharedScriptContext.cpp in Sources */,
E1B4CD2510B322E200BFFD7E /* CredentialStorageMac.mm in Sources */,
6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */,
+ 7A0E76D510BF050700A0276E /* JSInjectedScriptHostCustom.cpp in Sources */,
+ 7A0E76DA10BF059800A0276E /* JSInjectedScriptHost.cpp in Sources */,
+ 7A0E76F910BF08ED00A0276E /* InjectedScriptHost.cpp in Sources */,
+ 7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */,
+ 7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/WebCoreSources.bkl b/WebCore/WebCoreSources.bkl
index 236e2e2..8bfe499 100644
--- a/WebCore/WebCoreSources.bkl
+++ b/WebCore/WebCoreSources.bkl
@@ -111,8 +111,9 @@ This file contains the list of files needed to build WebCore.
bindings/js/JSHTMLSelectElementCustom.cpp
bindings/js/JSImageConstructor.cpp
bindings/js/JSImageDataCustom.cpp
+ bindings/js/JSInjectedScriptHostCustom.cpp
bindings/js/JSInspectedObjectWrapper.cpp
- bindings/js/JSInspectorBackendCustom.cpp
+ bindings/js/JSInspectorFrontendHostCustom.cpp
bindings/js/JSInspectorCallbackWrapper.cpp
bindings/js/JSJavaScriptCallFrameCustom.cpp
bindings/js/JSLocationCustom.cpp
@@ -366,7 +367,9 @@ This file contains the list of files needed to build WebCore.
DerivedSources/WebCore/JSHTMLUListElement.cpp
DerivedSources/WebCore/JSHistory.cpp
DerivedSources/WebCore/JSImageData.cpp
+ DerivedSources/WebCore/JSInjectedScriptHost.cpp
DerivedSources/WebCore/JSInspectorBackend.cpp
+ DerivedSources/WebCore/JSInspectorFrontendHost.cpp
DerivedSources/WebCore/JSJavaScriptCallFrame.cpp
DerivedSources/WebCore/JSKeyboardEvent.cpp
DerivedSources/WebCore/JSLocation.cpp
@@ -682,7 +685,9 @@ This file contains the list of files needed to build WebCore.
<set append="1" var="WEBCORE_SOURCES_INSPECTOR">
inspector/ConsoleMessage.cpp
+ inspector/InjectedScriptHost.cpp
inspector/InspectorBackend.cpp
+ inspector/InspectorFrontendHost.cpp
inspector/InspectorDatabaseResource.cpp
inspector/InspectorDOMAgent.cpp
inspector/InspectorDOMStorageResource.cpp
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index f08303a..0a58dbd 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -85,8 +85,9 @@
#include "JSHistoryCustom.cpp"
#include "JSImageConstructor.cpp"
#include "JSImageDataCustom.cpp"
+#include "JSInjectedScriptHostCustom.cpp"
#include "JSInspectedObjectWrapper.cpp"
-#include "JSInspectorBackendCustom.cpp"
+#include "JSInspectorFrontendHostCustom.cpp"
#include "JSJavaScriptCallFrameCustom.cpp"
#include "JSLazyEventListener.cpp"
#include "JSLocationCustom.cpp"
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
new file mode 100644
index 0000000..fcc9e5e
--- /dev/null
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSInjectedScriptHost.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Console.h"
+#if ENABLE(DATABASE)
+#include "Database.h"
+#include "JSDatabase.h"
+#endif
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "InjectedScriptHost.h"
+#include "InspectorController.h"
+#include "InspectorResource.h"
+#include "JSDOMWindow.h"
+#include "JSInspectedObjectWrapper.h"
+#include "JSInspectorCallbackWrapper.h"
+#include "JSNode.h"
+#include "JSRange.h"
+#include "Node.h"
+#include "Page.h"
+#if ENABLE(DOM_STORAGE)
+#include "Storage.h"
+#include "JSStorage.h"
+#endif
+#include "TextIterator.h"
+#include "VisiblePosition.h"
+#include <runtime/JSArray.h>
+#include <runtime/JSLock.h>
+#include <wtf/Vector.h>
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "JavaScriptCallFrame.h"
+#include "JavaScriptDebugServer.h"
+#include "JSJavaScriptCallFrame.h"
+#endif
+
+using namespace JSC;
+
+namespace WebCore {
+
+#if ENABLE(DATABASE)
+JSValue JSInjectedScriptHost::databaseForId(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ InspectorController* ic = impl()->inspectorController();
+ if (!ic)
+ return jsUndefined();
+
+ Database* database = impl()->databaseForId(args.at(0).toInt32(exec));
+ if (!database)
+ return jsUndefined();
+ // Could use currentWorld(exec) ... but which exec! The following mixed use of exec & inspectedWindow->globalExec() scares me!
+ JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
+ return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), toJS(exec, database));
+}
+#endif
+
+JSValue JSInjectedScriptHost::inspectedWindow(ExecState*, const ArgList&)
+{
+ InspectorController* ic = impl()->inspectorController();
+ if (!ic)
+ return jsUndefined();
+ JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
+ return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), inspectedWindow);
+}
+
+JSValue JSInjectedScriptHost::wrapCallback(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ return JSInspectorCallbackWrapper::wrap(exec, args.at(0));
+}
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+
+JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec, const ArgList&)
+{
+ JavaScriptCallFrame* callFrame = impl()->currentCallFrame();
+ if (!callFrame || !callFrame->isValid())
+ return jsUndefined();
+
+ // FIXME: I am not sure if this is actually needed. Can we just use exec?
+ ExecState* globalExec = callFrame->scopeChain()->globalObject->globalExec();
+
+ JSLock lock(SilenceAssertionsOnly);
+ return JSInspectedObjectWrapper::wrap(globalExec, toJS(exec, callFrame));
+}
+
+#endif
+
+JSValue JSInjectedScriptHost::nodeForId(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ Node* node = impl()->nodeForId(args.at(0).toInt32(exec));
+ if (!node)
+ return jsUndefined();
+
+ InspectorController* ic = impl()->inspectorController();
+ if (!ic)
+ return jsUndefined();
+
+ JSLock lock(SilenceAssertionsOnly);
+ JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
+ return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), toJS(exec, deprecatedGlobalObjectForPrototype(inspectedWindow->globalExec()), node));
+}
+
+JSValue JSInjectedScriptHost::wrapObject(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 2)
+ return jsUndefined();
+
+ return impl()->wrapObject(ScriptValue(args.at(0)), args.at(1).toString(exec)).jsValue();
+}
+
+JSValue JSInjectedScriptHost::unwrapObject(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ return impl()->unwrapObject(args.at(0).toString(exec)).jsValue();
+}
+
+JSValue JSInjectedScriptHost::pushNodePathToFrontend(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 2)
+ return jsUndefined();
+
+ JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
+ if (!wrapper)
+ return jsUndefined();
+
+ Node* node = toNode(wrapper->unwrappedObject());
+ if (!node)
+ return jsUndefined();
+
+ bool selectInUI = args.at(1).toBoolean(exec);
+ return jsNumber(exec, impl()->pushNodePathToFrontend(node, selectInUI));
+}
+
+#if ENABLE(DATABASE)
+JSValue JSInjectedScriptHost::selectDatabase(ExecState*, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
+ if (!wrapper)
+ return jsUndefined();
+
+ Database* database = toDatabase(wrapper->unwrappedObject());
+ if (database)
+ impl()->selectDatabase(database);
+ return jsUndefined();
+}
+#endif
+
+#if ENABLE(DOM_STORAGE)
+JSValue JSInjectedScriptHost::selectDOMStorage(ExecState*, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+ InspectorController* ic = impl()->inspectorController();
+ if (!ic)
+ return jsUndefined();
+
+ JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
+ if (!wrapper)
+ return jsUndefined();
+
+ Storage* storage = toStorage(wrapper->unwrappedObject());
+ if (storage)
+ impl()->selectDOMStorage(storage);
+ return jsUndefined();
+}
+#endif
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/js/JSInspectorBackendCustom.cpp b/WebCore/bindings/js/JSInspectorBackendCustom.cpp
deleted file mode 100644
index 439f532..0000000
--- a/WebCore/bindings/js/JSInspectorBackendCustom.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSInspectorBackend.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "Console.h"
-#if ENABLE(DATABASE)
-#include "Database.h"
-#include "JSDatabase.h"
-#endif
-#include "ExceptionCode.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "InspectorBackend.h"
-#include "InspectorController.h"
-#include "InspectorResource.h"
-#include "JSDOMWindow.h"
-#include "JSInspectedObjectWrapper.h"
-#include "JSInspectorCallbackWrapper.h"
-#include "JSNode.h"
-#include "JSRange.h"
-#include "Node.h"
-#include "Page.h"
-#if ENABLE(DOM_STORAGE)
-#include "Storage.h"
-#include "JSStorage.h"
-#endif
-#include "TextIterator.h"
-#include "VisiblePosition.h"
-#include <runtime/JSArray.h>
-#include <runtime/JSLock.h>
-#include <wtf/Vector.h>
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-#include "JavaScriptCallFrame.h"
-#include "JavaScriptDebugServer.h"
-#include "JSJavaScriptCallFrame.h"
-#endif
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSInspectorBackend::highlightDOMNode(JSC::ExecState* exec, const JSC::ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- impl()->highlight(args.at(0).toInt32(exec));
- return jsUndefined();
-}
-
-JSValue JSInspectorBackend::search(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 2)
- return jsUndefined();
-
- Node* node = toNode(args.at(0));
- if (!node)
- return jsUndefined();
-
- String target = args.at(1).toString(exec);
- if (exec->hadException())
- return jsUndefined();
-
- MarkedArgumentBuffer result;
- RefPtr<Range> searchRange(rangeOfContents(node));
-
- ExceptionCode ec = 0;
- do {
- RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));
- if (resultRange->collapsed(ec))
- break;
-
- // A non-collapsed result range can in some funky whitespace cases still not
- // advance the range's start position (4509328). Break to avoid infinite loop.
- VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
- if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
- break;
-
- result.append(toJS(exec, resultRange.get()));
-
- setStart(searchRange.get(), newStart);
- } while (true);
-
- return constructArray(exec, result);
-}
-
-#if ENABLE(DATABASE)
-JSValue JSInspectorBackend::databaseForId(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
-
- Database* database = impl()->databaseForId(args.at(0).toInt32(exec));
- if (!database)
- return jsUndefined();
- // Could use currentWorld(exec) ... but which exec! The following mixed use of exec & inspectedWindow->globalExec() scares me!
- JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
- return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), toJS(exec, database));
-}
-#endif
-
-JSValue JSInspectorBackend::inspectedWindow(ExecState*, const ArgList&)
-{
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
- JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
- return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), inspectedWindow);
-}
-
-JSValue JSInspectorBackend::setting(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- String key = args.at(0).toString(exec);
- if (exec->hadException())
- return jsUndefined();
-
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
- const InspectorController::Setting& setting = ic->setting(key);
-
- switch (setting.type()) {
- default:
- case InspectorController::Setting::NoType:
- return jsUndefined();
- case InspectorController::Setting::StringType:
- return jsString(exec, setting.string());
- case InspectorController::Setting::DoubleType:
- return jsNumber(exec, setting.doubleValue());
- case InspectorController::Setting::IntegerType:
- return jsNumber(exec, setting.integerValue());
- case InspectorController::Setting::BooleanType:
- return jsBoolean(setting.booleanValue());
- case InspectorController::Setting::StringVectorType: {
- MarkedArgumentBuffer stringsArray;
- const Vector<String>& strings = setting.stringVector();
- const unsigned length = strings.size();
- for (unsigned i = 0; i < length; ++i)
- stringsArray.append(jsString(exec, strings[i]));
- return constructArray(exec, stringsArray);
- }
- }
-}
-
-JSValue JSInspectorBackend::setSetting(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 2)
- return jsUndefined();
-
- String key = args.at(0).toString(exec);
- if (exec->hadException())
- return jsUndefined();
-
- InspectorController::Setting setting;
-
- JSValue value = args.at(1);
- if (value.isUndefined() || value.isNull()) {
- // Do nothing. The setting is already NoType.
- ASSERT(setting.type() == InspectorController::Setting::NoType);
- } else if (value.isString())
- setting.set(value.toString(exec));
- else if (value.isNumber())
- setting.set(value.toNumber(exec));
- else if (value.isBoolean())
- setting.set(value.toBoolean(exec));
- else {
- JSArray* jsArray = asArray(value);
- if (!jsArray)
- return jsUndefined();
- Vector<String> strings;
- for (unsigned i = 0; i < jsArray->length(); ++i) {
- String item = jsArray->get(exec, i).toString(exec);
- if (exec->hadException())
- return jsUndefined();
- strings.append(item);
- }
- setting.set(strings);
- }
-
- if (exec->hadException())
- return jsUndefined();
-
- InspectorController* ic = impl()->inspectorController();
- if (ic)
- ic->setSetting(key, setting);
-
- return jsUndefined();
-}
-
-JSValue JSInspectorBackend::wrapCallback(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- return JSInspectorCallbackWrapper::wrap(exec, args.at(0));
-}
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-
-JSValue JSInspectorBackend::currentCallFrame(ExecState* exec, const ArgList&)
-{
- JavaScriptCallFrame* callFrame = impl()->currentCallFrame();
- if (!callFrame || !callFrame->isValid())
- return jsUndefined();
-
- // FIXME: I am not sure if this is actually needed. Can we just use exec?
- ExecState* globalExec = callFrame->scopeChain()->globalObject->globalExec();
-
- JSLock lock(SilenceAssertionsOnly);
- return JSInspectedObjectWrapper::wrap(globalExec, toJS(exec, callFrame));
-}
-
-#endif
-
-JSValue JSInspectorBackend::nodeForId(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- Node* node = impl()->nodeForId(args.at(0).toInt32(exec));
- if (!node)
- return jsUndefined();
-
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
-
- JSLock lock(SilenceAssertionsOnly);
- JSDOMWindow* inspectedWindow = toJSDOMWindow(ic->inspectedPage()->mainFrame(), debuggerWorld());
- return JSInspectedObjectWrapper::wrap(inspectedWindow->globalExec(), toJS(exec, deprecatedGlobalObjectForPrototype(inspectedWindow->globalExec()), node));
-}
-
-JSValue JSInspectorBackend::wrapObject(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 2)
- return jsUndefined();
-
- return impl()->wrapObject(ScriptValue(args.at(0)), args.at(1).toString(exec)).jsValue();
-}
-
-JSValue JSInspectorBackend::unwrapObject(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- return impl()->unwrapObject(args.at(0).toString(exec)).jsValue();
-}
-
-JSValue JSInspectorBackend::pushNodePathToFrontend(ExecState* exec, const ArgList& args)
-{
- if (args.size() < 2)
- return jsUndefined();
-
- JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
- if (!wrapper)
- return jsUndefined();
-
- Node* node = toNode(wrapper->unwrappedObject());
- if (!node)
- return jsUndefined();
-
- bool selectInUI = args.at(1).toBoolean(exec);
- return jsNumber(exec, impl()->pushNodePathToFrontend(node, selectInUI));
-}
-
-#if ENABLE(DATABASE)
-JSValue JSInspectorBackend::selectDatabase(ExecState*, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
-
- JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
- if (!wrapper)
- return jsUndefined();
-
- Database* database = toDatabase(wrapper->unwrappedObject());
- if (database)
- impl()->selectDatabase(database);
- return jsUndefined();
-}
-#endif
-
-#if ENABLE(DOM_STORAGE)
-JSValue JSInspectorBackend::selectDOMStorage(ExecState*, const ArgList& args)
-{
- if (args.size() < 1)
- return jsUndefined();
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
-
- JSQuarantinedObjectWrapper* wrapper = JSQuarantinedObjectWrapper::asWrapper(args.at(0));
- if (!wrapper)
- return jsUndefined();
-
- Storage* storage = toStorage(wrapper->unwrappedObject());
- if (storage)
- impl()->selectDOMStorage(storage);
- return jsUndefined();
-}
-#endif
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
new file mode 100644
index 0000000..5b44134
--- /dev/null
+++ b/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSInspectorFrontendHost.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "InspectorController.h"
+#include "InspectorFrontendHost.h"
+#include "JSNode.h"
+#include "JSRange.h"
+#include "Node.h"
+#include "Page.h"
+#include "TextIterator.h"
+#include "VisiblePosition.h"
+#include <runtime/JSArray.h>
+#include <runtime/JSLock.h>
+#include <wtf/Vector.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSInspectorFrontendHost::search(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 2)
+ return jsUndefined();
+
+ Node* node = toNode(args.at(0));
+ if (!node)
+ return jsUndefined();
+
+ String target = args.at(1).toString(exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ MarkedArgumentBuffer result;
+ RefPtr<Range> searchRange(rangeOfContents(node));
+
+ ExceptionCode ec = 0;
+ do {
+ RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));
+ if (resultRange->collapsed(ec))
+ break;
+
+ // A non-collapsed result range can in some funky whitespace cases still not
+ // advance the range's start position (4509328). Break to avoid infinite loop.
+ VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
+ if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
+ break;
+
+ result.append(toJS(exec, resultRange.get()));
+
+ setStart(searchRange.get(), newStart);
+ } while (true);
+
+ return constructArray(exec, result);
+}
+
+JSValue JSInspectorFrontendHost::setting(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 1)
+ return jsUndefined();
+
+ String key = args.at(0).toString(exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ InspectorController* ic = impl()->inspectorController();
+ if (!ic)
+ return jsUndefined();
+ const InspectorController::Setting& setting = ic->setting(key);
+
+ switch (setting.type()) {
+ default:
+ case InspectorController::Setting::NoType:
+ return jsUndefined();
+ case InspectorController::Setting::StringType:
+ return jsString(exec, setting.string());
+ case InspectorController::Setting::DoubleType:
+ return jsNumber(exec, setting.doubleValue());
+ case InspectorController::Setting::IntegerType:
+ return jsNumber(exec, setting.integerValue());
+ case InspectorController::Setting::BooleanType:
+ return jsBoolean(setting.booleanValue());
+ case InspectorController::Setting::StringVectorType: {
+ MarkedArgumentBuffer stringsArray;
+ const Vector<String>& strings = setting.stringVector();
+ const unsigned length = strings.size();
+ for (unsigned i = 0; i < length; ++i)
+ stringsArray.append(jsString(exec, strings[i]));
+ return constructArray(exec, stringsArray);
+ }
+ }
+}
+
+JSValue JSInspectorFrontendHost::setSetting(ExecState* exec, const ArgList& args)
+{
+ if (args.size() < 2)
+ return jsUndefined();
+
+ String key = args.at(0).toString(exec);
+ if (exec->hadException())
+ return jsUndefined();
+
+ InspectorController::Setting setting;
+
+ JSValue value = args.at(1);
+ if (value.isUndefined() || value.isNull()) {
+ // Do nothing. The setting is already NoType.
+ ASSERT(setting.type() == InspectorController::Setting::NoType);
+ } else if (value.isString())
+ setting.set(value.toString(exec));
+ else if (value.isNumber())
+ setting.set(value.toNumber(exec));
+ else if (value.isBoolean())
+ setting.set(value.toBoolean(exec));
+ else {
+ JSArray* jsArray = asArray(value);
+ if (!jsArray)
+ return jsUndefined();
+ Vector<String> strings;
+ for (unsigned i = 0; i < jsArray->length(); ++i) {
+ String item = jsArray->get(exec, i).toString(exec);
+ if (exec->hadException())
+ return jsUndefined();
+ strings.append(item);
+ }
+ setting.set(strings);
+ }
+
+ if (exec->hadException())
+ return jsUndefined();
+
+ InspectorController* ic = impl()->inspectorController();
+ if (ic)
+ ic->setSetting(key, setting);
+
+ return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/bindings/js/ScriptObject.cpp b/WebCore/bindings/js/ScriptObject.cpp
index c8ffcc1..03ecfc6 100644
--- a/WebCore/bindings/js/ScriptObject.cpp
+++ b/WebCore/bindings/js/ScriptObject.cpp
@@ -36,7 +36,9 @@
#include <runtime/JSLock.h>
#if ENABLE(INSPECTOR)
+#include "JSInjectedScriptHost.h"
#include "JSInspectorBackend.h"
+#include "JSInspectorFrontendHost.h"
#endif
using namespace JSC;
@@ -159,6 +161,22 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect
globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
return handleException(scriptState);
}
+
+bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
+{
+ JSLock lock(SilenceAssertionsOnly);
+ JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+ globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
+ return handleException(scriptState);
+}
+
+bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InjectedScriptHost* value)
+{
+ JSLock lock(SilenceAssertionsOnly);
+ JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+ globalObject->putDirect(Identifier(scriptState, name), toJS(scriptState, globalObject, value));
+ return handleException(scriptState);
+}
#endif // ENABLE(INSPECTOR)
bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptObject& value)
diff --git a/WebCore/bindings/js/ScriptObject.h b/WebCore/bindings/js/ScriptObject.h
index b6dcaaa..fed7339 100644
--- a/WebCore/bindings/js/ScriptObject.h
+++ b/WebCore/bindings/js/ScriptObject.h
@@ -38,7 +38,9 @@
#include <runtime/Protect.h>
namespace WebCore {
+ class InjectedScriptHost;
class InspectorBackend;
+ class InspectorFrontendHost;
class ScriptObject : public ScriptValue {
public:
@@ -68,6 +70,8 @@ namespace WebCore {
static bool set(ScriptState*, const char* name, const ScriptObject&);
#if ENABLE(INSPECTOR)
static bool set(ScriptState*, const char* name, InspectorBackend*);
+ static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
+ static bool set(ScriptState*, const char* name, InjectedScriptHost*);
#endif
static bool get(ScriptState*, const char* name, ScriptObject&);
static bool remove(ScriptState*, const char* name);
diff --git a/WebCore/bindings/v8/DOMObjectsInclude.h b/WebCore/bindings/v8/DOMObjectsInclude.h
index 97211ae..e5e6fe4 100644
--- a/WebCore/bindings/v8/DOMObjectsInclude.h
+++ b/WebCore/bindings/v8/DOMObjectsInclude.h
@@ -257,7 +257,9 @@
#endif // XSLT
#if ENABLE(INSPECTOR)
+#include "InjectedScriptHost.h"
#include "InspectorBackend.h"
+#include "InspectorFrontendHost.h"
#endif // INSPECTOR
namespace WebCore {
diff --git a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
index 508cd45..cffc2fb 100644
--- a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
+++ b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
@@ -387,5 +387,7 @@
#endif
#if ENABLE(INSPECTOR)
+#include "bindings/V8InjectedScriptHost.cpp"
#include "bindings/V8InspectorBackend.cpp"
+#include "bindings/V8InspectorFrontendHost.cpp"
#endif
diff --git a/WebCore/bindings/v8/ScriptObject.cpp b/WebCore/bindings/v8/ScriptObject.cpp
index 1e9d024..94bb4da 100644
--- a/WebCore/bindings/v8/ScriptObject.cpp
+++ b/WebCore/bindings/v8/ScriptObject.cpp
@@ -36,6 +36,8 @@
#include "Document.h"
#include "Frame.h"
+#include "InspectorBackend.h"
+#include "InspectorFrontendHost.h"
#include "V8Binding.h"
#include "V8Proxy.h"
@@ -145,6 +147,20 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect
return scope.success();
}
+bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
+{
+ ScriptScope scope(scriptState);
+ scope.global()->Set(v8::String::New(name), V8DOMWrapper::convertToV8Object(V8ClassIndex::INSPECTORFRONTENDHOST, value));
+ return scope.success();
+}
+
+bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InjectedScriptHost* value)
+{
+ ScriptScope scope(scriptState);
+ scope.global()->Set(v8::String::New(name), V8DOMWrapper::convertToV8Object(V8ClassIndex::INJECTEDSCRIPTHOST, value));
+ return scope.success();
+}
+
bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptObject& value)
{
ScriptScope scope(scriptState);
diff --git a/WebCore/bindings/v8/ScriptObject.h b/WebCore/bindings/v8/ScriptObject.h
index 21823e4..630d3b9 100644
--- a/WebCore/bindings/v8/ScriptObject.h
+++ b/WebCore/bindings/v8/ScriptObject.h
@@ -36,7 +36,9 @@
#include <v8.h>
namespace WebCore {
+ class InjectedScriptHost;
class InspectorBackend;
+ class InspectorFrontendHost;
class ScriptState;
class ScriptObject : public ScriptValue {
@@ -67,6 +69,8 @@ namespace WebCore {
public:
static bool set(ScriptState*, const char* name, const ScriptObject&);
static bool set(ScriptState*, const char* name, InspectorBackend*);
+ static bool set(ScriptState*, const char* name, InspectorFrontendHost*);
+ static bool set(ScriptState*, const char* name, InjectedScriptHost*);
static bool get(ScriptState*, const char* name, ScriptObject&);
static bool remove(ScriptState*, const char* name);
private:
diff --git a/WebCore/bindings/v8/V8Index.cpp b/WebCore/bindings/v8/V8Index.cpp
index 7a43ac2..f312b27 100644
--- a/WebCore/bindings/v8/V8Index.cpp
+++ b/WebCore/bindings/v8/V8Index.cpp
@@ -433,7 +433,9 @@
#endif
#if ENABLE(INSPECTOR)
+#include "V8InjectedScriptHost.h"
#include "V8InspectorBackend.h"
+#include "V8InspectorFrontendHost.h"
#endif
namespace WebCore {
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index b120034..6f879b9 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -487,7 +487,9 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
#if ENABLE(INSPECTOR)
#define DOM_OBJECT_INSPECTOR_TYPES(V) \
- V(INSPECTORBACKEND, InspectorBackend)
+ V(INSPECTORBACKEND, InspectorBackend) \
+ V(INSPECTORFRONTENDHOST, InspectorFrontendHost) \
+ V(INJECTEDSCRIPTHOST, InjectedScriptHost)
#else
#define DOM_OBJECT_INSPECTOR_TYPES(V)
#endif
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index 4bd6d79..769a0b2 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -477,29 +477,23 @@ namespace WebCore {
DECLARE_CALLBACK(TreeWalkerNextSibling);
DECLARE_CALLBACK(TreeWalkerPreviousSibling);
- DECLARE_CALLBACK(InspectorBackendHighlightDOMNode);
- DECLARE_CALLBACK(InspectorBackendAddResourceSourceToFrame);
- DECLARE_CALLBACK(InspectorBackendAddSourceToFrame);
- DECLARE_CALLBACK(InspectorBackendSearch);
- DECLARE_CALLBACK(InspectorBackendSetting);
- DECLARE_CALLBACK(InspectorBackendDatabaseForId);
- DECLARE_CALLBACK(InspectorBackendInspectedWindow);
- DECLARE_CALLBACK(InspectorBackendSetSetting);
- DECLARE_CALLBACK(InspectorBackendCurrentCallFrame);
- DECLARE_CALLBACK(InspectorBackendDebuggerEnabled);
- DECLARE_CALLBACK(InspectorBackendPauseOnExceptions);
- DECLARE_CALLBACK(InspectorBackendProfilerEnabled);
- DECLARE_CALLBACK(InspectorBackendNodeForId);
- DECLARE_CALLBACK(InspectorBackendWrapObject);
- DECLARE_CALLBACK(InspectorBackendUnwrapObject);
- DECLARE_CALLBACK(InspectorBackendPushNodePathToFrontend);
+ DECLARE_CALLBACK(InjectedScriptHostInspectedWindow);
+ DECLARE_CALLBACK(InjectedScriptHostNodeForId);
+ DECLARE_CALLBACK(InjectedScriptHostWrapObject);
+ DECLARE_CALLBACK(InjectedScriptHostUnwrapObject);
+ DECLARE_CALLBACK(InjectedScriptHostPushNodePathToFrontend);
+ DECLARE_CALLBACK(InjectedScriptHostWrapCallback);
#if ENABLE(DATABASE)
- DECLARE_CALLBACK(InspectorBackendSelectDatabase);
+ DECLARE_CALLBACK(InjectedScriptHostSelectDatabase);
+ DECLARE_CALLBACK(InjectedScriptHostDatabaseForId);
#endif
#if ENABLE(DOM_STORAGE)
- DECLARE_CALLBACK(InspectorBackendSelectDOMStorage);
+ DECLARE_CALLBACK(InjectedScriptHostSelectDOMStorage);
#endif
- DECLARE_CALLBACK(InspectorBackendWrapCallback);
+
+ DECLARE_CALLBACK(InspectorFrontendHostSearch);
+ DECLARE_CALLBACK(InspectorFrontendHostSetting);
+ DECLARE_CALLBACK(InspectorFrontendHostSetSetting);
DECLARE_CALLBACK(ConsoleProfile);
DECLARE_CALLBACK(ConsoleProfileEnd);
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
new file mode 100644
index 0000000..fac6733
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2007-2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedScriptHost.h"
+
+#include "Database.h"
+#include "DOMWindow.h"
+#include "Frame.h"
+#include "InspectorController.h"
+#include "Node.h"
+#include "Page.h"
+
+#include "V8Binding.h"
+#include "V8CustomBinding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+CALLBACK_FUNC_DECL(InjectedScriptHostInspectedWindow)
+{
+ INC_STATS("InjectedScriptHost.inspectedWindow()");
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ InspectorController* ic = host->inspectorController();
+ if (!ic)
+ return v8::Undefined();
+ return V8DOMWrapper::convertToV8Object<DOMWindow>(V8ClassIndex::DOMWINDOW, ic->inspectedPage()->mainFrame()->domWindow());
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostWrapCallback)
+{
+ INC_STATS("InjectedScriptHost.wrapCallback()");
+ return args[0];
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostNodeForId)
+{
+ INC_STATS("InjectedScriptHost.nodeForId()");
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+
+ Node* node = host->nodeForId(args[0]->ToInt32()->Value());
+ if (!node)
+ return v8::Undefined();
+
+ InspectorController* ic = host->inspectorController();
+ if (!ic)
+ return v8::Undefined();
+
+ return V8DOMWrapper::convertToV8Object(V8ClassIndex::NODE, node);
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostWrapObject)
+{
+ INC_STATS("InjectedScriptHost.wrapObject()");
+ if (args.Length() < 2)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ return host->wrapObject(ScriptValue(args[0]), toWebCoreStringWithNullCheck(args[1])).v8Value();
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostUnwrapObject)
+{
+ INC_STATS("InjectedScriptHost.unwrapObject()");
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ return host->unwrapObject(toWebCoreStringWithNullCheck(args[0])).v8Value();
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostPushNodePathToFrontend)
+{
+ INC_STATS("InjectedScriptHost.pushNodePathToFrontend()");
+ if (args.Length() < 2)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0]));
+ bool selectInUI = args[1]->ToBoolean()->Value();
+ if (node)
+ return v8::Number::New(host->pushNodePathToFrontend(node, selectInUI));
+
+ return v8::Undefined();
+}
+
+#if ENABLE(DATABASE)
+CALLBACK_FUNC_DECL(InjectedScriptHostDatabaseForId)
+{
+ INC_STATS("InjectedScriptHost.databaseForId()");
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ Database* database = host->databaseForId(args[0]->ToInt32()->Value());
+ if (!database)
+ return v8::Undefined();
+ return V8DOMWrapper::convertToV8Object<Database>(V8ClassIndex::DATABASE, database);
+}
+
+CALLBACK_FUNC_DECL(InjectedScriptHostSelectDatabase)
+{
+ INC_STATS("InjectedScriptHost.selectDatabase()");
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ Database* database = V8DOMWrapper::convertToNativeObject<Database>(V8ClassIndex::DATABASE, v8::Handle<v8::Object>::Cast(args[0]));
+ if (database)
+ host->selectDatabase(database);
+
+ return v8::Undefined();
+}
+#endif
+
+#if ENABLE(DOM_STORAGE)
+CALLBACK_FUNC_DECL(InjectedScriptHostSelectDOMStorage)
+{
+ INC_STATS("InjectedScriptHost.selectDOMStorage()");
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ InjectedScriptHost* host = V8DOMWrapper::convertToNativeObject<InjectedScriptHost>(V8ClassIndex::INJECTEDSCRIPTHOST, args.Holder());
+ Storage* storage = V8DOMWrapper::convertToNativeObject<Storage>(V8ClassIndex::STORAGE, v8::Handle<v8::Object>::Cast(args[0]));
+ if (storage)
+ host->selectDOMStorage(storage);
+
+ return v8::Undefined();
+}
+#endif
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8InspectorBackendCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorBackendCustom.cpp
deleted file mode 100644
index ec9b034..0000000
--- a/WebCore/bindings/v8/custom/V8InspectorBackendCustom.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (C) 2007-2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "InspectorBackend.h"
-
-#include "Database.h"
-#include "DOMWindow.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "ExceptionCode.h"
-#include "InspectorController.h"
-#include "InspectorResource.h"
-#include "NotImplemented.h"
-#include "Node.h"
-#include "Range.h"
-#include "Page.h"
-#include "TextIterator.h"
-#include "VisiblePosition.h"
-
-#include "V8Binding.h"
-#include "V8CustomBinding.h"
-#include "V8Proxy.h"
-
-namespace WebCore {
-
-CALLBACK_FUNC_DECL(InspectorBackendHighlightDOMNode)
-{
- INC_STATS("InspectorBackend.highlightDOMNode()");
-
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- inspectorBackend->highlight(args[0]->ToInt32()->Value());
- return v8::Undefined();
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendSearch)
-{
- INC_STATS("InspectorBackend.search()");
-
- if (args.Length() < 2)
- return v8::Undefined();
-
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0]));
- if (!node)
- return v8::Undefined();
-
- String target = toWebCoreStringWithNullCheck(args[1]);
- if (target.isEmpty())
- return v8::Undefined();
-
- v8::Local<v8::Array> result = v8::Array::New();
- RefPtr<Range> searchRange(rangeOfContents(node));
-
- ExceptionCode ec = 0;
- int index = 0;
- do {
- RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));
- if (resultRange->collapsed(ec))
- break;
-
- // A non-collapsed result range can in some funky whitespace cases still not
- // advance the range's start position (4509328). Break to avoid infinite loop.
- VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
- if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
- break;
-
- result->Set(v8::Number::New(index++), V8DOMWrapper::convertToV8Object(V8ClassIndex::RANGE, resultRange.release()));
-
- setStart(searchRange.get(), newStart);
- } while (true);
-
- return result;
-}
-
-#if ENABLE(DATABASE)
-CALLBACK_FUNC_DECL(InspectorBackendDatabaseForId)
-{
- INC_STATS("InspectorBackend.databaseForId()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- Database* database = inspectorBackend->databaseForId(args[0]->ToInt32()->Value());
- if (!database)
- return v8::Undefined();
- return V8DOMWrapper::convertToV8Object<Database>(V8ClassIndex::DATABASE, database);
-}
-#endif
-
-CALLBACK_FUNC_DECL(InspectorBackendInspectedWindow)
-{
- INC_STATS("InspectorBackend.inspectedWindow()");
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- InspectorController* ic = inspectorBackend->inspectorController();
- if (!ic)
- return v8::Undefined();
- return V8DOMWrapper::convertToV8Object<DOMWindow>(V8ClassIndex::DOMWINDOW, ic->inspectedPage()->mainFrame()->domWindow());
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendSetting)
-{
- INC_STATS("InspectorBackend.setting()");
-
- if (args.Length() < 1)
- return v8::Undefined();
-
- String key = toWebCoreStringWithNullCheck(args[0]);
- if (key.isEmpty())
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- InspectorController* ic = inspectorBackend->inspectorController();
- if (!ic)
- return v8::Undefined();
- const InspectorController::Setting& setting = ic->setting(key);
-
- switch (setting.type()) {
- default:
- case InspectorController::Setting::NoType:
- return v8::Undefined();
- case InspectorController::Setting::StringType:
- return v8String(setting.string());
- case InspectorController::Setting::DoubleType:
- return v8::Number::New(setting.doubleValue());
- case InspectorController::Setting::IntegerType:
- return v8::Number::New(setting.integerValue());
- case InspectorController::Setting::BooleanType:
- return v8Boolean(setting.booleanValue());
- case InspectorController::Setting::StringVectorType: {
- const Vector<String>& strings = setting.stringVector();
- v8::Local<v8::Array> stringsArray = v8::Array::New(strings.size());
- const unsigned length = strings.size();
- for (unsigned i = 0; i < length; ++i)
- stringsArray->Set(v8::Number::New(i), v8String(strings[i]));
- return stringsArray;
- }
- }
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendSetSetting)
-{
- INC_STATS("InspectorBackend.setSetting()");
- if (args.Length() < 2)
- return v8::Undefined();
-
- String key = toWebCoreStringWithNullCheck(args[0]);
- if (key.isEmpty())
- return v8::Undefined();
-
- InspectorController::Setting setting;
-
- v8::Local<v8::Value> value = args[1];
- if (value->IsUndefined() || value->IsNull()) {
- // Do nothing. The setting is already NoType.
- ASSERT(setting.type() == InspectorController::Setting::NoType);
- } else if (value->IsString())
- setting.set(toWebCoreStringWithNullCheck(value));
- else if (value->IsNumber())
- setting.set(value->NumberValue());
- else if (value->IsBoolean())
- setting.set(value->BooleanValue());
- else if (value->IsArray()) {
- v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(value);
- Vector<String> strings;
- for (unsigned i = 0; i < v8Array->Length(); ++i) {
- String item = toWebCoreString(v8Array->Get(v8::Integer::New(i)));
- if (item.isEmpty())
- return v8::Undefined();
- strings.append(item);
- }
- setting.set(strings);
- } else
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- InspectorController* ic = inspectorBackend->inspectorController();
- if (ic)
- inspectorBackend->inspectorController()->setSetting(key, setting);
-
- return v8::Undefined();
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendWrapCallback)
-{
- INC_STATS("InspectorBackend.wrapCallback()");
- return args[0];
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendNodeForId)
-{
- INC_STATS("InspectorBackend.nodeForId()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
-
- Node* node = inspectorBackend->nodeForId(args[0]->ToInt32()->Value());
- if (!node)
- return v8::Undefined();
-
- InspectorController* ic = inspectorBackend->inspectorController();
- if (!ic)
- return v8::Undefined();
-
- return V8DOMWrapper::convertToV8Object(V8ClassIndex::NODE, node);
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendWrapObject)
-{
- INC_STATS("InspectorBackend.wrapObject()");
- if (args.Length() < 2)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- return inspectorBackend->wrapObject(ScriptValue(args[0]), toWebCoreStringWithNullCheck(args[1])).v8Value();
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendUnwrapObject)
-{
- INC_STATS("InspectorBackend.unwrapObject()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- return inspectorBackend->unwrapObject(toWebCoreStringWithNullCheck(args[0])).v8Value();
-}
-
-CALLBACK_FUNC_DECL(InspectorBackendPushNodePathToFrontend)
-{
- INC_STATS("InspectorBackend.pushNodePathToFrontend()");
- if (args.Length() < 2)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0]));
- bool selectInUI = args[1]->ToBoolean()->Value();
- if (node)
- return v8::Number::New(inspectorBackend->pushNodePathToFrontend(node, selectInUI));
-
- return v8::Undefined();
-}
-
-#if ENABLE(DATABASE)
-CALLBACK_FUNC_DECL(InspectorBackendSelectDatabase)
-{
- INC_STATS("InspectorBackend.selectDatabase()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- Database* database = V8DOMWrapper::convertToNativeObject<Database>(V8ClassIndex::DATABASE, v8::Handle<v8::Object>::Cast(args[0]));
- if (database)
- inspectorBackend->selectDatabase(database);
-
- return v8::Undefined();
-}
-#endif
-
-#if ENABLE(DOM_STORAGE)
-CALLBACK_FUNC_DECL(InspectorBackendSelectDOMStorage)
-{
- INC_STATS("InspectorBackend.selectDOMStorage()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InspectorBackend* inspectorBackend = V8DOMWrapper::convertToNativeObject<InspectorBackend>(V8ClassIndex::INSPECTORBACKEND, args.Holder());
- Storage* storage = V8DOMWrapper::convertToNativeObject<Storage>(V8ClassIndex::STORAGE, v8::Handle<v8::Object>::Cast(args[0]));
- if (storage)
- inspectorBackend->selectDOMStorage(storage);
-
- return v8::Undefined();
-}
-#endif
-
-} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
new file mode 100644
index 0000000..08cb889
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2007-2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InspectorFrontendHost.h"
+
+#include "ExceptionCode.h"
+#include "InspectorController.h"
+#include "Node.h"
+#include "Range.h"
+#include "Page.h"
+#include "TextIterator.h"
+#include "VisiblePosition.h"
+
+#include "V8Binding.h"
+#include "V8CustomBinding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+CALLBACK_FUNC_DECL(InspectorFrontendHostSearch)
+{
+ INC_STATS("InspectorFrontendHost.search()");
+
+ if (args.Length() < 2)
+ return v8::Undefined();
+
+ Node* node = V8DOMWrapper::convertDOMWrapperToNode<Node>(v8::Handle<v8::Object>::Cast(args[0]));
+ if (!node)
+ return v8::Undefined();
+
+ String target = toWebCoreStringWithNullCheck(args[1]);
+ if (target.isEmpty())
+ return v8::Undefined();
+
+ v8::Local<v8::Array> result = v8::Array::New();
+ RefPtr<Range> searchRange(rangeOfContents(node));
+
+ ExceptionCode ec = 0;
+ int index = 0;
+ do {
+ RefPtr<Range> resultRange(findPlainText(searchRange.get(), target, true, false));
+ if (resultRange->collapsed(ec))
+ break;
+
+ // A non-collapsed result range can in some funky whitespace cases still not
+ // advance the range's start position (4509328). Break to avoid infinite loop.
+ VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
+ if (newStart == startVisiblePosition(searchRange.get(), DOWNSTREAM))
+ break;
+
+ result->Set(v8::Number::New(index++), V8DOMWrapper::convertToV8Object(V8ClassIndex::RANGE, resultRange.release()));
+
+ setStart(searchRange.get(), newStart);
+ } while (true);
+
+ return result;
+}
+
+CALLBACK_FUNC_DECL(InspectorFrontendHostSetting)
+{
+ INC_STATS("InspectorFrontendHost.setting()");
+
+ if (args.Length() < 1)
+ return v8::Undefined();
+
+ String key = toWebCoreStringWithNullCheck(args[0]);
+ if (key.isEmpty())
+ return v8::Undefined();
+
+ InspectorFrontendHost* inspectorHost = V8DOMWrapper::convertToNativeObject<InspectorFrontendHost>(V8ClassIndex::INSPECTORFRONTENDHOST, args.Holder());
+ InspectorController* ic = inspectorHost->inspectorController();
+ if (!ic)
+ return v8::Undefined();
+ const InspectorController::Setting& setting = ic->setting(key);
+
+ switch (setting.type()) {
+ default:
+ case InspectorController::Setting::NoType:
+ return v8::Undefined();
+ case InspectorController::Setting::StringType:
+ return v8String(setting.string());
+ case InspectorController::Setting::DoubleType:
+ return v8::Number::New(setting.doubleValue());
+ case InspectorController::Setting::IntegerType:
+ return v8::Number::New(setting.integerValue());
+ case InspectorController::Setting::BooleanType:
+ return v8Boolean(setting.booleanValue());
+ case InspectorController::Setting::StringVectorType: {
+ const Vector<String>& strings = setting.stringVector();
+ v8::Local<v8::Array> stringsArray = v8::Array::New(strings.size());
+ const unsigned length = strings.size();
+ for (unsigned i = 0; i < length; ++i)
+ stringsArray->Set(v8::Number::New(i), v8String(strings[i]));
+ return stringsArray;
+ }
+ }
+}
+
+CALLBACK_FUNC_DECL(InspectorFrontendHostSetSetting)
+{
+ INC_STATS("InspectorFrontendHost.setSetting()");
+ if (args.Length() < 2)
+ return v8::Undefined();
+
+ String key = toWebCoreStringWithNullCheck(args[0]);
+ if (key.isEmpty())
+ return v8::Undefined();
+
+ InspectorController::Setting setting;
+
+ v8::Local<v8::Value> value = args[1];
+ if (value->IsUndefined() || value->IsNull()) {
+ // Do nothing. The setting is already NoType.
+ ASSERT(setting.type() == InspectorController::Setting::NoType);
+ } else if (value->IsString())
+ setting.set(toWebCoreStringWithNullCheck(value));
+ else if (value->IsNumber())
+ setting.set(value->NumberValue());
+ else if (value->IsBoolean())
+ setting.set(value->BooleanValue());
+ else if (value->IsArray()) {
+ v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(value);
+ Vector<String> strings;
+ for (unsigned i = 0; i < v8Array->Length(); ++i) {
+ String item = toWebCoreString(v8Array->Get(v8::Integer::New(i)));
+ if (item.isEmpty())
+ return v8::Undefined();
+ strings.append(item);
+ }
+ setting.set(strings);
+ } else
+ return v8::Undefined();
+
+ InspectorFrontendHost* inspectorHost = V8DOMWrapper::convertToNativeObject<InspectorFrontendHost>(V8ClassIndex::INSPECTORFRONTENDHOST, args.Holder());
+ InspectorController* ic = inspectorHost->inspectorController();
+ if (ic)
+ inspectorHost->inspectorController()->setSetting(key, setting);
+
+ return v8::Undefined();
+}
+
+} // namespace WebCore
diff --git a/WebCore/inspector/InjectedScriptHost.cpp b/WebCore/inspector/InjectedScriptHost.cpp
new file mode 100644
index 0000000..42d4b41
--- /dev/null
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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)
+
+
+#include "Element.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "HTMLFrameOwnerElement.h"
+#include "InspectorClient.h"
+#include "InspectorController.h"
+#include "InspectorDOMAgent.h"
+#include "InspectorFrontend.h"
+#include "InspectorResource.h"
+#include "Pasteboard.h"
+#include "ScriptArray.h"
+#include "ScriptFunctionCall.h"
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+#include "JavaScriptCallFrame.h"
+#include "JavaScriptDebugServer.h"
+using namespace JSC;
+#endif
+
+#if ENABLE(DATABASE)
+#include "Database.h"
+#endif
+
+#if ENABLE(DOM_STORAGE)
+#include "Storage.h"
+#endif
+
+#include "markup.h"
+
+#include <wtf/RefPtr.h>
+#include <wtf/StdLibExtras.h>
+
+using namespace std;
+
+namespace WebCore {
+
+InjectedScriptHost::InjectedScriptHost(InspectorController* inspectorController)
+ : m_inspectorController(inspectorController)
+{
+}
+
+InjectedScriptHost::~InjectedScriptHost()
+{
+}
+
+void InjectedScriptHost::copyText(const String& text)
+{
+ Pasteboard::generalPasteboard()->writePlainText(text);
+}
+
+Node* InjectedScriptHost::nodeForId(long nodeId)
+{
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ return domAgent->nodeForId(nodeId);
+ return 0;
+}
+
+ScriptValue InjectedScriptHost::wrapObject(const ScriptValue& object, const String& objectGroup)
+{
+ if (m_inspectorController)
+ return m_inspectorController->wrapObject(object, objectGroup);
+ return ScriptValue();
+}
+
+ScriptValue InjectedScriptHost::unwrapObject(const String& objectId)
+{
+ if (m_inspectorController)
+ return m_inspectorController->unwrapObject(objectId);
+ return ScriptValue();
+}
+
+long InjectedScriptHost::pushNodePathToFrontend(Node* node, bool selectInUI)
+{
+ InspectorFrontend* frontend = inspectorFrontend();
+ InspectorDOMAgent* domAgent = inspectorDOMAgent();
+ if (!domAgent || !frontend)
+ return 0;
+ long id = domAgent->pushNodePathToFrontend(node);
+ if (selectInUI)
+ frontend->updateFocusedNode(id);
+ return id;
+}
+
+void InjectedScriptHost::addNodesToSearchResult(const String& nodeIds)
+{
+ if (InspectorFrontend* frontend = inspectorFrontend())
+ frontend->addNodesToSearchResult(nodeIds);
+}
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+JavaScriptCallFrame* InjectedScriptHost::currentCallFrame() const
+{
+ return JavaScriptDebugServer::shared().currentCallFrame();
+}
+#endif
+
+#if ENABLE(DATABASE)
+Database* InjectedScriptHost::databaseForId(long databaseId)
+{
+ if (m_inspectorController)
+ return m_inspectorController->databaseForId(databaseId);
+ return 0;
+}
+
+void InjectedScriptHost::selectDatabase(Database* database)
+{
+ if (m_inspectorController)
+ m_inspectorController->selectDatabase(database);
+}
+#endif
+
+#if ENABLE(DOM_STORAGE)
+void InjectedScriptHost::selectDOMStorage(Storage* storage)
+{
+ if (m_inspectorController)
+ m_inspectorController->selectDOMStorage(storage);
+}
+#endif
+
+void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, const String& result, bool isException)
+{
+ if (InspectorFrontend* frontend = inspectorFrontend())
+ frontend->didDispatchOnInjectedScript(callId, result, isException);
+}
+
+InspectorDOMAgent* InjectedScriptHost::inspectorDOMAgent()
+{
+ if (!m_inspectorController)
+ return 0;
+ return m_inspectorController->domAgent();
+}
+
+InspectorFrontend* InjectedScriptHost::inspectorFrontend()
+{
+ if (!m_inspectorController)
+ return 0;
+ return m_inspectorController->m_frontend.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
new file mode 100644
index 0000000..8730498
--- /dev/null
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2007 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 "Console.h"
+#include "InspectorController.h"
+#include "PlatformString.h"
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Database;
+class InspectorDOMAgent;
+class InspectorFrontend;
+class JavaScriptCallFrame;
+class Node;
+class Storage;
+
+class InjectedScriptHost : public RefCounted<InjectedScriptHost>
+{
+public:
+ static PassRefPtr<InjectedScriptHost> create(InspectorController* inspectorController)
+ {
+ return adoptRef(new InjectedScriptHost(inspectorController));
+ }
+
+ ~InjectedScriptHost();
+
+ InspectorController* inspectorController() { return m_inspectorController; }
+ void disconnectController() { m_inspectorController = 0; }
+
+ void copyText(const String& text);
+ Node* nodeForId(long nodeId);
+ ScriptValue wrapObject(const ScriptValue& object, const String& objectGroup);
+ ScriptValue unwrapObject(const String& objectId);
+ long pushNodePathToFrontend(Node* node, bool selectInUI);
+ void addNodesToSearchResult(const String& nodeIds);
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ JavaScriptCallFrame* currentCallFrame() const;
+#endif
+#if ENABLE(DATABASE)
+ Database* databaseForId(long databaseId);
+ void selectDatabase(Database* database);
+#endif
+#if ENABLE(DOM_STORAGE)
+ void selectDOMStorage(Storage* storage);
+#endif
+ void reportDidDispatchOnInjectedScript(long callId, const String& result, bool isException);
+
+private:
+ InjectedScriptHost(InspectorController* inspectorController);
+ InspectorDOMAgent* inspectorDOMAgent();
+ InspectorFrontend* inspectorFrontend();
+
+ InspectorController* m_inspectorController;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InjectedScriptHost_h)
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
new file mode 100644
index 0000000..a4108b3
--- /dev/null
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+ interface [
+ GenerateConstructor
+ ] InjectedScriptHost {
+ [Custom] DOMWindow inspectedWindow();
+ [Custom] DOMObject wrapCallback(in DOMObject callback);
+ void copyText(in DOMString text);
+ [Custom] DOMObject nodeForId(in long nodeId);
+ [Custom] long wrapObject(in DOMObject object, in DOMString objectGroup);
+ [Custom] DOMObject unwrapObject(in long objectId);
+ [Custom] int pushNodePathToFrontend(in DOMObject node, in boolean selectInUI);
+ void addNodesToSearchResult(in DOMString nodeIds);
+
+#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
+ [Custom] DOMObject currentCallFrame();
+#endif
+
+#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
+ [Custom] DOMObject databaseForId(in long databaseId);
+ [Custom] void selectDatabase(in DOMObject database);
+#endif
+
+#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
+ [Custom] void selectDOMStorage(in DOMObject storage);
+#endif
+
+ void reportDidDispatchOnInjectedScript(in long callId, in DOMString result, in boolean isException);
+ };
+}
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 13dac73..6b3268d 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -68,9 +68,8 @@ using namespace std;
namespace WebCore {
-InspectorBackend::InspectorBackend(InspectorController* inspectorController, InspectorClient* client)
+InspectorBackend::InspectorBackend(InspectorController* inspectorController)
: m_inspectorController(inspectorController)
- , m_client(client)
{
}
@@ -78,117 +77,22 @@ InspectorBackend::~InspectorBackend()
{
}
-void InspectorBackend::hideDOMNodeHighlight()
-{
- if (m_inspectorController)
- m_inspectorController->hideHighlight();
-}
-
-String InspectorBackend::localizedStringsURL()
-{
- return m_client->localizedStringsURL();
-}
-
-String InspectorBackend::hiddenPanels()
-{
- return m_client->hiddenPanels();
-}
-
-void InspectorBackend::windowUnloading()
-{
- if (m_inspectorController)
- m_inspectorController->close();
-}
-
-bool InspectorBackend::isWindowVisible()
-{
- if (m_inspectorController)
- return m_inspectorController->windowVisible();
- return false;
-}
-
-void InspectorBackend::addResourceSourceToFrame(long identifier, Node* frame)
-{
- if (!m_inspectorController)
- return;
- RefPtr<InspectorResource> resource = m_inspectorController->resources().get(identifier);
- if (resource) {
- String sourceString = resource->sourceString();
- if (!sourceString.isEmpty())
- addSourceToFrame(resource->mimeType(), sourceString, frame);
- }
-}
-
-bool InspectorBackend::addSourceToFrame(const String& mimeType, const String& source, Node* frameNode)
-{
- ASSERT_ARG(frameNode, frameNode);
-
- if (!frameNode)
- return false;
-
- if (!frameNode->attached()) {
- ASSERT_NOT_REACHED();
- return false;
- }
-
- ASSERT(frameNode->isElementNode());
- if (!frameNode->isElementNode())
- return false;
-
- Element* element = static_cast<Element*>(frameNode);
- ASSERT(element->isFrameOwnerElement());
- if (!element->isFrameOwnerElement())
- return false;
-
- HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(element);
- ASSERT(frameOwner->contentFrame());
- if (!frameOwner->contentFrame())
- return false;
-
- FrameLoader* loader = frameOwner->contentFrame()->loader();
-
- loader->setResponseMIMEType(mimeType);
- loader->begin();
- loader->write(source);
- loader->end();
-
- return true;
-}
-
void InspectorBackend::clearMessages(bool clearUI)
{
if (m_inspectorController)
m_inspectorController->clearConsoleMessages(clearUI);
}
-void InspectorBackend::toggleNodeSearch()
-{
- if (m_inspectorController)
- m_inspectorController->toggleSearchForNodeInPage();
-}
-
-void InspectorBackend::attach()
-{
- if (m_inspectorController)
- m_inspectorController->attachWindow();
-}
-
-void InspectorBackend::detach()
-{
- if (m_inspectorController)
- m_inspectorController->detachWindow();
-}
-
-void InspectorBackend::setAttachedWindowHeight(unsigned height)
+void InspectorBackend::storeLastActivePanel(const String& panelName)
{
if (m_inspectorController)
- m_inspectorController->setAttachedWindowHeight(height);
+ m_inspectorController->storeLastActivePanel(panelName);
}
-void InspectorBackend::storeLastActivePanel(const String& panelName)
+void InspectorBackend::toggleNodeSearch()
{
if (m_inspectorController)
- m_inspectorController->storeLastActivePanel(panelName);
+ m_inspectorController->toggleSearchForNodeInPage();
}
bool InspectorBackend::searchingForNode()
@@ -198,10 +102,11 @@ bool InspectorBackend::searchingForNode()
return false;
}
-void InspectorBackend::loaded()
+bool InspectorBackend::resourceTrackingEnabled() const
{
if (m_inspectorController)
- m_inspectorController->scriptObjectReady();
+ return m_inspectorController->resourceTrackingEnabled();
+ return false;
}
void InspectorBackend::enableResourceTracking(bool always)
@@ -216,58 +121,6 @@ void InspectorBackend::disableResourceTracking(bool always)
m_inspectorController->disableResourceTracking(always);
}
-bool InspectorBackend::resourceTrackingEnabled() const
-{
- if (m_inspectorController)
- return m_inspectorController->resourceTrackingEnabled();
- return false;
-}
-
-void InspectorBackend::moveWindowBy(float x, float y) const
-{
- if (m_inspectorController)
- m_inspectorController->moveWindowBy(x, y);
-}
-
-void InspectorBackend::closeWindow()
-{
- if (m_inspectorController)
- m_inspectorController->closeWindow();
-}
-
-const String& InspectorBackend::platform() const
-{
-#if PLATFORM(MAC)
-#ifdef BUILDING_ON_TIGER
- DEFINE_STATIC_LOCAL(const String, platform, ("mac-tiger"));
-#else
- DEFINE_STATIC_LOCAL(const String, platform, ("mac-leopard"));
-#endif
-#elif PLATFORM(WIN_OS)
- DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
-#else
- DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
-#endif
-
- return platform;
-}
-
-
-const String& InspectorBackend::port() const
-{
-#if PLATFORM(QT)
- DEFINE_STATIC_LOCAL(const String, port, ("qt"));
-#elif PLATFORM(GTK)
- DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
-#elif PLATFORM(WX)
- DEFINE_STATIC_LOCAL(const String, port, ("wx"));
-#else
- DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
-#endif
-
- return port;
-}
-
void InspectorBackend::startTimelineProfiler()
{
if (m_inspectorController)
@@ -281,127 +134,126 @@ void InspectorBackend::stopTimelineProfiler()
}
#if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorBackend::startProfiling()
+bool InspectorBackend::debuggerEnabled() const
{
if (m_inspectorController)
- m_inspectorController->startUserInitiatedProfiling();
+ return m_inspectorController->debuggerEnabled();
+ return false;
}
-void InspectorBackend::stopProfiling()
+void InspectorBackend::enableDebugger(bool always)
{
if (m_inspectorController)
- m_inspectorController->stopUserInitiatedProfiling();
+ m_inspectorController->enableDebuggerFromFrontend(always);
}
-void InspectorBackend::enableProfiler(bool always)
+void InspectorBackend::disableDebugger(bool always)
{
if (m_inspectorController)
- m_inspectorController->enableProfiler(always);
+ m_inspectorController->disableDebugger(always);
}
-void InspectorBackend::disableProfiler(bool always)
+void InspectorBackend::addBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
{
- if (m_inspectorController)
- m_inspectorController->disableProfiler(always);
+ intptr_t sourceIDValue = sourceID.toIntPtr();
+ JavaScriptDebugServer::shared().addBreakpoint(sourceIDValue, lineNumber, condition);
}
-bool InspectorBackend::profilerEnabled()
+void InspectorBackend::updateBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
{
- if (m_inspectorController)
- return m_inspectorController->profilerEnabled();
- return false;
+ intptr_t sourceIDValue = sourceID.toIntPtr();
+ JavaScriptDebugServer::shared().updateBreakpoint(sourceIDValue, lineNumber, condition);
}
-void InspectorBackend::getProfileHeaders(long callId)
+void InspectorBackend::removeBreakpoint(const String& sourceID, unsigned lineNumber)
{
- if (m_inspectorController)
- m_inspectorController->getProfileHeaders(callId);
+ intptr_t sourceIDValue = sourceID.toIntPtr();
+ JavaScriptDebugServer::shared().removeBreakpoint(sourceIDValue, lineNumber);
}
-void InspectorBackend::getProfile(long callId, unsigned uid)
+void InspectorBackend::pauseInDebugger()
{
- if (m_inspectorController)
- m_inspectorController->getProfile(callId, uid);
+ JavaScriptDebugServer::shared().pauseProgram();
}
-void InspectorBackend::enableDebugger(bool always)
+void InspectorBackend::resumeDebugger()
{
if (m_inspectorController)
- m_inspectorController->enableDebuggerFromFrontend(always);
+ m_inspectorController->resumeDebugger();
}
-void InspectorBackend::disableDebugger(bool always)
+void InspectorBackend::stepOverStatementInDebugger()
{
- if (m_inspectorController)
- m_inspectorController->disableDebugger(always);
+ JavaScriptDebugServer::shared().stepOverStatement();
}
-bool InspectorBackend::debuggerEnabled() const
+void InspectorBackend::stepIntoStatementInDebugger()
{
- if (m_inspectorController)
- return m_inspectorController->debuggerEnabled();
- return false;
+ JavaScriptDebugServer::shared().stepIntoStatement();
}
-JavaScriptCallFrame* InspectorBackend::currentCallFrame() const
+void InspectorBackend::stepOutOfFunctionInDebugger()
{
- return JavaScriptDebugServer::shared().currentCallFrame();
+ JavaScriptDebugServer::shared().stepOutOfFunction();
}
-void InspectorBackend::addBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
+bool InspectorBackend::pauseOnExceptions()
{
- intptr_t sourceIDValue = sourceID.toIntPtr();
- JavaScriptDebugServer::shared().addBreakpoint(sourceIDValue, lineNumber, condition);
+ return JavaScriptDebugServer::shared().pauseOnExceptions();
}
-void InspectorBackend::updateBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition)
+void InspectorBackend::setPauseOnExceptions(bool pause)
{
- intptr_t sourceIDValue = sourceID.toIntPtr();
- JavaScriptDebugServer::shared().updateBreakpoint(sourceIDValue, lineNumber, condition);
+ JavaScriptDebugServer::shared().setPauseOnExceptions(pause);
}
-void InspectorBackend::removeBreakpoint(const String& sourceID, unsigned lineNumber)
+bool InspectorBackend::profilerEnabled()
{
- intptr_t sourceIDValue = sourceID.toIntPtr();
- JavaScriptDebugServer::shared().removeBreakpoint(sourceIDValue, lineNumber);
+ if (m_inspectorController)
+ return m_inspectorController->profilerEnabled();
+ return false;
}
-bool InspectorBackend::pauseOnExceptions()
+void InspectorBackend::enableProfiler(bool always)
{
- return JavaScriptDebugServer::shared().pauseOnExceptions();
+ if (m_inspectorController)
+ m_inspectorController->enableProfiler(always);
}
-void InspectorBackend::setPauseOnExceptions(bool pause)
+void InspectorBackend::disableProfiler(bool always)
{
- JavaScriptDebugServer::shared().setPauseOnExceptions(pause);
+ if (m_inspectorController)
+ m_inspectorController->disableProfiler(always);
}
-void InspectorBackend::pauseInDebugger()
+void InspectorBackend::startProfiling()
{
- JavaScriptDebugServer::shared().pauseProgram();
+ if (m_inspectorController)
+ m_inspectorController->startUserInitiatedProfiling();
}
-void InspectorBackend::resumeDebugger()
+void InspectorBackend::stopProfiling()
{
if (m_inspectorController)
- m_inspectorController->resumeDebugger();
+ m_inspectorController->stopUserInitiatedProfiling();
}
-void InspectorBackend::stepOverStatementInDebugger()
+void InspectorBackend::getProfileHeaders(long callId)
{
- JavaScriptDebugServer::shared().stepOverStatement();
+ if (m_inspectorController)
+ m_inspectorController->getProfileHeaders(callId);
}
-void InspectorBackend::stepIntoStatementInDebugger()
+void InspectorBackend::getProfile(long callId, unsigned uid)
{
- JavaScriptDebugServer::shared().stepIntoStatement();
+ if (m_inspectorController)
+ m_inspectorController->getProfile(callId, uid);
}
-void InspectorBackend::stepOutOfFunctionInDebugger()
+JavaScriptCallFrame* InspectorBackend::currentCallFrame() const
{
- JavaScriptDebugServer::shared().stepOutOfFunction();
+ return JavaScriptDebugServer::shared().currentCallFrame();
}
-
#endif
void InspectorBackend::dispatchOnInjectedScript(long callId, const String& methodName, const String& arguments, bool async)
@@ -493,50 +345,30 @@ void InspectorBackend::removeNode(long callId, long nodeId)
frontend->didRemoveNode(callId, nodeId);
}
-void InspectorBackend::getCookies(long callId, const String& domain)
-{
- if (!m_inspectorController)
- return;
- m_inspectorController->getCookies(callId, domain);
-}
-
-void InspectorBackend::deleteCookie(const String& cookieName, const String& domain)
-{
- if (!m_inspectorController)
- return;
- m_inspectorController->deleteCookie(cookieName, domain);
-}
-
-void InspectorBackend::copyText(const String& text)
-{
- Pasteboard::generalPasteboard()->writePlainText(text);
-}
-
-void InspectorBackend::highlight(long nodeId)
+void InspectorBackend::highlightDOMNode(long nodeId)
{
if (Node* node = nodeForId(nodeId))
m_inspectorController->highlight(node);
}
-Node* InspectorBackend::nodeForId(long nodeId)
+void InspectorBackend::hideDOMNodeHighlight()
{
- if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
- return domAgent->nodeForId(nodeId);
- return 0;
+ if (m_inspectorController)
+ m_inspectorController->hideHighlight();
}
-ScriptValue InspectorBackend::wrapObject(const ScriptValue& object, const String& objectGroup)
+void InspectorBackend::getCookies(long callId, const String& domain)
{
- if (m_inspectorController)
- return m_inspectorController->wrapObject(object, objectGroup);
- return ScriptValue();
+ if (!m_inspectorController)
+ return;
+ m_inspectorController->getCookies(callId, domain);
}
-ScriptValue InspectorBackend::unwrapObject(const String& objectId)
+void InspectorBackend::deleteCookie(const String& cookieName, const String& domain)
{
- if (m_inspectorController)
- return m_inspectorController->unwrapObject(objectId);
- return ScriptValue();
+ if (!m_inspectorController)
+ return;
+ m_inspectorController->deleteCookie(cookieName, domain);
}
void InspectorBackend::releaseWrapperObjectGroup(const String& objectGroup)
@@ -545,38 +377,13 @@ void InspectorBackend::releaseWrapperObjectGroup(const String& objectGroup)
m_inspectorController->releaseWrapperObjectGroup(objectGroup);
}
-long InspectorBackend::pushNodePathToFrontend(Node* node, bool selectInUI)
-{
- InspectorFrontend* frontend = inspectorFrontend();
- InspectorDOMAgent* domAgent = inspectorDOMAgent();
- if (!domAgent || !frontend)
- return 0;
- long id = domAgent->pushNodePathToFrontend(node);
- if (selectInUI)
- frontend->updateFocusedNode(id);
- return id;
-}
-
-void InspectorBackend::addNodesToSearchResult(const String& nodeIds)
-{
- if (InspectorFrontend* frontend = inspectorFrontend())
- frontend->addNodesToSearchResult(nodeIds);
-}
-
-#if ENABLE(DATABASE)
-Database* InspectorBackend::databaseForId(long databaseId)
-{
- if (m_inspectorController)
- return m_inspectorController->databaseForId(databaseId);
- return 0;
-}
-
-void InspectorBackend::selectDatabase(Database* database)
+void InspectorBackend::didEvaluateForTestInFrontend(long callId, const String& jsonResult)
{
if (m_inspectorController)
- m_inspectorController->selectDatabase(database);
+ m_inspectorController->didEvaluateForTestInFrontend(callId, jsonResult);
}
+#if ENABLE(DATABASE)
void InspectorBackend::getDatabaseTableNames(long callId, long databaseId)
{
if (InspectorFrontend* frontend = inspectorFrontend()) {
@@ -594,12 +401,6 @@ void InspectorBackend::getDatabaseTableNames(long callId, long databaseId)
#endif
#if ENABLE(DOM_STORAGE)
-void InspectorBackend::selectDOMStorage(Storage* storage)
-{
- if (m_inspectorController)
- m_inspectorController->selectDOMStorage(storage);
-}
-
void InspectorBackend::getDOMStorageEntries(long callId, long storageId)
{
if (m_inspectorController)
@@ -619,18 +420,6 @@ void InspectorBackend::removeDOMStorageItem(long callId, long storageId, const S
}
#endif
-void InspectorBackend::didEvaluateForTestInFrontend(long callId, const String& jsonResult)
-{
- if (m_inspectorController)
- m_inspectorController->didEvaluateForTestInFrontend(callId, jsonResult);
-}
-
-void InspectorBackend::reportDidDispatchOnInjectedScript(long callId, const String& result, bool isException)
-{
- if (InspectorFrontend* frontend = inspectorFrontend())
- frontend->didDispatchOnInjectedScript(callId, result, isException);
-}
-
InspectorDOMAgent* InspectorBackend::inspectorDOMAgent()
{
if (!m_inspectorController)
@@ -645,6 +434,13 @@ InspectorFrontend* InspectorBackend::inspectorFrontend()
return m_inspectorController->m_frontend.get();
}
+Node* InspectorBackend::nodeForId(long nodeId)
+{
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ return domAgent->nodeForId(nodeId);
+ return 0;
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index f84978a..8026294 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -39,8 +39,8 @@ namespace WebCore {
class CachedResource;
class Database;
-class InspectorClient;
class InspectorDOMAgent;
+class InspectorFrontend;
class JavaScriptCallFrame;
class Node;
class Storage;
@@ -48,87 +48,59 @@ class Storage;
class InspectorBackend : public RefCounted<InspectorBackend>
{
public:
- static PassRefPtr<InspectorBackend> create(InspectorController* inspectorController, InspectorClient* client)
+ static PassRefPtr<InspectorBackend> create(InspectorController* inspectorController)
{
- return adoptRef(new InspectorBackend(inspectorController, client));
+ return adoptRef(new InspectorBackend(inspectorController));
}
~InspectorBackend();
InspectorController* inspectorController() { return m_inspectorController; }
-
void disconnectController() { m_inspectorController = 0; }
- void hideDOMNodeHighlight();
-
- String localizedStringsURL();
- String hiddenPanels();
-
- void windowUnloading();
-
- bool isWindowVisible();
-
- void addResourceSourceToFrame(long identifier, Node* frame);
- bool addSourceToFrame(const String& mimeType, const String& source, Node* frame);
-
void clearMessages(bool clearUI);
-
- void toggleNodeSearch();
-
- void attach();
- void detach();
-
- void setAttachedWindowHeight(unsigned height);
-
void storeLastActivePanel(const String& panelName);
+ void toggleNodeSearch();
bool searchingForNode();
- void loaded();
-
void enableResourceTracking(bool always);
void disableResourceTracking(bool always);
bool resourceTrackingEnabled() const;
- void moveWindowBy(float x, float y) const;
- void closeWindow();
-
- const String& platform() const;
- const String& port() const;
-
void startTimelineProfiler();
void stopTimelineProfiler();
#if ENABLE(JAVASCRIPT_DEBUGGER)
- void startProfiling();
- void stopProfiling();
-
- void enableProfiler(bool always);
- void disableProfiler(bool always);
- bool profilerEnabled();
-
- void getProfileHeaders(long callId);
- void getProfile(long callId, unsigned uid);
-
+ bool debuggerEnabled() const;
void enableDebugger(bool always);
void disableDebugger(bool always);
- bool debuggerEnabled() const;
-
- JavaScriptCallFrame* currentCallFrame() const;
void addBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition);
void updateBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition);
void removeBreakpoint(const String& sourceID, unsigned lineNumber);
- bool pauseOnExceptions();
- void setPauseOnExceptions(bool pause);
-
void pauseInDebugger();
void resumeDebugger();
+ bool pauseOnExceptions();
+ void setPauseOnExceptions(bool pause);
+
void stepOverStatementInDebugger();
void stepIntoStatementInDebugger();
void stepOutOfFunctionInDebugger();
+
+ bool profilerEnabled();
+ void enableProfiler(bool always);
+ void disableProfiler(bool always);
+
+ void startProfiling();
+ void stopProfiling();
+
+ void getProfileHeaders(long callId);
+ void getProfile(long callId, unsigned uid);
+
+ JavaScriptCallFrame* currentCallFrame() const;
#endif
void dispatchOnInjectedScript(long callId, const String& methodName, const String& arguments, bool async);
@@ -139,41 +111,33 @@ public:
void getEventListenersForNode(long callId, long nodeId);
void copyNode(long nodeId);
void removeNode(long callId, long nodeId);
+ void highlightDOMNode(long nodeId);
+ void hideDOMNodeHighlight();
void getCookies(long callId, const String& domain);
void deleteCookie(const String& cookieName, const String& domain);
- void copyText(const String& text);
-
// Generic code called from custom implementations.
- void highlight(long nodeId);
- Node* nodeForId(long nodeId);
- ScriptValue wrapObject(const ScriptValue& object, const String& objectGroup);
- ScriptValue unwrapObject(const String& objectId);
void releaseWrapperObjectGroup(const String& objectGroup);
- long pushNodePathToFrontend(Node* node, bool selectInUI);
- void addNodesToSearchResult(const String& nodeIds);
+ void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
+
#if ENABLE(DATABASE)
- Database* databaseForId(long databaseId);
- void selectDatabase(Database* database);
void getDatabaseTableNames(long callId, long databaseId);
#endif
+
#if ENABLE(DOM_STORAGE)
- void selectDOMStorage(Storage* storage);
void getDOMStorageEntries(long callId, long storageId);
void setDOMStorageItem(long callId, long storageId, const String& key, const String& value);
void removeDOMStorageItem(long callId, long storageId, const String& key);
#endif
- void reportDidDispatchOnInjectedScript(long callId, const String& result, bool isException);
- void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
private:
- InspectorBackend(InspectorController* inspectorController, InspectorClient* client);
+ InspectorBackend(InspectorController* inspectorController);
InspectorDOMAgent* inspectorDOMAgent();
InspectorFrontend* inspectorFrontend();
+ Node* nodeForId(long nodeId);
InspectorController* m_inspectorController;
- InspectorClient* m_client;
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index d6a3cf9..e436e6b 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -34,43 +34,18 @@ module core {
interface [
GenerateConstructor
] InspectorBackend {
- void hideDOMNodeHighlight();
- [Custom] void highlightDOMNode(in long nodeId);
- void loaded();
- void windowUnloading();
- void attach();
- void detach();
-
- void closeWindow();
void clearMessages(in boolean clearUI);
- void toggleNodeSearch();
+ void storeLastActivePanel(in DOMString panelName);
- boolean isWindowVisible();
+ void toggleNodeSearch();
boolean searchingForNode();
- void addResourceSourceToFrame(in long identifier, in Node frame);
- boolean addSourceToFrame(in DOMString mimeType, in DOMString sourceValue, in Node frame);
- [Custom] void search(in Node node, in DOMString query);
-#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- void getDatabaseTableNames(in long callId, in long databaseId);
-#endif
-
- [Custom] DOMObject setting(in DOMString key);
- [Custom] void setSetting(in DOMString key, in DOMObject value);
- [Custom] DOMWindow inspectedWindow();
- DOMString localizedStringsURL();
- DOMString hiddenPanels();
- DOMString platform();
- DOMString port();
- void startTimelineProfiler();
- void stopTimelineProfiler();
- [ImplementationFunction=moveWindowBy] void moveByUnrestricted(in float x, in float y);
- void setAttachedWindowHeight(in unsigned long height);
- [Custom] DOMObject wrapCallback(in DOMObject callback);
boolean resourceTrackingEnabled();
void enableResourceTracking(in boolean always);
void disableResourceTracking(in boolean always);
- void storeLastActivePanel(in DOMString panelName);
+
+ void startTimelineProfiler();
+ void stopTimelineProfiler();
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
boolean debuggerEnabled();
@@ -88,8 +63,6 @@ module core {
void stepIntoStatementInDebugger();
void stepOutOfFunctionInDebugger();
- [Custom] DOMObject currentCallFrame();
-
boolean pauseOnExceptions();
void setPauseOnExceptions(in boolean pauseOnExceptions);
@@ -111,30 +84,23 @@ module core {
void getEventListenersForNode(in long callId, in long nodeId);
void copyNode(in long nodeId);
void removeNode(in long callId, in long nodeId);
+ void highlightDOMNode(in long nodeId);
+ void hideDOMNodeHighlight();
void getCookies(in long callId, in DOMString domain);
void deleteCookie(in DOMString cookieName, in DOMString domain);
- // Called from InjectedScript.
- // TODO: extract into a separate IDL.
- void copyText(in DOMString text);
- [Custom] DOMObject nodeForId(in long nodeId);
- [Custom] long wrapObject(in DOMObject object, in DOMString objectGroup);
- [Custom] DOMObject unwrapObject(in long objectId);
void releaseWrapperObjectGroup(in DOMString objectGroup);
- [Custom] int pushNodePathToFrontend(in DOMObject node, in boolean selectInUI);
- void addNodesToSearchResult(in DOMString nodeIds);
+ void didEvaluateForTestInFrontend(in long callId, in DOMString jsonResult);
+
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- [Custom] void selectDatabase(in DOMObject database);
- [Custom] DOMObject databaseForId(in long databaseId);
+ void getDatabaseTableNames(in long callId, in long databaseId);
#endif
+
#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
- [Custom] void selectDOMStorage(in DOMObject storage);
void getDOMStorageEntries(in long callId, in long storageId);
void setDOMStorageItem(in long callId, in long storageId, in DOMString key, in DOMString value);
void removeDOMStorageItem(in long callId, in long storageId, in DOMString key);
#endif
- void reportDidDispatchOnInjectedScript(in long callId, in DOMString result, in boolean isException);
- void didEvaluateForTestInFrontend(in long callId, in DOMString jsonResult);
};
}
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index f029e35..4e465e9 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -53,8 +53,10 @@
#include "HTMLFrameOwnerElement.h"
#include "HitTestResult.h"
#include "InspectorBackend.h"
+#include "InjectedScriptHost.h"
#include "InspectorClient.h"
#include "InspectorFrontend.h"
+#include "InspectorFrontendHost.h"
#include "InspectorDatabaseResource.h"
#include "InspectorDOMAgent.h"
#include "InspectorDOMStorageResource.h"
@@ -134,7 +136,9 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_previousMessage(0)
, m_resourceTrackingEnabled(false)
, m_resourceTrackingSettingsLoaded(false)
- , m_inspectorBackend(InspectorBackend::create(this, client))
+ , m_inspectorBackend(InspectorBackend::create(this))
+ , m_inspectorFrontendHost(InspectorFrontendHost::create(this, client))
+ , m_injectedScriptHost(InjectedScriptHost::create(this))
, m_lastBoundObjectId(1)
#if ENABLE(JAVASCRIPT_DEBUGGER)
, m_debuggerEnabled(false)
@@ -174,15 +178,19 @@ InspectorController::~InspectorController()
releaseDOMAgent();
m_inspectorBackend->disconnectController();
+ m_inspectorFrontendHost->disconnectController();
+ m_injectedScriptHost->disconnectController();
}
void InspectorController::inspectedPageDestroyed()
{
close();
- if (m_scriptState)
- ScriptGlobalObject::remove(m_scriptState, "InspectorController");
-
+ if (m_scriptState) {
+ ScriptGlobalObject::remove(m_scriptState, "InspectorBackend");
+ ScriptGlobalObject::remove(m_scriptState, "InspectorFrontendHost");
+ ScriptGlobalObject::remove(m_scriptState, "InjectedScriptHost");
+ }
ASSERT(m_inspectedPage);
m_inspectedPage = 0;
@@ -522,7 +530,9 @@ void InspectorController::windowScriptObjectAvailable()
// Grant the inspector the ability to script the inspected page.
m_page->mainFrame()->document()->securityOrigin()->grantUniversalAccess();
m_scriptState = scriptStateFromPage(debuggerWorld(), m_page);
- ScriptGlobalObject::set(m_scriptState, "InspectorController", m_inspectorBackend.get());
+ ScriptGlobalObject::set(m_scriptState, "InspectorBackend", m_inspectorBackend.get());
+ ScriptGlobalObject::set(m_scriptState, "InspectorFrontendHost", m_inspectorFrontendHost.get());
+ ScriptGlobalObject::set(m_scriptState, "InjectedScriptHost", m_injectedScriptHost.get());
}
void InspectorController::scriptObjectReady()
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index d3ea571..6f261ec 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -62,10 +62,12 @@ class Document;
class DocumentLoader;
class GraphicsContext;
class HitTestResult;
+class InjectedScriptHost;
class InspectorBackend;
class InspectorClient;
class InspectorDOMAgent;
class InspectorFrontend;
+class InspectorFrontendHost;
class InspectorTimelineAgent;
class JavaScriptCallFrame;
class KURL;
@@ -166,6 +168,8 @@ public:
~InspectorController();
InspectorBackend* inspectorBackend() { return m_inspectorBackend.get(); }
+ InspectorFrontendHost* inspectorFrontendHost() { return m_inspectorFrontendHost.get(); }
+ InjectedScriptHost* injectedScriptHost() { return m_injectedScriptHost.get(); }
void inspectedPageDestroyed();
void pageDestroyed() { m_page = 0; }
@@ -294,6 +298,8 @@ public:
private:
friend class InspectorBackend;
+ friend class InspectorFrontendHost;
+ friend class InjectedScriptHost;
// Following are used from InspectorBackend and internally.
void scriptObjectReady();
void moveWindowBy(float x, float y) const;
@@ -387,6 +393,8 @@ private:
bool m_resourceTrackingEnabled;
bool m_resourceTrackingSettingsLoaded;
RefPtr<InspectorBackend> m_inspectorBackend;
+ RefPtr<InspectorFrontendHost> m_inspectorFrontendHost;
+ RefPtr<InjectedScriptHost> m_injectedScriptHost;
HashMap<String, ScriptValue> m_idToWrappedObject;
ObjectGroupsMap m_objectGroups;
diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp
new file mode 100644
index 0000000..768eb08
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendHost.cpp
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ *
+ * 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 "InspectorFrontendHost.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Element.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "HTMLFrameOwnerElement.h"
+#include "InspectorClient.h"
+#include "InspectorResource.h"
+
+#include <wtf/RefPtr.h>
+
+using namespace std;
+
+namespace WebCore {
+
+InspectorFrontendHost::InspectorFrontendHost(InspectorController* inspectorController, InspectorClient* client)
+ : m_inspectorController(inspectorController)
+ , m_client(client)
+{
+}
+
+InspectorFrontendHost::~InspectorFrontendHost()
+{
+}
+
+void InspectorFrontendHost::loaded()
+{
+ if (m_inspectorController)
+ m_inspectorController->scriptObjectReady();
+}
+
+void InspectorFrontendHost::attach()
+{
+ if (m_inspectorController)
+ m_inspectorController->attachWindow();
+}
+
+void InspectorFrontendHost::detach()
+{
+ if (m_inspectorController)
+ m_inspectorController->detachWindow();
+}
+
+void InspectorFrontendHost::closeWindow()
+{
+ if (m_inspectorController)
+ m_inspectorController->closeWindow();
+}
+
+void InspectorFrontendHost::windowUnloading()
+{
+ if (m_inspectorController)
+ m_inspectorController->close();
+}
+
+void InspectorFrontendHost::setAttachedWindowHeight(unsigned height)
+{
+ if (m_inspectorController)
+ m_inspectorController->setAttachedWindowHeight(height);
+}
+
+void InspectorFrontendHost::moveWindowBy(float x, float y) const
+{
+ if (m_inspectorController)
+ m_inspectorController->moveWindowBy(x, y);
+}
+
+String InspectorFrontendHost::localizedStringsURL()
+{
+ return m_client->localizedStringsURL();
+}
+
+String InspectorFrontendHost::hiddenPanels()
+{
+ return m_client->hiddenPanels();
+}
+
+const String& InspectorFrontendHost::platform() const
+{
+#if PLATFORM(MAC)
+#ifdef BUILDING_ON_TIGER
+ DEFINE_STATIC_LOCAL(const String, platform, ("mac-tiger"));
+#else
+ DEFINE_STATIC_LOCAL(const String, platform, ("mac-leopard"));
+#endif
+#elif PLATFORM(WIN_OS)
+ DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
+#else
+ DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
+#endif
+ return platform;
+}
+
+
+const String& InspectorFrontendHost::port() const
+{
+#if PLATFORM(QT)
+ DEFINE_STATIC_LOCAL(const String, port, ("qt"));
+#elif PLATFORM(GTK)
+ DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
+#elif PLATFORM(WX)
+ DEFINE_STATIC_LOCAL(const String, port, ("wx"));
+#else
+ DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
+#endif
+
+ return port;
+}
+
+void InspectorFrontendHost::addResourceSourceToFrame(long identifier, Node* frame)
+{
+ if (!m_inspectorController)
+ return;
+ RefPtr<InspectorResource> resource = m_inspectorController->resources().get(identifier);
+ if (resource) {
+ String sourceString = resource->sourceString();
+ if (!sourceString.isEmpty())
+ addSourceToFrame(resource->mimeType(), sourceString, frame);
+ }
+}
+
+bool InspectorFrontendHost::addSourceToFrame(const String& mimeType, const String& source, Node* frameNode)
+{
+ ASSERT_ARG(frameNode, frameNode);
+
+ if (!frameNode)
+ return false;
+
+ if (!frameNode->attached()) {
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ ASSERT(frameNode->isElementNode());
+ if (!frameNode->isElementNode())
+ return false;
+
+ Element* element = static_cast<Element*>(frameNode);
+ ASSERT(element->isFrameOwnerElement());
+ if (!element->isFrameOwnerElement())
+ return false;
+
+ HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(element);
+ ASSERT(frameOwner->contentFrame());
+ if (!frameOwner->contentFrame())
+ return false;
+
+ FrameLoader* loader = frameOwner->contentFrame()->loader();
+
+ loader->setResponseMIMEType(mimeType);
+ loader->begin();
+ loader->write(source);
+ loader->end();
+
+ return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h
new file mode 100644
index 0000000..dcbec6b
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendHost.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorFrontendHost_h
+#define InspectorFrontendHost_h
+
+#include "Console.h"
+#include "InspectorController.h"
+#include "PlatformString.h"
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class InspectorClient;
+class Node;
+
+class InspectorFrontendHost : public RefCounted<InspectorFrontendHost>
+{
+public:
+ static PassRefPtr<InspectorFrontendHost> create(InspectorController* inspectorController, InspectorClient* client)
+ {
+ return adoptRef(new InspectorFrontendHost(inspectorController, client));
+ }
+
+ ~InspectorFrontendHost();
+
+ InspectorController* inspectorController() { return m_inspectorController; }
+ void disconnectController() { m_inspectorController = 0; }
+
+ void loaded();
+ void attach();
+ void detach();
+ void closeWindow();
+ void windowUnloading();
+
+ void setAttachedWindowHeight(unsigned height);
+ void moveWindowBy(float x, float y) const;
+
+ String localizedStringsURL();
+ String hiddenPanels();
+ const String& platform() const;
+ const String& port() const;
+
+ void addResourceSourceToFrame(long identifier, Node* frame);
+ bool addSourceToFrame(const String& mimeType, const String& source, Node* frame);
+
+private:
+ InspectorFrontendHost(InspectorController* inspectorController, InspectorClient* client);
+
+ InspectorController* m_inspectorController;
+ InspectorClient* m_client;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorFrontendHost_h)
diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl
new file mode 100644
index 0000000..9a7581d
--- /dev/null
+++ b/WebCore/inspector/InspectorFrontendHost.idl
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Matt Lilek <webkit at mattlilek.com>
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module core {
+ interface [
+ GenerateConstructor
+ ] InspectorFrontendHost {
+ void loaded();
+ void attach();
+ void detach();
+ void closeWindow();
+ void windowUnloading();
+
+ void setAttachedWindowHeight(in unsigned long height);
+ void moveWindowBy(in float x, in float y);
+
+ DOMString localizedStringsURL();
+ DOMString hiddenPanels();
+ DOMString platform();
+ DOMString port();
+
+ void addResourceSourceToFrame(in long identifier, in Node frame);
+ boolean addSourceToFrame(in DOMString mimeType, in DOMString sourceValue, in Node frame);
+
+ [Custom] void search(in Node node, in DOMString query);
+ [Custom] DOMObject setting(in DOMString key);
+ [Custom] void setSetting(in DOMString key, in DOMObject value);
+ };
+}
diff --git a/WebCore/inspector/front-end/Breakpoint.js b/WebCore/inspector/front-end/Breakpoint.js
index 292975a..5d46cc9 100644
--- a/WebCore/inspector/front-end/Breakpoint.js
+++ b/WebCore/inspector/front-end/Breakpoint.js
@@ -89,7 +89,7 @@ WebInspector.Breakpoint.prototype = {
this.dispatchEventToListeners("condition-changed");
if (this.enabled)
- InspectorController.updateBreakpoint(this.sourceID, this.line, c);
+ InspectorBackend.updateBreakpoint(this.sourceID, this.line, c);
}
}
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 1a99f16..9d4fe55 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -58,11 +58,11 @@ WebInspector.BreakpointsSidebarPane.prototype = {
this.bodyElement.appendChild(this.listElement);
}
- if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID)
+ if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
return;
if (breakpoint.enabled)
- InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
+ InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
},
_appendBreakpointElement: function(breakpoint)
@@ -135,10 +135,10 @@ WebInspector.BreakpointsSidebarPane.prototype = {
this.bodyElement.appendChild(this.emptyElement);
}
- if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID)
+ if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
return;
- InspectorController.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
+ InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
},
_breakpointEnableChanged: function(event)
@@ -148,13 +148,13 @@ WebInspector.BreakpointsSidebarPane.prototype = {
var checkbox = breakpoint._breakpointListElement.firstChild;
checkbox.checked = breakpoint.enabled;
- if (!InspectorController.debuggerEnabled() || !breakpoint.sourceID)
+ if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
return;
if (breakpoint.enabled)
- InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
+ InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
else
- InspectorController.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
+ InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
},
_breakpointTextChanged: function(event)
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 4566388..9815f4a 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -285,7 +285,7 @@ WebInspector.ConsoleView.prototype = {
clearMessages: function(clearInspectorController)
{
if (clearInspectorController)
- InspectorController.clearMessages(false);
+ InspectorBackend.clearMessages(false);
if (WebInspector.panels.resources)
WebInspector.panels.resources.clearMessages();
diff --git a/WebCore/inspector/front-end/CookieItemsView.js b/WebCore/inspector/front-end/CookieItemsView.js
index 5abdbea..0caa1b7 100644
--- a/WebCore/inspector/front-end/CookieItemsView.js
+++ b/WebCore/inspector/front-end/CookieItemsView.js
@@ -267,7 +267,7 @@ WebInspector.CookieItemsView.prototype = {
_deleteCookieCallback: function(node)
{
var cookie = node.cookie;
- InspectorController.deleteCookie(cookie.name, this._cookieDomain);
+ InspectorBackend.deleteCookie(cookie.name, this._cookieDomain);
this.update();
},
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 252b5f8..bdace7e 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -327,25 +327,25 @@ WebInspector.DOMAgent.prototype = {
callback(parent.children);
}
var callId = WebInspector.Callback.wrap(mycallback);
- InspectorController.getChildNodes(callId, parent.id);
+ InspectorBackend.getChildNodes(callId, parent.id);
},
setAttributeAsync: function(node, name, value, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorController.setAttribute(WebInspector.Callback.wrap(mycallback), node.id, name, value);
+ InspectorBackend.setAttribute(WebInspector.Callback.wrap(mycallback), node.id, name, value);
},
removeAttributeAsync: function(node, name, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorController.removeAttribute(WebInspector.Callback.wrap(mycallback), node.id, name);
+ InspectorBackend.removeAttribute(WebInspector.Callback.wrap(mycallback), node.id, name);
},
setTextNodeValueAsync: function(node, text, callback)
{
var mycallback = this._didApplyDomChange.bind(this, node, callback);
- InspectorController.setTextNodeValue(WebInspector.Callback.wrap(mycallback), node.id, text);
+ InspectorBackend.setTextNodeValue(WebInspector.Callback.wrap(mycallback), node.id, text);
},
_didApplyDomChange: function(node, callback, success)
@@ -447,7 +447,7 @@ WebInspector.Cookies.getCookiesAsync = function(callback, cookieDomain)
callback(cookies, true);
}
var callId = WebInspector.Callback.wrap(mycallback);
- InspectorController.getCookies(callId, cookieDomain);
+ InspectorBackend.getCookies(callId, cookieDomain);
}
WebInspector.Cookies.buildCookiesFromString = function(rawCookieString)
@@ -477,7 +477,7 @@ WebInspector.EventListeners.getEventListenersForNodeAsync = function(node, callb
return;
var callId = WebInspector.Callback.wrap(callback);
- InspectorController.getEventListenersForNode(callId, node.id);
+ InspectorBackend.getEventListenersForNode(callId, node.id);
}
WebInspector.CSSStyleDeclaration = function(payload)
diff --git a/WebCore/inspector/front-end/DOMStorage.js b/WebCore/inspector/front-end/DOMStorage.js
index 03a10bf..c5f658d 100644
--- a/WebCore/inspector/front-end/DOMStorage.js
+++ b/WebCore/inspector/front-end/DOMStorage.js
@@ -57,19 +57,19 @@ WebInspector.DOMStorage.prototype = {
getEntries: function(callback)
{
var callId = WebInspector.Callback.wrap(callback);
- InspectorController.getDOMStorageEntries(callId, this._id);
+ InspectorBackend.getDOMStorageEntries(callId, this._id);
},
setItem: function(key, value, callback)
{
var callId = WebInspector.Callback.wrap(callback);
- InspectorController.setDOMStorageItem(callId, this._id, key, value);
+ InspectorBackend.setDOMStorageItem(callId, this._id, key, value);
},
removeItem: function(key, callback)
{
var callId = WebInspector.Callback.wrap(callback);
- InspectorController.removeDOMStorageItem(callId, this._id, key);
+ InspectorBackend.removeDOMStorageItem(callId, this._id, key);
}
}
diff --git a/WebCore/inspector/front-end/Database.js b/WebCore/inspector/front-end/Database.js
index 1a348fc..5edefb1 100644
--- a/WebCore/inspector/front-end/Database.js
+++ b/WebCore/inspector/front-end/Database.js
@@ -82,7 +82,7 @@ WebInspector.Database.prototype = {
callback(names.sort());
}
var callId = WebInspector.Callback.wrap(sortingCallback);
- InspectorController.getDatabaseTableNames(callId, this._id);
+ InspectorBackend.getDatabaseTableNames(callId, this._id);
},
executeSql: function(query, onSuccess, onError)
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 74f5da6..84a3e86 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -58,8 +58,8 @@ WebInspector.ElementsPanel = function()
this.panel.updateProperties();
this.panel.updateEventListeners();
- if (InspectorController.searchingForNode()) {
- InspectorController.toggleNodeSearch();
+ if (InspectorBackend.searchingForNode()) {
+ InspectorBackend.toggleNodeSearch();
this.panel.nodeSearchButton.toggled = false;
}
if (this._focusedDOMNode)
@@ -150,8 +150,8 @@ WebInspector.ElementsPanel.prototype = {
WebInspector.hoveredDOMNode = null;
- if (InspectorController.searchingForNode()) {
- InspectorController.toggleNodeSearch();
+ if (InspectorBackend.searchingForNode()) {
+ InspectorBackend.toggleNodeSearch();
this.nodeSearchButton.toggled = false;
}
},
@@ -169,8 +169,8 @@ WebInspector.ElementsPanel.prototype = {
WebInspector.hoveredDOMNode = null;
- if (InspectorController.searchingForNode()) {
- InspectorController.toggleNodeSearch();
+ if (InspectorBackend.searchingForNode()) {
+ InspectorBackend.toggleNodeSearch();
this.nodeSearchButton.toggled = false;
}
@@ -183,11 +183,6 @@ WebInspector.ElementsPanel.prototype = {
if (!domWindow || !domWindow.document || !domWindow.document.firstChild)
return;
- // If the window isn't visible, return early so the DOM tree isn't built
- // and mutation event listeners are not added.
- if (!InspectorController.isWindowVisible())
- return;
-
var inspectedRootDocument = domWindow.document;
inspectedRootDocument.addEventListener("DOMNodeInserted", this._nodeInserted.bind(this));
inspectedRootDocument.addEventListener("DOMNodeRemoved", this._nodeRemoved.bind(this));
@@ -1023,7 +1018,7 @@ WebInspector.ElementsPanel.prototype = {
return;
event.clipboardData.clearData();
event.preventDefault();
- InspectorController.copyNode(this.focusedDOMNode.id);
+ InspectorBackend.copyNode(this.focusedDOMNode.id);
},
rightSidebarResizerDragStart: function(event)
@@ -1052,9 +1047,9 @@ WebInspector.ElementsPanel.prototype = {
_nodeSearchButtonClicked: function(event)
{
- InspectorController.toggleNodeSearch();
+ InspectorBackend.toggleNodeSearch();
- this.nodeSearchButton.toggled = InspectorController.searchingForNode();
+ this.nodeSearchButton.toggled = InspectorBackend.searchingForNode();
}
}
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 6c2d541..6880770 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -83,7 +83,7 @@ WebInspector.ElementsTreeOutline.prototype = {
this.focusedNodeChanged();
if (x && !this.suppressSelectHighlight) {
- InspectorController.highlightDOMNode(x.id);
+ InspectorBackend.highlightDOMNode(x.id);
if ("_restorePreviousHighlightNodeTimeout" in this)
clearTimeout(this._restorePreviousHighlightNodeTimeout);
@@ -92,9 +92,9 @@ WebInspector.ElementsTreeOutline.prototype = {
{
var hoveredNode = WebInspector.hoveredDOMNode;
if (hoveredNode)
- InspectorController.highlightDOMNode(hoveredNode.id);
+ InspectorBackend.highlightDOMNode(hoveredNode.id);
else
- InspectorController.hideDOMNodeHighlight();
+ InspectorBackend.hideDOMNodeHighlight();
}
this._restorePreviousHighlightNodeTimeout = setTimeout(restoreHighlightToHoveredNode, 2000);
@@ -945,7 +945,7 @@ WebInspector.ElementsTreeElement.prototype = {
}
var callId = WebInspector.Callback.wrap(removeNodeCallback);
- InspectorController.removeNode(callId, this.representedObject.id);
+ InspectorBackend.removeNode(callId, this.representedObject.id);
}
}
diff --git a/WebCore/inspector/front-end/EventListenersSidebarPane.js b/WebCore/inspector/front-end/EventListenersSidebarPane.js
index 2938196..c083c0e 100644
--- a/WebCore/inspector/front-end/EventListenersSidebarPane.js
+++ b/WebCore/inspector/front-end/EventListenersSidebarPane.js
@@ -108,7 +108,7 @@ WebInspector.EventListenersSidebarPane.prototype = {
var selectedOption = this.settingsSelectElement[this.settingsSelectElement.selectedIndex];
Preferences.eventListenersFilter = selectedOption.value;
- InspectorController.setSetting("event-listeners-filter", Preferences.eventListenersFilter);
+ InspectorFrontendHost.setSetting("event-listeners-filter", Preferences.eventListenersFilter);
for (var i = 0; i < this.sections.length; ++i)
this.sections[i].update();
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index f21280d..e71eafa 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -561,7 +561,7 @@ InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, obj
{
var result = {};
try {
- result.value = InspectorController.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression), objectGroup);
+ result.value = InjectedScriptHost.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression), objectGroup);
// Handle error that might have happened while describing result.
if (result.value.errorText) {
result.value = result.value.errorText;
@@ -646,10 +646,10 @@ InjectedScript.performSearch = function(whitespaceTrimmedQuery)
node[searchResultsProperty] = true;
InjectedScript._searchResults.push(node);
- var nodeId = InspectorController.pushNodePathToFrontend(node, false);
+ var nodeId = InjectedScriptHost.pushNodePathToFrontend(node, false);
nodeIds.push(nodeId);
}
- InspectorController.addNodesToSearchResult(nodeIds.join(","));
+ InjectedScriptHost.addNodesToSearchResult(nodeIds.join(","));
}
function matchExactItems(doc)
@@ -848,7 +848,7 @@ InjectedScript.openInInspectedWindow = function(url)
InjectedScript.getCallFrames = function()
{
- var callFrame = InspectorController.currentCallFrame();
+ var callFrame = InjectedScriptHost.currentCallFrame();
if (!callFrame)
return false;
@@ -871,7 +871,7 @@ InjectedScript.evaluateInCallFrame = function(callFrameId, code, objectGroup)
InjectedScript._callFrameForId = function(id)
{
- var callFrame = InspectorController.currentCallFrame();
+ var callFrame = InjectedScriptHost.currentCallFrame();
while (--id >= 0 && callFrame)
callFrame = callFrame.caller;
return callFrame;
@@ -879,7 +879,7 @@ InjectedScript._callFrameForId = function(id)
InjectedScript._clearConsoleMessages = function()
{
- InspectorController.clearMessages(true);
+ InjectedScriptHost.clearMessages(true);
}
InjectedScript._inspectObject = function(o)
@@ -890,14 +890,14 @@ InjectedScript._inspectObject = function(o)
var inspectedWindow = InjectedScript._window();
inspectedWindow.console.log(o);
if (Object.type(o) === "node") {
- InspectorController.pushNodePathToFrontend(o, true);
+ InjectedScriptHost.pushNodePathToFrontend(o, true);
} else {
switch (Object.describe(o)) {
case "Database":
- InspectorController.selectDatabase(o);
+ InjectedScriptHost.selectDatabase(o);
break;
case "Storage":
- InspectorController.selectDOMStorage(o);
+ InjectedScriptHost.selectDOMStorage(o);
break;
}
}
@@ -906,10 +906,10 @@ InjectedScript._inspectObject = function(o)
InjectedScript._copy = function(o)
{
if (Object.type(o) === "node") {
- var nodeId = InspectorController.pushNodePathToFrontend(o, false);
- InspectorController.copyNode(nodeId);
+ var nodeId = InjectedScriptHost.pushNodePathToFrontend(o, false);
+ InjectedScriptHost.copyNode(nodeId);
} else {
- InspectorController.copyText(o);
+ InjectedScriptHost.copyText(o);
}
}
@@ -986,9 +986,9 @@ InjectedScript._ensureCommandLineAPIInstalled = function(evalFunction, evalObjec
get $4() { return console._inspectorCommandLineAPI._inspectedNodes[4] }, \n\
};");
- inspectorCommandLineAPI.clear = InspectorController.wrapCallback(InjectedScript._clearConsoleMessages);
- inspectorCommandLineAPI.inspect = InspectorController.wrapCallback(InjectedScript._inspectObject);
- inspectorCommandLineAPI.copy = InspectorController.wrapCallback(InjectedScript._copy);
+ inspectorCommandLineAPI.clear = InjectedScriptHost.wrapCallback(InjectedScript._clearConsoleMessages);
+ inspectorCommandLineAPI.inspect = InjectedScriptHost.wrapCallback(InjectedScript._inspectObject);
+ inspectorCommandLineAPI.copy = InjectedScriptHost.wrapCallback(InjectedScript._copy);
}
InjectedScript._resolveObject = function(objectProxy)
@@ -1012,14 +1012,14 @@ InjectedScript._window = function()
{
// TODO: replace with 'return window;' once this script is injected into
// the page's context.
- return InspectorController.inspectedWindow();
+ return InjectedScriptHost.inspectedWindow();
}
InjectedScript._nodeForId = function(nodeId)
{
if (!nodeId)
return null;
- return InspectorController.nodeForId(nodeId);
+ return InjectedScriptHost.nodeForId(nodeId);
}
InjectedScript._objectForId = function(objectId)
@@ -1031,7 +1031,7 @@ InjectedScript._objectForId = function(objectId)
if (typeof objectId === "number") {
return InjectedScript._nodeForId(objectId);
} else if (typeof objectId === "string") {
- return InspectorController.unwrapObject(objectId);
+ return InjectedScriptHost.unwrapObject(objectId);
} else if (typeof objectId === "object") {
var callFrame = InjectedScript._callFrameForId(objectId.callFrame);
if (objectId.thisObject)
@@ -1047,7 +1047,7 @@ InjectedScript.pushNodeToFrontend = function(objectProxy)
var object = InjectedScript._resolveObject(objectProxy);
if (!object || Object.type(object) !== "node")
return false;
- return InspectorController.pushNodePathToFrontend(object, false);
+ return InjectedScriptHost.pushNodePathToFrontend(object, false);
}
// Called from within InspectorController on the 'inspected page' side.
@@ -1130,23 +1130,23 @@ InjectedScript.executeSql = function(callId, databaseId, query)
data[columnIdentifier] = String(text);
}
}
- InspectorController.reportDidDispatchOnInjectedScript(callId, JSON.stringify(result), false);
+ InjectedScriptHost.reportDidDispatchOnInjectedScript(callId, JSON.stringify(result), false);
}
function errorCallback(tx, error)
{
- InspectorController.reportDidDispatchOnInjectedScript(callId, JSON.stringify(error), false);
+ InjectedScriptHost.reportDidDispatchOnInjectedScript(callId, JSON.stringify(error), false);
}
function queryTransaction(tx)
{
- tx.executeSql(query, null, InspectorController.wrapCallback(successCallback), InspectorController.wrapCallback(errorCallback));
+ tx.executeSql(query, null, InjectedScriptHost.wrapCallback(successCallback), InjectedScriptHost.wrapCallback(errorCallback));
}
- var database = InspectorController.databaseForId(databaseId);
+ var database = InjectedScriptHost.databaseForId(databaseId);
if (!database)
errorCallback(null, { code : 2 }); // Return as unexpected version.
- database.transaction(InspectorController.wrapCallback(queryTransaction), InspectorController.wrapCallback(errorCallback));
+ database.transaction(InjectedScriptHost.wrapCallback(queryTransaction), InjectedScriptHost.wrapCallback(errorCallback));
return true;
}
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index 045833b..6d05732 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -47,7 +47,7 @@ InjectedScriptAccess._installHandler = function(methodName, async)
WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage("Error dispatching: " + methodName));
}
var callId = WebInspector.Callback.wrap(myCallback);
- InspectorController.dispatchOnInjectedScript(callId, methodName, argsString, !!async);
+ InspectorBackend.dispatchOnInjectedScript(callId, methodName, argsString, !!async);
};
}
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
new file mode 100644
index 0000000..1710b12
--- /dev/null
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+if (!window.InspectorBackend) {
+
+WebInspector.InspectorBackendStub = function()
+{
+ this._searchingForNode = false;
+ this._attachedWindowHeight = 0;
+ this._debuggerEnabled = true;
+ this._profilerEnabled = true;
+ this._resourceTrackingEnabled = false;
+ this._timelineEnabled = false;
+ this._settings = {};
+}
+
+WebInspector.InspectorBackendStub.prototype = {
+ wrapCallback: function(func)
+ {
+ return func;
+ },
+
+ platform: function()
+ {
+ return "mac-leopard";
+ },
+
+ port: function()
+ {
+ return "unknown";
+ },
+
+
+ closeWindow: function()
+ {
+ this._windowVisible = false;
+ },
+
+ attach: function()
+ {
+ },
+
+ detach: function()
+ {
+ },
+
+ storeLastActivePanel: function(panel)
+ {
+ },
+
+ clearMessages: function()
+ {
+ },
+
+ searchingForNode: function()
+ {
+ return this._searchingForNode;
+ },
+
+ search: function(sourceRow, query)
+ {
+ },
+
+ toggleNodeSearch: function()
+ {
+ this._searchingForNode = !this._searchingForNode;
+ },
+
+ setAttachedWindowHeight: function(height)
+ {
+ },
+
+ moveByUnrestricted: function(x, y)
+ {
+ },
+
+
+ addResourceSourceToFrame: function(identifier, element)
+ {
+ },
+
+ addSourceToFrame: function(mimeType, source, element)
+ {
+ return false;
+ },
+
+ getResourceDocumentNode: function(identifier)
+ {
+ return undefined;
+ },
+
+ highlightDOMNode: function(node)
+ {
+ },
+
+ hideDOMNodeHighlight: function()
+ {
+ },
+
+ inspectedWindow: function()
+ {
+ return window;
+ },
+
+ loaded: function()
+ {
+ },
+
+ localizedStringsURL: function()
+ {
+ return undefined;
+ },
+
+ windowUnloading: function()
+ {
+ return false;
+ },
+
+ hiddenPanels: function()
+ {
+ return "";
+ },
+
+ debuggerEnabled: function()
+ {
+ return this._debuggerEnabled;
+ },
+
+ enableResourceTracking: function()
+ {
+ this._resourceTrackingEnabled = true;
+ WebInspector.resourceTrackingWasEnabled();
+ },
+
+ disableResourceTracking: function()
+ {
+ this._resourceTrackingEnabled = false;
+ WebInspector.resourceTrackingWasDisabled();
+ },
+
+ resourceTrackingEnabled: function()
+ {
+ return this._resourceTrackingEnabled;
+ },
+
+ enableDebugger: function()
+ {
+ this._debuggerEnabled = true;
+ },
+
+ disableDebugger: function()
+ {
+ this._debuggerEnabled = false;
+ },
+
+ addBreakpoint: function(sourceID, line, condition)
+ {
+ },
+
+ removeBreakpoint: function(sourceID, line)
+ {
+ },
+
+ updateBreakpoint: function(sourceID, line, condition)
+ {
+ },
+
+ pauseInDebugger: function()
+ {
+ },
+
+ pauseOnExceptions: function()
+ {
+ return false;
+ },
+
+ setPauseOnExceptions: function(value)
+ {
+ },
+
+ resumeDebugger: function()
+ {
+ },
+
+ profilerEnabled: function()
+ {
+ return true;
+ },
+
+ enableProfiler: function()
+ {
+ this._profilerEnabled = true;
+ },
+
+ disableProfiler: function()
+ {
+ this._profilerEnabled = false;
+ },
+
+ startProfiling: function()
+ {
+ },
+
+ stopProfiling: function()
+ {
+ },
+
+ getProfileHeaders: function(callId)
+ {
+ WebInspector.didGetProfileHeaders(callId, []);
+ },
+
+ getProfile: function(callId, uid)
+ {
+ if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))
+ {
+ WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);
+ }
+ },
+
+ takeHeapSnapshot: function()
+ {
+ },
+
+ databaseTableNames: function(database)
+ {
+ return [];
+ },
+
+ stepIntoStatementInDebugger: function()
+ {
+ },
+
+ stepOutOfFunctionInDebugger: function()
+ {
+ },
+
+ stepOverStatementInDebugger: function()
+ {
+ },
+
+ setSetting: function(setting, value)
+ {
+ this._settings[setting] = value;
+ },
+
+ dispatchOnInjectedScript: function()
+ {
+ },
+
+ releaseWrapperObjectGroup: function()
+ {
+ },
+
+ setting: function(setting)
+ {
+ return this._settings[setting];
+ }
+}
+
+InspectorBackend = new WebInspector.InspectorBackendStub();
+
+}
diff --git a/WebCore/inspector/front-end/InspectorControllerStub.js b/WebCore/inspector/front-end/InspectorControllerStub.js
index f78c9bd..e69de29 100644
--- a/WebCore/inspector/front-end/InspectorControllerStub.js
+++ b/WebCore/inspector/front-end/InspectorControllerStub.js
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-if (!window.InspectorController) {
-
-WebInspector.InspectorControllerStub = function()
-{
- this._searchingForNode = false;
- this._windowVisible = true;
- this._attachedWindowHeight = 0;
- this._debuggerEnabled = true;
- this._profilerEnabled = true;
- this._resourceTrackingEnabled = false;
- this._timelineEnabled = false;
- this._settings = {};
-}
-
-WebInspector.InspectorControllerStub.prototype = {
- wrapCallback: function(func)
- {
- return func;
- },
-
- isWindowVisible: function()
- {
- return this._windowVisible;
- },
-
- platform: function()
- {
- return "mac-leopard";
- },
-
- port: function()
- {
- return "unknown";
- },
-
-
- closeWindow: function()
- {
- this._windowVisible = false;
- },
-
- attach: function()
- {
- },
-
- detach: function()
- {
- },
-
- storeLastActivePanel: function(panel)
- {
- },
-
- clearMessages: function()
- {
- },
-
- searchingForNode: function()
- {
- return this._searchingForNode;
- },
-
- search: function(sourceRow, query)
- {
- },
-
- toggleNodeSearch: function()
- {
- this._searchingForNode = !this._searchingForNode;
- },
-
- setAttachedWindowHeight: function(height)
- {
- },
-
- moveByUnrestricted: function(x, y)
- {
- },
-
-
- addResourceSourceToFrame: function(identifier, element)
- {
- },
-
- addSourceToFrame: function(mimeType, source, element)
- {
- return false;
- },
-
- getResourceDocumentNode: function(identifier)
- {
- return undefined;
- },
-
- highlightDOMNode: function(node)
- {
- },
-
- hideDOMNodeHighlight: function()
- {
- },
-
- inspectedWindow: function()
- {
- return window;
- },
-
- loaded: function()
- {
- },
-
- localizedStringsURL: function()
- {
- return undefined;
- },
-
- windowUnloading: function()
- {
- return false;
- },
-
- hiddenPanels: function()
- {
- return "";
- },
-
- debuggerEnabled: function()
- {
- return this._debuggerEnabled;
- },
-
- enableResourceTracking: function()
- {
- this._resourceTrackingEnabled = true;
- WebInspector.resourceTrackingWasEnabled();
- },
-
- disableResourceTracking: function()
- {
- this._resourceTrackingEnabled = false;
- WebInspector.resourceTrackingWasDisabled();
- },
-
- resourceTrackingEnabled: function()
- {
- return this._resourceTrackingEnabled;
- },
-
- enableDebugger: function()
- {
- this._debuggerEnabled = true;
- },
-
- disableDebugger: function()
- {
- this._debuggerEnabled = false;
- },
-
- addBreakpoint: function(sourceID, line, condition)
- {
- },
-
- removeBreakpoint: function(sourceID, line)
- {
- },
-
- updateBreakpoint: function(sourceID, line, condition)
- {
- },
-
- pauseInDebugger: function()
- {
- },
-
- pauseOnExceptions: function()
- {
- return false;
- },
-
- setPauseOnExceptions: function(value)
- {
- },
-
- resumeDebugger: function()
- {
- },
-
- profilerEnabled: function()
- {
- return true;
- },
-
- enableProfiler: function()
- {
- this._profilerEnabled = true;
- },
-
- disableProfiler: function()
- {
- this._profilerEnabled = false;
- },
-
- startProfiling: function()
- {
- },
-
- stopProfiling: function()
- {
- },
-
- getProfileHeaders: function(callId)
- {
- WebInspector.didGetProfileHeaders(callId, []);
- },
-
- getProfile: function(callId, uid)
- {
- if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles))
- {
- WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]);
- }
- },
-
- takeHeapSnapshot: function()
- {
- },
-
- databaseTableNames: function(database)
- {
- return [];
- },
-
- stepIntoStatementInDebugger: function()
- {
- },
-
- stepOutOfFunctionInDebugger: function()
- {
- },
-
- stepOverStatementInDebugger: function()
- {
- },
-
- setSetting: function(setting, value)
- {
- this._settings[setting] = value;
- },
-
- dispatchOnInjectedScript: function()
- {
- },
-
- releaseWrapperObjectGroup: function()
- {
- },
-
- setting: function(setting)
- {
- return this._settings[setting];
- }
-}
-
-window.InspectorController = new WebInspector.InspectorControllerStub();
-
-}
diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
new file mode 100644
index 0000000..facea4e
--- /dev/null
+++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+if (!window.InspectorFrontendHost) {
+
+WebInspector.InspectorFrontendHostStub = function()
+{
+ this._attachedWindowHeight = 0;
+ this._settings = {};
+}
+
+WebInspector.InspectorFrontendHostStub.prototype = {
+ platform: function()
+ {
+ return "mac-leopard";
+ },
+
+ port: function()
+ {
+ return "unknown";
+ },
+
+ closeWindow: function()
+ {
+ this._windowVisible = false;
+ },
+
+ attach: function()
+ {
+ },
+
+ detach: function()
+ {
+ },
+
+ search: function(sourceRow, query)
+ {
+ },
+
+ setAttachedWindowHeight: function(height)
+ {
+ },
+
+ moveWindowBy: function(x, y)
+ {
+ },
+
+ addResourceSourceToFrame: function(identifier, element)
+ {
+ },
+
+ addSourceToFrame: function(mimeType, source, element)
+ {
+ return false;
+ },
+
+ loaded: function()
+ {
+ },
+
+ localizedStringsURL: function()
+ {
+ return undefined;
+ },
+
+ hiddenPanels: function()
+ {
+ return "";
+ },
+
+ setSetting: function(setting, value)
+ {
+ this._settings[setting] = value;
+ },
+
+ setting: function(setting)
+ {
+ return this._settings[setting];
+ }
+}
+
+InspectorFrontendHost = new WebInspector.InspectorFrontendHostStub();
+
+}
diff --git a/WebCore/inspector/front-end/ProfileView.js b/WebCore/inspector/front-end/ProfileView.js
index 2b1d236..c164e94 100644
--- a/WebCore/inspector/front-end/ProfileView.js
+++ b/WebCore/inspector/front-end/ProfileView.js
@@ -95,7 +95,7 @@ WebInspector.CPUProfileView = function(profile)
}
var callId = WebInspector.Callback.wrap(profileCallback);
- InspectorController.getProfile(callId, this.profile.uid);
+ InspectorBackend.getProfile(callId, this.profile.uid);
}
WebInspector.CPUProfileView.prototype = {
@@ -594,9 +594,9 @@ WebInspector.CPUProfileType.prototype = {
this._recording = !this._recording;
if (this._recording)
- InspectorController.startProfiling();
+ InspectorBackend.startProfiling();
else
- InspectorController.stopProfiling();
+ InspectorBackend.stopProfiling();
},
setRecordingProfile: function(isProfiling)
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index adf0a29..b276ecb 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -400,7 +400,7 @@ WebInspector.ProfilesPanel.prototype = {
_updateInterface: function()
{
// FIXME: Replace ProfileType-specific button visibility changes by a single ProfileType-agnostic "combo-button" visibility change.
- if (InspectorController.profilerEnabled()) {
+ if (InspectorBackend.profilerEnabled()) {
this.enableToggleButton.title = WebInspector.UIString("Profiling enabled. Click to disable.");
this.enableToggleButton.toggled = true;
for (var typeId in this._profileTypeButtonsByIdMap)
@@ -419,17 +419,17 @@ WebInspector.ProfilesPanel.prototype = {
_enableProfiling: function()
{
- if (InspectorController.profilerEnabled())
+ if (InspectorBackend.profilerEnabled())
return;
this._toggleProfiling(this.panelEnablerView.alwaysEnabled);
},
_toggleProfiling: function(optionalAlways)
{
- if (InspectorController.profilerEnabled())
- InspectorController.disableProfiler(true);
+ if (InspectorBackend.profilerEnabled())
+ InspectorBackend.disableProfiler(true);
else
- InspectorController.enableProfiler(!!optionalAlways);
+ InspectorBackend.enableProfiler(!!optionalAlways);
},
_populateProfiles: function()
@@ -449,7 +449,7 @@ WebInspector.ProfilesPanel.prototype = {
}
var callId = WebInspector.Callback.wrap(populateCallback);
- InspectorController.getProfileHeaders(callId);
+ InspectorBackend.getProfileHeaders(callId);
delete this._shouldPopulateProfiles;
},
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 3104d13..121eba5 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -349,7 +349,7 @@ WebInspector.ResourcesPanel.prototype = {
this.summaryBar.reset();
- if (InspectorController.resourceTrackingEnabled()) {
+ if (InspectorBackend.resourceTrackingEnabled()) {
this.enableToggleButton.title = WebInspector.UIString("Resource tracking enabled. Click to disable.");
this.enableToggleButton.toggled = true;
this.largerResourcesButton.visible = true;
@@ -616,7 +616,7 @@ WebInspector.ResourcesPanel.prototype = {
this.itemsTreeElement.smallChildren = !this.itemsTreeElement.smallChildren;
Preferences.resourcesLargeRows = !Preferences.resourcesLargeRows;
- InspectorController.setSetting("resources-large-rows", Preferences.resourcesLargeRows);
+ InspectorFrontendHost.setSetting("resources-large-rows", Preferences.resourcesLargeRows);
if (this.itemsTreeElement.smallChildren) {
this.itemsGraphsElement.addStyleClass("small");
@@ -675,21 +675,21 @@ WebInspector.ResourcesPanel.prototype = {
_enableResourceTracking: function()
{
- if (InspectorController.resourceTrackingEnabled())
+ if (InspectorBackend.resourceTrackingEnabled())
return;
this._toggleResourceTracking(this.panelEnablerView.alwaysEnabled);
},
_toggleResourceTracking: function(optionalAlways)
{
- if (InspectorController.resourceTrackingEnabled()) {
+ if (InspectorBackend.resourceTrackingEnabled()) {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
- InspectorController.disableResourceTracking(true);
+ InspectorBackend.disableResourceTracking(true);
} else {
this.largerResourcesButton.visible = true;
this.sortingSelectElement.visible = true;
- InspectorController.enableResourceTracking(!!optionalAlways);
+ InspectorBackend.enableResourceTracking(!!optionalAlways);
}
},
diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js
index 124190c..38157ac 100644
--- a/WebCore/inspector/front-end/ScriptView.js
+++ b/WebCore/inspector/front-end/ScriptView.js
@@ -59,7 +59,7 @@ WebInspector.ScriptView.prototype = {
this.attach();
- if (!InspectorController.addSourceToFrame("text/javascript", this.script.source, this.sourceFrame.element))
+ if (!InspectorFrontendHost.addSourceToFrame("text/javascript", this.script.source, this.sourceFrame.element))
return;
delete this._frameNeedsSetup;
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index d69516e..8b31a8b 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -235,7 +235,7 @@ WebInspector.ScriptsPanel.prototype = {
view.visible = false;
}
if (this._attachDebuggerWhenShown) {
- InspectorController.enableDebugger(false);
+ InspectorBackend.enableDebugger(false);
delete this._attachDebuggerWhenShown;
}
},
@@ -293,7 +293,7 @@ WebInspector.ScriptsPanel.prototype = {
this.addBreakpoint(breakpoint);
if (breakpoint.enabled)
- InspectorController.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
+ InspectorBackend.addBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.condition);
}
}
}
@@ -421,7 +421,7 @@ WebInspector.ScriptsPanel.prototype = {
attachDebuggerWhenShown: function()
{
if (this.element.parentElement) {
- InspectorController.enableDebugger(false);
+ InspectorBackend.enableDebugger(false);
} else {
this._attachDebuggerWhenShown = true;
}
@@ -444,7 +444,7 @@ WebInspector.ScriptsPanel.prototype = {
delete this.currentQuery;
this.searchCanceled();
- if (!InspectorController.debuggerEnabled()) {
+ if (!InspectorBackend.debuggerEnabled()) {
this._paused = false;
this._waitingToPause = false;
this._stepping = false;
@@ -495,7 +495,7 @@ WebInspector.ScriptsPanel.prototype = {
canShowResource: function(resource)
{
- return resource && resource.scripts.length && InspectorController.debuggerEnabled();
+ return resource && resource.scripts.length && InspectorBackend.debuggerEnabled();
},
showScript: function(script, line)
@@ -606,7 +606,7 @@ WebInspector.ScriptsPanel.prototype = {
var url = scriptOrResource.url || scriptOrResource.sourceURL;
if (url && !options.initialLoad)
- InspectorController.setSetting("LastViewedScriptFile", url);
+ InspectorFrontendHost.setSetting("LastViewedScriptFile", url);
if (!options.fromBackForwardAction) {
var oldIndex = this._currentBackForwardIndex;
@@ -709,7 +709,7 @@ WebInspector.ScriptsPanel.prototype = {
else {
// if not first item, check to see if this was the last viewed
var url = option.representedObject.url || option.representedObject.sourceURL;
- var lastURL = InspectorController.setting("LastViewedScriptFile");
+ var lastURL = InspectorFrontendHost.setting("LastViewedScriptFile");
if (url && url === lastURL)
this._showScriptOrResource(option.representedObject, {initialLoad: true});
}
@@ -781,7 +781,7 @@ WebInspector.ScriptsPanel.prototype = {
_updatePauseOnExceptionsButton: function()
{
- if (InspectorController.pauseOnExceptions()) {
+ if (InspectorBackend.pauseOnExceptions()) {
this.pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.");
this.pauseOnExceptionButton.toggled = true;
} else {
@@ -792,7 +792,7 @@ WebInspector.ScriptsPanel.prototype = {
_updateDebuggerButtons: function()
{
- if (InspectorController.debuggerEnabled()) {
+ if (InspectorBackend.debuggerEnabled()) {
this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
this.enableToggleButton.toggled = true;
this.pauseOnExceptionButton.visible = true;
@@ -871,7 +871,7 @@ WebInspector.ScriptsPanel.prototype = {
_enableDebugging: function()
{
- if (InspectorController.debuggerEnabled())
+ if (InspectorBackend.debuggerEnabled())
return;
this._toggleDebugging(this.panelEnablerView.alwaysEnabled);
},
@@ -882,15 +882,15 @@ WebInspector.ScriptsPanel.prototype = {
this._waitingToPause = false;
this._stepping = false;
- if (InspectorController.debuggerEnabled())
- InspectorController.disableDebugger(true);
+ if (InspectorBackend.debuggerEnabled())
+ InspectorBackend.disableDebugger(true);
else
- InspectorController.enableDebugger(!!optionalAlways);
+ InspectorBackend.enableDebugger(!!optionalAlways);
},
_togglePauseOnExceptions: function()
{
- InspectorController.setPauseOnExceptions(!InspectorController.pauseOnExceptions());
+ InspectorBackend.setPauseOnExceptions(!InspectorBackend.pauseOnExceptions());
this._updatePauseOnExceptionsButton();
},
@@ -899,11 +899,11 @@ WebInspector.ScriptsPanel.prototype = {
if (this._paused) {
this._paused = false;
this._waitingToPause = false;
- InspectorController.resumeDebugger();
+ InspectorBackend.resumeDebugger();
} else {
this._stepping = false;
this._waitingToPause = true;
- InspectorController.pauseInDebugger();
+ InspectorBackend.pauseInDebugger();
}
this._clearInterface();
@@ -916,7 +916,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorController.stepOverStatementInDebugger();
+ InspectorBackend.stepOverStatementInDebugger();
},
_stepIntoClicked: function()
@@ -926,7 +926,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorController.stepIntoStatementInDebugger();
+ InspectorBackend.stepIntoStatementInDebugger();
},
_stepOutClicked: function()
@@ -936,7 +936,7 @@ WebInspector.ScriptsPanel.prototype = {
this._clearInterface();
- InspectorController.stepOutOfFunctionInDebugger();
+ InspectorBackend.stepOutOfFunctionInDebugger();
}
}
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index c1b1bbf..7ab7b5b 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -97,7 +97,7 @@ WebInspector.SourceView.prototype = {
delete this._frameNeedsSetup;
this.sourceFrame.addEventListener("content loaded", this._contentLoaded, this);
- InspectorController.addResourceSourceToFrame(this.resource.identifier, this.sourceFrame.element);
+ InspectorFrontendHost.addResourceSourceToFrame(this.resource.identifier, this.sourceFrame.element);
},
_contentLoaded: function()
@@ -180,13 +180,13 @@ WebInspector.SourceView.prototype = {
{
if (isNaN(lineToSearch)) {
// Search the whole document since there was no line to search.
- this._searchResults = (InspectorController.search(this.sourceFrame.element.contentDocument, query) || []);
+ this._searchResults = (InspectorFrontendHost.search(this.sourceFrame.element.contentDocument, query) || []);
} else {
var sourceRow = this.sourceFrame.sourceRow(lineToSearch);
if (sourceRow) {
if (filterlessQuery) {
// There is still a query string, so search for that string in the line.
- this._searchResults = (InspectorController.search(sourceRow, filterlessQuery) || []);
+ this._searchResults = (InspectorFrontendHost.search(sourceRow, filterlessQuery) || []);
} else {
// Match the whole line, since there was no remaining query string to match.
var rowRange = this.sourceFrame.element.contentDocument.createRange();
@@ -196,7 +196,7 @@ WebInspector.SourceView.prototype = {
}
// Attempt to search for the whole query, just incase it matches a color like "#333".
- var wholeQueryMatches = InspectorController.search(this.sourceFrame.element.contentDocument, query);
+ var wholeQueryMatches = InspectorFrontendHost.search(this.sourceFrame.element.contentDocument, query);
if (wholeQueryMatches)
this._searchResults = this._searchResults.concat(wholeQueryMatches);
}
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index caf3a53..699e3ce 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -334,7 +334,7 @@ WebInspector.StylesSidebarPane.prototype = {
var selectedOption = this.settingsSelectElement[this.settingsSelectElement.selectedIndex];
Preferences.colorFormat = selectedOption.value;
- InspectorController.setSetting("color-format", Preferences.colorFormat);
+ InspectorFrontendHost.setSetting("color-format", Preferences.colorFormat);
for (var i = 0; i < this.sections.length; ++i)
this.sections[i].update(true);
diff --git a/WebCore/inspector/front-end/TestController.js b/WebCore/inspector/front-end/TestController.js
index 2672952..b2630ae 100644
--- a/WebCore/inspector/front-end/TestController.js
+++ b/WebCore/inspector/front-end/TestController.js
@@ -43,7 +43,7 @@ WebInspector.TestController.prototype = {
notifyDone: function(result)
{
var message = typeof result === "undefined" ? "\"<undefined>\"" : JSON.stringify(result);
- InspectorController.didEvaluateForTestInFrontend(this._callId, message);
+ InspectorBackend.didEvaluateForTestInFrontend(this._callId, message);
},
runAfterPendingDispatches: function(callback)
diff --git a/WebCore/inspector/front-end/TimelinePanel.js b/WebCore/inspector/front-end/TimelinePanel.js
index 1cafd77..ac36fa5 100644
--- a/WebCore/inspector/front-end/TimelinePanel.js
+++ b/WebCore/inspector/front-end/TimelinePanel.js
@@ -119,9 +119,9 @@ WebInspector.TimelinePanel.prototype = {
_toggleTimelineButtonClicked: function()
{
if (this.toggleTimelineButton.toggled)
- InspectorController.stopTimelineProfiler();
+ InspectorBackend.stopTimelineProfiler();
else
- InspectorController.startTimelineProfiler();
+ InspectorBackend.startTimelineProfiler();
},
timelineWasStarted: function()
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index 26924af..ae2410d 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -127,7 +127,7 @@ WebInspector.WatchExpressionsSection.prototype = {
}
}
- InspectorController.releaseWrapperObjectGroup(this._watchObjectGroupId)
+ InspectorBackend.releaseWrapperObjectGroup(this._watchObjectGroupId)
var properties = [];
// Count the properties, so we known when to call this.updateProperties()
@@ -183,7 +183,7 @@ WebInspector.WatchExpressionsSection.prototype = {
loadSavedExpressions: function()
{
- var json = InspectorController.setting("watchExpressions");
+ var json = InspectorFrontendHost.setting("watchExpressions");
if (!json)
return [];
@@ -204,7 +204,7 @@ WebInspector.WatchExpressionsSection.prototype = {
toSave.push(this.watchExpressions[i]);
var json = JSON.stringify({expressions: toSave});
- InspectorController.setSetting("watchExpressions", json);
+ InspectorFrontendHost.setSetting("watchExpressions", json);
return toSave.length;
}
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 170d935..33542a8 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -28,7 +28,8 @@
<file>InjectedScript.js</file>
<file>InjectedScriptAccess.js</file>
<file>inspector.js</file>
- <file>InspectorControllerStub.js</file>
+ <file>InspectorBackendStub.js</file>
+ <file>InspectorFrontendHostStub.js</file>
<file>KeyboardShortcut.js</file>
<file>MetricsSidebarPane.js</file>
<file>Object.js</file>
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 34df32d..56a3de7 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -34,7 +34,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="treeoutline.js"></script>
<script type="text/javascript" src="inspector.js"></script>
- <script type="text/javascript" src="InspectorControllerStub.js"></script>
+ <script type="text/javascript" src="InspectorBackendStub.js"></script>
+ <script type="text/javascript" src="InspectorFrontendHostStub.js"></script>
<script type="text/javascript" src="Object.js"></script>
<script type="text/javascript" src="KeyboardShortcut.js"></script>
<script type="text/javascript" src="TextPrompt.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 65c60ae..ce234f8 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -77,7 +77,7 @@ var WebInspector = {
get platform()
{
if (!("_platform" in this))
- this._platform = InspectorController.platform();
+ this._platform = InspectorFrontendHost.platform();
return this._platform;
},
@@ -85,7 +85,7 @@ var WebInspector = {
get port()
{
if (!("_port" in this))
- this._port = InspectorController.port();
+ this._port = InspectorFrontendHost.port();
return this._port;
},
@@ -165,13 +165,13 @@ var WebInspector = {
for (var panelName in WebInspector.panels) {
if (WebInspector.panels[panelName] == x)
- InspectorController.storeLastActivePanel(panelName);
+ InspectorBackend.storeLastActivePanel(panelName);
}
},
_createPanels: function()
{
- var hiddenPanels = (InspectorController.hiddenPanels() || "").split(',');
+ var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
if (hiddenPanels.indexOf("elements") === -1)
this.panels.elements = new WebInspector.ElementsPanel();
if (hiddenPanels.indexOf("resources") === -1)
@@ -193,15 +193,15 @@ var WebInspector = {
_loadPreferences: function()
{
- var colorFormat = InspectorController.setting("color-format");
+ var colorFormat = InspectorFrontendHost.setting("color-format");
if (colorFormat)
Preferences.colorFormat = colorFormat;
- var eventListenersFilter = InspectorController.setting("event-listeners-filter");
+ var eventListenersFilter = InspectorFrontendHost.setting("event-listeners-filter");
if (eventListenersFilter)
Preferences.eventListenersFilter = eventListenersFilter;
- var resourcesLargeRows = InspectorController.setting("resources-large-rows");
+ var resourcesLargeRows = InspectorFrontendHost.setting("resources-large-rows");
if (typeof resourcesLargeRows !== "undefined")
Preferences.resourcesLargeRows = resourcesLargeRows;
},
@@ -224,12 +224,12 @@ var WebInspector = {
var body = document.body;
if (x) {
- InspectorController.attach();
+ InspectorFrontendHost.attach();
body.removeStyleClass("detached");
body.addStyleClass("attached");
dockToggleButton.title = WebInspector.UIString("Undock into separate window.");
} else {
- InspectorController.detach();
+ InspectorFrontendHost.detach();
body.removeStyleClass("attached");
body.addStyleClass("detached");
dockToggleButton.title = WebInspector.UIString("Dock to main window.");
@@ -398,10 +398,10 @@ var WebInspector = {
}
if (this._hoveredDOMNode) {
- InspectorController.highlightDOMNode(this._hoveredDOMNode.id);
+ InspectorBackend.highlightDOMNode(this._hoveredDOMNode.id);
this.showingDOMNodeHighlight = true;
} else {
- InspectorController.hideDOMNodeHighlight();
+ InspectorBackend.hideDOMNodeHighlight();
this.showingDOMNodeHighlight = false;
}
}
@@ -508,12 +508,12 @@ WebInspector.loaded = function()
document.getElementById("close-button-left").addEventListener("click", this.close, true);
document.getElementById("close-button-right").addEventListener("click", this.close, true);
- InspectorController.loaded();
+ InspectorFrontendHost.loaded();
}
var windowLoaded = function()
{
- var localizedStringsURL = InspectorController.localizedStringsURL();
+ var localizedStringsURL = InspectorFrontendHost.localizedStringsURL();
if (localizedStringsURL) {
var localizedStringsScriptElement = document.createElement("script");
localizedStringsScriptElement.addEventListener("load", WebInspector.loaded.bind(WebInspector), false);
@@ -546,7 +546,7 @@ WebInspector.dispatch = function() {
WebInspector.windowUnload = function(event)
{
- InspectorController.windowUnloading();
+ InspectorFrontendHost.windowUnloading();
}
WebInspector.windowResize = function(event)
@@ -586,7 +586,7 @@ WebInspector.setAttachedWindow = function(attached)
WebInspector.close = function(event)
{
- InspectorController.closeWindow();
+ InspectorFrontendHost.closeWindow();
}
WebInspector.documentClick = function(event)
@@ -909,14 +909,14 @@ WebInspector.toolbarDrag = function(event)
if (WebInspector.attached) {
var height = window.innerHeight - (event.screenY - toolbar.lastScreenY);
- InspectorController.setAttachedWindowHeight(height);
+ InspectorFrontendHost.setAttachedWindowHeight(height);
} else {
var x = event.screenX - toolbar.lastScreenX;
var y = event.screenY - toolbar.lastScreenY;
// We cannot call window.moveBy here because it restricts the movement
// of the window at the edges.
- InspectorController.moveByUnrestricted(x, y);
+ InspectorFrontendHost.moveWindowBy(x, y);
}
toolbar.lastScreenX = event.screenX;
@@ -1640,7 +1640,7 @@ WebInspector.UIString = function(string)
string = window.localizedStrings[string];
else {
if (!(string in this.missingLocalizedStrings)) {
- if (!WebInspector.InspectorControllerStub)
+ if (!WebInspector.InspectorBackendStub)
console.error("Localized string \"" + string + "\" not found.");
this.missingLocalizedStrings[string] = true;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list