Changeset 161272 in webkit
- Timestamp:
- Jan 3, 2014 11:13:38 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r161271 r161272 1 2014-01-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Define WebProcess::usesNetworkProcess unconditionally 4 https://bugs.webkit.org/show_bug.cgi?id=126208 5 6 Reviewed by Martin Robinson. 7 8 Returning false when network process is not enabled like 9 WebContext does. This way we reduce the amount of ifdefs used when 10 checking whether network process is in use. 11 12 * UIProcess/gtk/WebContextGtk.cpp: 13 (WebKit::WebContext::platformInitializeWebProcess): Remove #ifdef 14 and only setup network features when not using network process. 15 * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: 16 (WebKit::WebPlatformStrategies::isAvailable): Remove #ifdef. 17 * WebProcess/WebProcess.cpp: 18 (WebKit::WebProcess::downloadManager): 19 (WebKit::WebProcess::shouldTerminate): 20 (WebKit::WebProcess::usesNetworkProcess): 21 * WebProcess/WebProcess.h: 22 * WebProcess/mac/WebProcessMac.mm: 23 (WebKit::WebProcess::platformSetCacheModel): Remove #ifdef. 24 (WebKit::WebProcess::platformInitializeWebProcess): Ditto. 25 * WebProcess/soup/WebProcessSoup.cpp: 26 (WebKit::WebProcess::platformSetCacheModel): Ditto. 27 (WebKit::WebProcess::platformClearResourceCaches): Ditto. 28 (WebKit::WebProcess::platformInitializeWebProcess): Ditto. 29 (WebKit::WebProcess::platformTerminate): Only remove the language 30 observer when not using network process. 31 (WebKit::WebProcess::setIgnoreTLSErrors): Assert when this is 32 called with network process enabled. 33 (WebKit::WebProcess::allowSpecificHTTPSCertificateForHost): Ditto. 34 1 35 2014-01-03 Jinwoo Song <jinwoo7.song@samsung.com> 2 36 -
trunk/Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp
r160364 r161272 99 99 } 100 100 101 parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes(); 102 supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType); 103 parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy; 101 if (!usesNetworkProcess()) { 102 parameters.urlSchemesRegistered = supplement<WebSoupRequestManagerProxy>()->registeredURISchemes(); 103 104 supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType); 105 parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy; 106 107 parameters.ignoreTLSErrors = m_ignoreTLSErrors; 108 } 109 104 110 parameters.shouldTrackVisitedLinks = true; 105 #if !ENABLE(NETWORK_PROCESS)106 parameters.ignoreTLSErrors = m_ignoreTLSErrors;107 #endif108 111 } 109 112 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
r161045 r161272 322 322 { 323 323 // Shared workers do not work across multiple processes, and using network process is tied to multiple secondary process model. 324 #if ENABLE(NETWORK_PROCESS) 325 return !WebProcess::shared().usesNetworkProcess(); 326 #else 327 return true; 328 #endif 324 return !WebProcess::shared().usesNetworkProcess(); 329 325 } 330 326 -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r161158 r161272 469 469 DownloadManager& WebProcess::downloadManager() 470 470 { 471 #if ENABLE(NETWORK_PROCESS) 472 ASSERT(!m_usesNetworkProcess); 473 #endif 471 ASSERT(!usesNetworkProcess()); 474 472 475 473 static NeverDestroyed<DownloadManager> downloadManager(this); … … 598 596 { 599 597 ASSERT(m_pageMap.isEmpty()); 600 601 #if ENABLE(NETWORK_PROCESS) 602 ASSERT(m_usesNetworkProcess || !downloadManager().isDownloading()); 603 #else 604 ASSERT(!downloadManager().isDownloading()); 605 #endif 598 ASSERT(usesNetworkProcess() || !downloadManager().isDownloading()); 606 599 607 600 // FIXME: the ShouldTerminate message should also send termination parameters, such as any session cookies that need to be preserved. … … 994 987 } 995 988 989 bool WebProcess::usesNetworkProcess() const 990 { 991 #if ENABLE(NETWORK_PROCESS) 992 return m_usesNetworkProcess; 993 #else 994 return false; 995 #endif 996 } 997 996 998 #if ENABLE(NETWORK_PROCESS) 997 999 NetworkProcessConnection* WebProcess::networkConnection() -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r161148 r161272 153 153 EventDispatcher& eventDispatcher() { return *m_eventDispatcher; } 154 154 155 bool usesNetworkProcess() const; 156 155 157 #if ENABLE(NETWORK_PROCESS) 156 158 NetworkProcessConnection* networkConnection(); 157 159 void networkProcessConnectionClosed(NetworkProcessConnection*); 158 bool usesNetworkProcess() const { return m_usesNetworkProcess; }159 160 WebResourceLoadScheduler& webResourceLoadScheduler(); 160 161 #endif -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
r161148 r161272 113 113 NSURLCache *nsurlCache = [NSURLCache sharedURLCache]; 114 114 115 #if ENABLE(NETWORK_PROCESS)116 115 // FIXME: Once there is no loading being done in the WebProcess, we should remove this, 117 116 // as calling [NSURLCache sharedURLCache] initializes the cache, which we would rather not do. 118 if ( m_usesNetworkProcess) {117 if (usesNetworkProcess()) { 119 118 [nsurlCache setMemoryCapacity:0]; 120 119 [nsurlCache setDiskCapacity:0]; 121 120 return; 122 121 } 123 #endif124 122 125 123 [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity]; … … 163 161 // When the network process is enabled, each web process wants a stand-alone 164 162 // NSURLCache, which it can disable to save memory. 165 #if ENABLE(NETWORK_PROCESS) 166 if (!m_usesNetworkProcess) { 167 #endif 163 if (!usesNetworkProcess()) { 168 164 if (!parameters.diskCacheDirectory.isNull()) { 169 165 [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc] … … 172 168 diskPath:parameters.diskCacheDirectory]).get()]; 173 169 } 174 #if ENABLE(NETWORK_PROCESS) 175 } 176 #endif 170 } 177 171 178 172 m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution; -
trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp
r161156 r161272 94 94 SoupCache* cache = nullptr; 95 95 96 #if ENABLE(NETWORK_PROCESS) 97 if (!m_usesNetworkProcess) { 98 #endif 99 SoupSession* session = WebCore::ResourceHandle::defaultSession(); 100 cache = SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE)); 96 if (!usesNetworkProcess()) { 97 cache = SOUP_CACHE(soup_session_get_feature(WebCore::ResourceHandle::defaultSession(), SOUP_TYPE_CACHE)); 101 98 diskFreeSize = getCacheDiskFreeSize(cache) / 1024 / 1024; 102 #if ENABLE(NETWORK_PROCESS) 103 } 104 #endif 99 } 100 105 101 uint64_t memSize = getMemorySize(); 106 102 calculateCacheSizes(cacheModel, memSize, diskFreeSize, … … 112 108 WebCore::pageCache()->setCapacity(pageCacheCapacity); 113 109 114 #if ENABLE(NETWORK_PROCESS) 115 if (!m_usesNetworkProcess) { 116 #endif 110 if (!usesNetworkProcess()) { 117 111 if (urlCacheDiskCapacity > soup_cache_get_max_size(cache)) 118 112 soup_cache_set_max_size(cache, urlCacheDiskCapacity); 119 #if ENABLE(NETWORK_PROCESS) 120 } 121 #endif 122 if (urlCacheDiskCapacity > soup_cache_get_max_size(cache)) 123 soup_cache_set_max_size(cache, urlCacheDiskCapacity); 113 } 124 114 } 125 115 … … 130 120 131 121 // If we're using the network process then it is the only one that needs to clear the disk cache. 132 #if ENABLE(NETWORK_PROCESS) 133 if (m_usesNetworkProcess) 122 if (usesNetworkProcess()) 134 123 return; 135 #endif 136 SoupSession* session = WebCore::ResourceHandle::defaultSession(); 137 soup_cache_clear(SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE))); 124 125 soup_cache_clear(SOUP_CACHE(soup_session_get_feature(WebCore::ResourceHandle::defaultSession(), SOUP_TYPE_CACHE))); 138 126 } 139 127 … … 199 187 #endif 200 188 201 #if ENABLE(NETWORK_PROCESS) 202 if (!m_usesNetworkProcess) { 203 #endif 204 ASSERT(!parameters.diskCacheDirectory.isEmpty()); 205 GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(parameters.diskCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER)); 206 soup_session_add_feature(WebCore::ResourceHandle::defaultSession(), SOUP_SESSION_FEATURE(soupCache.get())); 207 soup_cache_load(soupCache.get()); 208 209 if (!parameters.cookiePersistentStoragePath.isEmpty()) { 210 supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath, 211 parameters.cookiePersistentStorageType); 212 } 213 supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy); 214 #if ENABLE(NETWORK_PROCESS) 215 } 216 #endif 189 if (usesNetworkProcess()) 190 return; 191 192 ASSERT(!parameters.diskCacheDirectory.isEmpty()); 193 GRefPtr<SoupCache> soupCache = adoptGRef(soup_cache_new(parameters.diskCacheDirectory.utf8().data(), SOUP_CACHE_SINGLE_USER)); 194 soup_session_add_feature(WebCore::ResourceHandle::defaultSession(), SOUP_SESSION_FEATURE(soupCache.get())); 195 soup_cache_load(soupCache.get()); 196 197 if (!parameters.cookiePersistentStoragePath.isEmpty()) { 198 supplement<WebCookieManager>()->setCookiePersistentStorage(parameters.cookiePersistentStoragePath, 199 parameters.cookiePersistentStorageType); 200 } 201 supplement<WebCookieManager>()->setHTTPCookieAcceptPolicy(parameters.cookieAcceptPolicy); 202 217 203 if (!parameters.languages.isEmpty()) 218 204 setSoupSessionAcceptLanguage(parameters.languages); … … 228 214 void WebProcess::platformTerminate() 229 215 { 230 WebCore::removeLanguageChangeObserver(this); 216 if (!usesNetworkProcess()) 217 WebCore::removeLanguageChangeObserver(this); 231 218 } 232 219 233 220 void WebProcess::setIgnoreTLSErrors(bool ignoreTLSErrors) 234 221 { 222 ASSERT(!usesNetworkProcess()); 235 223 WebCore::ResourceHandle::setIgnoreSSLErrors(ignoreTLSErrors); 236 224 } … … 238 226 void WebProcess::allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo& certificateInfo, const String& host) 239 227 { 228 ASSERT(!usesNetworkProcess()); 240 229 WebCore::ResourceHandle::setClientCertificate(host, certificateInfo.certificate()); 241 230 }
Note: See TracChangeset
for help on using the changeset viewer.