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

Unified Diff: chrome/browser/search/hotword_service_factory.h

Issue 654613004: [Hotword] Delay checking for audio devices until needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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/search/hotword_service.cc ('k') | chrome/browser/search/hotword_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/hotword_service_factory.h
diff --git a/chrome/browser/search/hotword_service_factory.h b/chrome/browser/search/hotword_service_factory.h
index 44b655d26a879b439a40d9cdc2aa9b53c551a14f..74665ec7ea158e200269e7030aca984c26c10ed2 100644
--- a/chrome/browser/search/hotword_service_factory.h
+++ b/chrome/browser/search/hotword_service_factory.h
@@ -35,6 +35,11 @@ class HotwordServiceFactory : public MediaCaptureDevicesDispatcher::Observer,
// is browser (not profile) specific, it resides in the factory.
static bool IsMicrophoneAvailable();
+ // Returns whether the state of the audio devices has been updated.
+ // Essentially it indicates the validity of the return value from
+ // IsMicrophoneAvailable().
+ static bool IsAudioDeviceStateUpdated();
+
// Overridden from MediaCaptureDevicesDispatcher::Observer
void OnUpdateAudioDevices(
const content::MediaStreamDevices& devices) override;
@@ -67,6 +72,13 @@ class HotwordServiceFactory : public MediaCaptureDevicesDispatcher::Observer,
bool microphone_available_;
+ // Indicates if the check for audio devices has been run such that it can be
+ // included in the error checking. Audio checking is not done immediately
+ // upon start up because of the negative impact on performance.
+ bool audio_device_state_updated_;
+
+ bool audio_device_state_updated() { return audio_device_state_updated_; }
+
DISALLOW_COPY_AND_ASSIGN(HotwordServiceFactory);
};
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/search/hotword_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698