Description[Presentation API / Media Router] Clean up default pres URL logic.
1. In presentation_service.mojom, there were 2 methods for default
presentation: ListenForDefaultSessionStart and SetDefaultPresentationURL.
There is no reason they should be called separately. Furthermore,
ListenForDefaultSessionStart is called after connecting to
PresentationService, which is not optimal. This CL removes the former
method.
2. Remove OnDefaultSessionStarted from PSD::Observer and replace it
with callbacks. The purpose of PSD::Observer is to notify
PresentationServiceImpl that PresentationServiceDelegate is being
destroyed and shouldn't include specific Pres API logic.
3. Fix default request matching logic in PSDImpl to account for all
of (frame, frame url, presentation url). Previously it was only
checking presentation url and always assumes it came from the
current main frame. This is a problem because the main frame of a
WebContents can change over time, i.e. main frame at time of setting
DPU and time of route response could be different). Now we create
a PresentationRequest object to hold all info needed to match default
request and pass it to MRUI, who then binds the request to the route
response callback in PSDImpl/PresentationFrameManager to perform the
matching.
BUG=544259
Committed: https://crrev.com/6104fb062821e3e8584ed2e40cdb3f77502d88f0
Cr-Commit-Position: refs/heads/master@{#358935}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : fix android compile, renamed a field in MRDC #Patch Set 5 : Fix compile again #
Total comments: 36
Patch Set 6 : Addressed mfoltz's comments #
Total comments: 12
Patch Set 7 : Addressed Mounir's comments #Patch Set 8 : Rebase #Patch Set 9 : Fix compile #
Total comments: 16
Patch Set 10 : Addressed mfoltz's comments #16 #Patch Set 11 : remove s #
Total comments: 8
Patch Set 12 : Addressed comments #20, #22 #
Total comments: 22
Patch Set 13 : Addressed comment #26 + add back main frame logic #Patch Set 14 : Rebase #Patch Set 15 : fix compile #Patch Set 16 : Compile fix x2 #Patch Set 17 : Original patch #Messages
Total messages: 35 (12 generated)
|