[Presentation API] (5th)(1-UA) integrate controller and receiver side for 1-UA messaging
This CL actually turns on 1-UA messaging:
- When presentation starts, a new route is created and returned to MR. In PresentationDispatcher, we send controller_connection_proxy and receiver_connection_request back to browser via PresentationService::SetPresentationConnection()
For 1-UA:
- In PresentationServiceDelegateImpl::ConnectToPresentation(), we register proxy and request as a controller connection entry to OPM. If there has been a receiver_call_back, invoke it;
- When offscreen tab is rendered, we register a receiverPSDImpl, which registers a receiver_call_back to OPM. If there is any pending controller connection entry, invoke receiver_call_back for each controller connection entry;
- In receiver_call_back (PresentationDispatcher::OnReceiverConnectionAvailable() function), we create a receiver_connection_proxy object, bind it to receiver_connection_request (input parameter) and connect it with controller_connection_proxy (input parameter). Message sending between controller Blink connection and receiver Blink connection may happen afterwards.
For 2-UA:
- In PresentationServiceDelegateImpl::ConnectToPresentation(), we create a browser_connection_proxy object, bind it to receiver_connection_request (input parameter) and connect it with controller_connection_proxy (input parameter). Message sending from controller Blink connection to media router may happen afterwards.
More details in code comments and design doc (use chromium.org account): https://docs.google.com/document/d/1XM3jhMJTQyhEC5PDAAJFNIaKh6UUEihqZDz_ztEe4Co/edit#heading=h.hadpx5oi0gml
Patch set 4 updates:
- added BrowserPresentationConnectionProxy class
- Added PresentationFrame::IsOffscreen() and PresentationFrame::OnBrowserConnectionAvailable()
- PresentationConnection::OnMessage() takes a callback
- PresentationDispatcher::SendXXX() takes PresentationConnectionProxy as parameter
BUG=525660,513859
Review-Url: https://codereview.chromium.org/2471573005
Cr-Original-Commit-Position: refs/heads/master@{#448299}
Committed: https://chromium.googlesource.com/chromium/src/+/4b94a1fe3f58aacad2c46bbfd84aa780469e15be
Review-Url: https://codereview.chromium.org/2471573005
Cr-Commit-Position: refs/heads/master@{#448509}
diff --git a/content/browser/presentation/presentation_service_impl_unittest.cc b/content/browser/presentation/presentation_service_impl_unittest.cc
index 3dac59b3..aa2339c 100644
--- a/content/browser/presentation/presentation_service_impl_unittest.cc
+++ b/content/browser/presentation/presentation_service_impl_unittest.cc
@@ -140,7 +140,7 @@
const content::PresentationConnectionStateChangedCallback&
state_changed_cb));
- void ConnectToOffscreenPresentation(
+ void ConnectToPresentation(
int render_process_id,
int render_frame_id,
const content::PresentationSessionInfo& session,
@@ -523,8 +523,7 @@
run_loop.Run();
}
-TEST_F(PresentationServiceImplTest,
- ListenForConnectionStateChange) {
+TEST_F(PresentationServiceImplTest, ListenForConnectionStateChange) {
content::PresentationSessionInfo connection(presentation_url1_,
kPresentationId);
content::PresentationConnectionStateChangedCallback state_changed_cb;