Changeset 205556 in webkit
- Timestamp:
- Sep 7, 2016 11:13:08 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r205549 r205556 1 2016-09-07 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [EFL] Switch to ENABLE_NETWORK_CACHE 4 https://bugs.webkit.org/show_bug.cgi?id=152676 5 6 Reviewed by Alex Christensen. 7 8 Build with -Wno-error=missing-field-initializers to avoid spurious build failures. 9 10 * Source/cmake/OptionsEfl.cmake: 11 1 12 2016-09-07 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r205554 r205556 1 2016-09-07 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [EFL] Switch to ENABLE_NETWORK_CACHE 4 https://bugs.webkit.org/show_bug.cgi?id=152676 5 6 Reviewed by Alex Christensen. 7 8 * PlatformEfl.cmake: Add GRefPtrSoup to build. 9 * platform/network/soup/SoupNetworkSession.cpp: 10 (WebCore::SoupNetworkSession::clearOldSoupCache): Renamed from clearCache. 11 (WebCore::SoupNetworkSession::setCache): Deleted. 12 (WebCore::SoupNetworkSession::cache): Deleted. 13 (WebCore::SoupNetworkSession::clearCache): Deleted. 14 * platform/network/soup/SoupNetworkSession.h: 15 1 16 2016-09-07 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/PlatformEfl.cmake
r204483 r205556 196 196 platform/network/soup/CredentialStorageSoup.cpp 197 197 platform/network/soup/DNSSoup.cpp 198 platform/network/soup/GRefPtrSoup.cpp 198 199 platform/network/soup/NetworkStorageSessionSoup.cpp 199 200 platform/network/soup/ProxyServerSoup.cpp -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r198127 r205556 161 161 } 162 162 163 void SoupNetworkSession::setCache(SoupCache* cache)164 {165 ASSERT(!soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_CACHE));166 soup_session_add_feature(m_soupSession.get(), SOUP_SESSION_FEATURE(cache));167 }168 169 SoupCache* SoupNetworkSession::cache() const170 {171 SoupSessionFeature* soupCache = soup_session_get_feature(m_soupSession.get(), SOUP_TYPE_CACHE);172 return soupCache ? SOUP_CACHE(soupCache) : nullptr;173 }174 175 163 static inline bool stringIsNumeric(const char* str) 176 164 { … … 183 171 } 184 172 185 void SoupNetworkSession::clearCache(const String& cacheDirectory) 173 // Old versions of WebKit created this cache. 174 void SoupNetworkSession::clearOldSoupCache(const String& cacheDirectory) 186 175 { 187 176 CString cachePath = fileSystemRepresentation(cacheDirectory); -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.h
r187586 r205556 59 59 SoupCookieJar* cookieJar() const; 60 60 61 void setCache(SoupCache*); 62 SoupCache* cache() const; 63 static void clearCache(const String& cacheDirectory); 61 static void clearOldSoupCache(const String& cacheDirectory); 64 62 65 63 void setSSLPolicy(SSLPolicy); -
trunk/Source/WebKit2/ChangeLog
r205549 r205556 1 2016-09-07 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [EFL] Switch to ENABLE_NETWORK_CACHE 4 https://bugs.webkit.org/show_bug.cgi?id=152676 5 6 Reviewed by Alex Christensen. 7 8 Nowadays GTK+ always uses the network cache, and never the soup cache. Remove support for 9 using the soup cache, and switch the EFL port to use network cache. 10 11 * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: 12 (WebKit::NetworkCache::BlobStorage::add): Check return value of link to placate 13 -Werror=unused-result on EFL builder 14 * NetworkProcess/efl/NetworkProcessMainEfl.cpp: 15 * NetworkProcess/soup/NetworkProcessSoup.cpp: 16 (WebKit::getCacheDiskFreeSize): 17 (WebKit::NetworkProcess::platformInitializeNetworkProcess): 18 (WebKit::NetworkProcess::platformSetCacheModel): 19 (WebKit::NetworkProcess::clearDiskCache): 20 * PlatformEfl.cmake: Add files to build. 21 * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: 22 (API::WebsiteDataStore::defaultNetworkCacheDirectory): Use a saner location. 23 * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp: 24 (API::WebsiteDataStore::defaultNetworkCacheDirectory): 25 * UIProcess/API/gtk/WebKitPrivate.h: 26 * UIProcess/soup/WebProcessPoolSoup.cpp: 27 (WebKit::WebProcessPool::platformInitializeNetworkProcess): 28 * WebProcess/efl/WebProcessMainEfl.cpp: 29 * config.h: 30 1 31 2016-09-07 Youenn Fablet <youenn@apple.com> 2 32 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp
r204466 r205556 98 98 auto existingData = mapFile(blobPath.data()); 99 99 if (bytesEqual(existingData, data)) { 100 link(blobPath.data(), linkPath.data()); 100 if (link(blobPath.data(), linkPath.data()) == -1) 101 WTFLogAlways("Failed to create hard link from %s to %s", blobPath.data(), linkPath.data()); 101 102 return { existingData, hash }; 102 103 } … … 108 109 return { }; 109 110 110 link(blobPath.data(), linkPath.data()); 111 if (link(blobPath.data(), linkPath.data()) == -1) 112 WTFLogAlways("Failed to create hard link from %s to %s", blobPath.data(), linkPath.data()); 111 113 112 114 m_approximateSize += mappedData.size(); -
trunk/Source/WebKit2/NetworkProcess/efl/NetworkProcessMainEfl.cpp
r192697 r205556 54 54 void platformFinalize() override 55 55 { 56 if (SoupCache* soupCache = SoupNetworkSession::defaultSession().cache()) {57 soup_cache_flush(soupCache);58 soup_cache_dump(soupCache);59 }60 61 56 ecore_shutdown(); 62 57 } -
trunk/Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
r203857 r205556 56 56 m_diskCacheDirectory = parameters.diskCacheDirectory; 57 57 58 #if ENABLE(NETWORK_CACHE) 59 // Clear the old soup cache if it exists. 60 SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(m_diskCacheDirectory)); 58 SoupNetworkSession::defaultSession().clearOldSoupCache(WebCore::directoryName(m_diskCacheDirectory)); 61 59 62 60 NetworkCache::Cache::Parameters cacheParameters { … … 67 65 }; 68 66 NetworkCache::singleton().initialize(m_diskCacheDirectory, cacheParameters); 69 #else70 // We used to use the given cache directory for the soup cache, but now we use a subdirectory to avoid71 // conflicts with other cache files in the same directory. Remove the old cache files if they still exist.72 SoupNetworkSession::defaultSession().clearCache(WebCore::directoryName(m_diskCacheDirectory));73 74 GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(m_diskCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER));75 SoupNetworkSession::defaultSession().setCache(soupCache.get());76 // Set an initial huge max_size for the SoupCache so the call to soup_cache_load() won't evict any cached77 // resource. The final size of the cache will be set by NetworkProcess::platformSetCacheModel().78 unsigned initialMaxSize = soup_cache_get_max_size(soupCache.get());79 soup_cache_set_max_size(soupCache.get(), G_MAXUINT);80 soup_cache_load(soupCache.get());81 soup_cache_set_max_size(soupCache.get(), initialMaxSize);82 #endif83 67 84 68 if (!parameters.cookiePersistentStoragePath.isEmpty()) { … … 94 78 } 95 79 96 void NetworkProcess::platformSetURLCacheSize(unsigned /*urlCacheMemoryCapacity*/, uint64_t urlCacheDiskCapacity)80 void NetworkProcess::platformSetURLCacheSize(unsigned, uint64_t) 97 81 { 98 #if !ENABLE(NETWORK_CACHE)99 SoupCache* cache = SoupNetworkSession::defaultSession().cache();100 if (urlCacheDiskCapacity > soup_cache_get_max_size(cache))101 soup_cache_set_max_size(cache, urlCacheDiskCapacity);102 #else103 UNUSED_PARAM(urlCacheDiskCapacity);104 #endif105 82 } 106 83 … … 125 102 void NetworkProcess::clearDiskCache(std::chrono::system_clock::time_point modifiedSince, std::function<void ()> completionHandler) 126 103 { 127 #if ENABLE(NETWORK_CACHE)128 104 NetworkCache::singleton().clear(modifiedSince, WTFMove(completionHandler)); 129 #else130 UNUSED_PARAM(modifiedSince);131 UNUSED_PARAM(completionHandler);132 soup_cache_clear(SoupNetworkSession::defaultSession().cache());133 #endif134 105 } 135 106 -
trunk/Source/WebKit2/PlatformEfl.cmake
r205266 r205556 8 8 9 9 NetworkProcess/Downloads/soup/DownloadSoup.cpp 10 11 NetworkProcess/cache/NetworkCacheCodersSoup.cpp 12 NetworkProcess/cache/NetworkCacheDataSoup.cpp 13 NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp 10 14 11 15 NetworkProcess/efl/NetworkProcessMainEfl.cpp -
trunk/Source/WebKit2/UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp
r197592 r205556 39 39 String WebsiteDataStore::defaultNetworkCacheDirectory() 40 40 { 41 #if ENABLE(NETWORK_CACHE) 42 static const char networkCacheSubdirectory[] = "WebKitCache"; 43 #else 44 static const char networkCacheSubdirectory[] = "webkit"; 45 #endif 46 47 return cacheDirectoryFileSystemRepresentation(networkCacheSubdirectory); 41 return cacheDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "WebKitCache"); 48 42 } 49 43 -
trunk/Source/WebKit2/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp
r197592 r205556 36 36 } 37 37 38 // FIXME: The other directories in this file are shared between all applications using WebKitGTK+. 39 // Why is only this directory namespaced to a particular application? 38 40 String WebsiteDataStore::defaultNetworkCacheDirectory() 39 41 { 40 #if ENABLE(NETWORK_CACHE) 41 static const char networkCacheSubdirectory[] = "WebKitCache"; 42 #else 43 static const char networkCacheSubdirectory[] = "webkit"; 44 #endif 45 return cacheDirectoryFileSystemRepresentation(WebCore::pathByAppendingComponent(WebCore::filenameToString(g_get_prgname()), networkCacheSubdirectory)); 42 return cacheDirectoryFileSystemRepresentation(WebCore::pathByAppendingComponent(WebCore::filenameToString(g_get_prgname()), "WebKitCache")); 46 43 } 47 44 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h
r187485 r205556 128 128 }; 129 129 130 #if ENABLE(NETWORK_CACHE)131 130 static const char networkCacheSubdirectory[] = "WebKitCache"; 132 #else133 static const char networkCacheSubdirectory[] = "webkit";134 #endif135 131 136 132 #endif // WebKitPrivate_h -
trunk/Source/WebKit2/UIProcess/soup/WebProcessPoolSoup.cpp
r204097 r205556 42 42 parameters.languages = WebCore::userPreferredLanguages(); 43 43 parameters.urlSchemesRegisteredForCustomProtocols = supplement<WebSoupCustomProtocolRequestManager>()->registeredSchemesForCustomProtocols(); 44 #if ENABLE(NETWORK_CACHE)45 44 parameters.shouldEnableNetworkCacheEfficacyLogging = false; 46 #endif47 45 } 48 46 -
trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp
r195725 r205556 105 105 void platformFinalize() override 106 106 { 107 if (SoupCache* soupCache = SoupNetworkSession::defaultSession().cache()) {108 soup_cache_flush(soupCache);109 soup_cache_dump(soupCache);110 }111 112 107 edje_shutdown(); 113 108 ecore_evas_shutdown(); -
trunk/Source/WebKit2/config.h
r201267 r205556 100 100 101 101 #ifndef ENABLE_NETWORK_CACHE 102 #if PLATFORM(COCOA) || PLATFORM(GTK)102 #if PLATFORM(COCOA) || USE(SOUP) 103 103 #define ENABLE_NETWORK_CACHE 1 104 104 #else -
trunk/Source/cmake/OptionsEfl.cmake
r205180 r205556 9 9 # FIXME: Disable WERROR in clang build because of many warnings. 10 10 if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 11 set(ADDITIONAL_COMPILER_FLAGS ENABLE_WERROR )11 set(ADDITIONAL_COMPILER_FLAGS ENABLE_WERROR "-Wno-error=missing-field-initializers") 12 12 endif () 13 13
Note: See TracChangeset
for help on using the changeset viewer.