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

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

Issue 1933053003: Used oneof in blimp_message.proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits 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
« no previous file with comments | « blimp/net/blimp_message_pump_unittest.cc ('k') | blimp/net/browser_connection_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BROWSER_CONNECTION_HANDLER_H_ 5 #ifndef BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_
6 #define BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ 6 #define BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 17 matching lines...) Expand all
28 // the lifetime of the application. 28 // the lifetime of the application.
29 // BrowserConnectionHandler is created on the UI thread, and then used and 29 // BrowserConnectionHandler is created on the UI thread, and then used and
30 // destroyed on the IO thread. 30 // destroyed on the IO thread.
31 class BLIMP_NET_EXPORT BrowserConnectionHandler 31 class BLIMP_NET_EXPORT BrowserConnectionHandler
32 : public ConnectionHandler, 32 : public ConnectionHandler,
33 public ConnectionErrorObserver { 33 public ConnectionErrorObserver {
34 public: 34 public:
35 BrowserConnectionHandler(); 35 BrowserConnectionHandler();
36 ~BrowserConnectionHandler() override; 36 ~BrowserConnectionHandler() override;
37 37
38 // Registers a message processor which will receive all messages of the |type| 38 // Registers a message processor which will receive all messages of the
39 // specified. Only one handler may be added per type. 39 // |feature_case| specified. Only one handler may be added per feature.
40 // That caller must ensure |incoming_processor| remains valid while 40 // That caller must ensure |incoming_processor| remains valid while
41 // this object is in-use. 41 // this object is in-use.
42 // 42 //
43 // Returns a BlimpMessageProcessor object for sending messages of type |type|. 43 // Returns a BlimpMessageProcessor object for sending messages for a given
44 // feature.
44 virtual std::unique_ptr<BlimpMessageProcessor> RegisterFeature( 45 virtual std::unique_ptr<BlimpMessageProcessor> RegisterFeature(
45 BlimpMessage::Type type, 46 BlimpMessage::FeatureCase feature_case,
46 BlimpMessageProcessor* incoming_processor); 47 BlimpMessageProcessor* incoming_processor);
47 48
48 // ConnectionHandler implementation. 49 // ConnectionHandler implementation.
49 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override; 50 void HandleConnection(std::unique_ptr<BlimpConnection> connection) override;
50 51
51 // ConnectionErrorObserver implementation. 52 // ConnectionErrorObserver implementation.
52 void OnConnectionError(int error) override; 53 void OnConnectionError(int error) override;
53 54
54 private: 55 private:
55 void DropCurrentConnection(); 56 void DropCurrentConnection();
(...skipping 14 matching lines...) Expand all
70 71
71 // Holds network resources while there is a Client connected. 72 // Holds network resources while there is a Client connected.
72 std::unique_ptr<BlimpConnection> connection_; 73 std::unique_ptr<BlimpConnection> connection_;
73 74
74 DISALLOW_COPY_AND_ASSIGN(BrowserConnectionHandler); 75 DISALLOW_COPY_AND_ASSIGN(BrowserConnectionHandler);
75 }; 76 };
76 77
77 } // namespace blimp 78 } // namespace blimp
78 79
79 #endif // BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_ 80 #endif // BLIMP_NET_BROWSER_CONNECTION_HANDLER_H_
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_pump_unittest.cc ('k') | blimp/net/browser_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698