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

Side by Side Diff: chrome/browser/resources/net_internals/main.js

Issue 6708030: NetLog: Removes private information from net-internals events tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Dictionary of constants (initialized by browser). 6 * Dictionary of constants (initialized by browser).
7 */ 7 */
8 var LogEventType = null; 8 var LogEventType = null;
9 var LogEventPhase = null; 9 var LogEventPhase = null;
10 var ClientInfo = null; 10 var ClientInfo = null;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 this.capturedEvents_ = []; 216 this.capturedEvents_ = [];
217 217
218 // Next unique id to be assigned to a log entry without a source. 218 // Next unique id to be assigned to a log entry without a source.
219 // Needed to simplify deletion, identify associated GUI elements, etc. 219 // Needed to simplify deletion, identify associated GUI elements, etc.
220 this.nextSourcelessEventId_ = -1; 220 this.nextSourcelessEventId_ = -1;
221 221
222 // True when viewing a log file rather than actively logged events. 222 // True when viewing a log file rather than actively logged events.
223 // When viewing a log file, all tabs are hidden except the event view, 223 // When viewing a log file, all tabs are hidden except the event view,
224 // and all received events are ignored. 224 // and all received events are ignored.
225 this.isViewingLogFile_ = false; 225 this.isViewingLogFile_ = false;
226
227 // True when cookies and authentication information should be removed from
228 // displayed events. When true, such information should be hidden from
229 // all pages.
230 this.doSecurityStripping_ = true;
226 } 231 }
227 232
228 /* 233 /*
229 * Takes the current hash in form of "#tab&param1=value1&param2=value2&...". 234 * Takes the current hash in form of "#tab&param1=value1&param2=value2&...".
230 * Puts the parameters in an object, and passes the resulting object to 235 * Puts the parameters in an object, and passes the resulting object to
231 * |categoryTabSwitcher|. Uses tab and |anchorMap| to find a tab ID, 236 * |categoryTabSwitcher|. Uses tab and |anchorMap| to find a tab ID,
232 * which it also passes to the tab switcher. 237 * which it also passes to the tab switcher.
233 * 238 *
234 * Parameters and values are decoded with decodeURIComponent(). 239 * Parameters and values are decoded with decodeURIComponent().
235 */ 240 */
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 * Deletes all captured events. 820 * Deletes all captured events.
816 */ 821 */
817 BrowserBridge.prototype.deleteAllEvents = function() { 822 BrowserBridge.prototype.deleteAllEvents = function() {
818 this.capturedEvents_ = []; 823 this.capturedEvents_ = [];
819 this.numPassivelyCapturedEvents_ = 0; 824 this.numPassivelyCapturedEvents_ = 0;
820 for (var i = 0; i < this.logObservers_.length; ++i) 825 for (var i = 0; i < this.logObservers_.length; ++i)
821 this.logObservers_[i].onAllLogEntriesDeleted(); 826 this.logObservers_[i].onAllLogEntriesDeleted();
822 }; 827 };
823 828
824 /** 829 /**
830 * Sets the value of |doSecurityStripping_| and informs log observers
831 * of the change.
832 */
833 BrowserBridge.prototype.setDoSecurityStripping =
eroman 2011/03/25 04:59:16 nit: in this and other locations, I suggest droppi
mmenke 2011/03/28 14:55:36 Done. I renamed the bools to "enableSecurityStrip
834 function(doSecurityStripping) {
835 this.doSecurityStripping_ = doSecurityStripping;
eroman 2011/03/25 04:59:16 same naming comment applies to variable. Maybe jus
mmenke 2011/03/28 14:55:36 Done.
836 for (var i = 0; i < this.logObservers_.length; ++i) {
837 if (this.logObservers_[i].onSecurityStrippingChanged)
838 this.logObservers_[i].onSecurityStrippingChanged();
839 }
840 };
841
842 /**
843 * Returns whether or not cookies and authentication information should be
844 * displayed for events that contain them.
845 */
846 BrowserBridge.prototype.getDoSecurityStripping = function() {
847 return this.doSecurityStripping_;
848 };
849
850 /**
825 * Informs log observers whether or not future events will be from a log file. 851 * Informs log observers whether or not future events will be from a log file.
826 * Hides all tabs except the events and data tabs when viewing a log file, shows 852 * Hides all tabs except the events and data tabs when viewing a log file, shows
827 * them all otherwise. 853 * them all otherwise.
828 */ 854 */
829 BrowserBridge.prototype.setIsViewingLogFile_ = function(isViewingLogFile) { 855 BrowserBridge.prototype.setIsViewingLogFile_ = function(isViewingLogFile) {
830 this.isViewingLogFile_ = isViewingLogFile; 856 this.isViewingLogFile_ = isViewingLogFile;
831 var tabIds = this.categoryTabSwitcher_.getAllTabIds(); 857 var tabIds = this.categoryTabSwitcher_.getAllTabIds();
832 858
833 for (var i = 0; i < this.logObservers_.length; ++i) 859 for (var i = 0; i < this.logObservers_.length; ++i)
834 this.logObservers_[i].onSetIsViewingLogFile(isViewingLogFile); 860 this.logObservers_[i].onSetIsViewingLogFile(isViewingLogFile);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 return true; 1010 return true;
985 }; 1011 };
986 1012
987 UpdateAllObserver.prototype.onDataReceived_ = function(helper, name, data) { 1013 UpdateAllObserver.prototype.onDataReceived_ = function(helper, name, data) {
988 helper.removeObserver(this); 1014 helper.removeObserver(this);
989 --this.observingCount_; 1015 --this.observingCount_;
990 this.updatedData_[name] = data; 1016 this.updatedData_[name] = data;
991 if (this.observingCount_ == 0) 1017 if (this.observingCount_ == 0)
992 this.callback_(this.updatedData_); 1018 this.callback_(this.updatedData_);
993 }; 1019 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/logviewpainter.js ('k') | chrome/browser/resources/net_internals/proxyview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698