Changeset 246671 in webkit


Ignore:
Timestamp:
Jun 20, 2019 10:37:04 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][WPE] Implement a basic DNS cache
https://bugs.webkit.org/show_bug.cgi?id=196094

Patch by Patrick Griffis <Patrick Griffis> and Carlos Garcia Campos <cgarcia@igalia.com> on 2019-06-20
Reviewed by Michael Catanzaro.

This adds a simple cache to all DNS operations in the network process.

  • NetworkProcess/glib/DNSCache.cpp: Added.

(WebKit::DNSCache::DNSCache):
(WebKit::DNSCache::mapForType):
(WebKit::DNSCache::lookup):
(WebKit::DNSCache::update):
(WebKit::DNSCache::removeExpiredResponsesInMap):
(WebKit::DNSCache::pruneResponsesInMap):
(WebKit::DNSCache::removeExpiredResponsesFired):
(WebKit::DNSCache::clear):

  • NetworkProcess/glib/DNSCache.h: Added.
  • NetworkProcess/glib/WebKitCachedResolver.cpp: Added.

(addressListVectorToGList):
(addressListGListToVector):
(webkitCachedResolverLookupByName):
(webkitCachedResolverLookupByNameAsync):
(webkitCachedResolverLookupByNameFinish):
(dnsCacheType):
(webkitCachedResolverLookupByNameWithFlags):
(webkitCachedResolverLookupByNameWithFlagsAsync):
(webkitCachedResolverLookupByNameWithFlagsFinish):
(webkitCachedResolverLookupByAddress):
(webkitCachedResolverLookupByAddressAsync):
(webkitCachedResolverLookupByAddressFinish):
(webkitCachedResolverLookupRecords):
(webkitCachedResolverLookupRecordsAsync):
(webkitCachedResolverLookupRecordsFinish):
(webkitCachedResolverReload):
(webkit_cached_resolver_class_init):
(webkitCachedResolverNew):

  • NetworkProcess/glib/WebKitCachedResolver.h: Added.
  • NetworkProcess/soup/NetworkProcessSoup.cpp:

(WebKit::NetworkProcess::platformInitializeNetworkProcess):

  • PlatformGTK.cmake:
  • PlatformWPE.cmake:
  • SourcesGTK.txt:
  • SourcesWPE.txt:
Location:
trunk/Source/WebKit
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246669 r246671  
     12019-06-20  Patrick Griffis  <pgriffis@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][WPE] Implement a basic DNS cache
     4        https://bugs.webkit.org/show_bug.cgi?id=196094
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This adds a simple cache to all DNS operations in the network process.
     9
     10        * NetworkProcess/glib/DNSCache.cpp: Added.
     11        (WebKit::DNSCache::DNSCache):
     12        (WebKit::DNSCache::mapForType):
     13        (WebKit::DNSCache::lookup):
     14        (WebKit::DNSCache::update):
     15        (WebKit::DNSCache::removeExpiredResponsesInMap):
     16        (WebKit::DNSCache::pruneResponsesInMap):
     17        (WebKit::DNSCache::removeExpiredResponsesFired):
     18        (WebKit::DNSCache::clear):
     19        * NetworkProcess/glib/DNSCache.h: Added.
     20        * NetworkProcess/glib/WebKitCachedResolver.cpp: Added.
     21        (addressListVectorToGList):
     22        (addressListGListToVector):
     23        (webkitCachedResolverLookupByName):
     24        (webkitCachedResolverLookupByNameAsync):
     25        (webkitCachedResolverLookupByNameFinish):
     26        (dnsCacheType):
     27        (webkitCachedResolverLookupByNameWithFlags):
     28        (webkitCachedResolverLookupByNameWithFlagsAsync):
     29        (webkitCachedResolverLookupByNameWithFlagsFinish):
     30        (webkitCachedResolverLookupByAddress):
     31        (webkitCachedResolverLookupByAddressAsync):
     32        (webkitCachedResolverLookupByAddressFinish):
     33        (webkitCachedResolverLookupRecords):
     34        (webkitCachedResolverLookupRecordsAsync):
     35        (webkitCachedResolverLookupRecordsFinish):
     36        (webkitCachedResolverReload):
     37        (webkit_cached_resolver_class_init):
     38        (webkitCachedResolverNew):
     39        * NetworkProcess/glib/WebKitCachedResolver.h: Added.
     40        * NetworkProcess/soup/NetworkProcessSoup.cpp:
     41        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
     42        * PlatformGTK.cmake:
     43        * PlatformWPE.cmake:
     44        * SourcesGTK.txt:
     45        * SourcesWPE.txt:
     46
    1472019-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    248
  • trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp

    r243143 r246671  
    3232#include "ResourceCachesToClear.h"
    3333#include "WebCookieManager.h"
     34#include "WebKitCachedResolver.h"
    3435#include <WebCore/CertificateInfo.h>
    3536#include <WebCore/NetworkStorageSession.h>
     
    110111    m_diskCacheDirectory = parameters.diskCacheDirectory;
    111112
     113    GRefPtr<GResolver> cachedResolver = adoptGRef(webkitCachedResolverNew(adoptGRef(g_resolver_get_default())));
     114    g_resolver_set_default(cachedResolver.get());
     115
    112116    SoupNetworkSession::clearOldSoupCache(FileSystem::directoryName(m_diskCacheDirectory));
    113117
  • trunk/Source/WebKit/PlatformGTK.cmake

    r246632 r246671  
    375375    "${WEBKIT_DIR}/PluginProcess/unix"
    376376    "${WEBKIT_DIR}/NetworkProcess/CustomProtocols/soup"
     377    "${WEBKIT_DIR}/NetworkProcess/glib"
    377378    "${WEBKIT_DIR}/NetworkProcess/gtk"
    378379    "${WEBKIT_DIR}/NetworkProcess/soup"
  • trunk/Source/WebKit/PlatformWPE.cmake

    r246257 r246671  
    234234    "${DERIVED_SOURCES_WPE_API_DIR}"
    235235    "${WEBKIT_DIR}/NetworkProcess/CustomProtocols/soup"
     236    "${WEBKIT_DIR}/NetworkProcess/glib"
    236237    "${WEBKIT_DIR}/NetworkProcess/soup"
    237238    "${WEBKIT_DIR}/NetworkProcess/unix"
  • trunk/Source/WebKit/SourcesGTK.txt

    r246632 r246671  
    3333NetworkProcess/cache/NetworkCacheDataSoup.cpp
    3434NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
     35
     36NetworkProcess/glib/DNSCache.cpp
     37NetworkProcess/glib/WebKitCachedResolver.cpp
    3538
    3639NetworkProcess/soup/NetworkDataTaskSoup.cpp
  • trunk/Source/WebKit/SourcesWPE.txt

    r245565 r246671  
    3333NetworkProcess/cache/NetworkCacheDataSoup.cpp
    3434NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
     35
     36NetworkProcess/glib/DNSCache.cpp
     37NetworkProcess/glib/WebKitCachedResolver.cpp
    3538
    3639NetworkProcess/soup/NetworkDataTaskSoup.cpp
Note: See TracChangeset for help on using the changeset viewer.