Changeset 110669 in webkit


Ignore:
Timestamp:
Mar 14, 2012 12:23:49 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[GTK] Use the same DNS prefetching path than the other ports.
https://bugs.webkit.org/show_bug.cgi?id=80997

Reviewed by Martin Robinson.

This patch basically reverts r56128. There is no need to add an
special code path for GTK+ DNS pre-fetching because the main
reason to do that (some potential changes in libsoup) is not
going to happen. It also reduces the amount of DNS queries by
adding a NULL hostname check.

No need for new tests as this just moves code around.

  • GNUmakefile.list.am:
  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::parseAttribute):

  • html/HTMLLinkElement.cpp:
  • loader/LinkLoader.cpp:

(WebCore::LinkLoader::loadLink):

  • page/Chrome.cpp:

(WebCore::Chrome::mouseDidMoveOverElement):

  • platform/network/DNS.h:

(WebCore):

  • platform/network/ResourceHandle.cpp:
  • platform/network/ResourceHandle.h:

(ResourceHandle):

  • platform/network/chromium/DNSChromium.cpp:
  • platform/network/soup/DNSSoup.cpp: restored.

(WebCore):
(WebCore::prefetchDNS):

  • platform/network/soup/ResourceHandleSoup.cpp:
Location:
trunk/Source/WebCore
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110667 r110669  
     12012-03-13  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [GTK] Use the same DNS prefetching path than the other ports.
     4        https://bugs.webkit.org/show_bug.cgi?id=80997
     5
     6        Reviewed by Martin Robinson.
     7
     8        This patch basically reverts r56128. There is no need to add an
     9        special code path for GTK+ DNS pre-fetching because the main
     10        reason to do that (some potential changes in libsoup) is not
     11        going to happen. It also reduces the amount of DNS queries by
     12        adding a NULL hostname check.
     13
     14        No need for new tests as this just moves code around.
     15
     16        * GNUmakefile.list.am:
     17        * html/HTMLAnchorElement.cpp:
     18        (WebCore::HTMLAnchorElement::parseAttribute):
     19        * html/HTMLLinkElement.cpp:
     20        * loader/LinkLoader.cpp:
     21        (WebCore::LinkLoader::loadLink):
     22        * page/Chrome.cpp:
     23        (WebCore::Chrome::mouseDidMoveOverElement):
     24        * platform/network/DNS.h:
     25        (WebCore):
     26        * platform/network/ResourceHandle.cpp:
     27        * platform/network/ResourceHandle.h:
     28        (ResourceHandle):
     29        * platform/network/chromium/DNSChromium.cpp:
     30        * platform/network/soup/DNSSoup.cpp: restored.
     31        (WebCore):
     32        (WebCore::prefetchDNS):
     33        * platform/network/soup/ResourceHandleSoup.cpp:
     34
    1352012-03-14  Kentaro Hara  <haraken@chromium.org>
    236
  • trunk/Source/WebCore/GNUmakefile.list.am

    r110639 r110669  
    33973397        Source/WebCore/platform/network/soup/CookieJarSoup.h \
    33983398        Source/WebCore/platform/network/soup/CredentialStorageSoup.cpp \
     3399        Source/WebCore/platform/network/soup/DNSSoup.cpp \
    33993400        Source/WebCore/platform/network/soup/GOwnPtrSoup.cpp \
    34003401        Source/WebCore/platform/network/soup/GOwnPtrSoup.h \
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r107477 r110669  
    2626
    2727#include "Attribute.h"
     28#include "DNS.h"
    2829#include "EventNames.h"
    2930#include "Frame.h"
     
    3839#include "PingLoader.h"
    3940#include "RenderImage.h"
    40 #include "ResourceHandle.h"
    4141#include "SecurityOrigin.h"
    4242#include "SecurityPolicy.h"
     
    222222            if (document()->isDNSPrefetchEnabled()) {
    223223                if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//"))
    224                     ResourceHandle::prepareForURL(document()->completeURL(parsedURL));
     224                    prefetchDNS(document()->completeURL(parsedURL).host());
    225225            }
    226226            if (document()->page() && !document()->page()->javaScriptURLsAreAllowed() && protocolIsJavaScript(parsedURL)) {
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r108814 r110669  
    4343#include "MediaQueryEvaluator.h"
    4444#include "Page.h"
    45 #include "ResourceHandle.h"
    4645#include "ScriptEventListener.h"
    4746#include "SecurityOrigin.h"
  • trunk/Source/WebCore/loader/LinkLoader.cpp

    r95901 r110669  
    3838#include "CachedResourceLoader.h"
    3939#include "ContainerNode.h"
     40#include "DNS.h"
    4041#include "Document.h"
    4142#include "Frame.h"
    4243#include "FrameView.h"
    4344#include "LinkRelAttribute.h"
    44 #include "ResourceHandle.h"
    4545#include "Settings.h"
    4646
     
    100100        // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=48857>.
    101101        if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !href.isEmpty())
    102             ResourceHandle::prepareForURL(href);
     102            prefetchDNS(href.host());
    103103    }
    104104
  • trunk/Source/WebCore/page/Chrome.cpp

    r108957 r110669  
    374374        Document* document = result.innerNode()->document();
    375375        if (document && document->isDNSPrefetchEnabled())
    376             ResourceHandle::prepareForURL(result.absoluteLinkURL());
     376            prefetchDNS(result.absoluteLinkURL().host());
    377377    }
    378378    m_client->mouseDidMoveOverElement(result, modifierFlags);
  • trunk/Source/WebCore/platform/network/DNS.h

    r95901 r110669  
    3131namespace WebCore {
    3232
    33 #if !USE(SOUP)
    34     void prefetchDNS(const String& hostname);
    35 #endif
     33void prefetchDNS(const String& hostname);
    3634}
    3735
  • trunk/Source/WebCore/platform/network/ResourceHandle.cpp

    r110066 r110669  
    2929
    3030#include "BlobRegistry.h"
    31 #include "DNS.h"
    3231#include "Logging.h"
    3332#include "ResourceHandleClient.h"
     
    186185}
    187186
    188 #if !USE(SOUP)
    189 void ResourceHandle::prepareForURL(const KURL& url)
    190 {
    191     return prefetchDNS(url.host());
    192 }
    193 #endif
    194 
    195187void ResourceHandle::cacheMetadata(const ResourceResponse&, const Vector<char>&)
    196188{
  • trunk/Source/WebCore/platform/network/ResourceHandle.h

    r110066 r110669  
    105105    static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
    106106
    107     static void prepareForURL(const KURL&);
    108107    static bool willLoadFromCache(ResourceRequest&, Frame*);
    109108    static void cacheMetadata(const ResourceResponse&, const Vector<char>&);
  • trunk/Source/WebCore/platform/network/chromium/DNSChromium.cpp

    r95901 r110669  
    2828
    2929#include "PlatformSupport.h"
    30 #include "ResourceHandle.h"
    3130
    3231namespace WebCore {
     
    3736}
    3837
    39 void ResourceHandle::prepareForURL(const KURL& url)
    40 {
    41     return prefetchDNS(url.host());
    42 }
    43 
    4438} // namespace WebCore
  • trunk/Source/WebCore/platform/network/soup/DNSSoup.cpp

    r110668 r110669  
    11/*
    2  * Copyright (C) 2008 Collin Jackson  <collinj@webkit.org>
     2 * Copyright (C) 2008 Apple Computer, Inc.  All rights reserved.
     3 * Copyright (C) 2009, 2012 Igalia S.L.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2728#include "DNS.h"
    2829
    29 #include "PlatformSupport.h"
     30#include "CString.h"
     31#include "GOwnPtrSoup.h"
    3032#include "ResourceHandle.h"
    3133
     
    3436void prefetchDNS(const String& hostname)
    3537{
    36     PlatformSupport::prefetchDNS(hostname);
     38    if (hostname.isEmpty())
     39        return;
     40
     41    String uri = "http://" + hostname;
     42    GOwnPtr<SoupURI> soupURI(soup_uri_new(uri.utf8().data()));
     43    if (!soupURI)
     44        return;
     45
     46    soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get());
    3747}
    3848
    39 void ResourceHandle::prepareForURL(const KURL& url)
    40 {
    41     return prefetchDNS(url.host());
    4249}
    43 
    44 } // namespace WebCore
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r109791 r110669  
    180180}
    181181
    182 void ResourceHandle::prepareForURL(const KURL& url)
    183 {
    184     GOwnPtr<SoupURI> soupURI(soup_uri_new(url.string().utf8().data()));
    185     if (!soupURI)
    186         return;
    187     soup_session_prepare_for_uri(ResourceHandle::defaultSession(), soupURI.get());
    188 }
    189 
    190182// Called each time the message is going to be sent again except the first time.
    191183// It's used mostly to let webkit know about redirects.
Note: See TracChangeset for help on using the changeset viewer.