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

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

Issue 1011813006: Make availability of hotword hardware known to hotword component extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/hotword/constants.js ('k') | 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 0d2b9b9c9fe73c72b289104b32331ddae187a18a..fef432d409b495761c25293f02af6e738eb91d3d 100644
--- a/chrome/browser/resources/hotword/nacl_manager.js
+++ b/chrome/browser/resources/hotword/nacl_manager.js
@@ -11,10 +11,12 @@ cr.define('hotword', function() {
* shutdown.
*
* @param {boolean} loggingEnabled Whether audio logging is enabled.
+ * @param {boolean} hotwordStream Whether the audio input stream is from a
+ * hotword stream.
* @constructor
* @extends {cr.EventTarget}
*/
-function NaClManager(loggingEnabled) {
+function NaClManager(loggingEnabled, hotwordStream) {
/**
* Current state of this manager.
* @private {hotword.NaClManager.ManagerState_}
@@ -70,6 +72,12 @@ function NaClManager(loggingEnabled) {
this.loggingEnabled_ = loggingEnabled;
/**
+ * Whether the audio input stream is from a hotword stream.
+ * @private {boolean}
+ */
+ this.hotwordStream_ = hotwordStream;
+
+ /**
* Audio log of X seconds before hotword triggered.
* @private {?Object}
*/
@@ -432,6 +440,13 @@ NaClManager.prototype.handleRequestModel_ = function() {
hotword.constants.NaClPlugin.LOG + ':' +
hotword.constants.AUDIO_LOG_SECONDS);
}
+
+ // If the audio stream is from a hotword stream, tell the plugin.
+ if (this.hotwordStream_) {
+ this.sendDataToPlugin_(
+ hotword.constants.NaClPlugin.DSP + ':' +
+ hotword.constants.HOTWORD_STREAM_TIMEOUT_SECONDS);
+ }
};
/**
« no previous file with comments | « chrome/browser/resources/hotword/constants.js ('k') | chrome/browser/resources/hotword/state_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698