Changeset 185251 in webkit
- Timestamp:
- Jun 5, 2015 10:19:37 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r185248 r185251 1 2015-06-05 Anders Carlsson <andersca@apple.com> 2 3 Disable the CFNetwork cache in the web process 4 https://bugs.webkit.org/show_bug.cgi?id=145700 5 rdar://problem/20243343 6 7 Reviewed by Geoffrey Garen. 8 9 * NetworkProcess/cache/NetworkCacheStorage.cpp: 10 (WebKit::NetworkCache::Storage::open): 11 * Shared/WebProcessCreationParameters.cpp: 12 (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted. 13 (WebKit::WebProcessCreationParameters::encode): Deleted. 14 (WebKit::WebProcessCreationParameters::decode): Deleted. 15 * Shared/WebProcessCreationParameters.h: 16 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 17 (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted. 18 * UIProcess/WebProcessPool.cpp: 19 (WebKit::WebProcessPool::createNewWebProcess): Deleted. 20 * WebProcess/WebProcess.cpp: 21 (WebKit::WebProcess::WebProcess): Deleted. 22 (WebKit::WebProcess::initializeWebProcess): Deleted. 23 * WebProcess/WebProcess.h: 24 * WebProcess/cocoa/WebProcessCocoa.mm: 25 (WebKit::WebProcess::platformClearResourceCaches): 26 (WebKit::WebProcess::platformInitializeWebProcess): 27 (WebKit::WebProcess::platformSetCacheModel): Deleted. 28 (WebKit::WebProcess::platformTerminate): Deleted. 29 1 30 2015-06-05 Anders Carlsson <andersca@apple.com> 2 31 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
r183755 r185251 81 81 82 82 String networkCachePath = WebCore::pathByAppendingComponent(cachePath, networkCacheSubdirectory); 83 83 84 if (!WebCore::makeAllDirectories(networkCachePath)) 84 85 return nullptr; -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
r184211 r185251 41 41 , defaultRequestTimeoutInterval(INT_MAX) 42 42 #if PLATFORM(COCOA) 43 , nsURLCacheMemoryCapacity(0)44 , nsURLCacheDiskCapacity(0)45 43 , shouldEnableKerningAndLigaturesByDefault(false) 46 44 , shouldEnableJIT(false) … … 72 70 encoder << webSQLDatabaseDirectory; 73 71 encoder << webSQLDatabaseDirectoryExtensionHandle; 74 encoder << diskCacheDirectory;75 encoder << diskCacheDirectoryExtensionHandle;76 72 #if ENABLE(SECCOMP_FILTERS) 77 73 encoder << cookieStorageDirectory; … … 123 119 encoder << presenterApplicationPid; 124 120 encoder << accessibilityEnhancedUserInterfaceEnabled; 125 encoder << nsURLCacheMemoryCapacity;126 encoder << nsURLCacheDiskCapacity;127 121 encoder << acceleratedCompositingPort; 128 122 encoder << uiProcessBundleResourcePath; … … 179 173 if (!decoder.decode(parameters.webSQLDatabaseDirectoryExtensionHandle)) 180 174 return false; 181 if (!decoder.decode(parameters.diskCacheDirectory))182 return false;183 if (!decoder.decode(parameters.diskCacheDirectoryExtensionHandle))184 return false;185 175 #if ENABLE(SECCOMP_FILTERS) 186 176 if (!decoder.decode(parameters.cookieStorageDirectory)) … … 268 258 return false; 269 259 if (!decoder.decode(parameters.accessibilityEnhancedUserInterfaceEnabled)) 270 return false;271 if (!decoder.decode(parameters.nsURLCacheMemoryCapacity))272 return false;273 if (!decoder.decode(parameters.nsURLCacheDiskCapacity))274 260 return false; 275 261 if (!decoder.decode(parameters.acceleratedCompositingPort)) -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h
r184211 r185251 73 73 String webSQLDatabaseDirectory; 74 74 SandboxExtension::Handle webSQLDatabaseDirectoryExtensionHandle; 75 String diskCacheDirectory;76 SandboxExtension::Handle diskCacheDirectoryExtensionHandle;77 75 #if ENABLE(SECCOMP_FILTERS) 78 76 String cookieStorageDirectory; … … 139 137 bool accessibilityEnhancedUserInterfaceEnabled; 140 138 141 uint64_t nsURLCacheMemoryCapacity;142 uint64_t nsURLCacheDiskCapacity;143 144 139 WebCore::MachSendRight acceleratedCompositingPort; 145 140 -
trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r184929 r185251 175 175 #endif 176 176 177 NSURLCache *urlCache = [NSURLCache sharedURLCache];178 parameters.nsURLCacheMemoryCapacity = [urlCache memoryCapacity];179 parameters.nsURLCacheDiskCapacity = [urlCache diskCapacity];180 181 177 parameters.shouldEnableKerningAndLigaturesByDefault = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey]; 182 178 parameters.shouldEnableJIT = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJSCJITEnabledDefaultsKey]; -
trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp
r184912 r185251 618 618 SandboxExtension::createHandleForReadWriteDirectory(parameters.webSQLDatabaseDirectory, parameters.webSQLDatabaseDirectoryExtensionHandle); 619 619 620 parameters.diskCacheDirectory = diskCacheDirectory();621 if (!parameters.diskCacheDirectory.isEmpty())622 SandboxExtension::createHandleForReadWriteDirectory(parameters.diskCacheDirectory, parameters.diskCacheDirectoryExtensionHandle);623 624 620 #if ENABLE(SECCOMP_FILTERS) 625 621 parameters.cookieStorageDirectory = this->cookieStorageDirectory(); -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r185206 r185251 158 158 , m_hasSetCacheModel(false) 159 159 , m_cacheModel(CacheModelDocumentViewer) 160 , m_diskCacheIsDisabledForTesting(false)161 #if PLATFORM(COCOA)162 , m_clearResourceCachesDispatchGroup(0)163 #endif164 160 , m_fullKeyboardAccessEnabled(false) 165 161 , m_textCheckerState() … … 301 297 ApplicationCacheStorage::singleton().setCacheDirectory(parameters.applicationCacheDirectory); 302 298 303 m_diskCacheIsDisabledForTesting = parameters.shouldUseTestingNetworkSession;304 299 setCacheModel(static_cast<uint32_t>(parameters.cacheModel)); 305 300 -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r184326 r185251 339 339 bool m_hasSetCacheModel; 340 340 CacheModel m_cacheModel; 341 bool m_diskCacheIsDisabledForTesting;342 341 343 342 #if PLATFORM(COCOA) 344 343 WebCore::MachSendRight m_compositingRenderServerPort; 345 344 pid_t m_presenterApplicationPid; 346 dispatch_group_t m_clearResourceCachesDispatchGroup;347 345 #endif 348 346 -
trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
r184950 r185251 99 99 memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval); 100 100 PageCache::singleton().setMaxSize(pageCacheSize); 101 102 NSURLCache *nsurlCache = [NSURLCache sharedURLCache];103 104 [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity];105 if (!m_diskCacheIsDisabledForTesting)106 [nsurlCache setDiskCapacity:std::max<unsigned long>(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.107 101 } 108 102 109 103 void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear) 110 104 { 111 if (cachesToClear == InMemoryResourceCachesOnly) 112 return; 113 114 // If we're using the network process then it is the only one that needs to clear the disk cache. 115 if (usesNetworkProcess()) 116 return; 117 118 if (!m_clearResourceCachesDispatchGroup) 119 m_clearResourceCachesDispatchGroup = dispatch_group_create(); 120 121 dispatch_group_async(m_clearResourceCachesDispatchGroup, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 122 [[NSURLCache sharedURLCache] removeAllCachedResponses]; 123 }); 105 // FIXME: Remove this. 124 106 } 125 107 … … 141 123 SandboxExtension::consumePermanently(parameters.webSQLDatabaseDirectoryExtensionHandle); 142 124 SandboxExtension::consumePermanently(parameters.applicationCacheDirectoryExtensionHandle); 143 SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);144 125 SandboxExtension::consumePermanently(parameters.mediaKeyStorageDirectoryExtensionHandle); 145 126 #if PLATFORM(IOS) … … 154 135 #endif 155 136 156 // FIXME: Most of what this function does for cache size gets immediately overridden by setCacheModel(). 157 // - memory cache size passed from UI process is always ignored; 158 // - disk cache size passed from UI process is effectively a minimum size. 159 // One non-obvious constraint is that we need to use -setSharedURLCache: even in testing mode, to prevent creating a default one on disk later, when some other code touches the cache. 160 161 ASSERT(!m_diskCacheIsDisabledForTesting || !parameters.nsURLCacheDiskCapacity); 162 163 #if PLATFORM(IOS) 164 if (!parameters.uiProcessBundleIdentifier.isNull()) { 165 [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc] 166 _initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity 167 diskCapacity:parameters.nsURLCacheDiskCapacity 168 relativePath:parameters.uiProcessBundleIdentifier]).get()]; 169 } 170 #else 171 if (!parameters.diskCacheDirectory.isNull()) { 172 [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc] 173 initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity 174 diskCapacity:parameters.nsURLCacheDiskCapacity 175 diskPath:parameters.diskCacheDirectory]).get()]; 176 } 177 #endif 137 auto urlCache = adoptNS([[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]); 138 [NSURLCache setSharedURLCache:urlCache.get()]; 178 139 179 140 #if PLATFORM(MAC) … … 232 193 void WebProcess::platformTerminate() 233 194 { 234 if (m_clearResourceCachesDispatchGroup) {235 dispatch_group_wait(m_clearResourceCachesDispatchGroup, DISPATCH_TIME_FOREVER);236 dispatch_release(m_clearResourceCachesDispatchGroup);237 m_clearResourceCachesDispatchGroup = 0;238 }239 195 } 240 196
Note: See TracChangeset
for help on using the changeset viewer.