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

Side by Side Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1823763003: Move more files to gpu/ipc/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android Build Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 const gfx::Size& size, 593 const gfx::Size& size,
594 gfx::BufferFormat format, 594 gfx::BufferFormat format,
595 gfx::BufferUsage usage, 595 gfx::BufferUsage usage,
596 int client_id, 596 int client_id,
597 bool reused_gpu_process, 597 bool reused_gpu_process,
598 const CreateCallback& callback) { 598 const CreateCallback& callback) {
599 DCHECK_CURRENTLY_ON(BrowserThread::IO); 599 DCHECK_CURRENTLY_ON(BrowserThread::IO);
600 600
601 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); 601 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
602 if (!host) { 602 if (!host) {
603 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, 603 host = GpuProcessHost::Get(
604 CAUSE_FOR_GPU_LAUNCH_GPU_MEMORY_BUFFER_ALLOCATE); 604 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
605 gpu::CAUSE_FOR_GPU_LAUNCH_GPU_MEMORY_BUFFER_ALLOCATE);
605 if (!host) { 606 if (!host) {
606 LOG(ERROR) << "Failed to launch GPU process."; 607 LOG(ERROR) << "Failed to launch GPU process.";
607 callback.Run(gfx::GpuMemoryBufferHandle()); 608 callback.Run(gfx::GpuMemoryBufferHandle());
608 return; 609 return;
609 } 610 }
610 gpu_host_id_ = host->host_id(); 611 gpu_host_id_ = host->host_id();
611 reused_gpu_process = false; 612 reused_gpu_process = false;
612 } else { 613 } else {
613 if (reused_gpu_process) { 614 if (reused_gpu_process) {
614 // We come here if we retried to create the buffer because of a failure 615 // We come here if we retried to create the buffer because of a failure
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 return gpu_client_tracing_id_; 748 return gpu_client_tracing_id_;
748 } 749 }
749 750
750 // In normal cases, |client_id| is a child process id, so we can perform 751 // In normal cases, |client_id| is a child process id, so we can perform
751 // the standard conversion. 752 // the standard conversion.
752 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( 753 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
753 client_id); 754 client_id);
754 } 755 }
755 756
756 } // namespace content 757 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698