OLD | NEW |
---|---|
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_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 5 #ifndef BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
6 #define BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 6 #define BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "blimp/client/blimp_client_export.h" | 10 #include "blimp/client/blimp_client_export.h" |
11 | 11 |
12 namespace blimp { | 12 namespace blimp { |
13 | 13 |
14 class BrowserConnectionHandler; | 14 class BrowserConnectionHandler; |
15 class ClientConnectionManager; | |
15 class NavigationFeature; | 16 class NavigationFeature; |
16 class RenderWidgetFeature; | 17 class RenderWidgetFeature; |
17 class TabControlFeature; | 18 class TabControlFeature; |
18 | 19 |
19 // BlimpClientSession represents a single active session of Blimp on the client | 20 // BlimpClientSession represents a single active session of Blimp on the client |
20 // regardless of whether or not the client application is in the background or | 21 // regardless of whether or not the client application is in the background or |
21 // foreground. The only time this session is invalid is during initialization | 22 // foreground. The only time this session is invalid is during initialization |
22 // and shutdown of this particular client process (or Activity on Android). | 23 // and shutdown of this particular client process (or Activity on Android). |
23 // | 24 // |
24 // This session glues together the feature proxy components and the network | 25 // This session glues together the feature proxy components and the network |
25 // layer. The network components must be interacted with on the IO thread. The | 26 // layer. The network components must be interacted with on the IO thread. The |
26 // feature proxies must be interacted with on the UI thread. | 27 // feature proxies must be interacted with on the UI thread. |
27 class BLIMP_CLIENT_EXPORT BlimpClientSession { | 28 class BLIMP_CLIENT_EXPORT BlimpClientSession { |
28 public: | 29 public: |
29 BlimpClientSession(); | 30 BlimpClientSession(); |
30 | 31 |
31 TabControlFeature* GetTabControlFeature() const; | 32 TabControlFeature* GetTabControlFeature() const; |
32 NavigationFeature* GetNavigationFeature() const; | 33 NavigationFeature* GetNavigationFeature() const; |
33 RenderWidgetFeature* GetRenderWidgetFeature() const; | 34 RenderWidgetFeature* GetRenderWidgetFeature() const; |
34 | 35 |
36 // Tells |connection_manager_| to start connecting to the remote host. | |
37 // Must be called on the IO thread. | |
38 void Connect(); | |
39 | |
35 protected: | 40 protected: |
36 virtual ~BlimpClientSession(); | 41 virtual ~BlimpClientSession(); |
37 | 42 |
43 ClientConnectionManager* GetConnectionManager() const; | |
44 | |
38 private: | 45 private: |
39 // The BrowserConnectionHandler is here so that the BlimpClientSession can | 46 // The BrowserConnectionHandler is here so that the BlimpClientSession can |
40 // glue the feature-specific handlers to the actual network connection. | 47 // glue the feature-specific handlers to the actual network connection. |
41 scoped_ptr<BrowserConnectionHandler> connection_handler_; | 48 scoped_ptr<BrowserConnectionHandler> connection_handler_; |
haibinlu
2015/12/29 00:51:45
can we have the similar BlimpNetworkComponent to c
Kevin M
2015/12/30 23:08:48
Done.
| |
42 | 49 |
50 scoped_ptr<ClientConnectionManager> connection_manager_; | |
51 | |
43 scoped_ptr<TabControlFeature> tab_control_feature_; | 52 scoped_ptr<TabControlFeature> tab_control_feature_; |
44 scoped_ptr<NavigationFeature> navigation_feature_; | 53 scoped_ptr<NavigationFeature> navigation_feature_; |
45 scoped_ptr<RenderWidgetFeature> render_widget_feature_; | 54 scoped_ptr<RenderWidgetFeature> render_widget_feature_; |
46 | 55 |
47 DISALLOW_COPY_AND_ASSIGN(BlimpClientSession); | 56 DISALLOW_COPY_AND_ASSIGN(BlimpClientSession); |
48 }; | 57 }; |
49 | 58 |
50 } // namespace blimp | 59 } // namespace blimp |
51 | 60 |
52 #endif // BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ | 61 #endif // BLIMP_CLIENT_SESSION_BLIMP_CLIENT_SESSION_H_ |
OLD | NEW |