• imcheng's avatar
    [Presentation API] Limit the number of pending Start/JoinSession · 27e2b56b
    imcheng authored
    requests.
    
    For StartSession, PSImpl keeps a queue of StartSession requests to be
    processed. (It can only process one at a time). If the queue has
    reached maximum allowed size (10), subsequent incoming requests will
    be immediately rejected.
    
    For Joinsession, PSImpl keeps a map of currently JoinSession requests
    that are currently processed. If the map reached maximum allowed size
    (10), subsequent incoming requests will be immediately rejected.
    
    Also, tried to simplify some of the cleanup flow for
    NewSessionMojoCallbacks by introducing a wrapper class that ensures
    callbacks are not dropped. Currently the cleanup logic is sprinkled
    all over the file so hopefully this makes things cleaner.
    
    We could generalize the callback wrapper pattern in the future if
    it makes necessary.
    
    BUG=412331
    
    Review URL: https://codereview.chromium.org/1141683002
    
    Cr-Commit-Position: refs/heads/master@{#330203}
    27e2b56b
presentation_service_impl.h 13.7 KB