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

Side by Side Diff: blimp/net/blimp_message_demultiplexer.h

Issue 2632803002: Remove all blimp network code. (Closed)
Patch Set: merge from origin/master for good measure Created 3 years, 11 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 2015 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 BLIMP_NET_BLIMP_MESSAGE_DEMULTIPLEXER_H_
6 #define BLIMP_NET_BLIMP_MESSAGE_DEMULTIPLEXER_H_
7
8 #include <map>
9
10 #include "base/containers/small_map.h"
11 #include "base/macros.h"
12 #include "base/threading/thread_checker.h"
13 #include "blimp/common/proto/blimp_message.pb.h"
14 #include "blimp/net/blimp_message_processor.h"
15 #include "blimp/net/blimp_net_export.h"
16
17 namespace blimp {
18
19 // Multiplexing BlimpMessageProcessor which routes BlimpMessages to message
20 // processors based on the specific feature.
21 // BlimpMessageDemultiplexer is created on the UI thread, and then used and
22 // destroyed on the IO thread.
23 class BLIMP_NET_EXPORT BlimpMessageDemultiplexer
24 : public BlimpMessageProcessor {
25 public:
26 BlimpMessageDemultiplexer();
27 ~BlimpMessageDemultiplexer() override;
28
29 // Registers a message processor which will receive all messages
30 // of the |feature_case| specified.
31 // Only one handler may be added per type.
32 //
33 // |handler| must be valid when ProcessMessage() is called.
34 void AddProcessor(BlimpMessage::FeatureCase feature_case,
35 BlimpMessageProcessor* handler);
36
37 // BlimpMessageProcessor implementation.
38 void ProcessMessage(std::unique_ptr<BlimpMessage> message,
39 const net::CompletionCallback& callback) override;
40
41 private:
42 base::SmallMap<std::map<BlimpMessage::FeatureCase, BlimpMessageProcessor*>>
43 feature_receiver_map_;
44
45 DISALLOW_COPY_AND_ASSIGN(BlimpMessageDemultiplexer);
46 };
47
48 } // namespace blimp
49
50 #endif // BLIMP_NET_BLIMP_MESSAGE_DEMULTIPLEXER_H_
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_checkpointer_unittest.cc ('k') | blimp/net/blimp_message_demultiplexer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698