• Matt Falkenhagen's avatar
    Fix client certificates through service workers. · f808bd6d
    Matt Falkenhagen authored
    Some https requests trigger TLS client certificate selection.
    This is a dialog displayed to the user in the tab containing the frame
    making the request.
    
    Service workers broke this when they intercepted the request from a
    frame, and reissued the request via fetch(). The service worker doesn't
    have a frame and there is no information on the request that tracks back
    to the frame.
    
    This CL addreses that via the following mechanism.
    ServiceWorkerProviderHost has a |fetch_request_window_id| which is
    similar to |client_uuid|, except it is not a web-exposed GUID and is
    reset on redirects during navigations.
    
    This token is added to requests that go through service workers, and
    identifies the originating frame. This corresponds to the Fetch
    specification's concept of a request's associated |window|.
    
    Now when the service worker reissues the request, and the browser wants
    to display the UI, it can get the WebContents of the originating frame.
    
    Limitations:
    * Doesn't work for requests from workers that are intercepted
      by service workers. Workers aren't fully supported as service
      worker clients yet (they don't have their own
      ServiceWorkerProviderHost).
    * The Fetch API's feature of disassociating a request via
      setting |init.window| to null in the constructor is not
      yet implemented.
    
    Bug: 894484
    Change-Id: I377f2103f62bee81bdee2c971b4359ee8a8b3049
    Reviewed-on: https://chromium-review.googlesource.com/c/1290435
    Commit-Queue: Matt Falkenhagen <falken@chromium.org>
    Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#608691}
    f808bd6d
web_contents_getter_registry.h 1.73 KB