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

Side by Side Diff: components/copresence/handlers/directive_handler_impl.h

Issue 2130803002: Deleting the copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_
7
8 #include <map>
9 #include <memory>
10 #include <string>
11 #include <vector>
12
13 #include "base/macros.h"
14 #include "components/copresence/handlers/audio/audio_directive_handler_impl.h"
15 #include "components/copresence/handlers/directive_handler.h"
16 #include "components/copresence/public/copresence_constants.h"
17
18 namespace copresence {
19
20 // The directive handler manages transmit and receive directives.
21 class DirectiveHandlerImpl final : public DirectiveHandler {
22 public:
23 DirectiveHandlerImpl();
24 explicit DirectiveHandlerImpl(
25 const DirectivesCallback& update_directives_callback);
26 DirectiveHandlerImpl(std::unique_ptr<AudioDirectiveHandler> audio_handler);
27 ~DirectiveHandlerImpl() override;
28
29 // DirectiveHandler overrides.
30 void Start(audio_modem::WhispernetClient* whispernet_client,
31 const audio_modem::TokensCallback& tokens_cb) override;
32 void AddDirective(const Directive& directive) override;
33 void RemoveDirectives(const std::string& op_id) override;
34 const std::string
35 GetCurrentAudioToken(audio_modem::AudioType type) const override;
36 bool IsAudioTokenHeard(audio_modem::AudioType type) const override;
37
38 private:
39 // Starts actually running a directive.
40 void StartDirective(const std::string& op_id, const Directive& directive);
41
42 std::unique_ptr<AudioDirectiveHandler> audio_handler_;
43 std::map<std::string, std::vector<Directive>> pending_directives_;
44
45 bool is_started_;
46
47 DISALLOW_COPY_AND_ASSIGN(DirectiveHandlerImpl);
48 };
49
50 } // namespace copresence
51
52 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_IMPL_H_
OLDNEW
« no previous file with comments | « components/copresence/handlers/directive_handler.h ('k') | components/copresence/handlers/directive_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698