Skip to content
  • Ria Jiang's avatar
    Change FrameSinkId for embed windows to be in embedded tree's id space. · a5f21099
    Ria Jiang authored
    When a client submits hit-test data for its own children, the client_id
    part of the frame_sink_id of its children is 0 and HitTestManager is
    supposed to fill in the correct client_id. However, if the root window
    of this client (e.g. browser, quick-launch, renderer; WindowManager is
    an exception) is being embedded, then the root window is really created
    by its embedder and has the client_id of its embedder. In these cases,
    we are filling in the wrong client_id if we just get the client_id part
    in CompositorFrameSinkSupport::frame_sink_id_. Essentially, in mus/mash,
    we are submitting compositor frames and hit-test data using parent’s
    client_id.
    
    This CL changes FrameSinkId for embed windows to be in embedded tree's
    id space. Currently, there are two ways for embedding:
    1) An embedded client creates a top level window by asking its WindowTree
    in NewTopLevelWindow(). The window_id provided in this call by the client
    is the same window_id used in its WindowTree. However, the associated
    ServerWindow is created by the WindowManager(embedder), and so its
    FrameSinkId used to include the WindowManager's client id. This CL
    changes that, so that the FrameSinkId of the ServerWindow is generated
    using the client_id (and window_id) of the embedded client.
    2) The embedder creates the aura::Window (the embed window) and asks its
    WindowTreeClient -> WindoeTree -> WindowServer to create a new WT for the
    embed client and embed it at the embed window. That embedded client will
    get notified in OnEmbed with that new tree and the embed window (and
    other information).
    For 1), this CL plumbs the client_window_id for the embed window from the
    embedded tree to the embedder tree and use that as the new FrameSinkId to
    make sure we don't use that FrameSinkId in the embedded tree again.
    For 2), right now it's only used by renderers (RendererWindowTreeClient)
    and we don't provide a window id to use for the embed window like case 1.
    This CL changes the new FrameSinkId for the embed window to be
    (embedded tree's id, 0) so that next_window_id_ on the embedded client
    side can remain unchanged.
    
    Bug: 712302
    Test: covered by tests
    Change-Id: Iaa6c5e477784f9887db696f74fa2f7bd938ab67c
    Reviewed-on: https://chromium-review.googlesource.com/748442
    
    
    Commit-Queue: Ria Jiang <riajiang@chromium.org>
    Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
    Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#516142}
    a5f21099