| 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_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // | 72 // |
| 73 // Never returns MemoryDumpManager::kInvalidTracingProcessId. | 73 // Never returns MemoryDumpManager::kInvalidTracingProcessId. |
| 74 // Returns only ChildProcessHost::kBrowserTracingProcessId in single-process | 74 // Returns only ChildProcessHost::kBrowserTracingProcessId in single-process |
| 75 // mode. | 75 // mode. |
| 76 static uint64_t ChildProcessUniqueIdToTracingProcessId(int child_process_id); | 76 static uint64_t ChildProcessUniqueIdToTracingProcessId(int child_process_id); |
| 77 | 77 |
| 78 // ChildProcessHost implementation | 78 // ChildProcessHost implementation |
| 79 bool Send(IPC::Message* message) override; | 79 bool Send(IPC::Message* message) override; |
| 80 void ForceShutdown() override; | 80 void ForceShutdown() override; |
| 81 std::string CreateChannel() override; | 81 std::string CreateChannel() override; |
| 82 std::string CreateChannelMojo(const std::string& child_token) override; |
| 82 bool IsChannelOpening() override; | 83 bool IsChannelOpening() override; |
| 83 void AddFilter(IPC::MessageFilter* filter) override; | 84 void AddFilter(IPC::MessageFilter* filter) override; |
| 84 #if defined(OS_POSIX) | 85 #if defined(OS_POSIX) |
| 85 base::ScopedFD TakeClientFileDescriptor() override; | 86 base::ScopedFD TakeClientFileDescriptor() override; |
| 86 #endif | 87 #endif |
| 87 | 88 |
| 88 private: | 89 private: |
| 89 friend class ChildProcessHost; | 90 friend class ChildProcessHost; |
| 90 | 91 |
| 91 explicit ChildProcessHostImpl(ChildProcessHostDelegate* delegate); | 92 explicit ChildProcessHostImpl(ChildProcessHostDelegate* delegate); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 102 base::SharedMemoryHandle* handle); | 103 base::SharedMemoryHandle* handle); |
| 103 void OnAllocateGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 104 void OnAllocateGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 104 uint32_t width, | 105 uint32_t width, |
| 105 uint32_t height, | 106 uint32_t height, |
| 106 gfx::BufferFormat format, | 107 gfx::BufferFormat format, |
| 107 gfx::BufferUsage usage, | 108 gfx::BufferUsage usage, |
| 108 gfx::GpuMemoryBufferHandle* handle); | 109 gfx::GpuMemoryBufferHandle* handle); |
| 109 void OnDeletedGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 110 void OnDeletedGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 110 const gpu::SyncToken& sync_token); | 111 const gpu::SyncToken& sync_token); |
| 111 | 112 |
| 113 // Initializes the IPC channel and returns true on success. |channel_| must be |
| 114 // non-null. |
| 115 bool InitChannel(); |
| 116 |
| 112 ChildProcessHostDelegate* delegate_; | 117 ChildProcessHostDelegate* delegate_; |
| 113 base::Process peer_process_; | 118 base::Process peer_process_; |
| 114 bool opening_channel_; // True while we're waiting the channel to be opened. | 119 bool opening_channel_; // True while we're waiting the channel to be opened. |
| 115 std::unique_ptr<IPC::Channel> channel_; | 120 std::unique_ptr<IPC::Channel> channel_; |
| 116 std::string channel_id_; | 121 std::string channel_id_; |
| 117 | 122 |
| 118 // Holds all the IPC message filters. Since this object lives on the IO | 123 // Holds all the IPC message filters. Since this object lives on the IO |
| 119 // thread, we don't have a IPC::ChannelProxy and so we manage filters | 124 // thread, we don't have a IPC::ChannelProxy and so we manage filters |
| 120 // manually. | 125 // manually. |
| 121 std::vector<scoped_refptr<IPC::MessageFilter> > filters_; | 126 std::vector<scoped_refptr<IPC::MessageFilter> > filters_; |
| 122 | 127 |
| 123 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); | 128 DISALLOW_COPY_AND_ASSIGN(ChildProcessHostImpl); |
| 124 }; | 129 }; |
| 125 | 130 |
| 126 } // namespace content | 131 } // namespace content |
| 127 | 132 |
| 128 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ | 133 #endif // CONTENT_COMMON_CHILD_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |