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

Unified Diff: content/browser/presentation/presentation_service_impl.cc

Issue 2355723004: [Presentation API] 1-UA: send message between controller and receiver page (Closed)
Patch Set: Merge with changes in Issue 2343013002 Created 4 years, 3 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/browser/presentation/presentation_service_impl.cc
diff --git a/content/browser/presentation/presentation_service_impl.cc b/content/browser/presentation/presentation_service_impl.cc
index 27a2ad143b03dd13bbb7d1db8d72da5c53ec1a93..e628c39b091659939e945ed3afbaffac41cbe383 100644
--- a/content/browser/presentation/presentation_service_impl.cc
+++ b/content/browser/presentation/presentation_service_impl.cc
@@ -403,7 +403,10 @@ void PresentationServiceImpl::SendSessionMessage(
blink::mojom::PresentationSessionInfoPtr session,
blink::mojom::SessionMessagePtr session_message,
const SendSessionMessageCallback& callback) {
- DVLOG(2) << "SendSessionMessage";
+ DVLOG(2) << "SendSessionMessage"
+ << " [url]: " << session->url << ", [id]: " << session->id
+ << ", [process id]: " << render_process_id_
+ << ", [render frame id]: " << render_frame_id_;
DCHECK(!session_message.is_null());
// send_message_callback_ should be null by now, otherwise resetting of
// send_message_callback_ with new callback will drop the old callback.
@@ -412,6 +415,13 @@ void PresentationServiceImpl::SendSessionMessage(
return;
}
+ for (auto message_observer : offscreen_presentation_observers_) {
+ ScopedVector<PresentationSessionMessage> messages;
+ messages.push_back(GetPresentationSessionMessage(session_message.Clone()));
+ message_observer->OnSessionMessages(session.To<PresentationSessionInfo>(),
+ messages, false);
+ }
+
send_message_callback_.reset(new SendSessionMessageCallback(callback));
delegate_->SendMessage(
render_process_id_, render_frame_id_,
@@ -493,8 +503,11 @@ void PresentationServiceImpl::OnSessionMessages(
const ScopedVector<PresentationSessionMessage>& messages,
bool pass_ownership) {
DCHECK(client_);
-
- DVLOG(2) << "OnSessionMessages";
+ DVLOG(2) << "OnSessionMessages"
+ << " [url]: " << session.presentation_url
+ << ", [id]: " << session.presentation_id
+ << ", [process id]: " << render_process_id_
+ << ", [render frame id]: " << render_frame_id_;
std::vector<blink::mojom::SessionMessagePtr> mojo_messages(messages.size());
std::transform(messages.begin(), messages.end(), mojo_messages.begin(),
[pass_ownership](PresentationSessionMessage* message) {
« no previous file with comments | « content/browser/presentation/presentation_service_impl.h ('k') | content/public/browser/presentation_service_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698