Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2115)

Unified Diff: Source/devtools/front_end/network/NetworkLogView.js

Issue 22548007: [DevTools] Network: prefetch resource content when "preserveLog" is on. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/network/NetworkLogView.js
diff --git a/Source/devtools/front_end/network/NetworkLogView.js b/Source/devtools/front_end/network/NetworkLogView.js
index 5914e0f8d2b48631f0a6ca2dccc463faf9331f6b..f4c651bc4ef8f7b19bddcb2b264cb241592824b1 100644
--- a/Source/devtools/front_end/network/NetworkLogView.js
+++ b/Source/devtools/front_end/network/NetworkLogView.js
@@ -731,6 +731,7 @@ WebInspector.NetworkLogView.prototype = {
this._largerRequestsButton.addEventListener("click", this._toggleLargerRequests, this);
this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspector.UIString("Preserve log"));
+ this._preserveLogCheckbox.inputElement.addEventListener("change", this._preserveLogCheckboxChanged.bind(this));
this._preserveLogCheckbox.element.title = WebInspector.UIString("Do not clear log on page reload / navigation.");
this._disableCacheCheckbox = new WebInspector.StatusBarCheckbox(WebInspector.UIString("Disable cache"));
@@ -829,7 +830,10 @@ WebInspector.NetworkLogView.prototype = {
this._updateSummaryBar();
},
- _onRecordButtonClicked: function()
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onRecordButtonClicked: function(event)
{
if (!this._recordButton.toggled)
this._reset();
@@ -845,6 +849,18 @@ WebInspector.NetworkLogView.prototype = {
this._recordButton.title = toggled ? WebInspector.UIString("Stop Recording Network Log") : WebInspector.UIString("Record Network Log");
},
+ /**
+ * @param {?Event} event
+ */
+ _preserveLogCheckboxChanged: function(event)
+ {
+ if (!this._preserveLogCheckbox.checked())
+ return;
+ var requests = this._nodesByRequestId.valuesArray().map(function(node) { return node.request(); });
+ for (var i = 0; i < requests.length; ++i)
+ this._forceContentLoading(requests[i]);
+ },
+
_reset: function()
{
this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.ViewCleared);
@@ -888,11 +904,25 @@ WebInspector.NetworkLogView.prototype = {
/**
* @param {!WebInspector.NetworkRequest} request
*/
+ _forceContentLoading: function(request)
+ {
+ /**
+ * @param {?string} content
+ */
+ function dummyContentCallback(content) { }
+
+ request.requestContent(dummyContentCallback);
+ },
+
+ /**
+ * @param {!WebInspector.NetworkRequest} request
+ */
_appendRequest: function(request)
{
var node = new WebInspector.NetworkDataGridNode(this, request);
node[WebInspector.NetworkLogView._isFilteredOutSymbol] = true;
node[WebInspector.NetworkLogView._isMatchingSearchQuerySymbol] = false;
+ // TODO: _forceContentLoading
// In case of redirect request id is reassigned to a redirected
// request and we need to update _nodesByRequestId and search results.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698