Chromium Code Reviews| 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..7a595bb809aa9f1ee5bbe1b07088bd99d9d6331a |
| --- /dev/null |
| +++ b/components/copresence/handlers/directive_handler.h |
| @@ -0,0 +1,47 @@ |
| +// 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 <queue> |
|
xiyuan
2014/07/25 21:02:09
nit: not used?
rkc
2014/07/28 21:02:02
Done.
|
| +#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 Directive; |
| +} |
| + |
| +namespace copresence { |
| + |
| +class AudioDirectiveHandler; |
| + |
| +// 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); |
| + virtual ~DirectiveHandler(); |
|
xiyuan
2014/07/25 21:02:09
nit: No need to be "virtual" if the class is not i
rkc
2014/07/28 21:02:02
Done.
|
| + |
| + // 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: |
| + // Audio: |
|
Daniel Erat
2014/07/28 21:18:17
nit: delete unnecessary comment
rkc
2014/07/29 00:33:35
Done.
|
| + scoped_ptr<AudioDirectiveHandler> audio_handler_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DirectiveHandler); |
| +}; |
| + |
| +} // namespace copresence |
| + |
| +#endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ |