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

Unified Diff: chrome/browser/resources/hotword/nacl_manager.js

Issue 620913003: Add messages on assertions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword/nacl_manager.js
diff --git a/chrome/browser/resources/hotword/nacl_manager.js b/chrome/browser/resources/hotword/nacl_manager.js
index 275ce96c46649cf0a75213b062e8109afab77400..36462c11e3dfff4fee3f952f9aba15ab4275e1c4 100644
--- a/chrome/browser/resources/hotword/nacl_manager.js
+++ b/chrome/browser/resources/hotword/nacl_manager.js
@@ -105,7 +105,7 @@ NaClManager.prototype.isRunning = function() {
* @private
*/
NaClManager.prototype.setTimeout_ = function(func, timeout) {
- assert(!this.naclTimeoutId_);
+ assert(!this.naclTimeoutId_, 'Timeout already exists');
this.naclTimeoutId_ = window.setTimeout(
function() {
this.naclTimeoutId_ = null;
@@ -216,7 +216,9 @@ NaClManager.prototype.createPlugin_ = function(src) {
* @return {boolean} True if the successful.
*/
NaClManager.prototype.initialize = function(naclArch, stream) {
- assert(this.recognizerState_ == ManagerState_.UNINITIALIZED);
+ assert(this.recognizerState_ == ManagerState_.UNINITIALIZED,
+ 'Recognizer not in uninitialized state. State: ' +
+ this.recognizerState_);
var langs = this.getPossibleLanguages_();
var i, j;
// For country-lang variations. For example, when combined with path it will
@@ -275,7 +277,8 @@ NaClManager.prototype.shutdown = function() {
* @private
*/
NaClManager.prototype.sendDataToPlugin_ = function(data) {
- assert(this.recognizerState_ != ManagerState_.UNINITIALIZED);
+ assert(this.recognizerState_ != ManagerState_.UNINITIALIZED,
+ 'Recognizer in uninitialized state');
this.plugin_.postMessage(data);
};
« no previous file with comments | « no previous file | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698