OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 5 #ifndef CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 6 #define CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace base { | 27 namespace base { |
28 class MessageLoop; | 28 class MessageLoop; |
29 } // namespace base | 29 } // namespace base |
30 | 30 |
31 namespace IPC { | 31 namespace IPC { |
32 class MessageFilter; | 32 class MessageFilter; |
33 class SyncChannel; | 33 class SyncChannel; |
34 class SyncMessageFilter; | 34 class SyncMessageFilter; |
35 } // namespace IPC | 35 } // namespace IPC |
36 | 36 |
| 37 namespace shell { |
| 38 class Connection; |
| 39 } // namespace shell |
| 40 |
37 namespace mojo { | 41 namespace mojo { |
38 namespace edk { | 42 namespace edk { |
39 class ScopedIPCSupport; | 43 class ScopedIPCSupport; |
40 } // namespace edk | 44 } // namespace edk |
41 } // namespace mojo | 45 } // namespace mojo |
42 | 46 |
43 namespace blink { | 47 namespace blink { |
44 class WebFrame; | 48 class WebFrame; |
45 } // namespace blink | 49 } // namespace blink |
46 | 50 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 #ifdef IPC_MESSAGE_LOG_ENABLED | 252 #ifdef IPC_MESSAGE_LOG_ENABLED |
249 void OnSetIPCLoggingEnabled(bool enable); | 253 void OnSetIPCLoggingEnabled(bool enable); |
250 #endif | 254 #endif |
251 | 255 |
252 void EnsureConnected(); | 256 void EnsureConnected(); |
253 | 257 |
254 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; | 258 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; |
255 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; | 259 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; |
256 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; | 260 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; |
257 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; | 261 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; |
| 262 std::unique_ptr<shell::Connection> browser_connection_; |
258 | 263 |
259 std::string channel_name_; | 264 std::string channel_name_; |
260 std::unique_ptr<IPC::SyncChannel> channel_; | 265 std::unique_ptr<IPC::SyncChannel> channel_; |
261 | 266 |
262 // Allows threads other than the main thread to send sync messages. | 267 // Allows threads other than the main thread to send sync messages. |
263 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 268 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
264 | 269 |
265 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 270 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
266 | 271 |
267 // Implements message routing functionality to the consumers of | 272 // Implements message routing functionality to the consumers of |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 323 |
319 struct ChildThreadImpl::Options { | 324 struct ChildThreadImpl::Options { |
320 Options(const Options& other); | 325 Options(const Options& other); |
321 ~Options(); | 326 ~Options(); |
322 | 327 |
323 class Builder; | 328 class Builder; |
324 | 329 |
325 std::string channel_name; | 330 std::string channel_name; |
326 bool use_mojo_channel; | 331 bool use_mojo_channel; |
327 bool auto_start_mojo_shell_connection; | 332 bool auto_start_mojo_shell_connection; |
| 333 bool connect_to_browser; |
328 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; | 334 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; |
329 std::vector<IPC::MessageFilter*> startup_filters; | 335 std::vector<IPC::MessageFilter*> startup_filters; |
330 std::string in_process_ipc_token; | 336 std::string in_process_ipc_token; |
331 std::string in_process_application_token; | 337 std::string in_process_application_token; |
332 | 338 |
333 private: | 339 private: |
334 Options(); | 340 Options(); |
335 }; | 341 }; |
336 | 342 |
337 class ChildThreadImpl::Options::Builder { | 343 class ChildThreadImpl::Options::Builder { |
338 public: | 344 public: |
339 Builder(); | 345 Builder(); |
340 | 346 |
341 Builder& InBrowserProcess(const InProcessChildThreadParams& params); | 347 Builder& InBrowserProcess(const InProcessChildThreadParams& params); |
342 Builder& UseMojoChannel(bool use_mojo_channel); | 348 Builder& UseMojoChannel(bool use_mojo_channel); |
343 Builder& AutoStartMojoShellConnection(bool auto_start); | 349 Builder& AutoStartMojoShellConnection(bool auto_start); |
| 350 Builder& ConnectToBrowser(bool connect_to_browser); |
344 Builder& WithChannelName(const std::string& channel_name); | 351 Builder& WithChannelName(const std::string& channel_name); |
345 Builder& AddStartupFilter(IPC::MessageFilter* filter); | 352 Builder& AddStartupFilter(IPC::MessageFilter* filter); |
346 | 353 |
347 Options Build(); | 354 Options Build(); |
348 | 355 |
349 private: | 356 private: |
350 struct Options options_; | 357 struct Options options_; |
351 | 358 |
352 DISALLOW_COPY_AND_ASSIGN(Builder); | 359 DISALLOW_COPY_AND_ASSIGN(Builder); |
353 }; | 360 }; |
354 | 361 |
355 } // namespace content | 362 } // namespace content |
356 | 363 |
357 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 364 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |