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

Unified Diff: components/mus/common/gpu_service.cc

Issue 2067833002: Fix a crash in mus::GpuService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 6 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 | « base/threading/thread_restrictions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/common/gpu_service.cc
diff --git a/components/mus/common/gpu_service.cc b/components/mus/common/gpu_service.cc
index ab9a3ad06d5cb61e9c2bc426ed0a2afc3f3a614b..05be8fe4ee5704bac56b3ee68b904d311ceb4d5b 100644
--- a/components/mus/common/gpu_service.cc
+++ b/components/mus/common/gpu_service.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/memory/singleton.h"
+#include "base/threading/thread_restrictions.h"
#include "components/mus/common/gpu_type_converters.h"
#include "components/mus/common/mojo_gpu_memory_buffer_manager.h"
#include "components/mus/common/switches.h"
@@ -56,11 +57,16 @@ scoped_refptr<gpu::GpuChannelHost> GpuService::EstablishGpuChannel(
int client_id = 0;
mojom::ChannelHandlePtr channel_handle;
mojom::GpuInfoPtr gpu_info;
- if (!gpu_service->EstablishGpuChannel(&client_id, &channel_handle,
- &gpu_info)) {
- DLOG(WARNING)
- << "Channel encountered error while establishing gpu channel.";
- return nullptr;
+ {
+ // TODO(penghuang): Remove the ScopedAllowWait when HW rendering is enabled
+ // in mus chrome.
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ if (!gpu_service->EstablishGpuChannel(&client_id, &channel_handle,
+ &gpu_info)) {
+ DLOG(WARNING)
+ << "Channel encountered error while establishing gpu channel.";
+ return nullptr;
+ }
}
// TODO(penghuang): Get the real gpu info from mus.
« no previous file with comments | « base/threading/thread_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698