Title: [237146] trunk/Source/WebKit
Revision
237146
Author
achristen...@apple.com
Date
2018-10-15 14:33:52 -0700 (Mon, 15 Oct 2018)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (237145 => 237146)


--- trunk/Source/WebKit/ChangeLog	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/ChangeLog	2018-10-15 21:33:52 UTC (rev 237146)
@@ -1,3 +1,38 @@
+2018-10-15  Alex Christensen  <achristen...@webkit.org>
+
+        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.
+
 2018-10-15  Chris Dumez  <cdu...@apple.com>
 
         Experiment: target=_blank on anchors should imply rel=noopener

Modified: trunk/Source/WebKit/Shared/WebPageGroupData.cpp (237145 => 237146)


--- trunk/Source/WebKit/Shared/WebPageGroupData.cpp	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/Shared/WebPageGroupData.cpp	2018-10-15 21:33:52 UTC (rev 237146)
@@ -34,30 +34,27 @@
 {
     encoder << identifier;
     encoder << pageGroupID;
-    encoder << visibleToInjectedBundle;
-    encoder << visibleToHistoryClient;
     encoder << userContentControllerIdentifier.toUInt64();
 }
 
 std::optional<WebPageGroupData> WebPageGroupData::decode(IPC::Decoder& decoder)
 {
-    String id;
-    if (!decoder.decode(id))
+    std::optional<String> identifier;
+    decoder >> identifier;
+    if (!identifier)
         return std::nullopt;
-    uint64_t pageGroupID;
-    if (!decoder.decode(pageGroupID))
+    
+    std::optional<uint64_t> pageGroupID;
+    decoder >> pageGroupID;
+    if (!pageGroupID)
         return std::nullopt;
-    bool visibleToInjectedBundle;
-    if (!decoder.decode(visibleToInjectedBundle))
-        return std::nullopt;
-    bool visibleToHistoryClient;
-    if (!decoder.decode(visibleToHistoryClient))
-        return std::nullopt;
-    std::optional<uint64_t> userContentControllerIdentifier;
+    
+    std::optional<UserContentControllerIdentifier> userContentControllerIdentifier;
     decoder >> userContentControllerIdentifier;
     if (!userContentControllerIdentifier)
         return std::nullopt;
-    return { { id, pageGroupID, visibleToInjectedBundle, visibleToHistoryClient, makeObjectIdentifier<UserContentControllerIdentifierType>(*userContentControllerIdentifier) } };
+    
+    return {{ WTFMove(*identifier), WTFMove(*pageGroupID), WTFMove(*userContentControllerIdentifier) }};
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/WebPageGroupData.h (237145 => 237146)


--- trunk/Source/WebKit/Shared/WebPageGroupData.h	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/Shared/WebPageGroupData.h	2018-10-15 21:33:52 UTC (rev 237146)
@@ -41,8 +41,6 @@
 
     String identifier;
     uint64_t pageGroupID;
-    bool visibleToInjectedBundle;
-    bool visibleToHistoryClient;
 
     UserContentControllerIdentifier userContentControllerIdentifier;
 };

Modified: trunk/Source/WebKit/UIProcess/WebPageGroup.cpp (237145 => 237146)


--- trunk/Source/WebKit/UIProcess/WebPageGroup.cpp	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/UIProcess/WebPageGroup.cpp	2018-10-15 21:33:52 UTC (rev 237146)
@@ -54,9 +54,9 @@
     return map;
 }
 
-Ref<WebPageGroup> WebPageGroup::create(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
+Ref<WebPageGroup> WebPageGroup::create(const String& identifier)
 {
-    return adoptRef(*new WebPageGroup(identifier, visibleToInjectedBundle, visibleToHistoryClient));
+    return adoptRef(*new WebPageGroup(identifier));
 }
 
 WebPageGroup* WebPageGroup::get(uint64_t pageGroupID)
@@ -64,7 +64,7 @@
     return webPageGroupMap().get(pageGroupID);
 }
 
-static WebPageGroupData pageGroupData(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
+static WebPageGroupData pageGroupData(const String& identifier)
 {
     WebPageGroupData data;
 
@@ -75,16 +75,13 @@
     else
         data.identifier = makeString("__uniquePageGroupID-", String::number(data.pageGroupID));
 
-    data.visibleToInjectedBundle = visibleToInjectedBundle;
-    data.visibleToHistoryClient = visibleToHistoryClient;
-
     return data;
 }
 
 // FIXME: Why does the WebPreferences object here use ".WebKit2" instead of "WebKit2." which all the other constructors use.
 // If it turns out that it's wrong, we can change it to to "WebKit2." and get rid of the globalDebugKeyPrefix from WebPreferences.
-WebPageGroup::WebPageGroup(const String& identifier, bool visibleToInjectedBundle, bool visibleToHistoryClient)
-    : m_data(pageGroupData(identifier, visibleToInjectedBundle, visibleToHistoryClient))
+WebPageGroup::WebPageGroup(const String& identifier)
+    : m_data(pageGroupData(identifier))
     , m_preferences(WebPreferences::createWithLegacyDefaults(m_data.identifier, ".WebKit2", "WebKit2."))
     , m_userContentController(WebUserContentControllerProxy::create())
 {

Modified: trunk/Source/WebKit/UIProcess/WebPageGroup.h (237145 => 237146)


--- trunk/Source/WebKit/UIProcess/WebPageGroup.h	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/UIProcess/WebPageGroup.h	2018-10-15 21:33:52 UTC (rev 237146)
@@ -41,8 +41,8 @@
 
 class WebPageGroup : public API::ObjectImpl<API::Object::Type::PageGroup> {
 public:
-    WebPageGroup(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
-    static Ref<WebPageGroup> create(const String& identifier = String(), bool visibleToInjectedBundle = true, bool visibleToHistoryClient = true);
+    explicit WebPageGroup(const String& identifier = { });
+    static Ref<WebPageGroup> create(const String& identifier = { });
 
     static WebPageGroup* get(uint64_t pageGroupID);
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (237145 => 237146)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-10-15 21:33:52 UTC (rev 237146)
@@ -1079,7 +1079,7 @@
 void WebFrameLoaderClient::updateGlobalHistory()
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
+    if (!webPage)
         return;
 
     DocumentLoader* loader = m_frame->coreFrame()->loader().documentLoader();
@@ -1097,7 +1097,7 @@
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
+    if (!webPage)
         return;
 
     DocumentLoader* loader = m_frame->coreFrame()->loader().documentLoader();
@@ -1340,7 +1340,7 @@
 void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const URL& url)
 {
     WebPage* webPage = m_frame->page();
-    if (!webPage || !webPage->pageGroup()->isVisibleToHistoryClient())
+    if (!webPage)
         return;
 
     // FIXME: Use direction of title.

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (237145 => 237146)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-10-15 21:33:52 UTC (rev 237146)
@@ -341,7 +341,7 @@
 {
     Ref<WebPage> page = adoptRef(*new WebPage(pageID, WTFMove(parameters)));
 
-    if (page->pageGroup()->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
+    if (WebProcess::singleton().injectedBundle())
         WebProcess::singleton().injectedBundle()->didCreatePage(page.ptr());
 
     return page;
@@ -1176,7 +1176,7 @@
     if (!mainWebFrame()->url().isEmpty())
         reportUsedFeatures();
 
-    if (pageGroup()->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
+    if (WebProcess::singleton().injectedBundle())
         WebProcess::singleton().injectedBundle()->willDestroyPage(this);
 
     if (m_inspector) {

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp (237145 => 237146)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp	2018-10-15 21:33:52 UTC (rev 237146)
@@ -39,7 +39,7 @@
 {
     auto pageGroup = adoptRef(*new WebPageGroupProxy(data));
 
-    if (pageGroup->isVisibleToInjectedBundle() && WebProcess::singleton().injectedBundle())
+    if (WebProcess::singleton().injectedBundle())
         WebProcess::singleton().injectedBundle()->didInitializePageGroup(pageGroup.ptr());
 
     return pageGroup;

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.h (237145 => 237146)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.h	2018-10-15 21:21:16 UTC (rev 237145)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.h	2018-10-15 21:33:52 UTC (rev 237146)
@@ -44,8 +44,6 @@
 
     const String& identifier() const { return m_data.identifier; }
     uint64_t pageGroupID() const { return m_data.pageGroupID; }
-    bool isVisibleToInjectedBundle() const { return m_data.visibleToInjectedBundle; }
-    bool isVisibleToHistoryClient() const { return m_data.visibleToHistoryClient; }
     WebCore::PageGroup* corePageGroup() const { return m_pageGroup; }
 
     WebUserContentController& userContentController();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to