| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 }; | 389 }; |
| 390 | 390 |
| 391 BrowserBridge.prototype.setLogLevel = function(logLevel) { | 391 BrowserBridge.prototype.setLogLevel = function(logLevel) { |
| 392 chrome.send('setLogLevel', ['' + logLevel]); | 392 chrome.send('setLogLevel', ['' + logLevel]); |
| 393 }; | 393 }; |
| 394 | 394 |
| 395 BrowserBridge.prototype.enableHttpThrottling = function(enable) { | 395 BrowserBridge.prototype.enableHttpThrottling = function(enable) { |
| 396 chrome.send('enableHttpThrottling', [enable]); | 396 chrome.send('enableHttpThrottling', [enable]); |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 BrowserBridge.prototype.loadLogFile = function() { | |
| 400 chrome.send('loadLogFile'); | |
| 401 }; | |
| 402 | |
| 403 BrowserBridge.prototype.refreshSystemLogs = function() { | 399 BrowserBridge.prototype.refreshSystemLogs = function() { |
| 404 chrome.send('refreshSystemLogs'); | 400 chrome.send('refreshSystemLogs'); |
| 405 }; | 401 }; |
| 406 | 402 |
| 407 BrowserBridge.prototype.getSystemLog = function(log_key, cellId) { | 403 BrowserBridge.prototype.getSystemLog = function(log_key, cellId) { |
| 408 chrome.send('getSystemLog', [log_key, cellId]); | 404 chrome.send('getSystemLog', [log_key, cellId]); |
| 409 }; | 405 }; |
| 410 | 406 |
| 411 //------------------------------------------------------------------------------ | 407 //------------------------------------------------------------------------------ |
| 412 // Messages received from the browser | 408 // Messages received from the browser |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 entries[i].type = LogEventType[entries[i].type]; | 602 entries[i].type = LogEventType[entries[i].type]; |
| 607 entries[i].source.type = LogSourceType[entries[i].source.type]; | 603 entries[i].source.type = LogSourceType[entries[i].source.type]; |
| 608 entries[i].phase = LogEventPhase[entries[i].phase]; | 604 entries[i].phase = LogEventPhase[entries[i].phase]; |
| 609 validEntries.push(entries[i]); | 605 validEntries.push(entries[i]); |
| 610 } else { | 606 } else { |
| 611 // TODO(mmenke): Do something reasonable when the event type isn't | 607 // TODO(mmenke): Do something reasonable when the event type isn't |
| 612 // found, which could happen when event types are | 608 // found, which could happen when event types are |
| 613 // removed or added between versions. Could also happen | 609 // removed or added between versions. Could also happen |
| 614 // with source types, but less likely. | 610 // with source types, but less likely. |
| 615 console.log( | 611 console.log( |
| 616 'Unrecognized values in log entry: ' + JSON.stringify(entry)); | 612 'Unrecognized values in log entry: ' + JSON.stringify(entries[i])); |
| 617 } | 613 } |
| 618 } | 614 } |
| 619 | 615 |
| 620 this.numPassivelyCapturedEvents_ = validEntries.length; | 616 this.numPassivelyCapturedEvents_ = validEntries.length; |
| 621 this.addLogEntries(validEntries); | 617 this.addLogEntries(validEntries); |
| 622 | 618 |
| 623 var numInvalidEntries = entries.length - validEntries.length; | 619 var numInvalidEntries = entries.length - validEntries.length; |
| 624 if (numInvalidEntries > 0 || numInvalidLines > 0) { | 620 if (numInvalidEntries > 0 || numInvalidLines > 0) { |
| 625 window.alert( | 621 window.alert( |
| 626 numInvalidLines.toString() + | 622 numInvalidLines.toString() + |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 return true; | 1073 return true; |
| 1078 }; | 1074 }; |
| 1079 | 1075 |
| 1080 UpdateAllObserver.prototype.onDataReceived_ = function(helper, name, data) { | 1076 UpdateAllObserver.prototype.onDataReceived_ = function(helper, name, data) { |
| 1081 helper.removeObserver(this); | 1077 helper.removeObserver(this); |
| 1082 --this.observingCount_; | 1078 --this.observingCount_; |
| 1083 this.updatedData_[name] = data; | 1079 this.updatedData_[name] = data; |
| 1084 if (this.observingCount_ == 0) | 1080 if (this.observingCount_ == 0) |
| 1085 this.callback_(this.updatedData_); | 1081 this.callback_(this.updatedData_); |
| 1086 }; | 1082 }; |
| OLD | NEW |