Changeset 185818 in webkit


Ignore:
Timestamp:
Jun 21, 2015 11:32:13 PM (9 years ago)
Author:
barraclough@apple.com
Message:

Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
https://bugs.webkit.org/show_bug.cgi?id=146198

Unreviewed rollout.

Source/WebCore:

  • platform/network/DNSResolveQueue.cpp:

(WebCore::DNSResolveQueue::DNSResolveQueue):
(WebCore::DNSResolveQueue::isUsingProxy):
(WebCore::DNSResolveQueue::add):
(WebCore::DNSResolveQueue::timerFired):

  • platform/network/DNSResolveQueue.h:
  • platform/network/cf/DNSCFNet.cpp:

(WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
(WebCore::clientCallback):
(WebCore::DNSResolveQueue::platformResolve):
(WebCore::proxyIsEnabledInSystemPreferences): Deleted.
(WebCore::isUsingProxy): Deleted.
(WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.

  • platform/network/soup/DNSSoup.cpp:

Source/WebKit2:

  • UIProcess/API/gtk/WebKitWebContext.cpp:

(webkit_web_context_prefetch_dns):

Source/WTF:

  • wtf/glib/GUniquePtr.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r185802 r185818  
     12015-06-21  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
     4        https://bugs.webkit.org/show_bug.cgi?id=146198
     5
     6        Unreviewed rollout.
     7
     8        * wtf/glib/GUniquePtr.h:
     9
    1102015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
    211
     
    442451        (WTF::TinyPtrSet::setReservedFlag):
    443452
    444 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
    445 
    446         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
    447         https://bugs.webkit.org/show_bug.cgi?id=145542
    448 
    449         Reviewed by Alexey Proskuryakov.
    450 
    451         Add template specialization for GUniquePtr<char*>. This smart pointer will free its data
    452         with g_strfreev() (as opposed to g_free(), which is used for GUniquePtr<char>).
    453 
    454         * wtf/gobject/GUniquePtr.h:
    455 
    4564532015-06-05  Chris Dumez  <cdumez@apple.com>
    457454
  • trunk/Source/WTF/wtf/glib/GUniquePtr.h

    r185502 r185818  
    4444    macro(GDir, g_dir_close) \
    4545    macro(GTimer, g_timer_destroy) \
    46     macro(GKeyFile, g_key_file_free) \
    47     macro(char*, g_strfreev)
     46    macro(GKeyFile, g_key_file_free)
    4847
    4948#define WTF_DEFINE_GPTR_DELETER(typeName, deleterFunc) \
  • trunk/Source/WebCore/ChangeLog

    r185816 r185818  
     12015-06-16  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
     4        https://bugs.webkit.org/show_bug.cgi?id=146198
     5
     6        Unreviewed rollout.
     7
     8        * platform/network/DNSResolveQueue.cpp:
     9        (WebCore::DNSResolveQueue::DNSResolveQueue):
     10        (WebCore::DNSResolveQueue::isUsingProxy):
     11        (WebCore::DNSResolveQueue::add):
     12        (WebCore::DNSResolveQueue::timerFired):
     13        * platform/network/DNSResolveQueue.h:
     14        * platform/network/cf/DNSCFNet.cpp:
     15        (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences):
     16        (WebCore::clientCallback):
     17        (WebCore::DNSResolveQueue::platformResolve):
     18        (WebCore::proxyIsEnabledInSystemPreferences): Deleted.
     19        (WebCore::isUsingProxy): Deleted.
     20        (WebCore::DNSResolveQueue::platformMaybeResolveHost): Deleted.
     21        * platform/network/soup/DNSSoup.cpp:
     22
    1232015-06-21  Alexey Proskuryakov  <ap@apple.com>
    224
  • trunk/Source/WebCore/platform/network/DNSResolveQueue.cpp

    r185320 r185818  
    2828#include "DNSResolveQueue.h"
    2929
     30#include <wtf/CurrentTime.h>
    3031#include <wtf/NeverDestroyed.h>
    3132
     
    6061    : m_timer(*this, &DNSResolveQueue::timerFired)
    6162    , m_requestsInFlight(0)
     63    , m_cachedProxyEnabledStatus(false)
     64    , m_lastProxyEnabledStatusCheckTime(0)
    6265{
     66}
     67
     68bool DNSResolveQueue::isUsingProxy()
     69{
     70    double time = monotonicallyIncreasingTime();
     71    static const double minimumProxyCheckDelay = 5;
     72    if (time - m_lastProxyEnabledStatusCheckTime > minimumProxyCheckDelay) {
     73        m_lastProxyEnabledStatusCheckTime = time;
     74        m_cachedProxyEnabledStatus = platformProxyIsEnabledInSystemPreferences();
     75    }
     76    return m_cachedProxyEnabledStatus;
    6377}
    6478
     
    6781    // If there are no names queued, and few enough are in flight, resolve immediately (the mouse may be over a link).
    6882    if (!m_names.size()) {
     83        if (isUsingProxy())
     84            return;
    6985        if (++m_requestsInFlight <= gNamesToResolveImmediately) {
    70             platformMaybeResolveHost(hostname);
     86            platformResolve(hostname);
    7187            return;
    7288        }
     
    85101void DNSResolveQueue::timerFired()
    86102{
     103    if (isUsingProxy()) {
     104        m_names.clear();
     105        return;
     106    }
     107
    87108    int requestsAllowed = gMaxSimultaneousRequests - m_requestsInFlight;
    88109
     
    90111        ++m_requestsInFlight;
    91112        HashSet<String>::iterator currentName = m_names.begin();
    92         platformMaybeResolveHost(*currentName);
     113        platformResolve(*currentName);
    93114        m_names.remove(currentName);
    94115    }
  • trunk/Source/WebCore/platform/network/DNSResolveQueue.h

    r185320 r185818  
    5151    DNSResolveQueue();
    5252
    53     // This function performs the actual DNS prefetch. Platforms must ensure that performing the
    54     // prefetch will not violate the user's expectations of privacy; for example, if an HTTP proxy
    55     // is in use, then performing a DNS lookup would be inappropriate, but this may be acceptable
    56     // for other types of proxies (e.g. SOCKS proxies).
    57     void platformMaybeResolveHost(const String&);
     53    bool isUsingProxy();
     54
     55    bool platformProxyIsEnabledInSystemPreferences();
     56    void platformResolve(const String&);
    5857
    5958    void timerFired();
     
    6362    HashSet<String> m_names;
    6463    std::atomic<int> m_requestsInFlight;
     64    bool m_cachedProxyEnabledStatus;
     65    double m_lastProxyEnabledStatusCheckTime;
    6566};
    6667
  • trunk/Source/WebCore/platform/network/cf/DNSCFNet.cpp

    r185320 r185818  
    3232#include "URL.h"
    3333#include "Timer.h"
    34 #include <wtf/CurrentTime.h>
    3534#include <wtf/HashSet.h>
    3635#include <wtf/MainThread.h>
     
    5049namespace WebCore {
    5150
    52 static bool proxyIsEnabledInSystemPreferences()
     51bool DNSResolveQueue::platformProxyIsEnabledInSystemPreferences()
    5352{
    5453    // Don't do DNS prefetch if proxies are involved. For many proxy types, the user agent is never exposed
     
    7776}
    7877
    79 static bool isUsingProxy()
    80 {
    81     static bool cachedProxyEnabledStatus = false;
    82     static double lastProxyEnabledStatusCheckTime = 0;
    83     static const double minimumProxyCheckDelay = 5;
    84     double time = monotonicallyIncreasingTime();
    85     if (time - lastProxyEnabledStatusCheckTime > minimumProxyCheckDelay) {
    86         lastProxyEnabledStatusCheckTime = time;
    87         cachedProxyEnabledStatus = proxyIsEnabledInSystemPreferences();
    88     }
    89     return cachedProxyEnabledStatus;
    90 }
    91 
    9278static void clientCallback(CFHostRef theHost, CFHostInfoType, const CFStreamError*, void*)
    9379{
     
    9682}
    9783
    98 void DNSResolveQueue::platformMaybeResolveHost(const String& hostname)
     84void DNSResolveQueue::platformResolve(const String& hostname)
    9985{
    10086    ASSERT(isMainThread());
    10187
    10288    RetainPtr<CFHostRef> host = adoptCF(CFHostCreateWithName(0, hostname.createCFString().get()));
    103     if (!host || isUsingProxy()) {
     89    if (!host) {
    10490        decrementRequestCount();
    10591        return;
  • trunk/Source/WebCore/platform/network/soup/DNSSoup.cpp

    r185502 r185818  
    11/*
    22 * Copyright (C) 2008 Apple Inc.  All rights reserved.
    3  * Copyright (C) 2009, 2012, 2015 Igalia S.L.
     3 * Copyright (C) 2009, 2012 Igalia S.L.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
  • trunk/Source/WebKit2/ChangeLog

    r185817 r185818  
     12015-06-16  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
     4        https://bugs.webkit.org/show_bug.cgi?id=146198
     5
     6        Unreviewed rollout.
     7
     8        * UIProcess/API/gtk/WebKitWebContext.cpp:
     9        (webkit_web_context_prefetch_dns):
     10
    1112015-06-21  Hyungwook Lee  <hyungwook.lee@navercorp.com>
    212
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp

    r185634 r185818  
    10451045 *
    10461046 * Resolve the domain name of the given @hostname in advance, so that if a URI
    1047  * of @hostname is requested the load will be performed more quickly. This
    1048  * function does nothing if the system has been configured to use a proxy to
    1049  * resolve @hostname.
     1047 * of @hostname is requested the load will be performed more quickly.
    10501048 */
    10511049void webkit_web_context_prefetch_dns(WebKitWebContext* context, const char* hostname)
Note: See TracChangeset for help on using the changeset viewer.