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 #include "content/common/child_process_host_impl.h" | 5 #include "content/common/child_process_host_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process/process_metrics.h" | 15 #include "base/process/process_metrics.h" |
16 #include "base/rand_util.h" | 16 #include "base/rand_util.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 18 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
19 #include "content/common/child_process_messages.h" | 19 #include "content/common/child_process_messages.h" |
20 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 20 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
21 #include "content/public/common/child_process_host_delegate.h" | 21 #include "content/public/common/child_process_host_delegate.h" |
22 #include "content/public/common/content_paths.h" | 22 #include "content/public/common/content_paths.h" |
23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
24 #include "ipc/ipc_channel.h" | 24 #include "ipc/ipc_channel.h" |
25 #include "ipc/ipc_logging.h" | 25 #include "ipc/ipc_logging.h" |
| 26 #include "ipc/message_filter.h" |
26 | 27 |
27 #if defined(OS_LINUX) | 28 #if defined(OS_LINUX) |
28 #include "base/linux_util.h" | 29 #include "base/linux_util.h" |
29 #elif defined(OS_WIN) | 30 #elif defined(OS_WIN) |
30 #include "content/common/font_cache_dispatcher_win.h" | 31 #include "content/common/font_cache_dispatcher_win.h" |
31 #endif // OS_LINUX | 32 #endif // OS_LINUX |
32 | 33 |
33 namespace { | 34 namespace { |
34 | 35 |
35 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 144 |
144 ChildProcessHostImpl::~ChildProcessHostImpl() { | 145 ChildProcessHostImpl::~ChildProcessHostImpl() { |
145 for (size_t i = 0; i < filters_.size(); ++i) { | 146 for (size_t i = 0; i < filters_.size(); ++i) { |
146 filters_[i]->OnChannelClosing(); | 147 filters_[i]->OnChannelClosing(); |
147 filters_[i]->OnFilterRemoved(); | 148 filters_[i]->OnFilterRemoved(); |
148 } | 149 } |
149 | 150 |
150 base::CloseProcessHandle(peer_handle_); | 151 base::CloseProcessHandle(peer_handle_); |
151 } | 152 } |
152 | 153 |
153 void ChildProcessHostImpl::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { | 154 void ChildProcessHostImpl::AddFilter(IPC::MessageFilter* filter) { |
154 filters_.push_back(filter); | 155 filters_.push_back(filter); |
155 | 156 |
156 if (channel_) | 157 if (channel_) |
157 filter->OnFilterAdded(channel_.get()); | 158 filter->OnFilterAdded(channel_.get()); |
158 } | 159 } |
159 | 160 |
160 void ChildProcessHostImpl::ForceShutdown() { | 161 void ChildProcessHostImpl::ForceShutdown() { |
161 Send(new ChildProcessMsg_Shutdown()); | 162 Send(new ChildProcessMsg_Shutdown()); |
162 } | 163 } |
163 | 164 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 uint32 internalformat, | 310 uint32 internalformat, |
310 gfx::GpuMemoryBufferHandle* handle) { | 311 gfx::GpuMemoryBufferHandle* handle) { |
311 handle->type = gfx::SHARED_MEMORY_BUFFER; | 312 handle->type = gfx::SHARED_MEMORY_BUFFER; |
312 AllocateSharedMemory( | 313 AllocateSharedMemory( |
313 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), | 314 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), |
314 peer_handle_, | 315 peer_handle_, |
315 &handle->handle); | 316 &handle->handle); |
316 } | 317 } |
317 | 318 |
318 } // namespace content | 319 } // namespace content |
OLD | NEW |