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 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/power_monitor/power_monitor.h" | 17 #include "base/power_monitor/power_monitor.h" |
18 #include "base/sequenced_task_runner.h" | 18 #include "base/sequenced_task_runner.h" |
19 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
22 #include "content/public/child/child_thread.h" | 22 #include "content/public/child/child_thread.h" |
23 #include "ipc/ipc.mojom.h" | |
24 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 23 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
25 #include "ipc/ipc_platform_file.h" | 24 #include "ipc/ipc_platform_file.h" |
26 #include "ipc/message_router.h" | 25 #include "ipc/message_router.h" |
27 #include "services/shell/public/cpp/shell_client.h" | 26 #include "services/shell/public/cpp/shell_client.h" |
28 | 27 |
29 namespace base { | 28 namespace base { |
30 class MessageLoop; | 29 class MessageLoop; |
31 } // namespace base | 30 } // namespace base |
32 | 31 |
33 namespace IPC { | 32 namespace IPC { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 void PreCacheFont(const LOGFONT& log_font) override; | 95 void PreCacheFont(const LOGFONT& log_font) override; |
97 void ReleaseCachedFonts() override; | 96 void ReleaseCachedFonts() override; |
98 #endif | 97 #endif |
99 void RecordAction(const base::UserMetricsAction& action) override; | 98 void RecordAction(const base::UserMetricsAction& action) override; |
100 void RecordComputedAction(const std::string& action) override; | 99 void RecordComputedAction(const std::string& action) override; |
101 MojoShellConnection* GetMojoShellConnection() override; | 100 MojoShellConnection* GetMojoShellConnection() override; |
102 shell::InterfaceRegistry* GetInterfaceRegistry() override; | 101 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
103 shell::InterfaceProvider* GetRemoteInterfaces() override; | 102 shell::InterfaceProvider* GetRemoteInterfaces() override; |
104 | 103 |
105 // shell::ShellClient: | 104 // shell::ShellClient: |
106 bool AcceptConnection(shell::Connection* connection) override; | |
107 shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; | 105 shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; |
108 shell::InterfaceProvider* GetInterfaceProviderForConnection() override; | 106 shell::InterfaceProvider* GetInterfaceProviderForConnection() override; |
109 | 107 |
110 IPC::SyncChannel* channel() { return channel_.get(); } | 108 IPC::SyncChannel* channel() { return channel_.get(); } |
111 | 109 |
112 IPC::MessageRouter* GetRouter(); | 110 IPC::MessageRouter* GetRouter(); |
113 | 111 |
114 // Allocates a block of shared memory of the given size. Returns NULL on | 112 // Allocates a block of shared memory of the given size. Returns NULL on |
115 // failure. | 113 // failure. |
116 // Note: On posix, this requires a sync IPC to the browser process, | 114 // Note: On posix, this requires a sync IPC to the browser process, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void OnShutdown(); | 245 void OnShutdown(); |
248 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); | 246 void OnSetProfilerStatus(tracked_objects::ThreadData::Status status); |
249 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); | 247 void OnGetChildProfilerData(int sequence_number, int current_profiling_phase); |
250 void OnProfilingPhaseCompleted(int profiling_phase); | 248 void OnProfilingPhaseCompleted(int profiling_phase); |
251 #ifdef IPC_MESSAGE_LOG_ENABLED | 249 #ifdef IPC_MESSAGE_LOG_ENABLED |
252 void OnSetIPCLoggingEnabled(bool enable); | 250 void OnSetIPCLoggingEnabled(bool enable); |
253 #endif | 251 #endif |
254 | 252 |
255 void EnsureConnected(); | 253 void EnsureConnected(); |
256 | 254 |
257 void BindBootstrapRequest(mojo::ScopedMessagePipeHandle handle); | |
258 | |
259 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; | 255 std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; |
260 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; | 256 std::unique_ptr<MojoShellConnection> mojo_shell_connection_; |
261 IPC::mojom::BootstrapPtr pending_bootstrap_; | |
262 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; | 257 std::unique_ptr<shell::InterfaceRegistry> interface_registry_; |
263 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; | 258 std::unique_ptr<shell::InterfaceProvider> remote_interfaces_; |
264 | 259 |
265 std::string channel_name_; | 260 std::string channel_name_; |
266 std::unique_ptr<IPC::SyncChannel> channel_; | 261 std::unique_ptr<IPC::SyncChannel> channel_; |
267 | 262 |
268 // Allows threads other than the main thread to send sync messages. | 263 // Allows threads other than the main thread to send sync messages. |
269 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 264 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
270 | 265 |
271 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 266 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 344 |
350 private: | 345 private: |
351 struct Options options_; | 346 struct Options options_; |
352 | 347 |
353 DISALLOW_COPY_AND_ASSIGN(Builder); | 348 DISALLOW_COPY_AND_ASSIGN(Builder); |
354 }; | 349 }; |
355 | 350 |
356 } // namespace content | 351 } // namespace content |
357 | 352 |
358 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 353 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
OLD | NEW |