diff options
author | Iain Merrick <husky@google.com> | 2010-09-13 16:35:48 +0100 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-09-16 12:10:42 +0100 |
commit | 5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch) | |
tree | ddce1aa5e3b6967a69691892e500897558ff8ab6 /WebCore/inspector | |
parent | 12bec63ec71e46baba27f0bd9bd9d8067683690a (diff) | |
download | external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2 |
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebCore/inspector')
31 files changed, 528 insertions, 246 deletions
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm index d76fbd3..c7907b4 100644 --- a/WebCore/inspector/CodeGeneratorInspector.pm +++ b/WebCore/inspector/CodeGeneratorInspector.pm @@ -533,7 +533,7 @@ WebInspector.InspectorBackendStub.prototype = { } if (args.length === 1) { - if (typeof args[0] !== "function") { + if (typeof args[0] !== "function" && typeof args[0] !== "undefined") { console.error("Protocol Error: Optional callback argument for 'InspectorBackend.%s' call should be a function but its type is '%s'.", request.command, typeof args[0]); return; } diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl index ff1c2af..169b188 100644 --- a/WebCore/inspector/Inspector.idl +++ b/WebCore/inspector/Inspector.idl @@ -40,10 +40,9 @@ module core { [notify] void childNodeCountUpdated(out long id, out int newValue); [notify] void childNodeInserted(out long parentId, out long prevId, out Object node); [notify] void childNodeRemoved(out long parentId, out long id); - [notify] void close(); [notify] void didCommitLoad(); [notify] void evaluateForTestInFrontend(out long testCallId, out String script); - [notify] void inspectedPageDestroyed(); + [notify] void disconnectFromBackend(); [notify] void inspectedURLChanged(out String url); [notify] void monitoringXHRWasEnabled(); [notify] void monitoringXHRWasDisabled(); @@ -73,7 +72,7 @@ module core { [notify] void debuggerWasDisabled(); [notify] void failedToParseScriptSource(out String url, out String data, out int firstLine, out int errorLine, out String errorMessage); [notify] void parsedScriptSource(out String sourceID, out String url, out String data, out int firstLine, out int scriptWorldType); - [notify] void pausedScript(out Value callFrames); + [notify] void pausedScript(out Object details); [notify] void profilerWasEnabled(); [notify] void profilerWasDisabled(); [notify] void restoredBreakpoint(out String sourceID, out String url, out int line, out boolean enabled, out String condition); diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp index 7fb052c..1e131f7 100644 --- a/WebCore/inspector/InspectorController.cpp +++ b/WebCore/inspector/InspectorController.cpp @@ -59,11 +59,12 @@ #include "InspectorBackendDispatcher.h" #include "InspectorCSSStore.h" #include "InspectorClient.h" -#include "InspectorFrontend.h" -#include "InspectorFrontendClient.h" +#include "InspectorDOMAgent.h" #include "InspectorDOMStorageResource.h" #include "InspectorDatabaseResource.h" #include "InspectorDebuggerAgent.h" +#include "InspectorFrontend.h" +#include "InspectorFrontendClient.h" #include "InspectorProfilerAgent.h" #include "InspectorResource.h" #include "InspectorStorageAgent.h" @@ -198,7 +199,7 @@ InspectorController::~InspectorController() void InspectorController::inspectedPageDestroyed() { if (m_frontend) - m_frontend->inspectedPageDestroyed(); + m_frontend->disconnectFromBackend(); hideHighlight(); @@ -537,7 +538,8 @@ void InspectorController::close() { if (!m_frontend) return; - m_frontend->close(); + m_frontend->disconnectFromBackend(); + disconnectFrontend(); } void InspectorController::disconnectFrontend() @@ -1843,6 +1845,58 @@ void InspectorController::reloadPage() m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true); } +void InspectorController::willInsertDOMNodeImpl(Node* node, Node* parent) +{ +#if ENABLE(JAVASCRIPT_DEBUGGER) + if (!m_debuggerAgent || !m_domAgent) + return; + PassRefPtr<InspectorValue> details; + if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &details)) + m_debuggerAgent->breakProgram(details); +#endif +} + +void InspectorController::didInsertDOMNodeImpl(Node* node) +{ + if (m_domAgent) + m_domAgent->didInsertDOMNode(node); +} + +void InspectorController::willRemoveDOMNodeImpl(Node* node) +{ +#if ENABLE(JAVASCRIPT_DEBUGGER) + if (!m_debuggerAgent || !m_domAgent) + return; + PassRefPtr<InspectorValue> details; + if (m_domAgent->shouldBreakOnNodeRemoval(node, &details)) + m_debuggerAgent->breakProgram(details); +#endif +} + +void InspectorController::didRemoveDOMNodeImpl(Node* node) +{ + if (m_domAgent) + m_domAgent->didRemoveDOMNode(node); +} + +void InspectorController::willModifyDOMAttrImpl(Element* element) +{ +#if ENABLE(JAVASCRIPT_DEBUGGER) + if (!m_debuggerAgent || !m_domAgent) + return; + PassRefPtr<InspectorValue> details; + if (m_domAgent->shouldBreakOnAttributeModification(element, &details)) + m_debuggerAgent->breakProgram(details); +#endif +} + +void InspectorController::didModifyDOMAttrImpl(Element* element) +{ + if (m_domAgent) + m_domAgent->didModifyDOMAttr(element); +} + + } // namespace WebCore #endif // ENABLE(INSPECTOR) diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h index 7ed2549..40099c6 100644 --- a/WebCore/inspector/InspectorController.h +++ b/WebCore/inspector/InspectorController.h @@ -31,7 +31,8 @@ #include "Console.h" #include "Cookie.h" -#include "InspectorDOMAgent.h" +#include "Element.h" +#include "Page.h" #include "PlatformString.h" #include "ScriptState.h" #include <wtf/HashMap.h> @@ -58,6 +59,7 @@ class InspectorBackend; class InspectorBackendDispatcher; class InspectorClient; class InspectorCSSStore; +class InspectorDOMAgent; class InspectorDOMStorageResource; class InspectorDatabaseResource; class InspectorDebuggerAgent; @@ -183,9 +185,12 @@ public: void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&); void mainResourceFiredDOMContentEvent(DocumentLoader*, const KURL&); - void didInsertDOMNode(Node*); - void didRemoveDOMNode(Node*); - void didModifyDOMAttr(Element*); + static void willInsertDOMNode(Node* node, Node* parent); + static void didInsertDOMNode(Node*); + static void willRemoveDOMNode(Node*); + static void willModifyDOMAttr(Element*); + static void didModifyDOMAttr(Element*); + #if ENABLE(WORKERS) enum WorkerAction { WorkerCreated, WorkerDestroyed }; @@ -306,6 +311,14 @@ private: void didEvaluateForTestInFrontend(long callId, const String& jsonResult); + static InspectorController* inspectorControllerForNode(Node*); + void willInsertDOMNodeImpl(Node* node, Node* parent); + void didInsertDOMNodeImpl(Node*); + void willRemoveDOMNodeImpl(Node*); + void didRemoveDOMNodeImpl(Node*); + void willModifyDOMAttrImpl(Element*); + void didModifyDOMAttrImpl(Element*); + #if ENABLE(JAVASCRIPT_DEBUGGER) friend class InspectorDebuggerAgent; String breakpointsSettingKey(); @@ -376,30 +389,62 @@ private: #endif }; +inline void InspectorController::willInsertDOMNode(Node* node, Node* parent) +{ +#if ENABLE(INSPECTOR) + if (InspectorController* inspectorController = inspectorControllerForNode(parent)) + inspectorController->willInsertDOMNodeImpl(node, parent); +#endif +} + inline void InspectorController::didInsertDOMNode(Node* node) { #if ENABLE(INSPECTOR) - if (m_domAgent) - m_domAgent->didInsertDOMNode(node); + if (InspectorController* inspectorController = inspectorControllerForNode(node)) + inspectorController->didInsertDOMNodeImpl(node); +#endif +} + +inline void InspectorController::willRemoveDOMNode(Node* node) +{ +#if ENABLE(INSPECTOR) + if (InspectorController* inspectorController = inspectorControllerForNode(node)) { + inspectorController->willRemoveDOMNodeImpl(node); + inspectorController->didRemoveDOMNodeImpl(node); + } #endif } -inline void InspectorController::didRemoveDOMNode(Node* node) +inline void InspectorController::willModifyDOMAttr(Element* element) { #if ENABLE(INSPECTOR) - if (m_domAgent) - m_domAgent->didRemoveDOMNode(node); + if (InspectorController* inspectorController = inspectorControllerForNode(element)) + inspectorController->willModifyDOMAttrImpl(element); #endif } inline void InspectorController::didModifyDOMAttr(Element* element) { #if ENABLE(INSPECTOR) - if (m_domAgent) - m_domAgent->didModifyDOMAttr(element); + if (InspectorController* inspectorController = inspectorControllerForNode(element)) + inspectorController->didModifyDOMAttrImpl(element); #endif } +inline InspectorController* InspectorController::inspectorControllerForNode(Node* node) +{ +#if ENABLE(INSPECTOR) + if (Page* page = node->document()->page()) { + if (InspectorController* inspectorController = page->inspectorController()) { + if (inspectorController->hasFrontend()) + return inspectorController; + } + } +#endif + + return 0; +} + } // namespace WebCore #endif // !defined(InspectorController_h) diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp index d2760e4..23c22aa 100644 --- a/WebCore/inspector/InspectorDOMAgent.cpp +++ b/WebCore/inspector/InspectorDOMAgent.cpp @@ -64,7 +64,6 @@ #include "PlatformString.h" #include "RenderStyle.h" #include "RenderStyleConstants.h" -#include "ScriptDebugServer.h" #include "ScriptEventListener.h" #include "StyleSheetList.h" #include "Text.h" @@ -210,8 +209,6 @@ const int domBreakpointDerivedTypeShift = 16; } -InspectorDOMAgent* InspectorDOMAgent::s_domAgentOnBreakpoint = 0; - InspectorDOMAgent::InspectorDOMAgent(InspectorCSSStore* cssStore, InspectorFrontend* frontend) : EventListener(InspectorDOMAgentType) , m_cssStore(cssStore) @@ -224,9 +221,6 @@ InspectorDOMAgent::InspectorDOMAgent(InspectorCSSStore* cssStore, InspectorFront InspectorDOMAgent::~InspectorDOMAgent() { reset(); - - if (this == s_domAgentOnBreakpoint) - s_domAgentOnBreakpoint = 0; } void InspectorDOMAgent::reset() @@ -780,6 +774,42 @@ void InspectorDOMAgent::removeDOMBreakpoint(long nodeId, long type) } } +bool InspectorDOMAgent::shouldBreakOnNodeInsertion(Node*, Node* parent, PassRefPtr<InspectorValue>* details) +{ + if (!hasBreakpoint(parent, SubtreeModified)) + return false; + RefPtr<InspectorObject> detailsObject = InspectorObject::create(); + detailsObject->setObject("breakpoint", createBreakpoint(parent, SubtreeModified)); + *details = detailsObject; + return true; +} + +bool InspectorDOMAgent::shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorValue>* details) +{ + bool hasNodeRemovedBreakpoint = hasBreakpoint(node, NodeRemoved); + bool hasAnyBreakpoint = hasNodeRemovedBreakpoint || hasBreakpoint(innerParentNode(node), SubtreeModified); + if (!hasAnyBreakpoint) + return false; + + RefPtr<InspectorObject> detailsObject = InspectorObject::create(); + if (hasNodeRemovedBreakpoint) + detailsObject->setObject("breakpoint", createBreakpoint(node, NodeRemoved)); + else + detailsObject->setObject("breakpoint", createBreakpoint(innerParentNode(node), SubtreeModified)); + *details = detailsObject; + return true; +} + +bool InspectorDOMAgent::shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorValue>* details) +{ + if (!hasBreakpoint(element, AttributeModified)) + return false; + RefPtr<InspectorObject> detailsObject = InspectorObject::create(); + detailsObject->setObject("breakpoint", createBreakpoint(element, AttributeModified)); + *details = detailsObject; + return true; +} + String InspectorDOMAgent::documentURLString(Document* document) const { if (!document || document->url().isNull()) @@ -985,12 +1015,7 @@ void InspectorDOMAgent::didInsertDOMNode(Node* node) return; if (m_breakpoints.size()) { - Node* parent = innerParentNode(node); - if (hasBreakpoint(parent, SubtreeModified)) { - if (!pauseOnBreakpoint()) - return; - } - uint32_t mask = m_breakpoints.get(parent); + uint32_t mask = m_breakpoints.get(innerParentNode(node)); uint32_t inheritableTypesMask = (mask | (mask >> domBreakpointDerivedTypeShift)) & inheritableDOMBreakpointTypesMask; if (inheritableTypesMask) updateSubtreeBreakpoints(node, inheritableTypesMask, true); @@ -1023,10 +1048,6 @@ void InspectorDOMAgent::didRemoveDOMNode(Node* node) return; if (m_breakpoints.size()) { - if (hasBreakpoint(node, NodeRemoved) || hasBreakpoint(innerParentNode(node), SubtreeModified)) { - if (!pauseOnBreakpoint()) - return; - } // Remove subtree breakpoints. m_breakpoints.remove(node); Vector<Node*> stack(1, innerFirstChild(node)); @@ -1063,12 +1084,24 @@ void InspectorDOMAgent::didModifyDOMAttr(Element* element) if (!id) return; - if (hasBreakpoint(element, AttributeModified)) { - if (!pauseOnBreakpoint()) - return; + m_frontend->attributesUpdated(id, buildArrayForElementAttributes(element)); +} + +PassRefPtr<InspectorObject> InspectorDOMAgent::createBreakpoint(Node* node, long type) +{ + RefPtr<InspectorObject> breakpoint = InspectorObject::create(); + + // Find breakpoint owner. + while (!(m_breakpoints.get(node) & (1 << type))) { + node = innerParentNode(node); + ASSERT(node); } + long nodeId = m_documentNodeToIdMap.get(node); + ASSERT(nodeId); - m_frontend->attributesUpdated(id, buildArrayForElementAttributes(element)); + breakpoint->setNumber("nodeId", nodeId); + breakpoint->setNumber("type", type); + return breakpoint.release(); } bool InspectorDOMAgent::hasBreakpoint(Node* node, long type) @@ -1078,19 +1111,6 @@ bool InspectorDOMAgent::hasBreakpoint(Node* node, long type) return m_breakpoints.get(node) & (rootBit | derivedBit); } -bool InspectorDOMAgent::pauseOnBreakpoint() -{ -#if ENABLE(JAVASCRIPT_DEBUGGER) - s_domAgentOnBreakpoint = this; - ScriptDebugServer::shared().breakProgram(); - bool deleted = !s_domAgentOnBreakpoint; - s_domAgentOnBreakpoint = 0; - return !deleted; -#else - return true; -#endif -} - void InspectorDOMAgent::updateSubtreeBreakpoints(Node* node, uint32_t rootMask, bool set) { uint32_t oldMask = m_breakpoints.get(node); diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h index fd3c5b5..9751e8e 100644 --- a/WebCore/inspector/InspectorDOMAgent.h +++ b/WebCore/inspector/InspectorDOMAgent.h @@ -36,7 +36,6 @@ #include "InspectorCSSStore.h" #include "InspectorValues.h" #include "NodeList.h" -#include "ScriptState.h" #include "Timer.h" #include <wtf/Deque.h> @@ -114,6 +113,9 @@ namespace WebCore { void searchCanceled(); void setDOMBreakpoint(long nodeId, long type); void removeDOMBreakpoint(long nodeId, long type); + bool shouldBreakOnNodeInsertion(Node* node, Node* parent, PassRefPtr<InspectorValue>* details); + bool shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorValue>* details); + bool shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorValue>* details); // Methods called from the frontend for CSS styles inspection. void getStyles(long nodeId, bool authorOnly, RefPtr<InspectorValue>* styles); @@ -160,7 +162,7 @@ namespace WebCore { bool pushDocumentToFrontend(); bool hasBreakpoint(Node* node, long type); - bool pauseOnBreakpoint(); + PassRefPtr<InspectorObject> createBreakpoint(Node* node, long type); void updateSubtreeBreakpoints(Node* root, uint32_t rootMask, bool value); PassRefPtr<InspectorObject> buildObjectForAttributeStyles(Element* element); @@ -217,8 +219,6 @@ namespace WebCore { HashSet<RefPtr<Node> > m_searchResults; Vector<long> m_inspectedNodes; HashMap<Node*, uint32_t> m_breakpoints; - - static InspectorDOMAgent* s_domAgentOnBreakpoint; }; #endif diff --git a/WebCore/inspector/InspectorDebuggerAgent.cpp b/WebCore/inspector/InspectorDebuggerAgent.cpp index 357a043..fd9fdf3 100644 --- a/WebCore/inspector/InspectorDebuggerAgent.cpp +++ b/WebCore/inspector/InspectorDebuggerAgent.cpp @@ -56,11 +56,14 @@ PassOwnPtr<InspectorDebuggerAgent> InspectorDebuggerAgent::create(InspectorContr return agent.release(); } +InspectorDebuggerAgent* InspectorDebuggerAgent::s_debuggerAgentOnBreakpoint = 0; + InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorController, InspectorFrontend* frontend) : m_inspectorController(inspectorController) , m_frontend(frontend) , m_pausedScriptState(0) , m_breakpointsLoaded(false) + , m_breakProgramReason(InspectorValue::null()) { } @@ -68,6 +71,9 @@ InspectorDebuggerAgent::~InspectorDebuggerAgent() { ScriptDebugServer::shared().removeListener(this, m_inspectorController->inspectedPage()); m_pausedScriptState = 0; + + if (this == s_debuggerAgentOnBreakpoint) + s_debuggerAgentOnBreakpoint = 0; } bool InspectorDebuggerAgent::isDebuggerAlwaysEnabled() @@ -282,9 +288,12 @@ void InspectorDebuggerAgent::failedToParseSource(const String& url, const String void InspectorDebuggerAgent::didPause(ScriptState* scriptState) { ASSERT(scriptState && !m_pausedScriptState); + ASSERT(m_breakProgramReason); m_pausedScriptState = scriptState; - RefPtr<InspectorValue> callFrames = currentCallFrames(); - m_frontend->pausedScript(callFrames.get()); + RefPtr<InspectorObject> details = InspectorObject::create(); + details->setValue("callFrames", currentCallFrames()); + details->setValue("reason", m_breakProgramReason); + m_frontend->pausedScript(details); } void InspectorDebuggerAgent::didContinue() @@ -293,6 +302,19 @@ void InspectorDebuggerAgent::didContinue() m_frontend->resumedScript(); } +void InspectorDebuggerAgent::breakProgram(PassRefPtr<InspectorValue> reason) +{ + s_debuggerAgentOnBreakpoint = this; + m_breakProgramReason = reason; + + ScriptDebugServer::shared().breakProgram(); + if (!s_debuggerAgentOnBreakpoint) + return; + + s_debuggerAgentOnBreakpoint = 0; + m_breakProgramReason = InspectorValue::null(); +} + } // namespace WebCore #endif // ENABLE(JAVASCRIPT_DEBUGGER) diff --git a/WebCore/inspector/InspectorDebuggerAgent.h b/WebCore/inspector/InspectorDebuggerAgent.h index 91bcd49..79b0a0e 100644 --- a/WebCore/inspector/InspectorDebuggerAgent.h +++ b/WebCore/inspector/InspectorDebuggerAgent.h @@ -61,6 +61,7 @@ public: void getScriptSource(const String& sourceID, String* scriptSource); void pause(); + void breakProgram(PassRefPtr<InspectorValue> reason); void resume(); void stepOverStatement(); void stepIntoStatement(); @@ -93,6 +94,8 @@ private: HashMap<String, SourceBreakpoints> m_stickyBreakpoints; HashMap<String, unsigned> m_breakpointsMapping; bool m_breakpointsLoaded; + static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint; + RefPtr<InspectorValue> m_breakProgramReason; }; } // namespace WebCore diff --git a/WebCore/inspector/InspectorFrontendClient.h b/WebCore/inspector/InspectorFrontendClient.h index cbbbc53..31f52b7 100644 --- a/WebCore/inspector/InspectorFrontendClient.h +++ b/WebCore/inspector/InspectorFrontendClient.h @@ -53,6 +53,7 @@ public: virtual void bringToFront() = 0; virtual void closeWindow() = 0; + virtual void disconnectFromBackend() = 0; virtual void requestAttachWindow() = 0; virtual void requestDetachWindow() = 0; diff --git a/WebCore/inspector/InspectorFrontendHost.cpp b/WebCore/inspector/InspectorFrontendHost.cpp index 8dc00ae..bc529ea 100644 --- a/WebCore/inspector/InspectorFrontendHost.cpp +++ b/WebCore/inspector/InspectorFrontendHost.cpp @@ -166,6 +166,14 @@ void InspectorFrontendHost::closeWindow() } } +void InspectorFrontendHost::disconnectFromBackend() +{ + if (m_client) { + m_client->disconnectFromBackend(); + disconnectClient(); // Disconnect from client. + } +} + void InspectorFrontendHost::bringToFront() { if (m_client) diff --git a/WebCore/inspector/InspectorFrontendHost.h b/WebCore/inspector/InspectorFrontendHost.h index 4b343fd..d333893 100644 --- a/WebCore/inspector/InspectorFrontendHost.h +++ b/WebCore/inspector/InspectorFrontendHost.h @@ -62,6 +62,7 @@ public: void requestAttachWindow(); void requestDetachWindow(); void closeWindow(); + void disconnectFromBackend(); void bringToFront(); void inspectedURLChanged(const String&); diff --git a/WebCore/inspector/InspectorFrontendHost.idl b/WebCore/inspector/InspectorFrontendHost.idl index 0c7cf8b..6853c7d 100644 --- a/WebCore/inspector/InspectorFrontendHost.idl +++ b/WebCore/inspector/InspectorFrontendHost.idl @@ -34,6 +34,7 @@ module core { interface [Conditional=INSPECTOR] InspectorFrontendHost { void loaded(); void closeWindow(); + void disconnectFromBackend(); void bringToFront(); void inspectedURLChanged(in DOMString newURL); diff --git a/WebCore/inspector/InspectorResource.cpp b/WebCore/inspector/InspectorResource.cpp index 131ce95..be77827 100644 --- a/WebCore/inspector/InspectorResource.cpp +++ b/WebCore/inspector/InspectorResource.cpp @@ -35,7 +35,7 @@ #include "Cache.h" #include "CachedResource.h" -#include "DocLoader.h" +#include "CachedResourceLoader.h" #include "DocumentLoader.h" #include "Frame.h" #include "InspectorFrontend.h" @@ -264,11 +264,11 @@ void InspectorResource::releaseScriptObject(InspectorFrontend* frontend) CachedResource* InspectorResource::cachedResource() const { - // Try hard to find a corresponding CachedResource. During preloading, DocLoader may not have the resource in document resources set yet, + // Try hard to find a corresponding CachedResource. During preloading, CachedResourceLoader may not have the resource in document resources set yet, // but Inspector will already try to fetch data that is only available via CachedResource (and it won't update once the resource is added, // because m_changes will not have the appropriate bits set). const String& url = m_requestURL.string(); - CachedResource* cachedResource = m_frame->document()->docLoader()->cachedResource(url); + CachedResource* cachedResource = m_frame->document()->cachedResourceLoader()->cachedResource(url); if (!cachedResource) cachedResource = cache()->resourceForURL(url); return cachedResource; diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h index 3dd9594..4036f55 100644 --- a/WebCore/inspector/InspectorValues.h +++ b/WebCore/inspector/InspectorValues.h @@ -67,6 +67,8 @@ public: Type type() const { return m_type; } + bool isNull() const { return m_type == TypeNull; } + virtual bool asBoolean(bool* output) const; virtual bool asNumber(double* output) const; virtual bool asNumber(long* output) const; diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js index 3a0860f..cda72fb 100644 --- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js +++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js @@ -106,7 +106,7 @@ WebInspector.BreakpointItem = function(breakpoint) this._element.appendChild(checkboxElement); this._breakpoint.addEventListener("enable-changed", this._enableChanged, this); - this._breakpoint.addEventListener("removed", this._removed, this); + this._breakpoint.addEventListener("removed", this.dispatchEventToListeners.bind(this, "removed")); } WebInspector.BreakpointItem.prototype = { @@ -128,15 +128,10 @@ WebInspector.BreakpointItem.prototype = { event.stopPropagation(); }, - _enableChanged: function() + _enableChanged: function(event) { var checkbox = this._element.firstChild; checkbox.checked = this._breakpoint.enabled; - }, - - _removed: function() - { - this.dispatchEventToListeners("removed"); } } @@ -188,7 +183,8 @@ WebInspector.DOMBreakpointItem = function(breakpoint) { WebInspector.BreakpointItem.call(this, breakpoint); - var link = WebInspector.panels.elements.linkifyNodeReference(this._breakpoint.node); + var node = WebInspector.domAgent.nodeForId(this._breakpoint.nodeId); + var link = WebInspector.panels.elements.linkifyNodeReference(node); this._element.appendChild(link); var type = WebInspector.DOMBreakpoint.labelForType(this._breakpoint.type); diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js index 5aaa0d3..9b386c3 100644 --- a/WebCore/inspector/front-end/DOMAgent.js +++ b/WebCore/inspector/front-end/DOMAgent.js @@ -143,6 +143,40 @@ WebInspector.DOMNode.prototype = { this.ownerDocument._domAgent.removeAttributeAsync(this, name, callback); }, + path: function() + { + var path = []; + var node = this; + while (node && "index" in node && node.nodeName.length) { + path.push([node.index, node.nodeName]); + node = node.parentNode; + } + path.reverse(); + return path.join(","); + }, + + setBreakpoint: function(type) + { + return WebInspector.domBreakpointManager.setBreakpoint(this.id, type, true, this.path()); + }, + + hasBreakpoint: function(type) + { + return !!WebInspector.domBreakpointManager.findBreakpoint(this.id, type); + }, + + removeBreakpoint: function(type) + { + var breakpoint = WebInspector.domBreakpointManager.findBreakpoint(this.id, type); + if (breakpoint) + breakpoint.remove(); + }, + + removeBreakpoints: function() + { + WebInspector.domBreakpointManager.removeBreakpointsForNode(this.id); + }, + _setAttributesPayload: function(attrs) { this.attributes = []; @@ -362,6 +396,7 @@ WebInspector.DOMAgent.prototype = { this.document = new WebInspector.DOMDocument(this, this._window, payload); this._idToDOMNode[payload.id] = this.document; this._bindNodes(this.document.children); + WebInspector.domBreakpointManager.restoreBreakpoints(); } else this.document = null; WebInspector.panels.elements.setDocument(this.document); @@ -418,7 +453,17 @@ WebInspector.DOMAgent.prototype = { var event = { target : node, relatedNode : parent }; this.document._fireDomEvent("DOMNodeRemoved", event); delete this._idToDOMNode[nodeId]; - } + this._removeBreakpoints(node); + }, + + _removeBreakpoints: function(node) + { + node.removeBreakpoints(); + if (!node.children) + return; + for (var i = 0; i < node.children.length; ++i) + this._removeBreakpoints(node.children[i]); + } } WebInspector.ApplicationCache = {} @@ -679,20 +724,24 @@ WebInspector.childNodeRemoved = function() WebInspector.DOMBreakpointManager = function() { this._breakpoints = {}; + this._pathCache = {}; } WebInspector.DOMBreakpointManager.prototype = { - setBreakpoint: function(node, type) + setBreakpoint: function(nodeId, type, enabled, path) { - if (!(node.id in this._breakpoints)) - this._breakpoints[node.id] = {}; - else if (type in this._breakpoints[node.id]) + if (!(nodeId in this._breakpoints)) + this._breakpoints[nodeId] = {}; + else if (type in this._breakpoints[nodeId]) return; - var breakpoint = new WebInspector.DOMBreakpoint(node, type); - this._breakpoints[node.id][type] = breakpoint; + var breakpoint = new WebInspector.DOMBreakpoint(nodeId, type, enabled); + this._breakpoints[nodeId][type] = breakpoint; breakpoint.addEventListener("removed", this._breakpointRemoved, this); + if (!(nodeId in this._pathCache)) + this._pathCache[nodeId] = path; + this.dispatchEventToListeners("dom-breakpoint-added", breakpoint); }, @@ -703,9 +752,9 @@ WebInspector.DOMBreakpointManager.prototype = { return nodeBreakpoints[type]; }, - removeBreakpointsForNode: function(node) + removeBreakpointsForNode: function(nodeId) { - var nodeBreakpoints = this._breakpoints[node.id]; + var nodeBreakpoints = this._breakpoints[nodeId]; for (var type in nodeBreakpoints) nodeBreakpoints[type].remove(); }, @@ -714,23 +763,49 @@ WebInspector.DOMBreakpointManager.prototype = { { var breakpoint = event.target; - var nodeBreakpoints = this._breakpoints[breakpoint.node.id]; + var nodeBreakpoints = this._breakpoints[breakpoint.nodeId]; delete nodeBreakpoints[breakpoint.type]; for (var type in nodeBreakpoints) return; - delete this._breakpoints[breakpoint.node.id]; + + delete this._breakpoints[breakpoint.nodeId]; + delete this._pathCache[breakpoint.nodeId]; + }, + + restoreBreakpoints: function() + { + var breakpoints = this._breakpoints; + this._breakpoints = {}; + var pathCache = this._pathCache; + this._pathCache = {}; + + for (var oldNodeId in breakpoints) { + var path = pathCache[oldNodeId]; + InspectorBackend.pushNodeByPathToFrontend(path, restoreBreakpointsForNode.bind(this, breakpoints[oldNodeId], path)); + } + + function restoreBreakpointsForNode(nodeBreakpoints, path, nodeId) + { + if (!nodeId) + return; + for (var type in nodeBreakpoints) { + var breakpoint = nodeBreakpoints[type]; + this.setBreakpoint(nodeId, breakpoint.type, breakpoint.enabled, path); + } + } } } WebInspector.DOMBreakpointManager.prototype.__proto__ = WebInspector.Object.prototype; -WebInspector.DOMBreakpoint = function(node, type) +WebInspector.DOMBreakpoint = function(nodeId, type, enabled) { - this.node = node; - this.type = type; - this._enabled = true; + this._nodeId = nodeId; + this._type = type; + this._enabled = enabled; - InspectorBackend.setDOMBreakpoint(this.node.id, this.type); + if (this.enabled) + InspectorBackend.setDOMBreakpoint(this.nodeId, this.type); } WebInspector.DOMBreakpoint.Types = { @@ -762,6 +837,16 @@ WebInspector.DOMBreakpoint.contextMenuLabelForType = function(type) } WebInspector.DOMBreakpoint.prototype = { + get nodeId() + { + return this._nodeId; + }, + + get type() + { + return this._type; + }, + get enabled() { return this._enabled; @@ -773,18 +858,18 @@ WebInspector.DOMBreakpoint.prototype = { return; this._enabled = enabled; - if (this._enabled) - InspectorBackend.setDOMBreakpoint(this.node.id, this.type); + if (this.enabled) + InspectorBackend.setDOMBreakpoint(this.nodeId, this.type); else - InspectorBackend.removeDOMBreakpoint(this.node.id, this.type); + InspectorBackend.removeDOMBreakpoint(this.nodeId, this.type); this.dispatchEventToListeners("enable-changed"); }, remove: function() { - if (this._enabled) - InspectorBackend.removeDOMBreakpoint(this.node.id, this.type); + if (this.enabled) + InspectorBackend.removeDOMBreakpoint(this.nodeId, this.type); this.dispatchEventToListeners("removed"); } } diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js index e1bc637..c60d4b1 100644 --- a/WebCore/inspector/front-end/ElementsPanel.js +++ b/WebCore/inspector/front-end/ElementsPanel.js @@ -159,16 +159,8 @@ WebInspector.ElementsPanel.prototype = { reset: function() { - if (this.focusedDOMNode) { - this._selectedPathOnReset = []; - var node = this.focusedDOMNode; - while ("index" in node && node.nodeName && node.nodeName.length) { - this._selectedPathOnReset.push(node.nodeName); - this._selectedPathOnReset.push(node.index); - node = node.parentNode; - } - this._selectedPathOnReset.reverse(); - } + if (this.focusedDOMNode) + this._selectedPathOnReset = this.focusedDOMNode.path(); this.rootDOMNode = null; this.focusedDOMNode = null; @@ -225,7 +217,7 @@ WebInspector.ElementsPanel.prototype = { } if (this._selectedPathOnReset) - InspectorBackend.pushNodeByPathToFrontend(this._selectedPathOnReset.join(","), selectLastSelectedNode.bind(this)); + InspectorBackend.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this)); else selectNode.call(this); delete this._selectedPathOnReset; diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js index ba3b320..10131f4 100644 --- a/WebCore/inspector/front-end/ElementsTreeOutline.js +++ b/WebCore/inspector/front-end/ElementsTreeOutline.js @@ -765,15 +765,17 @@ WebInspector.ElementsTreeElement.prototype = { if (Preferences.domBreakpointsEnabled) { // Add debbuging-related actions contextMenu.appendSeparator(); - for (var type in WebInspector.DOMBreakpoint.Types) { - var typeId = WebInspector.DOMBreakpoint.Types[type]; - var label = WebInspector.DOMBreakpoint.contextMenuLabelForType(typeId); - var breakpoint = WebInspector.domBreakpointManager.findBreakpoint(this.representedObject.id, typeId); - if (!breakpoint) - var handler = WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, typeId); + + var node = this.representedObject; + for (var key in WebInspector.DOMBreakpoint.Types) { + var type = WebInspector.DOMBreakpoint.Types[key]; + var label = WebInspector.DOMBreakpoint.contextMenuLabelForType(type); + var hasBreakpoint = node.hasBreakpoint(type); + if (!hasBreakpoint) + var handler = node.setBreakpoint.bind(node, type); else - var handler = breakpoint.remove.bind(breakpoint); - contextMenu.appendCheckboxItem(label, handler, !!breakpoint); + var handler = node.removeBreakpoint.bind(node, type); + contextMenu.appendCheckboxItem(label, handler, hasBreakpoint); } } }, diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js index f410d8c..bdf3a25 100644 --- a/WebCore/inspector/front-end/ExtensionServer.js +++ b/WebCore/inspector/front-end/ExtensionServer.js @@ -103,7 +103,7 @@ WebInspector.ExtensionServer.prototype = { { return { id: resource.identifier, - type: resource.type, + type: WebInspector.Resource.Type.toString(resource.type), har: (new WebInspector.HAREntry(resource)).build(), }; }, @@ -321,10 +321,20 @@ WebInspector.ExtensionServer.prototype = { _buildExtensionAPIInjectedScript: function() { + var resourceTypes = {}; + var resourceTypeProperties = Object.getOwnPropertyNames(WebInspector.Resource.Type); + for (var i = 0; i < resourceTypeProperties.length; ++i) { + var propName = resourceTypeProperties[i]; + var propValue = WebInspector.Resource.Type[propName]; + if (typeof propValue === "number") + resourceTypes[propName] = WebInspector.Resource.Type.toString(propValue); + } + return "(function(){ " + "var private = {};" + "(" + WebInspector.commonExtensionSymbols.toString() + ")(private);" + "(" + WebInspector.injectedExtensionAPI.toString() + ").apply(this, arguments);" + + "webInspector.resources.Types = " + JSON.stringify(resourceTypes) + ";" + "})"; }, diff --git a/WebCore/inspector/front-end/HAREntry.js b/WebCore/inspector/front-end/HAREntry.js index c06e64f..9f188ed 100644 --- a/WebCore/inspector/front-end/HAREntry.js +++ b/WebCore/inspector/front-end/HAREntry.js @@ -116,11 +116,13 @@ WebInspector.HAREntry.prototype = { _buildPostData: function() { - return { + var res = { mimeType: this._resource.requestHeaderValue("Content-Type"), - params: this._buildParameters(this._resource.formParameters), text: this._resource.requestFormData }; + if (this._resource.formParameters) + res.params = this._buildParameters(this._resource.formParameters); + return res; }, _buildParameters: function(parameters) diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js index c4e6bf4..07f392d 100644 --- a/WebCore/inspector/front-end/InspectorFrontendHostStub.js +++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js @@ -64,6 +64,11 @@ WebInspector.InspectorFrontendHostStub.prototype = { this._windowVisible = false; }, + disconnectFromBackend: function() + { + this._windowVisible = false; + }, + attach: function() { }, diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js index 06a610d..de87047 100644 --- a/WebCore/inspector/front-end/Resource.js +++ b/WebCore/inspector/front-end/Resource.js @@ -52,24 +52,33 @@ WebInspector.Resource.Type = { return (type === this.Document) || (type === this.Stylesheet) || (type === this.Script) || (type === this.XHR); }, + toUIString: function(type) + { + return WebInspector.UIString(WebInspector.Resource.Type.toString(type)); + }, + + // Returns locale-independent string identifier of resource type (primarily for use in extension API). + // The IDs need to be kept in sync with webInspector.resoureces.Types object in ExtensionAPI.js. toString: function(type) { switch (type) { case this.Document: - return WebInspector.UIString("document"); + return "document"; case this.Stylesheet: - return WebInspector.UIString("stylesheet"); + return "stylesheet"; case this.Image: - return WebInspector.UIString("image"); + return "image"; case this.Font: - return WebInspector.UIString("font"); + return "font"; case this.Script: - return WebInspector.UIString("script"); + return "script"; case this.XHR: - return WebInspector.UIString("XHR"); + return "XHR"; + case this.Media: + return "media"; case this.Other: default: - return WebInspector.UIString("other"); + return "other"; } } } @@ -603,7 +612,7 @@ WebInspector.Resource.prototype = { this.url, null, 1, - String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message, WebInspector.Resource.Type.toString(this.type), this.mimeType), + String.sprintf(WebInspector.Warnings.IncorrectMIMEType.message, WebInspector.Resource.Type.toUIString(this.type), this.mimeType), null, null); break; diff --git a/WebCore/inspector/front-end/Script.js b/WebCore/inspector/front-end/Script.js index 42d6850..be3f020 100644 --- a/WebCore/inspector/front-end/Script.js +++ b/WebCore/inspector/front-end/Script.js @@ -62,11 +62,14 @@ WebInspector.Script.prototype = { { if (!this.source) return 0; + if (this._linesCount) + return this._linesCount; this._linesCount = 0; var lastIndex = this.source.indexOf("\n"); while (lastIndex !== -1) { lastIndex = this.source.indexOf("\n", lastIndex + 1) this._linesCount++; } + return this._linesCount; } } diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js index 75fd6f7..c5267f7 100644 --- a/WebCore/inspector/front-end/ScriptsPanel.js +++ b/WebCore/inspector/front-end/ScriptsPanel.js @@ -276,14 +276,6 @@ WebInspector.ScriptsPanel.prototype = { // Remove script from the files list. script.filesSelectOption.parentElement.removeChild(script.filesSelectOption); - - // Move breakpoints to the resource's frame. - if (script._scriptView) { - var sourceFrame = script._scriptView.sourceFrame; - var resourceFrame = this._sourceFrameForScriptOrResource(resource); - for (var j = 0; j < sourceFrame.breakpoints; ++j) - resourceFrame.addBreakpoint(sourceFrame.breakpoints[j]); - } } // Adding first script will add resource. this._addScriptToFilesMenu(resource._scriptsPendingResourceLoad[0]); @@ -599,10 +591,6 @@ WebInspector.ScriptsPanel.prototype = { return null; view = WebInspector.panels.resources.resourceViewForResource(scriptOrResource); view.headersVisible = false; - var sourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource); - var breakpoints = WebInspector.breakpointManager.breakpointsForURL(scriptOrResource.url); - for (var i = 0; i < breakpoints.length; ++i) - sourceFrame.addBreakpoint(breakpoints[i]); } else if (scriptOrResource instanceof WebInspector.Script) view = this.scriptViewForScript(scriptOrResource); diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js index 16b8e8d..a9033f2 100644 --- a/WebCore/inspector/front-end/SourceFrame.js +++ b/WebCore/inspector/front-end/SourceFrame.js @@ -598,9 +598,11 @@ WebInspector.SourceFrame.prototype = { var popupContentElement = null; if (result.type !== "object" && result.type !== "node" && result.type !== "array") { popupContentElement = document.createElement("span"); - popupContentElement.className = "monospace"; + popupContentElement.className = "monospace console-formatted-" + result.type; popupContentElement.style.whiteSpace = "pre"; popupContentElement.textContent = result.description; + if (result.type === "string") + popupContentElement.textContent = "\"" + popupContentElement.textContent + "\""; this._popup = new WebInspector.Popover(popupContentElement); this._popup.show(element); } else { diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js index 240dca1..3f762cc 100644 --- a/WebCore/inspector/front-end/SourceView.js +++ b/WebCore/inspector/front-end/SourceView.js @@ -99,6 +99,9 @@ WebInspector.SourceView.prototype = { var mimeType = this._canonicalMimeType(this.resource); this.sourceFrame.setContent(mimeType, content, this.resource.url); this._sourceFrameSetupFinished(); + var breakpoints = WebInspector.breakpointManager.breakpointsForURL(this.resource.url); + for (var i = 0; i < breakpoints.length; ++i) + this.sourceFrame.addBreakpoint(breakpoints[i]); }, _canonicalMimeType: function(resource) diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc index b640936..f90a9fe 100644 --- a/WebCore/inspector/front-end/WebKit.qrc +++ b/WebCore/inspector/front-end/WebKit.qrc @@ -106,6 +106,7 @@ <file>WelcomeView.js</file> <file>WorkersSidebarPane.js</file> <file>audits.css</file> + <file>heapProfiler.css</file> <file>helpScreen.css</file> <file>inspector.css</file> <file>inspectorSyntaxHighlight.css</file> diff --git a/WebCore/inspector/front-end/heapProfiler.css b/WebCore/inspector/front-end/heapProfiler.css new file mode 100644 index 0000000..03a6dd0 --- /dev/null +++ b/WebCore/inspector/front-end/heapProfiler.css @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +.heap-snapshot-sidebar-tree-item .icon { + content: url(Images/profileIcon.png); +} + +.heap-snapshot-sidebar-tree-item.small .icon { + content: url(Images/profileSmallIcon.png); +} + +.heap-snapshot-view { + display: none; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.heap-snapshot-view.visible { + display: block; +} + +.heap-snapshot-view .data-grid { + border: none; + max-height: 100%; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 93px; +} + +.heap-snapshot-view .data-grid th.count-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.count-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.size-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.size-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.countDelta-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.countDelta-column { + text-align: right; +} + +.heap-snapshot-view .data-grid th.sizeDelta-column { + text-align: center; +} + +.heap-snapshot-view .data-grid td.sizeDelta-column { + text-align: right; +} + +#heap-snapshot-summary-container { + position: absolute; + padding-top: 20px; + bottom: 0; + left: 0; + right: 0; + height: 93px; + margin-left: -1px; + border-left: 1px solid rgb(102, 102, 102); + background-color: rgb(101, 111, 130); + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); + background-repeat: repeat-x; + background-position: top; + text-align: center; + text-shadow: black 0 1px 1px; + white-space: nowrap; + color: white; + -webkit-background-size: 1px 6px; + -webkit-background-origin: padding; + -webkit-background-clip: padding; +} + +.heap-snapshot-summary { + display: inline-block; + width: 50%; + min-width: 300px; + position: relative; +} + +.heap-snapshot-summary canvas.summary-graph { + width: 225px; +} + +.heap-snapshot-summary-label { + font-size: 12px; + font-weight: bold; + position: absolute; + top: 1px; + width: 50%; + left: 25%; +} diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css index a3ffa44..4319816 100644 --- a/WebCore/inspector/front-end/inspector.css +++ b/WebCore/inspector/front-end/inspector.css @@ -3910,115 +3910,6 @@ button.enable-toggle-status-bar-item .glyph { -webkit-mask-image: url(Images/reloadButtonGlyph.png); } -/* Heap Snapshot View Styles */ - -/* FIXME: move to a separate css file */ -.heap-snapshot-sidebar-tree-item .icon { - content: url(Images/profileIcon.png); -} - -.heap-snapshot-sidebar-tree-item.small .icon { - content: url(Images/profileSmallIcon.png); -} - -.heap-snapshot-view { - display: none; - overflow: hidden; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; -} - -.heap-snapshot-view.visible { - display: block; -} - -.heap-snapshot-view .data-grid { - border: none; - max-height: 100%; - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 93px; -} - -.heap-snapshot-view .data-grid th.count-column { - text-align: center; -} - -.heap-snapshot-view .data-grid td.count-column { - text-align: right; -} - -.heap-snapshot-view .data-grid th.size-column { - text-align: center; -} - -.heap-snapshot-view .data-grid td.size-column { - text-align: right; -} - -.heap-snapshot-view .data-grid th.countDelta-column { - text-align: center; -} - -.heap-snapshot-view .data-grid td.countDelta-column { - text-align: right; -} - -.heap-snapshot-view .data-grid th.sizeDelta-column { - text-align: center; -} - -.heap-snapshot-view .data-grid td.sizeDelta-column { - text-align: right; -} - -#heap-snapshot-summary-container { - position: absolute; - padding-top: 20px; - bottom: 0; - left: 0; - right: 0; - height: 93px; - margin-left: -1px; - border-left: 1px solid rgb(102, 102, 102); - background-color: rgb(101, 111, 130); - background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0))); - background-repeat: repeat-x; - background-position: top; - text-align: center; - text-shadow: black 0 1px 1px; - white-space: nowrap; - color: white; - -webkit-background-size: 1px 6px; - -webkit-background-origin: padding; - -webkit-background-clip: padding; -} - -.heap-snapshot-summary { - display: inline-block; - width: 50%; - min-width: 300px; - position: relative; -} - -.heap-snapshot-summary canvas.summary-graph { - width: 225px; -} - -.heap-snapshot-summary-label { - font-size: 12px; - font-weight: bold; - position: absolute; - top: 1px; - width: 50%; - left: 25%; -} - .delete-storage-status-bar-item .glyph { -webkit-mask-image: url(Images/excludeButtonGlyph.png); } diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html index 3e4b6c1..0536ee6 100644 --- a/WebCore/inspector/front-end/inspector.html +++ b/WebCore/inspector/front-end/inspector.html @@ -30,6 +30,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="audits.css"> + <link rel="stylesheet" type="text/css" href="heapProfiler.css"> <link rel="stylesheet" type="text/css" href="inspector.css"> <link rel="stylesheet" type="text/css" href="inspectorSyntaxHighlight.css"> <link rel="stylesheet" type="text/css" href="popover.css"> diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js index 0bff335..840745f 100644 --- a/WebCore/inspector/front-end/inspector.js +++ b/WebCore/inspector/front-end/inspector.js @@ -715,9 +715,9 @@ WebInspector.close = function(event) InspectorFrontendHost.closeWindow(); } -WebInspector.inspectedPageDestroyed = function() +WebInspector.disconnectFromBackend = function() { - WebInspector.close(); + InspectorFrontendHost.disconnectFromBackend(); } WebInspector.documentMouseOver = function(event) @@ -1445,9 +1445,9 @@ WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLin this.panels.scripts.addScript(null, sourceURL, source, startingLine, errorLine, errorMessage); } -WebInspector.pausedScript = function(callFrames) +WebInspector.pausedScript = function(details) { - this.panels.scripts.debuggerPaused(callFrames); + this.panels.scripts.debuggerPaused(details.callFrames); InspectorFrontendHost.bringToFront(); } |