• Alex Moshchuk's avatar
    Replace SiteInstance::IsSameWebSite() with a new non-static method. · 78cf66bd
    Alex Moshchuk authored
    Currently, SiteInstance::IsSameWebSite() is static and will need to be
    modified to support dynamic isolated origins.  Those origins will
    apply only to future BrowsingInstances, meaning the answer to
    IsSameWebSite will depend on which frame/SiteInstance is asking this
    question.  This CL replaces this method with a non-static
    SiteInstance::IsSameSiteWithURL method.  This will ensure that the
    internal implementation will be able to provide sufficient context
    (i.e., BrowsingInstance info) in the future, without having to expose
    that context outside of content/.  Note that the content-internal
    version of this call, SiteInstanceImpl::IsSameWebSite, stays as-is for
    now.
    
    The only two non-test uses of this were in NaCl code.  They were
    checking whether the current SiteInstance's site URL is same-site with
    the URL of the NaCl file to be loaded, with both URLs expected to be
    extension URLs.  There should be no behavior change in these, as the
    underlying implementation doesn't change.
    
    A few tests are also refactored to either avoid using IsSameWebSite
    entirely, or, for tests inside content/, to use the internal version
    of IsSameWebSite.
    
    Bug: 905513
    Change-Id: Ia2957bb1ec7a16de8c3d18ef167149f1f5a08066
    Reviewed-on: https://chromium-review.googlesource.com/c/1352856Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
    Reviewed-by: default avatarDerek Schuff <dschuff@chromium.org>
    Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
    Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612495}
    78cf66bd
site_instance.h 8.96 KB