Changeset 185317 in webkit


Ignore:
Timestamp:
Jun 8, 2015 8:59:14 AM (9 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
https://bugs.webkit.org/show_bug.cgi?id=145751

Reviewed by Darin Adler.

In r185251 the CFNetwork cache was disabled in the web process,
but it also removed the disk cache directory web process
initialization parameter. While we support networking in the web
process when shared secondary process model is used, the network
cache should still work. We can remove this if we eventually
switch to use the network process unconditionally.

  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
(WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.

  • Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
  • UIProcess/gtk/WebProcessPoolGtk.cpp:

(WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.

  • WebProcess/soup/WebProcessSoup.cpp:

(WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185315 r185317  
     12015-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
     4        https://bugs.webkit.org/show_bug.cgi?id=145751
     5
     6        Reviewed by Darin Adler.
     7
     8        In r185251 the CFNetwork cache was disabled in the web process,
     9        but it also removed the disk cache directory web process
     10        initialization parameter. While we support networking in the web
     11        process when shared secondary process model is used, the network
     12        cache should still work. We can remove this if we eventually
     13        switch to use the network process unconditionally.
     14
     15        * Shared/WebProcessCreationParameters.cpp:
     16        (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
     17        (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
     18        * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
     19        * UIProcess/gtk/WebProcessPoolGtk.cpp:
     20        (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
     21        * WebProcess/soup/WebProcessSoup.cpp:
     22        (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
     23
    1242015-06-08  Csaba Osztrogonác  <ossy@webkit.org>
    225
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp

    r185251 r185317  
    9797    encoder << urlSchemesRegisteredForCustomProtocols;
    9898#if USE(SOUP)
     99    encoder << diskCacheDirectory;
    99100    encoder << cookiePersistentStoragePath;
    100101    encoder << cookiePersistentStorageType;
     
    218219        return false;
    219220#if USE(SOUP)
     221    if (!decoder.decode(parameters.diskCacheDirectory))
     222        return false;
    220223    if (!decoder.decode(parameters.cookiePersistentStoragePath))
    221224        return false;
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h

    r185251 r185317  
    102102    Vector<String> urlSchemesRegisteredForCustomProtocols;
    103103#if USE(SOUP)
     104    String diskCacheDirectory;
    104105    String cookiePersistentStoragePath;
    105106    uint32_t cookiePersistentStorageType;
  • trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp

    r185311 r185317  
    2929#include "WebProcessPool.h"
    3030
     31#include "APIProcessPoolConfiguration.h"
    3132#include "Logging.h"
    3233#include "WebCookieManagerProxy.h"
     
    106107
    107108        parameters.ignoreTLSErrors = m_ignoreTLSErrors;
     109        parameters.diskCacheDirectory = m_configuration->diskCacheDirectory();
    108110    }
    109111}
  • trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp

    r185300 r185317  
    3232#endif
    3333
    34 #include "APIProcessPoolConfiguration.h"
    3534#include "CertificateInfo.h"
    3635#include "WebCookieManager.h"
     
    137136        return;
    138137
    139     auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
    140 
    141     ASSERT(!configuration->diskCacheDirectory().isEmpty());
     138    ASSERT(!parameters.diskCacheDirectory.isEmpty());
    142139
    143140    // We used to use the given cache directory for the soup cache, but now we use a subdirectory to avoid
    144141    // conflicts with other cache files in the same directory. Remove the old cache files if they still exist.
    145     WebCore::SoupNetworkSession::defaultSession().clearCache(configuration->diskCacheDirectory());
     142    WebCore::SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(parameters.diskCacheDirectory));
    146143
    147     String diskCachePath = WebCore::pathByAppendingComponent(configuration->diskCacheDirectory(), "webkit");
    148     GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.utf8().data(), SOUP_CACHE_SINGLE_USER));
     144#if ENABLE(NETWORK_CACHE)
     145    // When network cache is enabled, the disk cache directory is the network process one.
     146    CString diskCachePath = WebCore::pathByAppendingComponent(WebCore::directoryName(parameters.diskCacheDirectory), "webkit").utf8();
     147#else
     148    CString diskCachePath = parameters.diskCacheDirectory.utf8();
     149#endif
     150
     151    GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(diskCachePath.data(), SOUP_CACHE_SINGLE_USER));
    149152    WebCore::SoupNetworkSession::defaultSession().setCache(soupCache.get());
    150153    // Set an initial huge max_size for the SoupCache so the call to soup_cache_load() won't evict any cached
Note: See TracChangeset for help on using the changeset viewer.