Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: content/common/child_process_host_impl.cc

Issue 1827123002: Move content/common/gpu/client to gpu/ipc/client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/client/command_buffer_proxy_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/hash.h" 12 #include "base/hash.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
16 #include "base/numerics/safe_math.h" 16 #include "base/numerics/safe_math.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/process/process_metrics.h" 18 #include "base/process/process_metrics.h"
19 #include "base/rand_util.h" 19 #include "base/rand_util.h"
20 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
21 #include "base/synchronization/lock.h" 21 #include "base/synchronization/lock.h"
22 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 22 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 #include "content/common/child_process_messages.h" 24 #include "content/common/child_process_messages.h"
25 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
26 #include "content/public/common/child_process_host_delegate.h" 25 #include "content/public/common/child_process_host_delegate.h"
27 #include "content/public/common/content_paths.h" 26 #include "content/public/common/content_paths.h"
28 #include "content/public/common/content_switches.h" 27 #include "content/public/common/content_switches.h"
28 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
29 #include "ipc/attachment_broker.h" 29 #include "ipc/attachment_broker.h"
30 #include "ipc/attachment_broker_privileged.h" 30 #include "ipc/attachment_broker_privileged.h"
31 #include "ipc/ipc_channel.h" 31 #include "ipc/ipc_channel.h"
32 #include "ipc/ipc_logging.h" 32 #include "ipc/ipc_logging.h"
33 #include "ipc/message_filter.h" 33 #include "ipc/message_filter.h"
34 34
35 #if defined(OS_LINUX) 35 #if defined(OS_LINUX)
36 #include "base/linux_util.h" 36 #include "base/linux_util.h"
37 #elif defined(OS_WIN) 37 #elif defined(OS_WIN)
38 #include "content/common/font_cache_dispatcher_win.h" 38 #include "content/common/font_cache_dispatcher_win.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 uint32_t width, 310 uint32_t width,
311 uint32_t height, 311 uint32_t height,
312 gfx::BufferFormat format, 312 gfx::BufferFormat format,
313 gfx::BufferUsage usage, 313 gfx::BufferUsage usage,
314 gfx::GpuMemoryBufferHandle* handle) { 314 gfx::GpuMemoryBufferHandle* handle) {
315 // TODO(reveman): Add support for other types of GpuMemoryBuffers. 315 // TODO(reveman): Add support for other types of GpuMemoryBuffers.
316 316
317 // AllocateForChildProcess() will check if |width| and |height| are valid 317 // AllocateForChildProcess() will check if |width| and |height| are valid
318 // and handle failure in a controlled way when not. We just need to make 318 // and handle failure in a controlled way when not. We just need to make
319 // sure |usage| is supported here. 319 // sure |usage| is supported here.
320 if (GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) { 320 if (gpu::GpuMemoryBufferImplSharedMemory::IsUsageSupported(usage)) {
321 *handle = GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( 321 *handle = gpu::GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
322 id, gfx::Size(width, height), format, peer_process_.Handle()); 322 id, gfx::Size(width, height), format, peer_process_.Handle());
323 } 323 }
324 } 324 }
325 325
326 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( 326 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer(
327 gfx::GpuMemoryBufferId id, 327 gfx::GpuMemoryBufferId id,
328 const gpu::SyncToken& sync_token) { 328 const gpu::SyncToken& sync_token) {
329 // Note: Nothing to do here as ownership of shared memory backed 329 // Note: Nothing to do here as ownership of shared memory backed
330 // GpuMemoryBuffers is passed with IPC. 330 // GpuMemoryBuffers is passed with IPC.
331 } 331 }
332 332
333 } // namespace content 333 } // namespace content
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/client/command_buffer_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698