Index: ui/ozone/platform/drm/ozone_platform_gbm.cc |
diff --git a/ui/ozone/platform/drm/ozone_platform_gbm.cc b/ui/ozone/platform/drm/ozone_platform_gbm.cc |
index 829a876831519f590ef6b04211d675c810689101..9a97e0a8cbbafce304603969085674a818a2e547 100644 |
--- a/ui/ozone/platform/drm/ozone_platform_gbm.cc |
+++ b/ui/ozone/platform/drm/ozone_platform_gbm.cc |
@@ -110,11 +110,13 @@ class OzonePlatformGbm |
void AddInterfaces(shell::InterfaceRegistry* registry) override { |
registry->AddInterface<ozone::mojom::DeviceCursor>(this); |
} |
- // shell::InterfaceFactory<mojom::ozone::Cursor> implementation. |
+ // shell::InterfaceFactory<ozone::mojom::DeviceCursor> implementation. |
void Create(const shell::Identity& remote_identity, |
ozone::mojom::DeviceCursorRequest request) override { |
- DCHECK(drm_thread_proxy_); |
- drm_thread_proxy_->AddBinding(std::move(request)); |
+ if (drm_thread_proxy_) |
+ drm_thread_proxy_->AddBinding(std::move(request)); |
+ else |
+ pending_cursor_requests_.push_back(std::move(request)); |
} |
std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
PlatformWindowDelegate* delegate, |
@@ -235,6 +237,9 @@ class OzonePlatformGbm |
if (using_mojo_ || single_process_) { |
mus_thread_proxy_->StartDrmThread(); |
} |
+ for (auto& request : pending_cursor_requests_) |
+ drm_thread_proxy_->AddBinding(std::move(request)); |
+ pending_cursor_requests_.clear(); |
} |
private: |
@@ -246,6 +251,8 @@ class OzonePlatformGbm |
std::unique_ptr<GlApiLoader> gl_api_loader_; |
std::unique_ptr<GbmSurfaceFactory> surface_factory_; |
scoped_refptr<IPC::MessageFilter> gpu_message_filter_; |
+ // TODO(sad): Once the mus gpu process split happens, this can go away. |
+ std::vector<ozone::mojom::DeviceCursorRequest> pending_cursor_requests_; |
// Objects in the Browser process. |
std::unique_ptr<DeviceManager> device_manager_; |