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

Unified Diff: content/renderer/mus/compositor_mus_connection.cc

Issue 2089183003: mus: Introduce API for embedder to dispatch event to the embeded client. Base URL: https://chromium.googlesource.com/chromium/src.git@mus-parent-window-receives-child-event
Patch Set: 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
Index: content/renderer/mus/compositor_mus_connection.cc
diff --git a/content/renderer/mus/compositor_mus_connection.cc b/content/renderer/mus/compositor_mus_connection.cc
index 322fa11becb9ee19602bb095370a1fadcb52fd9f..95b0e546a85c73dddc27d2ac9efb7287eae44589 100644
--- a/content/renderer/mus/compositor_mus_connection.cc
+++ b/content/renderer/mus/compositor_mus_connection.cc
@@ -93,7 +93,8 @@ void CompositorMusConnection::OnWindowInputEventAckOnMainThread(
const base::Callback<void(EventResult)>& ack,
EventResult result) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
- compositor_task_runner_->PostTask(FROM_HERE, base::Bind(ack, result));
+ if (!ack.is_null())
+ compositor_task_runner_->PostTask(FROM_HERE, base::Bind(ack, result));
}
void CompositorMusConnection::OnWindowTreeClientDestroyed(
@@ -145,8 +146,11 @@ void CompositorMusConnection::OnWindowInputEvent(
// OnWindowInputEventAckOnMainThread.
ack =
base::Bind(&CompositorMusConnection::OnWindowInputEventAckOnMainThread,
- this, *ack_callback->get());
- ack_callback->reset();
+ this,
+ ack_callback ? *ack_callback->get()
+ : base::Callback<void(EventResult)>());
+ if (ack_callback)
+ ack_callback->reset();
}
main_task_runner_->PostTask(
FROM_HERE,
« no previous file with comments | « content/renderer/input/render_widget_input_handler.cc ('k') | content/renderer/mus/render_widget_mus_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698