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

Unified Diff: chromeos/audio/cras_audio_handler.h

Issue 23444057: Reduce chrome cras dbus call logs during device rebooting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename EnableLog Created 7 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 | « chrome/browser/extensions/api/audio/audio_service_chromeos.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler.h
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index cbd8612ad9e5f10f5cdf39c66022d58873f333d1..a3e706af52f1903562a898edf29c34252ed17f4b 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -15,6 +15,7 @@
#include "chromeos/audio/audio_pref_observer.h"
#include "chromeos/dbus/audio_node.h"
#include "chromeos/dbus/cras_audio_client.h"
+#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/dbus/volume_state.h"
class PrefRegistrySimple;
@@ -25,7 +26,8 @@ namespace chromeos {
class AudioDevicesPrefHandler;
class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
- public AudioPrefObserver {
+ public AudioPrefObserver,
+ public SessionManagerClient::Observer {
public:
typedef std::priority_queue<AudioDevice,
std::vector<AudioDevice>,
@@ -153,21 +155,27 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Sets the mute for device.
virtual void SetMuteForDevice(uint64 device_id, bool mute_on);
+ // Enables error logging.
+ virtual void LogErrors();
+
protected:
explicit CrasAudioHandler(
scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler);
virtual ~CrasAudioHandler();
private:
- // Overriden from CrasAudioClient::Observer.
+ // CrasAudioClient::Observer overrides.
virtual void AudioClientRestarted() OVERRIDE;
virtual void NodesChanged() OVERRIDE;
virtual void ActiveOutputNodeChanged(uint64 node_id) OVERRIDE;
virtual void ActiveInputNodeChanged(uint64 node_id) OVERRIDE;
- // Overriden from AudioPrefObserver.
+ // AudioPrefObserver overrides.
virtual void OnAudioPolicyPrefChanged() OVERRIDE;
+ // SessionManagerClient::Observer overrides.
+ virtual void EmitLoginPromptVisibleCalled() OVERRIDE;
+
// Sets the active audio output/input node to the node with |node_id|.
void SetActiveOutputNode(uint64 node_id);
void SetActiveInputNode(uint64 node_id);
@@ -226,6 +234,10 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Handles dbus callback for GetNodes.
void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success);
+ // Handles the dbus error callback.
+ void HandleGetNodesError(const std::string& error_name,
+ const std::string& error_msg);
+
scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler_;
base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_;
ObserverList<AudioObserver> observers_;
@@ -248,6 +260,9 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
bool output_mute_locked_;
bool input_mute_locked_;
+ // Failures are not logged at startup, since CRAS may not be running yet.
+ bool log_errors_;
+
DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler);
};
« no previous file with comments | « chrome/browser/extensions/api/audio/audio_service_chromeos.cc ('k') | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698