Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Sep 2015 19:44:50 +0000 (19:44 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Sep 2015 19:44:50 +0000 (19:44 +0000)
<rdar://problem/22560715>

Speculative roll out of r188331 as we had a ~2.5% PLT regression around
the time it landed and it seems the most likely culprit. I'll reland if
the perf bots do not recover after the roll out.

Source/WebCore:

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* page/Chrome.cpp:
(WebCore::Chrome::mouseDidMoveOverElement):

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::storageSession): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
(webkitWebExtensionDidReceiveMessage):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
* WebProcess/WebProcess.cpp:
* WebProcess/WebProcess.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190364 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/page/Chrome.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h

index f806976..db2b39a 100644 (file)
@@ -1,3 +1,20 @@
+2015-09-30  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
+        <rdar://problem/22560715>
+
+        Speculative roll out of r188331 as we had a ~2.5% PLT regression around
+        the time it landed and it seems the most likely culprit. I'll reland if
+        the perf bots do not recover after the roll out.
+
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::parseAttribute):
+        * loader/FrameLoaderClient.h:
+        * loader/LinkLoader.cpp:
+        (WebCore::LinkLoader::loadLink):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::mouseDidMoveOverElement):
+
 2015-09-30  Timothy Horton  <timothy_horton@apple.com>
 
         Compute document marker rects at use time instead of paint time
index 053ec45..171b0ee 100644 (file)
@@ -25,6 +25,7 @@
 #include "HTMLAnchorElement.h"
 
 #include "AttributeDOMTokenList.h"
+#include "DNS.h"
 #include "ElementIterator.h"
 #include "EventHandler.h"
 #include "EventNames.h"
@@ -252,9 +253,9 @@ void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt
             setNeedsStyleRecalc();
         if (isLink()) {
             String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
-            if (document().isDNSPrefetchEnabled() && document().frame()) {
+            if (document().isDNSPrefetchEnabled()) {
                 if (protocolIsInHTTPFamily(parsedURL) || parsedURL.startsWith("//"))
-                    document().frame()->loader().client().prefetchDNS(document().completeURL(parsedURL).host());
+                    prefetchDNS(document().completeURL(parsedURL).host());
             }
         }
         invalidateCachedVisitedLinkHash();
index e04bbf5..80c70cd 100644 (file)
@@ -30,7 +30,6 @@
 #ifndef FrameLoaderClient_h
 #define FrameLoaderClient_h
 
-#include "DNS.h"
 #include "FrameLoaderTypes.h"
 #include "IconURL.h"
 #include "LayoutMilestones.h"
@@ -346,7 +345,6 @@ namespace WebCore {
 #if ENABLE(CONTENT_FILTERING)
         virtual void contentFilterDidBlockLoad(ContentFilterUnblockHandler) { }
 #endif
-        virtual void prefetchDNS(const String& hostname) { WebCore::prefetchDNS(hostname); }
     };
 
 } // namespace WebCore
index f69e26e..abbc00d 100644 (file)
@@ -37,6 +37,7 @@
 #include "CachedResourceLoader.h"
 #include "CachedResourceRequest.h"
 #include "ContainerNode.h"
+#include "DNS.h"
 #include "Document.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
@@ -97,8 +98,8 @@ bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, const URL& href,
         Settings* settings = document.settings();
         // FIXME: The href attribute of the link element can be in "//hostname" form, and we shouldn't attempt
         // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=48857>.
-        if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty() && document.frame())
-            document.frame()->loader().client().prefetchDNS(href.host());
+        if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty())
+            prefetchDNS(href.host());
     }
 
 #if ENABLE(LINK_PREFETCH)
index e95d38c..d2bfc65 100644 (file)
 #include "Chrome.h"
 
 #include "ChromeClient.h"
+#include "DNS.h"
 #include "Document.h"
 #include "DocumentType.h"
 #include "FileIconLoader.h"
 #include "FileChooser.h"
 #include "FileList.h"
 #include "FloatRect.h"
-#include "FrameLoaderClient.h"
 #include "FrameTree.h"
 #include "Geolocation.h"
 #include "HTMLFormElement.h"
@@ -350,7 +350,7 @@ void Chrome::setStatusbarText(Frame* frame, const String& status)
 void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
 {
     if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnabled())
-        m_page.mainFrame().loader().client().prefetchDNS(result.absoluteLinkURL().host());
+        prefetchDNS(result.absoluteLinkURL().host());
     m_client.mouseDidMoveOverElement(result, modifierFlags);
 
     InspectorInstrumentation::mouseDidMoveOverElement(m_page, result, modifierFlags);
index 179bea7..b0f62d5 100644 (file)
@@ -1,3 +1,25 @@
+2015-09-30  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, roll out r188331: "NetworkProcess: DNS prefetch happens in the Web Process"
+        <rdar://problem/22560715>
+
+        Speculative roll out of r188331 as we had a ~2.5% PLT regression around
+        the time it landed and it seems the most likely culprit. I'll reland if
+        the perf bots do not recover after the roll out.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::storageSession): Deleted.
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
+        (webkitWebExtensionDidReceiveMessage):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
+        * WebProcess/WebProcess.cpp:
+        * WebProcess/WebProcess.h:
+
 2015-09-30  Timothy Horton  <timothy_horton@apple.com>
 
         Compute document marker rects at use time instead of paint time
index 558082d..82a20d5 100644 (file)
@@ -36,7 +36,6 @@
 #include "NetworkResourceLoaderMessages.h"
 #include "RemoteNetworkingContext.h"
 #include "SessionTracker.h"
-#include <WebCore/DNS.h>
 #include <WebCore/PingHandle.h>
 #include <WebCore/PlatformCookieJar.h>
 #include <WebCore/ResourceLoaderOptions.h>
@@ -160,11 +159,6 @@ void NetworkConnectionToWebProcess::setDefersLoading(ResourceLoadIdentifier iden
     loader->setDefersLoading(defers);
 }
 
-void NetworkConnectionToWebProcess::prefetchDNS(const String& hostname)
-{
-    WebCore::prefetchDNS(hostname);
-}
-
 static NetworkStorageSession& storageSession(SessionID sessionID)
 {
     if (sessionID.isEphemeral()) {
index 1c03e95..822de58 100644 (file)
@@ -73,7 +73,6 @@ private:
     void scheduleResourceLoad(const NetworkResourceLoadParameters&);
     void performSynchronousLoad(const NetworkResourceLoadParameters&, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>);
     void loadPing(const NetworkResourceLoadParameters&);
-    void prefetchDNS(const String&);
 
     void removeLoadIdentifier(ResourceLoadIdentifier);
     void setDefersLoading(ResourceLoadIdentifier, bool);
index 39aeffd..4c0a7ad 100644 (file)
@@ -29,7 +29,6 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver {
     LoadPing(WebKit::NetworkResourceLoadParameters resourceLoadParameters)
     RemoveLoadIdentifier(uint64_t resourceLoadIdentifier)
     SetDefersLoading(uint64_t resourceLoadIdentifier, bool defers)
-    PrefetchDNS(String hostname)
 
     StartDownload(WebCore::SessionID sessionID, uint64_t downloadID, WebCore::ResourceRequest request)
     ConvertMainResourceLoadToDownload(uint64_t mainResourceLoadIdentifier, uint64_t downloadID, WebCore::ResourceRequest request, WebCore::ResourceResponse response)
index 344fb22..cf2696f 100644 (file)
@@ -27,7 +27,7 @@
 #include "WebKitPrivate.h"
 #include "WebKitWebExtensionPrivate.h"
 #include "WebKitWebPagePrivate.h"
-#include "WebProcess.h"
+#include <WebCore/DNS.h>
 #include <wtf/HashMap.h>
 #include <wtf/glib/GRefPtr.h>
 
@@ -161,7 +161,7 @@ static void webkitWebExtensionDidReceiveMessage(WebKitWebExtension*, const Strin
 {
     if (messageName == String::fromUTF8("PrefetchDNS")) {
         API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname")));
-        WebProcess::singleton().prefetchDNS(hostname->string());
+        WebCore::prefetchDNS(hostname->string());
     } else
         ASSERT_NOT_REACHED();
 }
index 7fcc450..ab6efd5 100644 (file)
@@ -1715,9 +1715,4 @@ void WebFrameLoaderClient::didRequestAutocomplete(PassRefPtr<WebCore::FormState>
 }
 #endif
 
-void WebFrameLoaderClient::prefetchDNS(const String& hostname)
-{
-    WebProcess::singleton().prefetchDNS(hostname);
-}
-
 } // namespace WebKit
index e8869a9..590f971 100644 (file)
@@ -241,8 +241,6 @@ private:
     void contentFilterDidBlockLoad(WebCore::ContentFilterUnblockHandler) override;
 #endif
 
-    void prefetchDNS(const String&) override;
-
     WebFrame* m_frame;
     RefPtr<PluginView> m_pluginView;
     bool m_hasSentResponseToPluginView;
index 863a854..3da475d 100644 (file)
@@ -50,6 +50,7 @@
 #import "WebProcess.h"
 #import <CoreText/CTFont.h>
 #import <WebCore/Chrome.h>
+#import <WebCore/DNS.h>
 #import <WebCore/DiagnosticLoggingClient.h>
 #import <WebCore/DiagnosticLoggingKeys.h>
 #import <WebCore/Element.h>
@@ -58,7 +59,6 @@
 #import <WebCore/FloatQuad.h>
 #import <WebCore/FocusController.h>
 #import <WebCore/Frame.h>
-#import <WebCore/FrameLoaderClient.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/GeometryUtilities.h>
 #import <WebCore/HTMLElementTypeHelpers.h>
@@ -629,7 +629,7 @@ void WebPage::sendTapHighlightForNodeIfNecessary(uint64_t requestID, Node* node)
         return;
 
     if (is<Element>(*node))
-        m_page->mainFrame().loader().client().prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());
+        prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());
 
     Vector<FloatQuad> quads;
     if (RenderObject *renderer = node->renderer()) {
index 15959ad..70036b0 100644 (file)
@@ -36,7 +36,6 @@
 #include "EventDispatcher.h"
 #include "InjectedBundle.h"
 #include "Logging.h"
-#include "NetworkConnectionToWebProcessMessages.h"
 #include "PluginProcessConnectionManager.h"
 #include "SessionTracker.h"
 #include "StatisticsData.h"
@@ -68,7 +67,6 @@
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/AuthenticationChallenge.h>
 #include <WebCore/CrossOriginPreflightResultCache.h>
-#include <WebCore/DNS.h>
 #include <WebCore/FontCache.h>
 #include <WebCore/FontCascade.h>
 #include <WebCore/Frame.h>
@@ -1453,16 +1451,4 @@ void WebProcess::setEnabledServices(bool hasImageServices, bool hasSelectionServ
 }
 #endif
 
-void WebProcess::prefetchDNS(const String& hostname)
-{
-    if (!usesNetworkProcess()) {
-        WebCore::prefetchDNS(hostname);
-        return;
-    }
-
-#if ENABLE(NETWORK_PROCESS)
-    networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
-#endif
-}
-
 } // namespace WebKit
index e878ce9..bb204e4 100644 (file)
@@ -214,8 +214,6 @@ public:
     bool hasRichContentServices() const { return m_hasRichContentServices; }
 #endif
 
-    void prefetchDNS(const String&);
-
 private:
     WebProcess();
     ~WebProcess();