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

Unified Diff: ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc

Issue 522463005: [Ozone-GBM] Handle GPU crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
diff --git a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc b/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
index 160b5153dbd4df2eaddf55892c9c6fab5196251b..90a75ca52f67b582421218b925dd29d3dbecffe1 100644
--- a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
+++ b/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
@@ -7,6 +7,7 @@
#include "base/debug/trace_event.h"
#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
+#include "ui/ozone/platform/dri/channel_observer.h"
namespace ui {
@@ -29,6 +30,18 @@ void GpuPlatformSupportHostGbm::UnregisterHandler(
handlers_.erase(it);
}
+void GpuPlatformSupportHostGbm::AddChannelObserver(ChannelObserver* observer) {
+ channel_observers_.AddObserver(observer);
+
+ if (sender_)
+ observer->OnChannelEstablished();
+}
+
+void GpuPlatformSupportHostGbm::RemoveChannelObserver(
+ ChannelObserver* observer) {
+ channel_observers_.RemoveObserver(observer);
+}
+
void GpuPlatformSupportHostGbm::OnChannelEstablished(int host_id,
IPC::Sender* sender) {
TRACE_EVENT0("dri", "GpuPlatformSupportHostGbm::OnChannelEstablished");
@@ -42,6 +55,9 @@ void GpuPlatformSupportHostGbm::OnChannelEstablished(int host_id,
for (size_t i = 0; i < handlers_.size(); ++i)
handlers_[i]->OnChannelEstablished(host_id, sender);
+
+ FOR_EACH_OBSERVER(
+ ChannelObserver, channel_observers_, OnChannelEstablished());
}
void GpuPlatformSupportHostGbm::OnChannelDestroyed(int host_id) {
@@ -53,6 +69,8 @@ void GpuPlatformSupportHostGbm::OnChannelDestroyed(int host_id) {
for (size_t i = 0; i < handlers_.size(); ++i)
handlers_[i]->OnChannelDestroyed(host_id);
+
+ FOR_EACH_OBSERVER(ChannelObserver, channel_observers_, OnChannelDestroyed());
}
bool GpuPlatformSupportHostGbm::OnMessageReceived(const IPC::Message& message) {

Powered by Google App Engine
This is Rietveld 408576698