Changeset 188331 in webkit
- Timestamp:
- Aug 12, 2015, 12:13:01 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r188329 r188331 1 2015-08-11 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 NetworkProcess: DNS prefetch happens in the Web Process 4 https://bugs.webkit.org/show_bug.cgi?id=147824 5 6 Reviewed by Alexey Proskuryakov. 7 8 Use FrameLoaderClient to do the DNS prefetch. 9 10 * html/HTMLAnchorElement.cpp: 11 (WebCore::HTMLAnchorElement::parseAttribute): 12 * loader/FrameLoaderClient.h: 13 * loader/LinkLoader.cpp: 14 (WebCore::LinkLoader::loadLink): 15 * page/Chrome.cpp: 16 (WebCore::Chrome::mouseDidMoveOverElement): 17 1 18 2015-08-11 Mark Lam <mark.lam@apple.com> 2 19 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r185111 r188331 25 25 #include "HTMLAnchorElement.h" 26 26 27 #include "DNS.h"28 27 #include "ElementIterator.h" 29 28 #include "EventHandler.h" … … 254 253 if (isLink()) { 255 254 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); 256 if (document().isDNSPrefetchEnabled() ) {255 if (document().isDNSPrefetchEnabled() && document().frame()) { 257 256 if (protocolIsInHTTPFamily(parsedURL) || parsedURL.startsWith("//")) 258 prefetchDNS(document().completeURL(parsedURL).host());257 document().frame()->loader().client().prefetchDNS(document().completeURL(parsedURL).host()); 259 258 } 260 259 } -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r187002 r188331 31 31 #define FrameLoaderClient_h 32 32 33 #include "DNS.h" 33 34 #include "FrameLoaderTypes.h" 34 35 #include "IconURL.h" … … 348 349 virtual void contentFilterDidBlockLoad(ContentFilterUnblockHandler) { } 349 350 #endif 351 virtual void prefetchDNS(const String& hostname) { WebCore::prefetchDNS(hostname); } 350 352 }; 351 353 -
trunk/Source/WebCore/loader/LinkLoader.cpp
r183563 r188331 38 38 #include "CachedResourceRequest.h" 39 39 #include "ContainerNode.h" 40 #include "DNS.h"41 40 #include "Document.h" 42 41 #include "Frame.h" … … 99 98 // FIXME: The href attribute of the link element can be in "//hostname" form, and we shouldn't attempt 100 99 // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=48857>. 101 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty() )102 prefetchDNS(href.host());100 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty() && document.frame()) 101 document.frame()->loader().client().prefetchDNS(href.host()); 103 102 } 104 103 -
trunk/Source/WebCore/page/Chrome.cpp
r187002 r188331 24 24 25 25 #include "ChromeClient.h" 26 #include "DNS.h"27 26 #include "Document.h" 28 27 #include "DocumentType.h" … … 31 30 #include "FileList.h" 32 31 #include "FloatRect.h" 32 #include "FrameLoaderClient.h" 33 33 #include "FrameTree.h" 34 34 #include "Geolocation.h" … … 351 351 { 352 352 if (result.innerNode() && result.innerNode()->document().isDNSPrefetchEnabled()) 353 prefetchDNS(result.absoluteLinkURL().host());353 m_page.mainFrame().loader().client().prefetchDNS(result.absoluteLinkURL().host()); 354 354 m_client.mouseDidMoveOverElement(result, modifierFlags); 355 355 -
trunk/Source/WebKit2/ChangeLog
r188317 r188331 1 2015-08-11 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 NetworkProcess: DNS prefetch happens in the Web Process 4 https://bugs.webkit.org/show_bug.cgi?id=147824 5 6 Reviewed by Alexey Proskuryakov. 7 8 DNS prefetch requests started in the WebProcess should be sent to 9 the network process when it's enabled. 10 11 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 12 (WebKit::NetworkConnectionToWebProcess::prefetchDNS): Do the 13 actual DNS prefetch. 14 * NetworkProcess/NetworkConnectionToWebProcess.h: 15 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Add 16 PrefetchDNS message. 17 * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: 18 (webkitWebExtensionDidReceiveMessage): Use WebProcess::prefetchDNS(). 19 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 20 (WebKit::WebFrameLoaderClient::prefetchDNS): Ditto. 21 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 22 * WebProcess/WebPage/ios/WebPageIOS.mm: 23 (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Use 24 FrameLoaderClient to do the DNS prefetch. 25 * WebProcess/WebProcess.cpp: 26 (WebKit::WebProcess::prefetchDNS): Send the request to the network 27 process if it's enabled, otherwise do the actual DNS prefetch. 28 * WebProcess/WebProcess.h: 29 1 30 2015-08-11 Hunseop Jeong <hs85.jeong@samsung.com> 2 31 -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
r187364 r188331 37 37 #include "RemoteNetworkingContext.h" 38 38 #include "SessionTracker.h" 39 #include <WebCore/DNS.h> 39 40 #include <WebCore/PingHandle.h> 40 41 #include <WebCore/PlatformCookieJar.h> … … 158 159 159 160 loader->setDefersLoading(defers); 161 } 162 163 void NetworkConnectionToWebProcess::prefetchDNS(const String& hostname) 164 { 165 WebCore::prefetchDNS(hostname); 160 166 } 161 167 -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
r186530 r188331 74 74 void performSynchronousLoad(const NetworkResourceLoadParameters&, PassRefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>); 75 75 void loadPing(const NetworkResourceLoadParameters&); 76 void prefetchDNS(const String&); 76 77 77 78 void removeLoadIdentifier(ResourceLoadIdentifier); -
trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r186530 r188331 30 30 RemoveLoadIdentifier(uint64_t resourceLoadIdentifier) 31 31 SetDefersLoading(uint64_t resourceLoadIdentifier, bool defers) 32 PrefetchDNS(String hostname) 32 33 33 34 StartDownload(WebCore::SessionID sessionID, uint64_t downloadID, WebCore::ResourceRequest request) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp
r185502 r188331 28 28 #include "WebKitWebExtensionPrivate.h" 29 29 #include "WebKitWebPagePrivate.h" 30 #include <WebCore/DNS.h>30 #include "WebProcess.h" 31 31 #include <wtf/HashMap.h> 32 32 #include <wtf/glib/GRefPtr.h> … … 162 162 if (messageName == String::fromUTF8("PrefetchDNS")) { 163 163 API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname"))); 164 Web Core::prefetchDNS(hostname->string());164 WebProcess::singleton().prefetchDNS(hostname->string()); 165 165 } else 166 166 ASSERT_NOT_REACHED(); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r188287 r188331 1712 1712 #endif 1713 1713 1714 void WebFrameLoaderClient::prefetchDNS(const String& hostname) 1715 { 1716 WebProcess::singleton().prefetchDNS(hostname); 1717 } 1718 1714 1719 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r187002 r188331 242 242 #endif 243 243 244 void prefetchDNS(const String&) override; 245 244 246 WebFrame* m_frame; 245 247 RefPtr<PluginView> m_pluginView; -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r187522 r188331 51 51 #import <CoreText/CTFont.h> 52 52 #import <WebCore/Chrome.h> 53 #import <WebCore/DNS.h>54 53 #import <WebCore/DiagnosticLoggingClient.h> 55 54 #import <WebCore/DiagnosticLoggingKeys.h> … … 60 59 #import <WebCore/FocusController.h> 61 60 #import <WebCore/Frame.h> 61 #import <WebCore/FrameLoaderClient.h> 62 62 #import <WebCore/FrameView.h> 63 63 #import <WebCore/GeometryUtilities.h> … … 630 630 631 631 if (is<Element>(*node)) 632 prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host());632 m_page->mainFrame().loader().client().prefetchDNS(downcast<Element>(*node).absoluteLinkURL().host()); 633 633 634 634 Vector<FloatQuad> quads; -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r187544 r188331 37 37 #include "InjectedBundle.h" 38 38 #include "Logging.h" 39 #include "NetworkConnectionToWebProcessMessages.h" 39 40 #include "PluginProcessConnectionManager.h" 40 41 #include "SessionTracker.h" … … 68 69 #include <WebCore/AuthenticationChallenge.h> 69 70 #include <WebCore/CrossOriginPreflightResultCache.h> 71 #include <WebCore/DNS.h> 70 72 #include <WebCore/FontCache.h> 71 73 #include <WebCore/FontCascade.h> … … 1452 1454 #endif 1453 1455 1456 void WebProcess::prefetchDNS(const String& hostname) 1457 { 1458 if (!usesNetworkProcess()) { 1459 WebCore::prefetchDNS(hostname); 1460 return; 1461 } 1462 1463 #if ENABLE(NETWORK_PROCESS) 1464 networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0); 1465 #endif 1466 } 1467 1454 1468 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r186140 r188331 215 215 #endif 216 216 217 void prefetchDNS(const String&); 218 217 219 private: 218 220 WebProcess();
Note:
See TracChangeset
for help on using the changeset viewer.