• imcheng's avatar
    [Presentation API] Convert screen availability API into Client style. · 9ce5394b
    imcheng authored
    Introduced a PresentationServiceClient mojo interface implemented by
    PresentationDispatcher. On connection to PresentationService,
    PDispatcher will pass a proxy of itself to PSImpl.
    
    Please note that screen availability updates are already throttled
    from the browser's perspective.
    
    When a screen availability update is available, it will be transmitted
    back to PSDispatcher via the PresentationServiceClient interface.
    
    In the future, I plan to use the same interface for other types of
    observer-style APIs (e.g. default session start, session state change,
    on message).
    
    Also, simplified the ScreenAvailability API so it only operates on
    the DPU (or 1-UA mode if absent). The current semantics to support
    listening on arbitrarily presentation URLs + handling behavior for
    DPU is very confusing. We should revisit the implementation when we
    decide to support it.
    
    This will also hopefully fix the bug where ScreenAvailability mojo
    callbacks accumulate over time.
    
    Also fix mojom indent.
    
    BUG=485337
    
    Review URL: https://codereview.chromium.org/1131053005
    
    Cr-Commit-Position: refs/heads/master@{#329457}
    9ce5394b
presentation_service.mojom 4.13 KB