| Index: content/browser/gpu/gpu_process_host.cc
|
| diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
|
| index 7749da464a4d2790cbd2bc3fd6cb9055163779f8..fceea4588da4445d95d2d3088efb781c44c5c2d7 100644
|
| --- a/content/browser/gpu/gpu_process_host.cc
|
| +++ b/content/browser/gpu/gpu_process_host.cc
|
| @@ -717,6 +717,22 @@ void GpuProcessHost::CreateGpuMemoryBuffer(
|
| weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| +void GpuProcessHost::GetGpuMemoryBufferAttribs(
|
| + const GetGpuMemoryBufferAttribsCallback& callback) {
|
| + TRACE_EVENT0("gpu", "GpuProcessHost::GetGpuMemoryBufferAttribs");
|
| +
|
| + DCHECK(CalledOnValidThread());
|
| +
|
| + get_gpu_memory_buffer_attribs_requests_.push(callback);
|
| +
|
| + if (get_gpu_memory_buffer_attribs_requests_.size() > 1)
|
| + return;
|
| +
|
| + gpu_service_ptr_->GetGpuMemoryBufferAttribs(
|
| + base::Bind(&GpuProcessHost::OnGpuMemoryBufferAttribsReceived,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| +}
|
| +
|
| void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
|
| int client_id,
|
| const gpu::SyncToken& sync_token) {
|
| @@ -780,6 +796,17 @@ void GpuProcessHost::OnDestroyingVideoSurfaceAck() {
|
| }
|
| #endif
|
|
|
| +void GpuProcessHost::OnGpuMemoryBufferAttribsReceived(
|
| + const gfx::GpuMemoryBufferAttribVector& supported_attribs) {
|
| + TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferAttribsReceived");
|
| +
|
| + while (!get_gpu_memory_buffer_attribs_requests_.empty()) {
|
| + auto callback = get_gpu_memory_buffer_attribs_requests_.front();
|
| + get_gpu_memory_buffer_attribs_requests_.pop();
|
| + callback.Run(supported_attribs);
|
| + }
|
| +}
|
| +
|
| void GpuProcessHost::OnProcessLaunched() {
|
| UMA_HISTOGRAM_TIMES("GPU.GPUProcessLaunchTime",
|
| base::TimeTicks::Now() - init_start_time_);
|
| @@ -1058,6 +1085,12 @@ void GpuProcessHost::SendOutstandingReplies() {
|
| BufferCreationStatus::GPU_HOST_INVALID);
|
| }
|
|
|
| + while (!get_gpu_memory_buffer_attribs_requests_.empty()) {
|
| + auto callback = get_gpu_memory_buffer_attribs_requests_.front();
|
| + get_gpu_memory_buffer_attribs_requests_.pop();
|
| + callback.Run(gfx::GpuMemoryBufferAttribVector());
|
| + }
|
| +
|
| if (!send_destroying_video_surface_done_cb_.is_null())
|
| base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run();
|
| }
|
|
|