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

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

Issue 1876983002: Use Chromium BUILD to approximate Blimp protocol version, and check it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Route EndConnection to OnConnectionError notifications Created 4 years, 7 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 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 <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 25 matching lines...) Expand all
36 36
37 // Sets the processor which will take incoming messages for this connection. 37 // Sets the processor which will take incoming messages for this connection.
38 // Can be set multiple times, but previously set processors are discarded. 38 // Can be set multiple times, but previously set processors are discarded.
39 // Caller retains the ownership of |processor|. 39 // Caller retains the ownership of |processor|.
40 virtual void SetIncomingMessageProcessor(BlimpMessageProcessor* processor); 40 virtual void SetIncomingMessageProcessor(BlimpMessageProcessor* processor);
41 41
42 // Gets a processor for BrowserSession->BlimpConnection message routing. 42 // Gets a processor for BrowserSession->BlimpConnection message routing.
43 virtual BlimpMessageProcessor* GetOutgoingMessageProcessor(); 43 virtual BlimpMessageProcessor* GetOutgoingMessageProcessor();
44 44
45 protected: 45 protected:
46 class EndConnectionHandler;
47 friend class EndConnectionHandler;
48
46 BlimpConnection(); 49 BlimpConnection();
47 50
48 // ConnectionErrorObserver implementation. 51 // ConnectionErrorObserver implementation.
49 void OnConnectionError(int error) override; 52 void OnConnectionError(int error) override;
50 53
51 private: 54 private:
52 std::unique_ptr<PacketReader> reader_; 55 std::unique_ptr<PacketReader> reader_;
53 std::unique_ptr<BlimpMessagePump> message_pump_; 56 std::unique_ptr<BlimpMessagePump> message_pump_;
54 std::unique_ptr<PacketWriter> writer_; 57 std::unique_ptr<PacketWriter> writer_;
55 std::unique_ptr<BlimpMessageProcessor> outgoing_msg_processor_; 58 std::unique_ptr<BlimpMessageProcessor> outgoing_msg_processor_;
56 base::ObserverList<ConnectionErrorObserver> error_observers_; 59 base::ObserverList<ConnectionErrorObserver> error_observers_;
60 std::unique_ptr<EndConnectionHandler> end_connection_handler_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(BlimpConnection); 62 DISALLOW_COPY_AND_ASSIGN(BlimpConnection);
59 }; 63 };
60 64
61 } // namespace blimp 65 } // namespace blimp
62 66
63 #endif // BLIMP_NET_BLIMP_CONNECTION_H_ 67 #endif // BLIMP_NET_BLIMP_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698