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

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

Issue 433283002: Adding the Copresence RpcHandler and HttpPost helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@directive-handler
Patch Set: Rebasing off the correct CL 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license
3 // found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ 5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ 6 #define COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "components/copresence/handlers/audio/audio_directive_list.h" 13 #include "components/copresence/handlers/audio/audio_directive_list.h"
14 #include "components/copresence/mediums/audio/audio_recorder.h" 14 #include "components/copresence/mediums/audio/audio_recorder.h"
15 15
16 namespace copresence { 16 namespace copresence {
17 17
18 class AudioDirectiveHandler; 18 class AudioDirectiveHandler;
19 class Directive; 19 class Directive;
20 20
21 // The directive handler manages transmit and receive directives given to it 21 // The directive handler manages transmit and receive directives
22 // by the client. 22 // given to it by the client.
Daniel Erat 2014/08/06 00:44:46 is your editor wrapping comments at some width les
Charlie 2014/08/06 19:32:18 See previous response. On 2014/08/06 00:44:46, Da
23 class DirectiveHandler { 23 class DirectiveHandler {
24 public: 24 public:
25 DirectiveHandler(const AudioRecorder::DecodeSamplesCallback& decode_cb, 25 DirectiveHandler(const AudioRecorder::DecodeSamplesCallback& decode_cb,
26 const AudioDirectiveList::EncodeTokenCallback& encode_cb); 26 const AudioDirectiveList::EncodeTokenCallback& encode_cb);
27 ~DirectiveHandler(); 27 virtual ~DirectiveHandler();
28 28
29 // Adds a directive to handle. 29 // Adds a directive to handle.
30 void AddDirective(const copresence::Directive& directive); 30 virtual void AddDirective(const copresence::Directive& directive);
31 // Removes any directives associated with the given operation id. 31 // Removes any directives associated with the given operation id.
32 void RemoveDirectives(const std::string& op_id); 32 void RemoveDirectives(const std::string& op_id);
33 33
34 protected:
35 // Empty constructor for testing.
36 DirectiveHandler();
37
34 private: 38 private:
35 scoped_ptr<AudioDirectiveHandler> audio_handler_; 39 scoped_ptr<AudioDirectiveHandler> audio_handler_;
36 40
37 DISALLOW_COPY_AND_ASSIGN(DirectiveHandler); 41 DISALLOW_COPY_AND_ASSIGN(DirectiveHandler);
38 }; 42 };
39 43
40 } // namespace copresence 44 } // namespace copresence
41 45
42 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_ 46 #endif // COMPONENTS_COPRESENCE_HANDLERS_DIRECTIVE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698