Changeset 237146 in webkit


Ignore:
Timestamp:
Oct 15, 2018, 2:33:52 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Remove unused parameters of WebPageGroupData
https://bugs.webkit.org/show_bug.cgi?id=190600

Reviewed by Chris Dumez.

visibleToInjectedBundle and visibleToHistoryClient are both always true.
This removes a mysterious check in the history code.

  • Shared/WebPageGroupData.cpp:

(WebKit::WebPageGroupData::encode const):
(WebKit::WebPageGroupData::decode):

  • Shared/WebPageGroupData.h:
  • UIProcess/WebPageGroup.cpp:

(WebKit::WebPageGroup::create):
(WebKit::pageGroupData):
(WebKit::WebPageGroup::WebPageGroup):

  • UIProcess/WebPageGroup.h:

(WebKit::WebPageGroup::WebPageGroup):
(WebKit::WebPageGroup::create):

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::updateGlobalHistory):
(WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
(WebKit::WebFrameLoaderClient::setTitle):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::create):
(WebKit::WebPage::close):

  • WebProcess/WebPage/WebPageGroupProxy.cpp:

(WebKit::WebPageGroupProxy::create):

  • WebProcess/WebPage/WebPageGroupProxy.h:

(WebKit::WebPageGroupProxy::pageGroupID const):
(WebKit::WebPageGroupProxy::isVisibleToInjectedBundle const): Deleted.
(WebKit::WebPageGroupProxy::isVisibleToHistoryClient const): Deleted.

Location:
trunk/Source/WebKit
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebKit/ChangeLog

    r237144 r237146  
     12018-10-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Remove unused parameters of WebPageGroupData
     4        https://bugs.webkit.org/show_bug.cgi?id=190600
     5
     6        Reviewed by Chris Dumez.
     7
     8        visibleToInjectedBundle and visibleToHistoryClient are both always true.
     9        This removes a mysterious check in the history code.
     10
     11        * Shared/WebPageGroupData.cpp:
     12        (WebKit::WebPageGroupData::encode const):
     13        (WebKit::WebPageGroupData::decode):
     14        * Shared/WebPageGroupData.h:
     15        * UIProcess/WebPageGroup.cpp:
     16        (WebKit::WebPageGroup::create):
     17        (WebKit::pageGroupData):
     18        (WebKit::WebPageGroup::WebPageGroup):
     19        * UIProcess/WebPageGroup.h:
     20        (WebKit::WebPageGroup::WebPageGroup):
     21        (WebKit::WebPageGroup::create):
     22        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     23        (WebKit::WebFrameLoaderClient::updateGlobalHistory):
     24        (WebKit::WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
     25        (WebKit::WebFrameLoaderClient::setTitle):
     26        * WebProcess/WebPage/WebPage.cpp:
     27        (WebKit::WebPage::create):
     28        (WebKit::WebPage::close):
     29        * WebProcess/WebPage/WebPageGroupProxy.cpp:
     30        (WebKit::WebPageGroupProxy::create):
     31        * WebProcess/WebPage/WebPageGroupProxy.h:
     32        (WebKit::WebPageGroupProxy::pageGroupID const):
     33        (WebKit::WebPageGroupProxy::isVisibleToInjectedBundle const): Deleted.
     34        (WebKit::WebPageGroupProxy::isVisibleToHistoryClient const): Deleted.
     35
    1362018-10-15  Chris Dumez  <cdumez@apple.com>
    237
  • TabularUnified trunk/Source/WebKit/Shared/WebPageGroupData.cpp

    r230232 r237146  
    3535    encoder << identifier;
    3636    encoder << pageGroupID;
    37     encoder << visibleToInjectedBundle;
    38     encoder << visibleToHistoryClient;
    3937    encoder << userContentControllerIdentifier.toUInt64();
    4038}
     
    4240std::optional<WebPageGroupData> WebPageGroupData::decode(IPC::Decoder& decoder)
    4341{
    44     String id;
    45     if (!decoder.decode(id))
     42    std::optional<String> identifier;
     43    decoder >> identifier;
     44    if (!identifier)
    4645        return std::nullopt;
    47     uint64_t pageGroupID;
    48     if (!decoder.decode(pageGroupID))
     46   
     47    std::optional<uint64_t> pageGroupID;
     48    decoder >> pageGroupID;
     49    if (!pageGroupID)
    4950        return std::nullopt;
    50     bool visibleToInjectedBundle;
    51     if (!decoder.decode(visibleToInjectedBundle))
    52         return std::nullopt;
    53     bool visibleToHistoryClient;
    54     if (!decoder.decode(visibleToHistoryClient))
    55         return std::nullopt;
    56     std::optional<uint64_t> userContentControllerIdentifier;
     51   
     52    std::optional<UserContentControllerIdentifier> userContentControllerIdentifier;
    5753    decoder >> userContentControllerIdentifier;
    5854    if (!userContentControllerIdentifier)
    5955        return std::nullopt;
    60     return { { id, pageGroupID, visibleToInjectedBundle, visibleToHistoryClient, makeObjectIdentifier<UserContentControllerIdentifierType>(*userContentControllerIdentifier) } };
     56   
     57    return {{ WTFMove(*identifier), WTFMove(*pageGroupID), WTFMove(*userContentControllerIdentifier) }};
    6158}
    6259
  • TabularUnified trunk/Source/WebKit/Shared/WebPageGroupData.h

    r230223 r237146  
    4242    String identifier;
    4343    uint64_t pageGroupID;
    44     bool visibleToInjectedBundle;
    45     bool visibleToHistoryClient;
    4644
    4745    UserContentControllerIdentifier userContentControllerIdentifier;
  • TabularUnified trunk/Source/WebKit/UIProcess/WebPageGroup.cpp

    r225700 r237146  
    5555}
    5656
    57 Ref<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
     57Ref<WebPageGroup> WebPageGroup::create(const String& identifier)
    5858{
    59     return adoptRef(*new WebPageGroup(identifier, visibleToInjectedBundle, visibleToHistoryClient));
     59    return adoptRef(*new WebPageGroup(identifier));
    6060}
    6161
     
    6565}
    6666
    67 static WebPageGroupData pageGroupData(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
     67static WebPageGroupData pageGroupData(const String& identifier)
    6868{
    6969    WebPageGroupData data;
     
    7676        data.identifier = makeString("__uniquePageGroupID-", String::number(data.pageGroupID));
    7777
    78     data.visibleToInjectedBundle = visibleToInjectedBundle;
    79     data.visibleToHistoryClient = visibleToHistoryClient;
    80 
    8178    return data;
    8279}
     
    8481// FIXME: Why does the WebPreferences object here use ".WebKit2" instead of "WebKit2." which all the other constructors use.
    8582// If it turns out that it's wrong, we can change it to to "WebKit2." and get rid of the globalDebugKeyPrefix from WebPreferences.
    86 WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
    87     : m_data(pageGroupData(identifier, visibleToInjectedBundle, visibleToHistoryClient))
     83WebPageGroup::WebPageGroup(const String& identifier)
     84    : m_data(pageGroupData(identifier))
    8885    , m_preferences(WebPreferences::createWithLegacyDefaults(m_data.identifier, ".WebKit2", "WebKit2."))
    8986    , m_userContentController(WebUserContentControllerProxy::create())
  • TabularUnified trunk/Source/WebKit/UIProcess/WebPageGroup.h

    r225700 r237146  
    4242class WebPageGroup : public API::ObjectImpl<API::Object::Type::PageGroup> {
    4343public:
    44     WebPageGroup(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
    45     static Ref<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
     44    explicit WebPageGroup(const String& identifier = { });
     45    static Ref<WebPageGroup> create(const String& identifier = { });
    4646
    4747    static WebPageGroup* get(uint64_t pageGroupID);
  • TabularUnified trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r237138 r237146  
    10801080{
    10811081    WebPage* webPage = m_frame->page();
    1082     if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
     1082    if (!webPage)
    10831083        return;
    10841084
     
    10981098{
    10991099    WebPage* webPage = m_frame->page();
    1100     if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
     1100    if (!webPage)
    11011101        return;
    11021102
     
    13411341{
    13421342    WebPage* webPage = m_frame->page();
    1343     if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
     1343    if (!webPage)
    13441344        return;
    13451345
  • TabularUnified trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r237087 r237146  
    342342    Ref<WebPage> page = adoptRef(*new WebPage(pageID, WTFMove(parameters)));
    343343
    344     if (page->pageGroup()->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
     344    if (WebProcess::singleton().injectedBundle())
    345345        WebProcess::singleton().injectedBundle()->didCreatePage(page.ptr());
    346346
     
    11771177        reportUsedFeatures();
    11781178
    1179     if (pageGroup()->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
     1179    if (WebProcess::singleton().injectedBundle())
    11801180        WebProcess::singleton().injectedBundle()->willDestroyPage(this);
    11811181
  • TabularUnified trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp

    r216448 r237146  
    4040    auto pageGroup = adoptRef(*new WebPageGroupProxy(data));
    4141
    42     if (pageGroup->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
     42    if (WebProcess::singleton().injectedBundle())
    4343        WebProcess::singleton().injectedBundle()->didInitializePageGroup(pageGroup.ptr());
    4444
  • TabularUnified trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.h

    r216448 r237146  
    4545    const String& identifier() const { return m_data.identifier; }
    4646    uint64_t pageGroupID() const { return m_data.pageGroupID; }
    47     bool isVisibleToInjectedBundle() const { return m_data.visibleToInjectedBundle; }
    48     bool isVisibleToHistoryClient() const { return m_data.visibleToHistoryClient; }
    4947    WebCore::PageGroup* corePageGroup() const { return m_pageGroup; }
    5048
Note: See TracChangeset for help on using the changeset viewer.