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

Side by Side Diff: content/child/child_thread_impl.h

Issue 2183703005: Renderers should obtain browser InterfaceProvider by connecting to browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 (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
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
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 bool connect_to_browser_ = false;
263 std::unique_ptr<shell::Connection> browser_connection_;
258 264
259 std::string channel_name_; 265 std::string channel_name_;
260 std::unique_ptr<IPC::SyncChannel> channel_; 266 std::unique_ptr<IPC::SyncChannel> channel_;
261 267
262 // Allows threads other than the main thread to send sync messages. 268 // Allows threads other than the main thread to send sync messages.
263 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; 269 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
264 270
265 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 271 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
266 272
267 // Implements message routing functionality to the consumers of 273 // Implements message routing functionality to the consumers of
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 324
319 struct ChildThreadImpl::Options { 325 struct ChildThreadImpl::Options {
320 Options(const Options& other); 326 Options(const Options& other);
321 ~Options(); 327 ~Options();
322 328
323 class Builder; 329 class Builder;
324 330
325 std::string channel_name; 331 std::string channel_name;
326 bool use_mojo_channel; 332 bool use_mojo_channel;
327 bool auto_start_mojo_shell_connection; 333 bool auto_start_mojo_shell_connection;
334 bool connect_to_browser;
328 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner; 335 scoped_refptr<base::SequencedTaskRunner> browser_process_io_runner;
329 std::vector<IPC::MessageFilter*> startup_filters; 336 std::vector<IPC::MessageFilter*> startup_filters;
330 std::string in_process_ipc_token; 337 std::string in_process_ipc_token;
331 std::string in_process_application_token; 338 std::string in_process_application_token;
332 339
333 private: 340 private:
334 Options(); 341 Options();
335 }; 342 };
336 343
337 class ChildThreadImpl::Options::Builder { 344 class ChildThreadImpl::Options::Builder {
338 public: 345 public:
339 Builder(); 346 Builder();
340 347
341 Builder& InBrowserProcess(const InProcessChildThreadParams& params); 348 Builder& InBrowserProcess(const InProcessChildThreadParams& params);
342 Builder& UseMojoChannel(bool use_mojo_channel); 349 Builder& UseMojoChannel(bool use_mojo_channel);
343 Builder& AutoStartMojoShellConnection(bool auto_start); 350 Builder& AutoStartMojoShellConnection(bool auto_start);
351 Builder& ConnectToBrowser(bool connect_to_browser);
344 Builder& WithChannelName(const std::string& channel_name); 352 Builder& WithChannelName(const std::string& channel_name);
345 Builder& AddStartupFilter(IPC::MessageFilter* filter); 353 Builder& AddStartupFilter(IPC::MessageFilter* filter);
346 354
347 Options Build(); 355 Options Build();
348 356
349 private: 357 private:
350 struct Options options_; 358 struct Options options_;
351 359
352 DISALLOW_COPY_AND_ASSIGN(Builder); 360 DISALLOW_COPY_AND_ASSIGN(Builder);
353 }; 361 };
354 362
355 } // namespace content 363 } // namespace content
356 364
357 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ 365 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698