• Mikel Astiz's avatar
    Reland "Avoid a proxy tab helper on Android for sync delegation" · ce816173
    Mikel Astiz authored
    This is a reland of 42c62276
    
    The underlying issue in SyncedTabDelegateAndroid::GetSessionId()
    has been reverted, which introduced an accidental behavioral
    difference in the original version, causing crashes on Android
    for placeholder tabs (i.e. tabs without WebContents).
    
    TBR=avi@chromium.org,treib@chromium.org
    
    Original change's description:
    > Avoid a proxy tab helper on Android for sync delegation
    >
    > Prior to this patch, TabContentsSyncedTabDelegate was itself a tab
    > helper (WebContentsUserData) that was created on all platforms, with the
    > whole purpose to reuse a partial implementation of
    > sync_sessions::SyncedTabDelegate.
    >
    > This was a bit weird because
    > a) The life cycle diverges across platforms: created lazily on Android,
    >    early otherwise.
    > b) On Android there was no real need to register a tab helper.
    > c) On Android, it's weird to reason about two tab delegates coexisting,
    >    one of which is a proxy but also overrides some logic.
    >
    > Instead, let's make TabContentsSyncedTabDelegate a base class that is
    > *NOT* a WebContentsUserData, and let platform-specific subclasses
    > decide whether they want to register as WebContentsUserData, as well
    > as which logic they need to override.
    >
    > This also removes code that is dead on some platforms, because the
    > base class is abtract and doesn't implements all methods (as opposed
    > to a proxy object which cannot be abstract).
    >
    > Bug: 851905
    > Change-Id: I305ad85e2392fdd2ce428c0464b7750ac599babf
    > Reviewed-on: https://chromium-review.googlesource.com/1097405
    > Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    > Reviewed-by: Avi Drissman <avi@chromium.org>
    > Reviewed-by: Marc Treib <treib@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#567213}
    
    Bug: 851905
    Change-Id: I9e060ecf1272fec1ceebd4353fd390b95e64b669
    Reviewed-on: https://chromium-review.googlesource.com/1103717Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
    Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#567966}
    ce816173
BUILD.gn 177 KB