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

Unified Diff: cc/trees/remote_channel_main.cc

Issue 1986883002: blimp: Update page load status update indicator to use first paint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 7 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: cc/trees/remote_channel_main.cc
diff --git a/cc/trees/remote_channel_main.cc b/cc/trees/remote_channel_main.cc
index a231bcbe061dde24317cbce8969b914dde928e2f..eaca0dae3b75a916ccc1f4f09295e1e111d6c805 100644
--- a/cc/trees/remote_channel_main.cc
+++ b/cc/trees/remote_channel_main.cc
@@ -177,13 +177,26 @@ void RemoteChannelMain::StartCommitOnImpl(
to_impl_proto->set_message_type(proto::CompositorMessageToImpl::START_COMMIT);
proto::StartCommit* start_commit_message =
to_impl_proto->mutable_start_commit_message();
+ std::vector<std::unique_ptr<SwapPromise>> swap_promises;
layer_tree_host->ToProtobufForCommit(
- start_commit_message->mutable_layer_tree_host());
+ start_commit_message->mutable_layer_tree_host(), &swap_promises);
VLOG(1) << "Sending commit message to client. Commit bytes size: "
<< proto.ByteSize();
SendMessageProto(proto);
+ // Activate the swap promises after the commit is queued.
+ // In the threaded compositor, activation implies that the pending tree on the
+ // impl thread has been activated. While the impl thread for the remote
+ // compositor is on the client, the embedder still expects to receive these
+ // events in order to drive decisions that depend on impl frame production.
+ // So we dispatch these events after a commit message is sent to the client.
+ // Sending the commit message implies that a visual update has been queued for
+ // the client, which is the closest we can come to offering an indicator akin
+ // to an impl frame queued for display.
+ for (const auto& swap_promise : swap_promises)
+ swap_promise->DidActivate();
+
// In order to avoid incurring the overhead for the client to send us a
// message for when a frame to be committed is drawn we inform the embedder
// that the draw was successful immediately after sending the commit message.
« no previous file with comments | « cc/trees/layer_tree_host_unittest_serialization.cc ('k') | content/browser/renderer_host/render_widget_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698