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

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

Issue 1429193002: Add interfaces for most major Blimp net components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Import multiplexer changes from 1434533005 Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BLIMP_NET_BLIMP_CONNECTION_H_ 5 #ifndef BLIMP_NET_BLIMP_CONNECTION_H_
6 #define BLIMP_NET_BLIMP_CONNECTION_H_ 6 #define BLIMP_NET_BLIMP_CONNECTION_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
9 #include "blimp/net/blimp_net_export.h" 10 #include "blimp/net/blimp_net_export.h"
10 11
11 namespace blimp { 12 namespace blimp {
12 13
14 class BlimpMessageProcessor;
15
16 // Encapsulates the state and logic used to exchange BlimpMessages over
17 // a network connection.
13 class BLIMP_NET_EXPORT BlimpConnection { 18 class BLIMP_NET_EXPORT BlimpConnection {
14 public: 19 public:
20 class DisconnectObserver {
21 // Called when the network connection for |this| is disconnected.
22 virtual void OnDisconnected() = 0;
23 };
24
15 BlimpConnection(); 25 BlimpConnection();
26
16 ~BlimpConnection(); 27 ~BlimpConnection();
17 28
29 // Lets |observer| know when the network connection is terminated.
30 void AddDisconnectObserver(const DisconnectObserver& observer);
Wez 2015/11/12 00:12:53 Strange to have |observer| passed as a const refer
Kevin M 2015/11/12 01:53:15 Good find, it should be a non-const pointer. Done
31
32 // Sets the processor for BlimpConnection->BrowserSession message routing.
Wez 2015/11/12 00:12:53 This class doesn't know anything about BrowserSess
Kevin M 2015/11/12 01:53:16 Done.
33 // Only one can be set a time. Can be set multiple times, but previously set
34 // incoming message processors are discarded.
35 void set_incoming_message_processor(
36 scoped_ptr<BlimpMessageProcessor> processor);
37
38 // Gets a processor for BrowserSession->BlimpConnection message routing.
39 scoped_ptr<BlimpMessageProcessor> take_outgoing_message_processor() const;
40
18 private: 41 private:
19 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); 42 DISALLOW_COPY_AND_ASSIGN(BlimpConnection);
20 }; 43 };
21 44
22 } // namespace blimp 45 } // namespace blimp
23 46
24 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ 47 #endif // BLIMP_NET_BLIMP_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698