OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 soon after loading by data from browser, | 6 * Dictionary of constants (Initialized soon after loading by data from browser, |
7 * updated on load log). The *Types dictionaries map strings to numeric IDs, | 7 * updated on load log). The *Types dictionaries map strings to numeric IDs, |
8 * while the *TypeNames are the other way around. | 8 * while the *TypeNames are the other way around. |
9 */ | 9 */ |
10 var LogEventType = null; | 10 var LogEventType = null; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 * HTML elements that send messages to the browser. Cannot be undone | 162 * HTML elements that send messages to the browser. Cannot be undone |
163 * without reloading the page. Must be called before passing loaded data | 163 * without reloading the page. Must be called before passing loaded data |
164 * to the individual views. | 164 * to the individual views. |
165 * | 165 * |
166 * @param {String} opt_fileName The name of the log file that has been | 166 * @param {String} opt_fileName The name of the log file that has been |
167 * loaded, if we're loading a log file. | 167 * loaded, if we're loading a log file. |
168 */ | 168 */ |
169 onLoadLog: function(opt_fileName) { | 169 onLoadLog: function(opt_fileName) { |
170 isViewingLoadedLog = true; | 170 isViewingLoadedLog = true; |
171 | 171 |
172 SourceTracker.getInstance().setSecurityStripping(false); | |
173 this.stopCapturing(); | 172 this.stopCapturing(); |
174 if (opt_fileName != undefined) { | 173 if (opt_fileName != undefined) { |
175 // If there's a file name, a log file was loaded, so swap out the status | 174 // If there's a file name, a log file was loaded, so swap out the status |
176 // bar to indicate we're no longer capturing events. | 175 // bar to indicate we're no longer capturing events. Also disable |
| 176 // hiding cookies, so if the log dump has them, they'll be displayed. |
177 this.statusView_.switchToSubView('loaded').setFileName(opt_fileName); | 177 this.statusView_.switchToSubView('loaded').setFileName(opt_fileName); |
| 178 SourceTracker.getInstance().setSecurityStripping(false); |
178 } else { | 179 } else { |
179 // Otherwise, the "Stop Capturing" button was presumably pressed. | 180 // Otherwise, the "Stop Capturing" button was presumably pressed. |
| 181 // Don't disable hiding cookies, so created log dumps won't have them, |
| 182 // unless the user toggles the option. |
180 this.statusView_.switchToSubView('halted'); | 183 this.statusView_.switchToSubView('halted'); |
181 } | 184 } |
182 }, | 185 }, |
183 | 186 |
184 switchToViewOnlyMode: function() { | 187 switchToViewOnlyMode: function() { |
185 // Since this won't be dumped to a file, we don't want to remove | 188 // Since this won't be dumped to a file, we don't want to remove |
186 // cookies and credentials. | 189 // cookies and credentials. |
187 log_util.createLogDumpAsync('', log_util.loadLogFile, false); | 190 log_util.createLogDumpAsync('', log_util.loadLogFile, false); |
188 }, | 191 }, |
189 | 192 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 * Returns a string representation of |family|. | 296 * Returns a string representation of |family|. |
294 * @param {number} family An AddressFamily | 297 * @param {number} family An AddressFamily |
295 * @return {string} A representation of the given family. | 298 * @return {string} A representation of the given family. |
296 */ | 299 */ |
297 function addressFamilyToString(family) { | 300 function addressFamilyToString(family) { |
298 var str = getKeyWithValue(AddressFamily, family); | 301 var str = getKeyWithValue(AddressFamily, family); |
299 // All the address family start with ADDRESS_FAMILY_*. | 302 // All the address family start with ADDRESS_FAMILY_*. |
300 // Strip that prefix since it is redundant and only clutters the output. | 303 // Strip that prefix since it is redundant and only clutters the output. |
301 return str.replace(/^ADDRESS_FAMILY_/, ''); | 304 return str.replace(/^ADDRESS_FAMILY_/, ''); |
302 } | 305 } |
OLD | NEW |