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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 2879723003: Revert of gpu: guarantee to match pending GBM buffer request to actual GBM handle (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e8a2fe135af523c26a4640f1a1d2b471e2bd7dfb..c809a615c61e0efbdae86a852b11951aab86c417 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -736,9 +736,7 @@
TRACE_EVENT0("gpu", "GpuProcessHost::CreateGpuMemoryBuffer");
DCHECK(CalledOnValidThread());
- DCHECK(create_gpu_memory_buffer_requests_.find(id) ==
- create_gpu_memory_buffer_requests_.end());
- create_gpu_memory_buffer_requests_[id] = callback;
+ create_gpu_memory_buffer_requests_.push(callback);
gpu_service_ptr_->CreateGpuMemoryBuffer(
id, size, format, usage, client_id, surface_handle,
base::Bind(&GpuProcessHost::OnGpuMemoryBufferCreated,
@@ -794,14 +792,9 @@
const gfx::GpuMemoryBufferHandle& handle) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnGpuMemoryBufferCreated");
- if (create_gpu_memory_buffer_requests_.find(handle.id) ==
- create_gpu_memory_buffer_requests_.end()) {
- DVLOG(1) << "GpuMemoryBuffer creation fails due to missing callback.";
- return;
- }
-
- auto callback = create_gpu_memory_buffer_requests_[handle.id];
- create_gpu_memory_buffer_requests_.erase(handle.id);
+ DCHECK(!create_gpu_memory_buffer_requests_.empty());
+ auto callback = create_gpu_memory_buffer_requests_.front();
+ create_gpu_memory_buffer_requests_.pop();
callback.Run(handle, BufferCreationStatus::SUCCESS);
}
@@ -1084,12 +1077,12 @@
EstablishChannelStatus::GPU_HOST_INVALID);
}
- for (auto& pair : create_gpu_memory_buffer_requests_) {
- auto callback = pair.second;
+ while (!create_gpu_memory_buffer_requests_.empty()) {
+ auto callback = create_gpu_memory_buffer_requests_.front();
+ create_gpu_memory_buffer_requests_.pop();
callback.Run(gfx::GpuMemoryBufferHandle(),
BufferCreationStatus::GPU_HOST_INVALID);
}
- create_gpu_memory_buffer_requests_.clear();
if (!send_destroying_video_surface_done_cb_.is_null())
base::ResetAndReturn(&send_destroying_video_surface_done_cb_).Run();
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698