Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 var DeviceLogUI = (function() { | 5 var DeviceLogUI = (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Creates a tag for the log level. | 9 * Creates a tag for the log level. |
| 10 * | 10 * |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 container.appendChild(entry); | 88 container.appendChild(entry); |
| 89 } | 89 } |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Callback function, triggered when the log is received. | 93 * Callback function, triggered when the log is received. |
| 94 * | 94 * |
| 95 * @param {Object} data A JSON structure of event log entries. | 95 * @param {Object} data A JSON structure of event log entries. |
| 96 */ | 96 */ |
| 97 var getLogCallback = function(data) { | 97 var getLogCallback = function(data) { |
| 98 createEventLog(JSON.parse(data)); | 98 try { |
| 99 createEventLog(JSON.parse(data)); | |
| 100 } catch(e) {} | |
|
stevenjb
2016/01/27 18:13:08
This is fine as-is, but we might want to put somet
| |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 /** | 103 /** |
| 102 * Requests a log update. | 104 * Requests a log update. |
| 103 */ | 105 */ |
| 104 var requestLog = function() { | 106 var requestLog = function() { |
| 105 chrome.send('DeviceLog.getLog'); | 107 chrome.send('DeviceLog.getLog'); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 /** | 110 /** |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 checkboxes[i].onclick = requestLog; | 142 checkboxes[i].onclick = requestLog; |
| 141 | 143 |
| 142 setRefresh(); | 144 setRefresh(); |
| 143 requestLog(); | 145 requestLog(); |
| 144 }); | 146 }); |
| 145 | 147 |
| 146 return { | 148 return { |
| 147 getLogCallback: getLogCallback | 149 getLogCallback: getLogCallback |
| 148 }; | 150 }; |
| 149 })(); | 151 })(); |
| OLD | NEW |