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

Side by Side Diff: blimp/engine/session/blimp_engine_session.h

Issue 2256363003: Clean up thread handling in Blimp browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wez feedback Created 4 years, 4 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_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/engine/feature/engine_render_widget_feature.h" 15 #include "blimp/engine/feature/engine_render_widget_feature.h"
16 #include "blimp/engine/feature/engine_settings_feature.h" 16 #include "blimp/engine/feature/engine_settings_feature.h"
17 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h" 17 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h"
18 #include "blimp/engine/mojo/blob_channel_service.h" 18 #include "blimp/engine/mojo/blob_channel_service.h"
19 #include "blimp/net/blimp_message_processor.h" 19 #include "blimp/net/blimp_message_processor.h"
20 #include "blimp/net/blob_channel/blob_channel_sender_impl.h"
20 #include "blimp/net/connection_error_observer.h" 21 #include "blimp/net/connection_error_observer.h"
21 #include "content/public/browser/invalidate_type.h" 22 #include "content/public/browser/invalidate_type.h"
22 #include "content/public/browser/web_contents_delegate.h" 23 #include "content/public/browser/web_contents_delegate.h"
23 #include "net/base/completion_callback.h" 24 #include "net/base/completion_callback.h"
24 #include "ui/base/ime/input_method_observer.h" 25 #include "ui/base/ime/input_method_observer.h"
25 #include "ui/gfx/geometry/size.h" 26 #include "ui/gfx/geometry/size.h"
26 27
27 namespace aura { 28 namespace aura {
28 class WindowTreeHost; 29 class WindowTreeHost;
29 30
(...skipping 20 matching lines...) Expand all
50 namespace wm { 51 namespace wm {
51 class FocusController; 52 class FocusController;
52 } 53 }
53 54
54 namespace blimp { 55 namespace blimp {
55 56
56 class BlimpConnection; 57 class BlimpConnection;
57 class BlimpMessage; 58 class BlimpMessage;
58 class BlimpMessageThreadPipe; 59 class BlimpMessageThreadPipe;
59 class BlobCache; 60 class BlobCache;
60 class BlobChannelSender;
61 class HeliumBlobSenderDelegate; 61 class HeliumBlobSenderDelegate;
62 class ThreadPipeManager; 62 class ThreadPipeManager;
63 class SettingsManager; 63 class SettingsManager;
64 64
65 namespace engine { 65 namespace engine {
66 66
67 class BlimpBrowserContext; 67 class BlimpBrowserContext;
68 class BlimpEngineConfig; 68 class BlimpEngineConfig;
69 class BlimpFocusClient; 69 class BlimpFocusClient;
70 class BlimpScreen; 70 class BlimpScreen;
(...skipping 19 matching lines...) Expand all
90 // values for e.g. screen size pending real values being supplied by the 90 // values for e.g. screen size pending real values being supplied by the
91 // client. 91 // client.
92 void Initialize(); 92 void Initialize();
93 93
94 BlimpBrowserContext* browser_context() { return browser_context_.get(); } 94 BlimpBrowserContext* browser_context() { return browser_context_.get(); }
95 95
96 BlobChannelSender* blob_channel_sender() { 96 BlobChannelSender* blob_channel_sender() {
97 return blob_channel_sender_.get(); 97 return blob_channel_sender_.get();
98 } 98 }
99 99
100 BlobChannelService* blob_channel_service() { 100 BlobChannelService* GetBlobChannelService();
101 return blob_channel_service_.get();
102 }
103 101
104 // Gets Engine's listening port. Invokes callback with the allocated port. 102 // Gets Engine's listening port. Invokes callback with the allocated port.
105 void GetEnginePortForTesting(const GetPortCallback& callback); 103 void GetEnginePortForTesting(const GetPortCallback& callback);
106 104
107 // BlimpMessageProcessor implementation. 105 // BlimpMessageProcessor implementation.
108 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly. 106 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly.
109 void ProcessMessage(std::unique_ptr<BlimpMessage> message, 107 void ProcessMessage(std::unique_ptr<BlimpMessage> message,
110 const net::CompletionCallback& callback) override; 108 const net::CompletionCallback& callback) override;
111 109
112 private: 110 private:
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 199
202 // Handles all incoming and outgoing messages related to RenderWidget, 200 // Handles all incoming and outgoing messages related to RenderWidget,
203 // including INPUT, COMPOSITOR and RENDER_WIDGET messages. 201 // including INPUT, COMPOSITOR and RENDER_WIDGET messages.
204 EngineRenderWidgetFeature render_widget_feature_; 202 EngineRenderWidgetFeature render_widget_feature_;
205 203
206 // Sends outgoing blob data as BlimpMessages. 204 // Sends outgoing blob data as BlimpMessages.
207 HeliumBlobSenderDelegate* blob_delegate_; 205 HeliumBlobSenderDelegate* blob_delegate_;
208 206
209 // Receives image data and sends it to the client via 207 // Receives image data and sends it to the client via
210 // |blob_delegate_|. 208 // |blob_delegate_|.
211 std::unique_ptr<BlobChannelSender> blob_channel_sender_; 209 std::unique_ptr<BlobChannelSenderImpl> blob_channel_sender_;
210
211 std::unique_ptr<base::WeakPtrFactory<BlobChannelSenderImpl>>
212 blob_channel_sender_weak_factory_;
212 213
213 // Receives image data from the renderer and sends it to 214 // Receives image data from the renderer and sends it to
214 // |blob_channel_sender_|. 215 // |blob_channel_sender_|.
215 std::unique_ptr<BlobChannelService> blob_channel_service_; 216 std::unique_ptr<BlobChannelService> blob_channel_service_;
216 217
217 // Handles all incoming and outgoing messages related to Geolocation. 218 // Handles all incoming and outgoing messages related to Geolocation.
218 EngineGeolocationFeature geolocation_feature_; 219 EngineGeolocationFeature geolocation_feature_;
219 220
220 // Container for connection manager, authentication handler, and 221 // Container for connection manager, authentication handler, and
221 // browser connection handler. The components run on the I/O thread, and 222 // browser connection handler. The components run on the I/O thread, and
222 // this object is destroyed there. 223 // this object is destroyed there.
223 std::unique_ptr<EngineNetworkComponents> net_components_; 224 std::unique_ptr<EngineNetworkComponents> net_components_;
224 225
225 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; 226 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_;
226 227
227 // Used to send TAB_CONTROL or NAVIGATION messages to client. 228 // Used to send TAB_CONTROL or NAVIGATION messages to client.
228 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; 229 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_;
229 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; 230 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_;
230 231
231 // TODO(haibinlu): Support more than one tab (crbug/547231) 232 // TODO(haibinlu): Support more than one tab (crbug/547231)
232 std::unique_ptr<Tab> tab_; 233 std::unique_ptr<Tab> tab_;
233 234
234 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); 235 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession);
235 }; 236 };
236 237
237 } // namespace engine 238 } // namespace engine
238 } // namespace blimp 239 } // namespace blimp
239 240
240 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ 241 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_
OLDNEW
« no previous file with comments | « blimp/engine/renderer/blob_channel_sender_proxy_unittest.cc ('k') | blimp/engine/session/blimp_engine_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698