Diff
Modified: trunk/Source/WebCore/ChangeLog (188330 => 188331)
--- trunk/Source/WebCore/ChangeLog 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebCore/ChangeLog 2015-08-12 07:13:01 UTC (rev 188331)
@@ -1,3 +1,20 @@
+2015-08-11 Carlos Garcia Campos <[email protected]>
+
+ NetworkProcess: DNS prefetch happens in the Web Process
+ https://bugs.webkit.org/show_bug.cgi?id=147824
+
+ Reviewed by Alexey Proskuryakov.
+
+ Use FrameLoaderClient to do the DNS prefetch.
+
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::parseAttribute):
+ * loader/FrameLoaderClient.h:
+ * loader/LinkLoader.cpp:
+ (WebCore::LinkLoader::loadLink):
+ * page/Chrome.cpp:
+ (WebCore::Chrome::mouseDidMoveOverElement):
+
2015-08-11 Mark Lam <[email protected]>
Implementation _javascript_ watchdog using WTF::WorkQueue.
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (188330 => 188331)
--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -24,7 +24,6 @@
#include "config.h"
#include "HTMLAnchorElement.h"
-#include "DNS.h"
#include "ElementIterator.h"
#include "EventHandler.h"
#include "EventNames.h"
@@ -253,9 +252,9 @@
setNeedsStyleRecalc();
if (isLink()) {
String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
- if (document().isDNSPrefetchEnabled()) {
+ if (document().isDNSPrefetchEnabled() && document().frame()) {
if (protocolIsInHTTPFamily(parsedURL) || parsedURL.startsWith("//"))
- prefetchDNS(document().completeURL(parsedURL).host());
+ document().frame()->loader().client().prefetchDNS(document().completeURL(parsedURL).host());
}
}
invalidateCachedVisitedLinkHash();
Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (188330 => 188331)
--- trunk/Source/WebCore/loader/FrameLoaderClient.h 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h 2015-08-12 07:13:01 UTC (rev 188331)
@@ -30,6 +30,7 @@
#ifndef FrameLoaderClient_h
#define FrameLoaderClient_h
+#include "DNS.h"
#include "FrameLoaderTypes.h"
#include "IconURL.h"
#include "LayoutMilestones.h"
@@ -347,6 +348,7 @@
#if ENABLE(CONTENT_FILTERING)
virtual void contentFilterDidBlockLoad(ContentFilterUnblockHandler) { }
#endif
+ virtual void prefetchDNS(const String& hostname) { WebCore::prefetchDNS(hostname); }
};
} // namespace WebCore
Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (188330 => 188331)
--- trunk/Source/WebCore/loader/LinkLoader.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -37,7 +37,6 @@
#include "CachedResourceLoader.h"
#include "CachedResourceRequest.h"
#include "ContainerNode.h"
-#include "DNS.h"
#include "Document.h"
#include "Frame.h"
#include "FrameLoaderClient.h"
@@ -98,8 +97,8 @@
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())
- prefetchDNS(href.host());
+ if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty() && document.frame())
+ document.frame()->loader().client().prefetchDNS(href.host());
}
#if ENABLE(LINK_PREFETCH)
Modified: trunk/Source/WebCore/page/Chrome.cpp (188330 => 188331)
--- trunk/Source/WebCore/page/Chrome.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebCore/page/Chrome.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -23,13 +23,13 @@
#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::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
{
if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnabled())
- prefetchDNS(result.absoluteLinkURL().host());
+ m_page.mainFrame().loader().client().prefetchDNS(result.absoluteLinkURL().host());
m_client.mouseDidMoveOverElement(result, modifierFlags);
InspectorInstrumentation::mouseDidMoveOverElement(m_page, result, modifierFlags);
Modified: trunk/Source/WebKit2/ChangeLog (188330 => 188331)
--- trunk/Source/WebKit2/ChangeLog 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/ChangeLog 2015-08-12 07:13:01 UTC (rev 188331)
@@ -1,3 +1,32 @@
+2015-08-11 Carlos Garcia Campos <[email protected]>
+
+ NetworkProcess: DNS prefetch happens in the Web Process
+ https://bugs.webkit.org/show_bug.cgi?id=147824
+
+ Reviewed by Alexey Proskuryakov.
+
+ DNS prefetch requests started in the WebProcess should be sent to
+ the network process when it's enabled.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::prefetchDNS): Do the
+ actual DNS prefetch.
+ * NetworkProcess/NetworkConnectionToWebProcess.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Add
+ PrefetchDNS message.
+ * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
+ (webkitWebExtensionDidReceiveMessage): Use WebProcess::prefetchDNS().
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::prefetchDNS): Ditto.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Use
+ FrameLoaderClient to do the DNS prefetch.
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::prefetchDNS): Send the request to the network
+ process if it's enabled, otherwise do the actual DNS prefetch.
+ * WebProcess/WebProcess.h:
+
2015-08-11 Hunseop Jeong <[email protected]>
Try to fix the EFL build after r188279
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (188330 => 188331)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -36,6 +36,7 @@
#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>
@@ -159,6 +160,11 @@
loader->setDefersLoading(defers);
}
+void NetworkConnectionToWebProcess::prefetchDNS(const String& hostname)
+{
+ WebCore::prefetchDNS(hostname);
+}
+
static NetworkStorageSession& storageSession(SessionID sessionID)
{
if (sessionID.isEphemeral()) {
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (188330 => 188331)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h 2015-08-12 07:13:01 UTC (rev 188331)
@@ -73,6 +73,7 @@
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);
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in (188330 => 188331)
--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2015-08-12 07:13:01 UTC (rev 188331)
@@ -29,6 +29,7 @@
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)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -27,7 +27,7 @@
#include "WebKitPrivate.h"
#include "WebKitWebExtensionPrivate.h"
#include "WebKitWebPagePrivate.h"
-#include <WebCore/DNS.h>
+#include "WebProcess.h"
#include <wtf/HashMap.h>
#include <wtf/glib/GRefPtr.h>
@@ -161,7 +161,7 @@
{
if (messageName == String::fromUTF8("PrefetchDNS")) {
API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname")));
- WebCore::prefetchDNS(hostname->string());
+ WebProcess::singleton().prefetchDNS(hostname->string());
} else
ASSERT_NOT_REACHED();
}
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -1711,4 +1711,9 @@
}
#endif
+void WebFrameLoaderClient::prefetchDNS(const String& hostname)
+{
+ WebProcess::singleton().prefetchDNS(hostname);
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h 2015-08-12 07:13:01 UTC (rev 188331)
@@ -241,6 +241,8 @@
void contentFilterDidBlockLoad(WebCore::ContentFilterUnblockHandler) override;
#endif
+ void prefetchDNS(const String&) override;
+
WebFrame* m_frame;
RefPtr<PluginView> m_pluginView;
bool m_hasSentResponseToPluginView;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2015-08-12 07:13:01 UTC (rev 188331)
@@ -50,7 +50,6 @@
#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>
@@ -59,6 +58,7 @@
#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 @@
return;
if (is<Element>(*node))
- prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());
+ m_page->mainFrame().loader().client().prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());
Vector<FloatQuad> quads;
if (RenderObject *renderer = node->renderer()) {
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-08-12 07:13:01 UTC (rev 188331)
@@ -36,6 +36,7 @@
#include "EventDispatcher.h"
#include "InjectedBundle.h"
#include "Logging.h"
+#include "NetworkConnectionToWebProcessMessages.h"
#include "PluginProcessConnectionManager.h"
#include "SessionTracker.h"
#include "StatisticsData.h"
@@ -67,6 +68,7 @@
#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>
@@ -1451,4 +1453,16 @@
}
#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
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (188330 => 188331)
--- trunk/Source/WebKit2/WebProcess/WebProcess.h 2015-08-12 06:05:08 UTC (rev 188330)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h 2015-08-12 07:13:01 UTC (rev 188331)
@@ -214,6 +214,8 @@
bool hasRichContentServices() const { return m_hasRichContentServices; }
#endif
+ void prefetchDNS(const String&);
+
private:
WebProcess();
~WebProcess();