summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/inspector/front-end/inspector.js
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/inspector/front-end/inspector.js')
-rw-r--r--Source/WebCore/inspector/front-end/inspector.js92
1 files changed, 44 insertions, 48 deletions
diff --git a/Source/WebCore/inspector/front-end/inspector.js b/Source/WebCore/inspector/front-end/inspector.js
index b4c3fda..59171db 100644
--- a/Source/WebCore/inspector/front-end/inspector.js
+++ b/Source/WebCore/inspector/front-end/inspector.js
@@ -141,7 +141,7 @@ var WebInspector = {
resetFocusElement: function()
{
this.currentFocusElement = null;
- this._previousFocusElement = null;
+ this._previousFocusElement = null;
},
get currentPanel()
@@ -182,17 +182,6 @@ var WebInspector = {
return pane;
},
- createXHRBreakpointsSidebarPane: function()
- {
- var pane = new WebInspector.XHRBreakpointsSidebarPane();
- function breakpointAdded(event)
- {
- pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));
- }
- WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.XHRBreakpointAdded, breakpointAdded);
- return pane;
- },
-
_createPanels: function()
{
var hiddenPanels = (InspectorFrontendHost.hiddenPanels() || "").split(',');
@@ -206,16 +195,8 @@ var WebInspector = {
this.panels.scripts = new WebInspector.ScriptsPanel();
if (hiddenPanels.indexOf("timeline") === -1)
this.panels.timeline = new WebInspector.TimelinePanel();
- if (hiddenPanels.indexOf("profiles") === -1) {
+ if (hiddenPanels.indexOf("profiles") === -1)
this.panels.profiles = new WebInspector.ProfilesPanel();
- this.panels.profiles.registerProfileType(new WebInspector.CPUProfileType());
- if (Preferences.heapProfilerPresent) {
- if (!Preferences.detailedHeapProfiles)
- this.panels.profiles.registerProfileType(new WebInspector.HeapSnapshotProfileType());
- else
- this.panels.profiles.registerProfileType(new WebInspector.DetailedHeapshotProfileType());
- }
- }
if (hiddenPanels.indexOf("audits") === -1)
this.panels.audits = new WebInspector.AuditsPanel();
if (hiddenPanels.indexOf("console") === -1)
@@ -247,7 +228,7 @@ var WebInspector = {
dockToggleButton.title = WebInspector.UIString("Dock to main window.");
}
- // This may be called before onLoadedDone, hence the bulk of inspector objects may
+ // This may be called before onLoadedDone, hence the bulk of inspector objects may
// not be created yet.
if (WebInspector.searchController)
WebInspector.searchController.updateSearchLabel();
@@ -347,9 +328,9 @@ var WebInspector = {
this._highlightedDOMNodeId = nodeId;
if (nodeId)
- InspectorAgent.highlightDOMNode(nodeId);
+ DOMAgent.highlightDOMNode(nodeId);
else
- InspectorAgent.hideDOMNodeHighlight();
+ DOMAgent.hideDOMNodeHighlight();
},
highlightDOMNodeForTwoSeconds: function(nodeId)
@@ -458,11 +439,12 @@ WebInspector.doLoadedDone = function()
this.drawer = new WebInspector.Drawer();
this.console = new WebInspector.ConsoleView(this.drawer);
this.drawer.visibleView = this.console;
+ this.networkManager = new WebInspector.NetworkManager();
this.resourceTreeModel = new WebInspector.ResourceTreeModel();
- this.networkManager = new WebInspector.NetworkManager(this.resourceTreeModel);
this.domAgent = new WebInspector.DOMAgent();
InspectorBackend.registerDomainDispatcher("Inspector", this);
+ InspectorBackend.registerDomainDispatcher("Page", this);
this.resourceCategories = {
documents: new WebInspector.ResourceCategory("documents", WebInspector.UIString("Documents"), "rgb(47,102,236)"),
@@ -522,25 +504,16 @@ WebInspector.doLoadedDone = function()
this.extensionServer.initExtensions();
- function onPopulateScriptObjects()
- {
- if (!WebInspector.currentPanel)
- WebInspector.showPanel(WebInspector.settings.lastActivePanel);
- }
- InspectorAgent.populateScriptObjects(onPopulateScriptObjects);
-
- if (Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled)
- this.debuggerModel.enableDebugger();
- if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled)
- InspectorAgent.enableProfiler();
if (WebInspector.settings.monitoringXHREnabled)
ConsoleAgent.setMonitoringXHREnabled(true);
+ ConsoleAgent.enable(this.console.setConsoleMessageExpiredCount.bind(this.console));
- ConsoleAgent.setConsoleMessagesEnabled(true);
+ WebInspector.showPanel(WebInspector.settings.lastActivePanel);
- function propertyNamesCallback(names)
+ function propertyNamesCallback(error, names)
{
- WebInspector.cssNameCompletions = new WebInspector.CSSCompletions(names);
+ if (!error)
+ WebInspector.cssNameCompletions = new WebInspector.CSSCompletions(names);
}
// As a DOMAgent method, this needs to happen after the frontend has loaded and the agent is available.
CSSAgent.getSupportedCSSProperties(propertyNamesCallback);
@@ -702,7 +675,7 @@ WebInspector.openResource = function(resourceURL, inResourcesPanel)
WebInspector.panels.resources.showResource(resource);
WebInspector.showPanel("resources");
} else
- InspectorAgent.openInInspectedWindow(resource ? resource.url : resourceURL);
+ PageAgent.openInInspectedWindow(resource ? resource.url : resourceURL);
}
WebInspector._registerShortcuts = function()
@@ -826,13 +799,13 @@ WebInspector.documentKeyDown = function(event)
case "U+0052": // R key
if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) {
- InspectorAgent.reloadPage(event.shiftKey);
+ PageAgent.reloadPage(event.shiftKey);
event.preventDefault();
}
break;
case "F5":
if (!isMac)
- InspectorAgent.reloadPage(event.ctrlKey || event.shiftKey);
+ PageAgent.reloadPage(event.ctrlKey || event.shiftKey);
break;
}
}
@@ -1013,6 +986,12 @@ WebInspector.showPanel = function(panel)
this.currentPanel = this.panels[panel];
}
+WebInspector.startUserInitiatedDebugging = function()
+{
+ this.currentPanel = this.panels.scripts;
+ WebInspector.debuggerModel.enableDebugger();
+}
+
WebInspector.domContentEventFired = function(time)
{
this.panels.audits.mainResourceDOMContentTime = time;
@@ -1070,6 +1049,18 @@ WebInspector.inspectedURLChanged = function(url)
this.extensionServer.notifyInspectedURLChanged();
}
+WebInspector.didCreateWorker = function()
+{
+ var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+ workersPane.addWorker.apply(workersPane, arguments);
+}
+
+WebInspector.didDestroyWorker = function()
+{
+ var workersPane = WebInspector.panels.scripts.sidebarPanes.workers;
+ workersPane.removeWorker.apply(workersPane, arguments);
+}
+
WebInspector.log = function(message, messageLevel)
{
// remember 'this' for setInterval() callback
@@ -1185,13 +1176,16 @@ WebInspector.drawLoadingPieChart = function(canvas, percent) {
g.fill();
}
-WebInspector.inspect = function(objectId, hints)
+WebInspector.inspect = function(payload, hints)
{
- var object = WebInspector.RemoteObject.fromPayload(objectId);
+ var object = WebInspector.RemoteObject.fromPayload(payload);
if (object.type === "node") {
// Request node from backend and focus it.
- object.pushNodeToFrontend(WebInspector.updateFocusedNode.bind(WebInspector));
- } else if (hints.databaseId) {
+ object.pushNodeToFrontend(WebInspector.updateFocusedNode.bind(WebInspector), object.release.bind(object));
+ return;
+ }
+
+ if (hints.databaseId) {
WebInspector.currentPanel = WebInspector.panels.resources;
WebInspector.panels.resources.selectDatabase(hints.databaseId);
} else if (hints.domStorageId) {
@@ -1199,7 +1193,7 @@ WebInspector.inspect = function(objectId, hints)
WebInspector.panels.resources.selectDOMStorage(hints.domStorageId);
}
- RuntimeAgent.releaseObject(objectId);
+ object.release();
}
WebInspector.updateFocusedNode = function(nodeId)
@@ -1416,6 +1410,8 @@ WebInspector.addMainEventListeners = function(doc)
WebInspector.frontendReused = function()
{
this.networkManager.frontendReused();
+ this.resourceTreeModel.frontendReused();
+ WebInspector.panels.network.clear();
this.reset();
}
@@ -1541,7 +1537,7 @@ WebInspector.startEditing = function(element, config)
var isMetaOrCtrl = WebInspector.isMac() ?
event.metaKey && !event.shiftKey && !event.ctrlKey && !event.altKey :
event.ctrlKey && !event.shiftKey && !event.metaKey && !event.altKey;
- if (isEnterKey(event) && (!config.multiline || isMetaOrCtrl))
+ if (isEnterKey(event) && (event.isMetaOrCtrlForTest || !config.multiline || isMetaOrCtrl))
return "commit";
else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code)
return "cancel";