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

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

Issue 2805623002: gpu: Notify callbacks the reason for channel creation failure (Closed)
Patch Set: . Created 3 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 side-by-side diff with in-line comments
Download patch
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 664053cc27de908f5aa1e0823724e830765ee34b..1970f87f693759864951c370fe7a150ab04d7719 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -688,7 +688,8 @@ void GpuProcessHost::EstablishGpuChannel(
// If GPU features are already blacklisted, no need to establish the channel.
if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) {
DVLOG(1) << "GPU blacklisted, refusing to open a GPU channel.";
- callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
+ callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(),
+ EstablishChannelStatus::GPU_ACCESS_DENIED);
return;
}
@@ -760,13 +761,15 @@ void GpuProcessHost::OnChannelEstablished(
if (channel_handle.is_valid() &&
!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(nullptr)) {
gpu_service_ptr_->CloseChannel(client_id);
- callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
+ callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(),
+ EstablishChannelStatus::GPU_ACCESS_DENIED);
RecordLogMessage(logging::LOG_WARNING, "WARNING",
"Hardware acceleration is unavailable.");
return;
}
- callback.Run(IPC::ChannelHandle(channel_handle.release()), gpu_info_);
+ callback.Run(IPC::ChannelHandle(channel_handle.release()), gpu_info_,
+ EstablishChannelStatus::SUCCESS);
}
void GpuProcessHost::OnGpuMemoryBufferCreated(
@@ -1061,7 +1064,8 @@ void GpuProcessHost::SendOutstandingReplies() {
while (!channel_requests_.empty()) {
auto callback = channel_requests_.front();
channel_requests_.pop();
- callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
+ callback.Run(IPC::ChannelHandle(), gpu::GPUInfo(),
+ EstablishChannelStatus::GPU_HOST_INVALID);
}
while (!create_gpu_memory_buffer_requests_.empty()) {

Powered by Google App Engine
This is Rietveld 408576698