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

Unified Diff: chrome/browser/resources/net_internals/dataview.js

Issue 6025017: Adds the ability to load JSON log files to about:net-internals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Put load log button on its own line Created 9 years, 11 months 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 | « chrome/browser/net/net_log_logger.cc ('k') | chrome/browser/resources/net_internals/eventsview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/dataview.js
===================================================================
--- chrome/browser/resources/net_internals/dataview.js (revision 72508)
+++ chrome/browser/resources/net_internals/dataview.js (working copy)
@@ -19,7 +19,12 @@
byteLoggingCheckboxId,
passivelyCapturedCountId,
activelyCapturedCountId,
- deleteAllId) {
+ deleteAllId,
+ dumpDataDivId,
+ loadDataDivId,
+ loadLogFileId,
+ capturingTextSpanId,
+ loggingTextSpanId) {
DivView.call(this, mainBoxId);
this.textPre_ = document.getElementById(outputTextBoxId);
@@ -40,6 +45,14 @@
document.getElementById(deleteAllId).onclick =
g_browser.deleteAllEvents.bind(g_browser);
+ this.dumpDataDiv_ = document.getElementById(dumpDataDivId);
+ this.loadDataDiv_ = document.getElementById(loadDataDivId);
+ this.capturingTextSpan_ = document.getElementById(capturingTextSpanId);
+ this.loggingTextSpan_ = document.getElementById(loggingTextSpanId);
+
+ document.getElementById(loadLogFileId).onclick =
+ g_browser.loadLogFile.bind(g_browser);
+
this.updateEventCounts_();
this.waitingForUpdate_ = false;
@@ -71,6 +84,18 @@
};
/**
+ * Called when either a log file is loaded or when going back to actively
+ * logging events. In either case, called after clearing the old entries,
+ * but before getting any new ones.
+ */
+DataView.prototype.onSetIsViewingLogFile = function(isViewingLogFile) {
+ setNodeDisplay(this.dumpDataDiv_, !isViewingLogFile);
+ setNodeDisplay(this.capturingTextSpan_, !isViewingLogFile);
+ setNodeDisplay(this.loggingTextSpan_, isViewingLogFile);
+ this.setText_('');
+};
+
+/**
* Updates the counters showing how many events have been captured.
*/
DataView.prototype.updateEventCounts_ = function() {
@@ -108,6 +133,10 @@
* Presents the captured data as formatted text.
*/
DataView.prototype.onUpdateAllCompleted = function(data) {
+ // It's possible for a log file to be loaded while a dump is being generated.
+ // When that happens, don't display the log dump, to avoid any confusion.
+ if (g_browser.isViewingLogFile())
+ return;
this.waitingForUpdate_ = false;
var text = [];
« no previous file with comments | « chrome/browser/net/net_log_logger.cc ('k') | chrome/browser/resources/net_internals/eventsview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698