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_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 5 #ifndef BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
6 #define BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 6 #define BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "blimp/common/proto/blimp_message.pb.h" | 14 #include "blimp/common/proto/blimp_message.pb.h" |
| 15 #include "blimp/common/public/session/assignment_options.h" |
15 #include "blimp/engine/feature/engine_render_widget_feature.h" | 16 #include "blimp/engine/feature/engine_render_widget_feature.h" |
16 #include "blimp/engine/feature/engine_settings_feature.h" | 17 #include "blimp/engine/feature/engine_settings_feature.h" |
17 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h" | 18 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h" |
18 #include "blimp/engine/mojo/blob_channel_service.h" | 19 #include "blimp/engine/mojo/blob_channel_service.h" |
19 #include "blimp/net/blimp_message_processor.h" | 20 #include "blimp/net/blimp_message_processor.h" |
20 #include "blimp/net/blob_channel/blob_channel_sender_impl.h" | 21 #include "blimp/net/blob_channel/blob_channel_sender_impl.h" |
21 #include "blimp/net/connection_error_observer.h" | 22 #include "blimp/net/connection_error_observer.h" |
22 #include "content/public/browser/invalidate_type.h" | 23 #include "content/public/browser/invalidate_type.h" |
23 #include "content/public/browser/web_contents_delegate.h" | 24 #include "content/public/browser/web_contents_delegate.h" |
24 #include "net/base/completion_callback.h" | 25 #include "net/base/completion_callback.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class BlimpFocusClient; | 69 class BlimpFocusClient; |
69 class BlimpScreen; | 70 class BlimpScreen; |
70 class BlimpWindowTreeHost; | 71 class BlimpWindowTreeHost; |
71 class EngineNetworkComponents; | 72 class EngineNetworkComponents; |
72 class Tab; | 73 class Tab; |
73 | 74 |
74 class BlimpEngineSession : public BlimpMessageProcessor, | 75 class BlimpEngineSession : public BlimpMessageProcessor, |
75 public content::WebContentsDelegate, | 76 public content::WebContentsDelegate, |
76 public ui::InputMethodObserver { | 77 public ui::InputMethodObserver { |
77 public: | 78 public: |
78 using GetPortCallback = base::Callback<void(uint16_t)>; | 79 using GetAssignmentOptionsCallback = base::Callback<void(AssignmentOptions)>; |
79 | 80 |
80 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, | 81 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, |
81 net::NetLog* net_log, | 82 net::NetLog* net_log, |
82 BlimpEngineConfig* config, | 83 BlimpEngineConfig* config, |
83 SettingsManager* settings_manager); | 84 SettingsManager* settings_manager); |
84 ~BlimpEngineSession() override; | 85 ~BlimpEngineSession() override; |
85 | 86 |
86 // Starts the network stack on the IO thread, and sets default placeholder | 87 // Starts the network stack on the IO thread, and sets default placeholder |
87 // values for e.g. screen size pending real values being supplied by the | 88 // values for e.g. screen size pending real values being supplied by the |
88 // client. | 89 // client. |
89 void Initialize(); | 90 void Initialize(); |
90 | 91 |
91 BlimpBrowserContext* browser_context() { return browser_context_.get(); } | 92 BlimpBrowserContext* browser_context() { return browser_context_.get(); } |
92 | 93 |
93 BlobChannelSender* blob_channel_sender() { | 94 BlobChannelSender* blob_channel_sender() { |
94 return blob_channel_sender_.get(); | 95 return blob_channel_sender_.get(); |
95 } | 96 } |
96 | 97 |
97 BlobChannelService* GetBlobChannelService(); | 98 BlobChannelService* GetBlobChannelService(); |
98 | 99 |
99 // Gets Engine's listening port. Invokes callback with the allocated port. | 100 // Gets Engine's listening port. Invokes callback with the allocated port. |
100 void GetEnginePortForTesting(const GetPortCallback& callback); | 101 void GetAssignmentOptions(const GetAssignmentOptionsCallback& callback); |
101 | 102 |
102 // BlimpMessageProcessor implementation. | 103 // BlimpMessageProcessor implementation. |
103 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly. | 104 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly. |
104 void ProcessMessage(std::unique_ptr<BlimpMessage> message, | 105 void ProcessMessage(std::unique_ptr<BlimpMessage> message, |
105 const net::CompletionCallback& callback) override; | 106 const net::CompletionCallback& callback) override; |
106 | 107 |
107 private: | 108 private: |
108 // Creates ThreadPipeManager, registers features, and then starts to accept | 109 // Creates ThreadPipeManager, registers features, and then starts to accept |
109 // incoming connection. | 110 // incoming connection. |
110 void RegisterFeatures(); | 111 void RegisterFeatures(); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // TODO(haibinlu): Support more than one tab (crbug/547231) | 221 // TODO(haibinlu): Support more than one tab (crbug/547231) |
221 std::unique_ptr<Tab> tab_; | 222 std::unique_ptr<Tab> tab_; |
222 | 223 |
223 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 224 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
224 }; | 225 }; |
225 | 226 |
226 } // namespace engine | 227 } // namespace engine |
227 } // namespace blimp | 228 } // namespace blimp |
228 | 229 |
229 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 230 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
OLD | NEW |