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

Unified Diff: components/copresence/mediums/audio/audio_manager_stub.h

Issue 637223011: Redesign the copresence audio handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: 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
Index: components/copresence/mediums/audio/audio_manager_stub.h
diff --git a/components/copresence/mediums/audio/audio_manager_stub.h b/components/copresence/mediums/audio/audio_manager_stub.h
new file mode 100644
index 0000000000000000000000000000000000000000..8694fbab237b899a2ae6b2df48fe842a9b4452d5
--- /dev/null
+++ b/components/copresence/mediums/audio/audio_manager_stub.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_STUB_H_
+#define COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_STUB_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "components/copresence/mediums/audio/audio_manager.h"
+#include "components/copresence/public/copresence_constants.h"
+
+namespace copresence {
+
+class AudioManagerStub final : public AudioManager {
+ public:
+ AudioManagerStub();
+ virtual ~AudioManagerStub();
+
+ // AudioManager overrides:
+ virtual void Initialize(const DecodeSamplesCallback& decode_cb,
+ const EncodeTokenCallback& encode_cb) override;
+ virtual void StartPlaying(AudioType type) override;
+ virtual void StopPlaying(AudioType type) override;
+ virtual void StartRecording(AudioType type) override;
+ virtual void StopRecording(AudioType type) override;
+ virtual void SetToken(AudioType type,
+ const std::string& url_unsafe_token) override;
+ virtual const std::string& GetToken(AudioType type) override;
+ virtual bool IsRecording(AudioType type) override;
+ virtual bool IsPlaying(AudioType type) override;
+
+ private:
+ // Indexed using enum AudioType.
+ bool playing_[2];
+ bool recording_[2];
+
+ std::string token_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioManagerStub);
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_MANAGER_STUB_H_

Powered by Google App Engine
This is Rietveld 408576698