Commit e8306de9 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

Pass URL in page events

Webview clients want to know the URL for the page event. Include it for
convenience to reduce the number of IPCs.

Bug: b/132811925
Test: Compiled
Change-Id: I4d2b4fd7ead9002270f5008cb4bbfb5be57b3904
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1833117Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701650}
parent a6917ab1
...@@ -93,6 +93,7 @@ message AsyncPageEvent { ...@@ -93,6 +93,7 @@ message AsyncPageEvent {
int32 stopped_error_code = 2; int32 stopped_error_code = 2;
bool resource_load_failed = 3; bool resource_load_failed = 3;
bool did_first_visually_non_empty_paint = 4; bool did_first_visually_non_empty_paint = 4;
string url = 5;
} }
message StopPageRequest { message StopPageRequest {
......
...@@ -335,6 +335,7 @@ void WebviewController::OnPageStateChanged(CastWebContents* cast_web_contents) { ...@@ -335,6 +335,7 @@ void WebviewController::OnPageStateChanged(CastWebContents* cast_web_contents) {
std::unique_ptr<webview::WebviewResponse> response = std::unique_ptr<webview::WebviewResponse> response =
std::make_unique<webview::WebviewResponse>(); std::make_unique<webview::WebviewResponse>();
auto* event = response->mutable_page_event(); auto* event = response->mutable_page_event();
event->set_url(contents_->GetURL().spec());
event->set_current_page_state(current_state()); event->set_current_page_state(current_state());
client_->EnqueueSend(std::move(response)); client_->EnqueueSend(std::move(response));
} }
...@@ -347,6 +348,7 @@ void WebviewController::OnPageStopped(CastWebContents* cast_web_contents, ...@@ -347,6 +348,7 @@ void WebviewController::OnPageStopped(CastWebContents* cast_web_contents,
std::unique_ptr<webview::WebviewResponse> response = std::unique_ptr<webview::WebviewResponse> response =
std::make_unique<webview::WebviewResponse>(); std::make_unique<webview::WebviewResponse>();
auto* event = response->mutable_page_event(); auto* event = response->mutable_page_event();
event->set_url(contents_->GetURL().spec());
event->set_current_page_state(current_state()); event->set_current_page_state(current_state());
event->set_stopped_error_code(error_code); event->set_stopped_error_code(error_code);
client_->EnqueueSend(std::move(response)); client_->EnqueueSend(std::move(response));
...@@ -361,6 +363,7 @@ void WebviewController::ResourceLoadFailed(CastWebContents* cast_web_contents) { ...@@ -361,6 +363,7 @@ void WebviewController::ResourceLoadFailed(CastWebContents* cast_web_contents) {
std::unique_ptr<webview::WebviewResponse> response = std::unique_ptr<webview::WebviewResponse> response =
std::make_unique<webview::WebviewResponse>(); std::make_unique<webview::WebviewResponse>();
auto* event = response->mutable_page_event(); auto* event = response->mutable_page_event();
event->set_url(contents_->GetURL().spec());
event->set_current_page_state(current_state()); event->set_current_page_state(current_state());
event->set_resource_load_failed(true); event->set_resource_load_failed(true);
client_->EnqueueSend(std::move(response)); client_->EnqueueSend(std::move(response));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment