| 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_message.h" // For IPC_MESSAGE_LOG_ENABLED. | 23 #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. |
| 24 #include "ipc/ipc_platform_file.h" | 24 #include "ipc/ipc_platform_file.h" |
| 25 #include "ipc/message_router.h" | 25 #include "ipc/message_router.h" |
| 26 #include "services/shell/public/cpp/shell_client.h" | 26 #include "services/shell/public/cpp/service.h" |
| 27 | 27 |
| 28 namespace base { | 28 namespace base { |
| 29 class MessageLoop; | 29 class MessageLoop; |
| 30 } // namespace base | 30 } // namespace base |
| 31 | 31 |
| 32 namespace IPC { | 32 namespace IPC { |
| 33 class MessageFilter; | 33 class MessageFilter; |
| 34 class SyncChannel; | 34 class SyncChannel; |
| 35 class SyncMessageFilter; | 35 class SyncMessageFilter; |
| 36 } // namespace IPC | 36 } // namespace IPC |
| (...skipping 25 matching lines...) Expand all Loading... |
| 62 class ResourceDispatcher; | 62 class ResourceDispatcher; |
| 63 class ThreadSafeSender; | 63 class ThreadSafeSender; |
| 64 class WebSocketDispatcher; | 64 class WebSocketDispatcher; |
| 65 class WebSocketMessageFilter; | 65 class WebSocketMessageFilter; |
| 66 struct RequestInfo; | 66 struct RequestInfo; |
| 67 | 67 |
| 68 // The main thread of a child process derives from this class. | 68 // The main thread of a child process derives from this class. |
| 69 class CONTENT_EXPORT ChildThreadImpl | 69 class CONTENT_EXPORT ChildThreadImpl |
| 70 : public IPC::Listener, | 70 : public IPC::Listener, |
| 71 virtual public ChildThread, | 71 virtual public ChildThread, |
| 72 public NON_EXPORTED_BASE(shell::ShellClient){ | 72 public NON_EXPORTED_BASE(shell::Service){ |
| 73 public: | 73 public: |
| 74 struct CONTENT_EXPORT Options; | 74 struct CONTENT_EXPORT Options; |
| 75 | 75 |
| 76 // Creates the thread. | 76 // Creates the thread. |
| 77 ChildThreadImpl(); | 77 ChildThreadImpl(); |
| 78 // Allow to be used for single-process mode and for in process gpu mode via | 78 // Allow to be used for single-process mode and for in process gpu mode via |
| 79 // options. | 79 // options. |
| 80 explicit ChildThreadImpl(const Options& options); | 80 explicit ChildThreadImpl(const Options& options); |
| 81 // ChildProcess::main_thread() is reset after Shutdown(), and before the | 81 // ChildProcess::main_thread() is reset after Shutdown(), and before the |
| 82 // destructor, so any subsystem that relies on ChildProcess::main_thread() | 82 // destructor, so any subsystem that relies on ChildProcess::main_thread() |
| (...skipping 11 matching lines...) Expand all Loading... |
| 94 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
| 95 void PreCacheFont(const LOGFONT& log_font) override; | 95 void PreCacheFont(const LOGFONT& log_font) override; |
| 96 void ReleaseCachedFonts() override; | 96 void ReleaseCachedFonts() override; |
| 97 #endif | 97 #endif |
| 98 void RecordAction(const base::UserMetricsAction& action) override; | 98 void RecordAction(const base::UserMetricsAction& action) override; |
| 99 void RecordComputedAction(const std::string& action) override; | 99 void RecordComputedAction(const std::string& action) override; |
| 100 MojoShellConnection* GetMojoShellConnection() override; | 100 MojoShellConnection* GetMojoShellConnection() override; |
| 101 shell::InterfaceRegistry* GetInterfaceRegistry() override; | 101 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
| 102 shell::InterfaceProvider* GetRemoteInterfaces() override; | 102 shell::InterfaceProvider* GetRemoteInterfaces() override; |
| 103 | 103 |
| 104 // shell::ShellClient: | 104 // shell::Service: |
| 105 shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; | 105 shell::InterfaceRegistry* GetInterfaceRegistryForConnection() override; |
| 106 shell::InterfaceProvider* GetInterfaceProviderForConnection() override; | 106 shell::InterfaceProvider* GetInterfaceProviderForConnection() override; |
| 107 | 107 |
| 108 IPC::SyncChannel* channel() { return channel_.get(); } | 108 IPC::SyncChannel* channel() { return channel_.get(); } |
| 109 | 109 |
| 110 IPC::MessageRouter* GetRouter(); | 110 IPC::MessageRouter* GetRouter(); |
| 111 | 111 |
| 112 // 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 |
| 113 // failure. | 113 // failure. |
| 114 // 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 private: | 345 private: |
| 346 struct Options options_; | 346 struct Options options_; |
| 347 | 347 |
| 348 DISALLOW_COPY_AND_ASSIGN(Builder); | 348 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 349 }; | 349 }; |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| 352 | 352 |
| 353 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ | 353 #endif // CONTENT_CHILD_CHILD_THREAD_IMPL_H_ |
| OLD | NEW |