summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-03-10 11:11:35 +0100
committerGitHub <noreply@github.com>2018-03-10 11:11:35 +0100
commite3c30c6a4d9efb9a1218634939eed64bf7bd479e (patch)
tree7bbd0aae4d46ba743a46be8f40ef8c150157cf18
parent9e2ba2237f3ead25f6caa0c6838934058f795fa8 (diff)
parent2f4fa17a5c8eaf44a80c58c524dd27c4229a7eb8 (diff)
downloadUXP-e3c30c6a4d9efb9a1218634939eed64bf7bd479e.tar
UXP-e3c30c6a4d9efb9a1218634939eed64bf7bd479e.tar.gz
UXP-e3c30c6a4d9efb9a1218634939eed64bf7bd479e.tar.lz
UXP-e3c30c6a4d9efb9a1218634939eed64bf7bd479e.tar.xz
UXP-e3c30c6a4d9efb9a1218634939eed64bf7bd479e.zip
Merge pull request #53 from janekptacijarabaci/devtools_network_markers_1
DOMContentLoaded and load does not work properly; follow up if "devtools.webconsole.persistlog == true"
-rw-r--r--devtools/client/netmonitor/netmonitor-controller.js3
-rw-r--r--devtools/client/netmonitor/requests-menu-view.js20
-rw-r--r--devtools/client/netmonitor/selectors/index.js6
3 files changed, 20 insertions, 9 deletions
diff --git a/devtools/client/netmonitor/netmonitor-controller.js b/devtools/client/netmonitor/netmonitor-controller.js
index 939b6e4f5..39bee8570 100644
--- a/devtools/client/netmonitor/netmonitor-controller.js
+++ b/devtools/client/netmonitor/netmonitor-controller.js
@@ -407,6 +407,9 @@ TargetEventsHandler.prototype = {
if (!Services.prefs.getBoolPref("devtools.webconsole.persistlog")) {
NetMonitorView.RequestsMenu.reset();
NetMonitorView.Sidebar.toggle(false);
+ } else {
+ // If the log is persistent, just clear some informations.
+ NetMonitorView.RequestsMenu.resetNotPersistent();
}
// Switch to the default network traffic inspector view.
if (NetMonitorController.getCurrentActivity() == ACTIVITY_TYPE.NONE) {
diff --git a/devtools/client/netmonitor/requests-menu-view.js b/devtools/client/netmonitor/requests-menu-view.js
index c491fcb0e..0c854d264 100644
--- a/devtools/client/netmonitor/requests-menu-view.js
+++ b/devtools/client/netmonitor/requests-menu-view.js
@@ -275,8 +275,15 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
this._addQueue = [];
this._updateQueue = [];
this._firstRequestStartedMillis = -1;
- this._firstRequestStartedMillisInRequests = false;
this._lastRequestEndedMillis = -1;
+ this.resetNotPersistent();
+ },
+
+ /**
+ * Reset informations that "devtools.webconsole.persistlog == true".
+ */
+ resetNotPersistent: function () {
+ this._firstRequestStartedMillisNotPersistent = -1;
},
/**
@@ -651,9 +658,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
// Append a network request item to this container.
let requestItem = this.push([menuView, id], {
attachment: {
- firstRequestStartedMillis: this._firstRequestStartedMillisInRequests
- ? null
- : this._firstRequestStartedMillis,
+ firstRequestStartedMillisNotPersistent: this._firstRequestStartedMillisNotPersistent,
startedDeltaMillis: unixTime - this._firstRequestStartedMillis,
startedMillis: unixTime,
method: method,
@@ -665,8 +670,6 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
}
});
- this._firstRequestStartedMillisInRequests = true;
-
if (id == this._preferredItemId) {
this.selectedItem = requestItem;
}
@@ -1528,6 +1531,9 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
if (this._firstRequestStartedMillis == -1) {
this._firstRequestStartedMillis = unixTime;
}
+ if (this._firstRequestStartedMillisNotPersistent == -1) {
+ this._firstRequestStartedMillisNotPersistent = unixTime;
+ }
},
/**
@@ -1569,7 +1575,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
_ctx: null,
_cachedWaterfallWidth: 0,
_firstRequestStartedMillis: -1,
- _firstRequestStartedMillisInRequests: false,
+ _firstRequestStartedMillisNotPersistent: -1,
_lastRequestEndedMillis: -1,
_updateQueue: [],
_addQueue: [],
diff --git a/devtools/client/netmonitor/selectors/index.js b/devtools/client/netmonitor/selectors/index.js
index 612188758..ba5c19094 100644
--- a/devtools/client/netmonitor/selectors/index.js
+++ b/devtools/client/netmonitor/selectors/index.js
@@ -80,8 +80,10 @@ function getDisplayedTimingMarker(state, marker) {
}
let firstRequestStartedMillis = null;
if (state.requests.items.length) {
- firstRequestStartedMillis = state.requests.items[0]
- .attachment.firstRequestStartedMillis;
+ firstRequestStartedMillis = state.requests
+ .items[state.requests.items.length - 1]
+ .attachment
+ .firstRequestStartedMillisNotPersistent;
}
if (timingMarker && firstRequestStartedMillis) {
return timingMarker - firstRequestStartedMillis;