WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
bug-137083-20140924161126.patch (text/plain), 25.83 KB, created by
Brian Burg
on 2014-09-24 16:11:33 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Brian Burg
Created:
2014-09-24 16:11:33 PDT
Size:
25.83 KB
patch
obsolete
>Subversion Revision: 173802 >diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js >index 00c100cc202b22b7153f8b64d2aad78cdb1921a6..b72af23abf364d660e7e5c55cbdc9a94df94b5f3 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Main.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js >@@ -738,12 +738,10 @@ WebInspector._dragOver = function(event) > event.preventDefault(); > } > >-/* > WebInspector._captureDidStart = function(event) > { > this.dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.replay); > } >-*/ > > WebInspector._debuggerDidPause = function(event) > { >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/ReplayManager.js b/Source/WebInspectorUI/UserInterface/Controllers/ReplayManager.js >index b8c1ef20249dd8345c92788b99ac6b3c397ae6e0..5fb56eea27403fd2647741b96e3fa5c0beb0289d 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/ReplayManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/ReplayManager.js >@@ -158,7 +158,7 @@ WebInspector.ReplayManager.prototype = { > > get playbackSession() > { >- console.assert(this.sessionState === WebInspector.ReplayManager.SessionState.Replaying); >+ console.assert(this.sessionState !== WebInspector.ReplayManager.SessionState.Capturing); > return this._sessions.get(this.activeSessionIdentifier); > }, > >diff --git a/Source/WebInspectorUI/UserInterface/Main.html b/Source/WebInspectorUI/UserInterface/Main.html >index 1b9dca4b95e8b788e6ca3fc82fa9b1f3a205021c..c67ecf2c9ba9d2579c4520004959e5c5ff34ea09 100644 >--- a/Source/WebInspectorUI/UserInterface/Main.html >+++ b/Source/WebInspectorUI/UserInterface/Main.html >@@ -247,7 +247,9 @@ > <script src="Models/Probe.js"></script> > <script src="Models/ProbeSet.js"></script> > <script src="Models/ProbeSetDataFrame.js"></script> >+ <script src="Models/ProbeSetReplayDataFrame.js"></script> > <script src="Models/ProbeSetDataTable.js"></script> >+ <script src="Models/ProbeSetReplayDataTable.js"></script> > <script src="Models/Profile.js"></script> > <script src="Models/ProfileNode.js"></script> > <script src="Models/ProfileNodeCall.js"></script> >diff --git a/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js b/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js >index edaf77ef81c72c7b7321641803f61d8cd9f86ce6..769bec4c0612796e05cbd9faddb33b97f5b78dcf 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ProbeSet.js >@@ -35,11 +35,21 @@ WebInspector.ProbeSet = function(breakpoint) > this._probes = []; > this._probesByIdentifier = new Map; > >- this._createDataTable(); >+ this._dataTable = new WebInspector.ProbeSetDataTable(this); > >- WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this); >- WebInspector.Probe.addEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this); >- WebInspector.Breakpoint.addEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this); >+ this._listeners = new WebInspector.EventListenerSet(this, "ProbeSet listeners"); >+ this._listeners.register(WebInspector.Frame, WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged); >+ this._listeners.register(WebInspector.Probe, WebInspector.Probe.Event.SampleAdded, this._sampleCollected); >+ this._listeners.register(WebInspector.Breakpoint, WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange); >+ this._listeners.register(WebInspector.replayManager, WebInspector.ReplayManager.Event.CaptureStopped, this._replayCaptureStopped); >+ this._listeners.register(WebInspector.replayManager, WebInspector.ReplayManager.Event.ActiveSessionChanged, this._playbackSessionChanged); >+ this._listeners.register(WebInspector.ReplaySession, WebInspector.ReplaySession.Event.SegmentsChanged, this._playbackSessionSegmentsChanged); >+ >+ this._listeners.install(); >+ >+ // Start with a normal data table, and upgrade to a replay data table if a non-empty session is active. The >+ // replay manager may not be synchronized with the backend yet if the probe set is restored from cookie. >+ WebInspector.replayManager.waitUntilInitialized().then(this._playbackSessionChanged.bind(this)); > } > > WebInspector.Object.addConstructorFunctions(WebInspector.ProbeSet); >@@ -122,9 +132,7 @@ WebInspector.ProbeSet.prototype = { > { > console.assert(!this._probes.length, "ProbeSet.willRemove called, but probes still associated with group: ", this._probes); > >- WebInspector.Frame.removeEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceChanged, this); >- WebInspector.Probe.removeEventListener(WebInspector.Probe.Event.SampleAdded, this._sampleCollected, this); >- WebInspector.Breakpoint.removeEventListener(WebInspector.Breakpoint.Event.ResolvedStateDidChange, this._breakpointResolvedStateDidChange, this); >+ this._listeners.uninstall(true); > }, > > // Private >@@ -136,10 +144,13 @@ WebInspector.ProbeSet.prototype = { > > _createDataTable: function() > { >- if (this.dataTable) >- this.dataTable.willRemove(); >+ if (this._dataTable) >+ this._dataTable.willRemove(); > >- this._dataTable = new WebInspector.ProbeSetDataTable(this); >+ if (WebInspector.replayManager.sessionState !== WebInspector.ReplayManager.SessionState.Capturing && WebInspector.replayManager.playbackSession.segments.length) >+ this._dataTable = new WebInspector.ProbeSetReplayDataTable(this); >+ else >+ this._dataTable = new WebInspector.ProbeSetDataTable(this); > }, > > _sampleCollected: function(event) >@@ -155,6 +166,42 @@ WebInspector.ProbeSet.prototype = { > this.dataTable.addSampleForProbe(probe, sample); > }, > >+ _replayCaptureStopped: function(event) >+ { >+ if (WebInspector.ReplaySession.sessionState === WebInspector.ReplayManager.SessionState.Capturing) >+ return; >+ >+ if (!WebInspector.replayManager.playbackSession.segments.length) >+ return; >+ >+ this.clearSamples(); >+ }, >+ >+ _playbackSessionChanged: function(event) >+ { >+ if (WebInspector.ReplaySession.sessionState === WebInspector.ReplayManager.SessionState.Capturing) >+ return; >+ >+ if (!WebInspector.replayManager.playbackSession.segments.length) >+ return; >+ >+ this.clearSamples(); >+ }, >+ >+ _playbackSessionSegmentsChanged: function(event) >+ { >+ if (event.target !== WebInspector.replayManager.playbackSession) >+ return; >+ >+ if (WebInspector.ReplaySession.sessionState === WebInspector.ReplayManager.SessionState.Capturing) >+ return; >+ >+ if (!WebInspector.replayManager.playbackSession.segments.length) >+ return; >+ >+ this.clearSamples(); >+ }, >+ > _breakpointResolvedStateDidChange: function(event) > { > this.dispatchEventToListeners(WebInspector.ProbeSet.Event.ResolvedStateDidChange); >diff --git a/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js b/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js >index 9e116d21b489348b93c22509b789b8cdb91c84c4..1048607b0fde598d696cc12c0cff6d4f73b949d4 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataFrame.js >@@ -31,7 +31,7 @@ WebInspector.ProbeSetDataFrame = function(index) > this._separator = false; > }; > >-WebInspector.ProbeSetDataFrame.compare = function(a, b) { >+WebInspector.ProbeSetDataFrame.comparator = function(a, b) { > console.assert(a instanceof WebInspector.ProbeSetDataFrame, a); > console.assert(b instanceof WebInspector.ProbeSetDataFrame, b); > >diff --git a/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js b/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js >index c538143d4974730844c32e9ee9f4c79ec59fef1b..81e0ac119c130440203f76966d9129b8387829e9 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ProbeSetDataTable.js >@@ -35,7 +35,9 @@ WebInspector.ProbeSetDataTable = function(probeSet) > > WebInspector.ProbeSetDataTable.Event = { > FrameInserted: "probe-set-data-table-frame-inserted", >+ FrameReplaced: "probe-set-data-table-frame-replaced", > SeparatorInserted: "probe-set-data-table-separator-inserted", >+ SeparatorReplaced: "probe-set-data-table-separator-replaced", > WillRemove: "probe-set-data-table-will-remove" > }; > >diff --git a/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataFrame.js b/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataFrame.js >new file mode 100644 >index 0000000000000000000000000000000000000000..dcda35e2dbc9c4a0335af98d8c3c29cda3881b40 >--- /dev/null >+++ b/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataFrame.js >@@ -0,0 +1,61 @@ >+/* >+ * Copyright (C) 2013 University of Washington. All rights reserved. >+ * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY 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 >+ * HOLDER 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. >+ */ >+ >+WebInspector.ProbeSetReplayDataFrame = function(position, counterValue) >+{ >+ WebInspector.ProbeSetDataFrame.call(this, 0); >+ this.position = position; >+ this.counterValue = counterValue; >+}; >+ >+WebInspector.ProbeSetReplayDataFrame.comparator = function(a, b) >+{ >+ console.assert(a instanceof WebInspector.ProbeSetReplayDataFrame, a); >+ console.assert(b instanceof WebInspector.ProbeSetReplayDataFrame, b); >+ >+ var positionRelation = WebInspector.ReplayPosition.comparator(a.position, b.position); >+ if (positionRelation !== 0) >+ return positionRelation; >+ >+ return a.counterValue - b.counterValue; >+} >+ >+WebInspector.ProbeSetReplayDataFrame.prototype = { >+ constructor: WebInspector.ProbeSetReplayDataFrame, >+ __proto__: WebInspector.ProbeSetDataFrame.prototype, >+ >+ // Public >+ >+ get key() >+ { >+ return "%d,%d,%d".format(this.position.segmentOffset, this.position.inputOffset, this.counterValue); >+ }, >+ >+ get compareFunction() >+ { >+ return WebInspector.ProbeSetReplayDataFrame.comparator; >+ } >+}; >diff --git a/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataTable.js b/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataTable.js >new file mode 100644 >index 0000000000000000000000000000000000000000..ff289d082fca62a13d2b383b8450d6097cf60e60 >--- /dev/null >+++ b/Source/WebInspectorUI/UserInterface/Models/ProbeSetReplayDataTable.js >@@ -0,0 +1,91 @@ >+/* >+ * Copyright (C) 2013 University of Washington. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+WebInspector.ProbeSetReplayDataTable = function(probeSet) >+{ >+ WebInspector.ProbeSetDataTable.call(this, probeSet); >+ >+ this._counterValue = WebInspector.ProbeSetDataTable.SentinelValue; >+ this._previousFrame = null; >+ >+ >+ WebInspector.replayManager.addEventListener(WebInspector.ReplayManager.Event.PlaybackPositionChanged, this._playbackPositionChanged, this); >+}; >+ >+WebInspector.ProbeSetReplayDataTable.prototype = { >+ constructor: WebInspector.ProbeSetReplayDataTable, >+ __proto__: WebInspector.ProbeSetDataTable.prototype, >+ >+ willRemove: function() >+ { >+ WebInspector.replayManager.removeEventListener(WebInspector.ReplayManager.Event.PlaybackPositionChanged, this._playbackPositionChanged, this); >+ >+ WebInspector.ProbeSetDataTable.prototype.willRemove.call(this); >+ }, >+ >+ // Protected >+ >+ createFrame: function() >+ { >+ this._counterValue = (this._counterValue === WebInspector.ProbeSetDataTable.SentinelValue) ? 0 : this._counterValue + 1; >+ return new WebInspector.ProbeSetReplayDataFrame(WebInspector.replayManager.playbackPosition, this._counterValue); >+ }, >+ >+ addFrame: function(frame) >+ { >+ var insertionIndex = insertionIndexForObjectInListSortedByFunction(frame, this._frames, WebInspector.ProbeSetReplayDataFrame.comparator); >+ if (this._frames.hasOwnProperty(insertionIndex)) { >+ this._frames.splice(insertionIndex, 1, frame); >+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.FrameReplaced, frame); >+ } else { >+ this._frames.splice(insertionIndex, 0, frame); >+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.FrameInserted, frame); >+ } >+ >+ // Save the previous frame so the separator can be placed there. >+ this._previousFrame = frame; >+ }, >+ >+ addSeparator: function() >+ { >+ // Separators must be associated with a frame. >+ if (!this._previousFrame) >+ return; >+ >+ if (this._previousFrame.isSeparator) >+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.SeparatorReplaced, this._previousFrame); >+ else { >+ this._previousFrame.isSeparator = true; >+ this.dispatchEventToListeners(WebInspector.ProbeSetDataTable.Event.SeparatorInserted, this._previousFrame); >+ } >+ }, >+ >+ // Private >+ >+ _playbackPositionChanged: function(event) >+ { >+ this._counterValue = WebInspector.ProbeSetDataTable.SentinelValue; >+ } >+}; >diff --git a/Source/WebInspectorUI/UserInterface/Models/ReplayPosition.js b/Source/WebInspectorUI/UserInterface/Models/ReplayPosition.js >index 2ac0c24f20cedd421f2cef54dc46f4efc2d7396b..c3df336ec2ac3695628cc3a26afe0f78c6f805bf 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ReplayPosition.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ReplayPosition.js >@@ -36,6 +36,24 @@ WebInspector.ReplayPosition.fromProtocol = function(payload) > return new WebInspector.ReplayPosition(payload.segmentOffset, payload.inputOffset); > }; > >+WebInspector.ReplayPosition.comparator = function(a, b) >+{ >+ console.assert(a instanceof WebInspector.ReplayPosition, a); >+ console.assert(b instanceof WebInspector.ReplayPosition, b); >+ >+ if (a.segmentOffset < b.segmentOffset) >+ return -1; >+ if (a.segmentOffset > b.segmentOffset) >+ return 1; >+ >+ if (a.inputOffset < b.inputOffset) >+ return -1; >+ if (a.inputOffset > b.inputOffset) >+ return 1; >+ >+ return 0; >+} >+ > WebInspector.ReplayPosition.prototype = { > constructor: WebInspector.ReplayPosition, > __proto__: WebInspector.Object.prototype, >diff --git a/Source/WebInspectorUI/UserInterface/Models/ReplaySession.js b/Source/WebInspectorUI/UserInterface/Models/ReplaySession.js >index d2401c0af211829302f666c84eb4d53c776bb534..24fb0a20054a1619df1e64049dff493da4b8cf7a 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/ReplaySession.js >+++ b/Source/WebInspectorUI/UserInterface/Models/ReplaySession.js >@@ -34,6 +34,8 @@ WebInspector.ReplaySession = function(identifier) > this._timestamp = null; > }; > >+WebInspector.Object.addConstructorFunctions(WebInspector.ReplaySession); >+ > WebInspector.ReplaySession.fromPayload = function(identifier, payload) > { > var session = new WebInspector.ReplaySession(identifier); >diff --git a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css >index 4fce26fade7af0bd0790d6e92e3677dea5fa6f9b..acf6505707202e28b149510e75ae73a50ac4d391 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css >+++ b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.css >@@ -29,6 +29,11 @@ > color: #777; > } > >+.details-section.probe-set .data-grid .data-container tr.future-value td { >+ background-color: rgba(255, 255, 255, 0.3); >+ color: #aaa; >+} >+ > .details-section.probe-set .data-grid > td.unknown-value { > background-color: rgba(230, 230, 230, 0.8); > background-image: repeating-linear-gradient(-45deg, transparent, transparent 7px, rgba(255, 255, 255, .5) 7px, rgba(255, 255, 255, .5) 14px); >diff --git a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js >index 1cb7ebc5e10d6480cbadfa811578cca41210730d..35054785bf6ef478661ff9d85806e31c54ca7a8d 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGrid.js >@@ -39,14 +39,15 @@ WebInspector.ProbeSetDataGrid = function(probeSet) > > this.element.classList.add("inline"); > >- this._frameNodes = new Map; >+ this._frameKeyToNodesMap = new Map; > this._nodesSinceLastNavigation = []; > > this._listeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid instance listeners"); > this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeAdded, this._setupProbe); > this._listeners.register(probeSet, WebInspector.ProbeSet.Event.ProbeRemoved, this._teardownProbe); > this._listeners.register(probeSet, WebInspector.ProbeSet.Event.SamplesCleared, this._setupData); >- this._listeners.register(WebInspector.Probe, WebInspector.Probe.Event.ExpressionChanged, this._probeExpressionChanged) >+ this._listeners.register(WebInspector.Probe, WebInspector.Probe.Event.ExpressionChanged, this._probeExpressionChanged); >+ this._listeners.register(WebInspector.replayManager, WebInspector.ReplayManager.Event.ActiveSegmentChanged, this._activeSegmentChanged); > this._listeners.install(); > > this._setupData(); >@@ -54,6 +55,7 @@ WebInspector.ProbeSetDataGrid = function(probeSet) > > WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName = "data-updated"; > WebInspector.ProbeSetDataGrid.PastFrameStyleClassName = "past-value"; >+WebInspector.ProbeSetDataGrid.FutureFrameStyleClassName = "future-value"; > WebInspector.ProbeSetDataGrid.HighlightedFrameStyleClassName = "highlighted"; > > WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration = 300; // milliseconds >@@ -100,7 +102,9 @@ WebInspector.ProbeSetDataGrid.prototype = { > > this._dataListeners = new WebInspector.EventListenerSet(this, "ProbeSetDataGrid data table listeners"); > this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.FrameInserted, this._dataFrameInserted); >+ this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.FrameReplaced, this._dataFrameReplaced); > this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.SeparatorInserted, this._dataSeparatorInserted); >+ this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.SeparatorReplaced, this._dataSeparatorReplaced); > this._dataListeners.register(this._data, WebInspector.ProbeSetDataTable.Event.WillRemove, this._teardownData); > this._dataListeners.install(); > }, >@@ -109,7 +113,7 @@ WebInspector.ProbeSetDataGrid.prototype = { > { > this._dataListeners.uninstall(true); > this.removeChildren(); >- this._frameNodes = new Map; >+ this._frameKeyToNodesMap = new Map; > this._separators = new Map; > delete this._lastUpdatedFrame; > }, >@@ -118,20 +122,24 @@ WebInspector.ProbeSetDataGrid.prototype = { > { > console.assert(frame instanceof WebInspector.ProbeSetDataFrame, "Invalid ProbeSetDataFrame argument: ", frame); > var node = null; >- if (this._frameNodes.has(frame)) { >- node = this._frameNodes.get(frame); >+ if (this._frameKeyToNodesMap.has(frame.key)) { >+ node = this._frameKeyToNodesMap.get(frame.key); > node.frame = frame; > node.refresh(); > } else { > node = new WebInspector.ProbeSetDataGridNode(this); > node.frame = frame; >- this._frameNodes.set(frame, node); >+ this._frameKeyToNodesMap.set(frame.key, node); > node.createCells(); > >- var sortFunction = function(a, b) { >- return WebInspector.ProbeSetDataFrame.compare(a.frame, b.frame); >- }; >- var insertionIndex = insertionIndexForObjectInListSortedByFunction(node, this.children, sortFunction); >+ var frameComparator = frame.constructor.comparator; >+ console.assert(frameComparator instanceof Function); >+ function nodeComparator(a, b) { >+ // Dynamically find the right comparator for this frame subclass. >+ return frameComparator(a.frame, b.frame); >+ } >+ >+ var insertionIndex = insertionIndexForObjectInListSortedByFunction(node, this.children, nodeComparator); > if (insertionIndex === this.children.length) > this.appendChild(node); > else if (this.children[insertionIndex].frame.key === frame.key) { >@@ -147,13 +155,14 @@ WebInspector.ProbeSetDataGrid.prototype = { > node.element.classList.remove(WebInspector.ProbeSetDataGrid.DataUpdatedStyleClassName); > }, WebInspector.ProbeSetDataGrid.DataUpdatedAnimationDuration); > >+ node.element.classList.remove(WebInspector.ProbeSetDataGrid.FutureFrameStyleClassName); > this._nodesSinceLastNavigation.push(node); > }, > > _updateNodeForSeparator: function(frame) > { >- console.assert(this._frameNodes.has(frame), "Tried to add separator for unknown data frame: ", frame); >- this._frameNodes.get(frame).updateCellsForSeparator(frame, this.probeSet); >+ console.assert(this._frameKeyToNodesMap.has(frame.key), "Tried to add separator for unknown data frame: ", frame); >+ this._frameKeyToNodesMap.get(frame.key).updateCellsForSeparator(frame, this.probeSet); > > for (var node of this._nodesSinceLastNavigation) > node.element.classList.add(WebInspector.ProbeSetDataGrid.PastFrameStyleClassName); >@@ -168,12 +177,25 @@ WebInspector.ProbeSetDataGrid.prototype = { > this._updateNodeForFrame(frame); > }, > >+ _dataFrameReplaced: function(event) >+ { >+ var frame = event.data; >+ this._lastUpdatedFrame = frame; >+ this._updateNodeForFrame(frame); >+ }, >+ > _dataSeparatorInserted: function(event) > { > var frame = event.data; > this._updateNodeForSeparator(frame); > }, > >+ _dataSeparatorReplaced: function(event) >+ { >+ var frame = event.data; >+ this._updateNodeForSeparator(frame); >+ }, >+ > _probeExpressionChanged: function(event) > { > var probe = event.target; >@@ -191,5 +213,18 @@ WebInspector.ProbeSetDataGrid.prototype = { > > for (var frame of this._data.frames) > this._updateNodeForFrame(frame); >+ }, >+ >+ _activeSegmentChanged: function(event) >+ { >+ // Don't clear samples if the final segment was unloaded. >+ if (!WebInspector.replayManager.activeSegmentIdentifier) >+ return; >+ >+ this._nodesSinceLastNavigation = []; >+ for (var [frameKey, node] of this._frameKeyToNodesMap) { >+ node.element.classList.add(WebInspector.ProbeSetDataGrid.FutureFrameStyleClassName); >+ node.element.classList.remove(WebInspector.ProbeSetDataGrid.PastFrameStyleClassName); >+ } > } > } >diff --git a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js >index e62e24dd18777d02095ba7fbe30182abf77e2454..ce89a50ef32f809f5cca7b9eb8c9bc9ef19f8e45 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ProbeSetDataGridNode.js >@@ -33,7 +33,7 @@ WebInspector.ProbeSetDataGridNode = function(dataGrid) > this._data = {}; > > this._element = document.createElement("tr"); >- this._element.dataGridNode = this; >+ this._element._dataGridNode = this; > this._element.classList.add("revealed"); > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 137083
: 238618