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

Unified Diff: components/copresence/handlers/directive_handler.h

Issue 419073002: Add the copresence DirectiveHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/handlers/directive_handler.h
diff --git a/components/copresence/handlers/directive_handler.h b/components/copresence/handlers/directive_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a415f1dbb77cda9b70dfce35cd6ad2550d1e822
--- /dev/null
+++ b/components/copresence/handlers/directive_handler.h
@@ -0,0 +1,42 @@
+// 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_HANDLERS_DIRECTIVE_HANDLER_
+#define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/copresence/handlers/audio/audio_directive_list.h"
+#include "components/copresence/mediums/audio/audio_recorder.h"
+
+namespace copresence {
+
+class AudioDirectiveHandler;
+class Directive;
+
+// The directive handler manages transmit and receive directives given to it
+// by the client.
+class DirectiveHandler {
+ public:
+ DirectiveHandler(const AudioRecorder::DecodeSamplesCallback& decode_cb,
+ const AudioDirectiveList::EncodeTokenCallback& encode_cb);
+ ~DirectiveHandler();
+
+ // Adds a directive to handle.
+ void AddDirective(const copresence::Directive& directive);
+ // Removes any directives associated with the given operation id.
+ void RemoveDirectives(const std::string& op_id);
+
+ private:
+ scoped_ptr<AudioDirectiveHandler> audio_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(DirectiveHandler);
+};
+
+} // namespace copresence
+
+#endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_

Powered by Google App Engine
This is Rietveld 408576698