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

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

Issue 872093002: [Ozone-DRI] Check the host_id when resetting the cursor IPC callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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 | « ui/ozone/platform/dri/dri_cursor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_cursor.cc
diff --git a/ui/ozone/platform/dri/dri_cursor.cc b/ui/ozone/platform/dri/dri_cursor.cc
index f1571a44e7a1237910086a87e45e1709f1048136..7fb10a92aa9b4517ebf050aa47382ea499ba6d89 100644
--- a/ui/ozone/platform/dri/dri_cursor.cc
+++ b/ui/ozone/platform/dri/dri_cursor.cc
@@ -192,6 +192,7 @@ void DriCursor::OnChannelEstablished(
#endif
DCHECK(ui_task_runner_->BelongsToCurrentThread());
base::AutoLock lock(state_.lock);
+ state_.host_id = host_id;
state_.send_runner = send_runner;
state_.send_callback = send_callback;
// Initial set for this GPU process will happen after the window
@@ -201,8 +202,11 @@ void DriCursor::OnChannelEstablished(
void DriCursor::OnChannelDestroyed(int host_id) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
base::AutoLock lock(state_.lock);
- state_.send_runner = NULL;
- state_.send_callback.Reset();
+ if (state_.host_id == host_id) {
+ state_.host_id = -1;
+ state_.send_runner = NULL;
+ state_.send_callback.Reset();
+ }
}
bool DriCursor::OnMessageReceived(const IPC::Message& message) {
@@ -267,7 +271,8 @@ void DriCursor::SendLocked(IPC::Message* message) {
delete message;
}
-DriCursor::CursorState::CursorState() : window(gfx::kNullAcceleratedWidget) {
+DriCursor::CursorState::CursorState()
+ : window(gfx::kNullAcceleratedWidget), host_id(-1) {
}
DriCursor::CursorState::~CursorState() {
« no previous file with comments | « ui/ozone/platform/dri/dri_cursor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698