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