Changeset 186355 in webkit
- Timestamp:
- Jul 6, 2015, 9:44:37 AM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r186333 r186355 1 2015-07-06 Antti Koivisto <antti@apple.com> 2 3 With multipart/replaced (e.g. motion JPEG), m_bufferedDataForCache grows unbounded in Networking process 4 https://bugs.webkit.org/show_bug.cgi?id=146630 5 <rdar://problem/21677340> 6 7 Reviewed by Chris Dumez. 8 9 * NetworkProcess/NetworkResourceLoader.cpp: 10 (WebKit::NetworkResourceLoader::didReceiveResponseAsync): 11 12 Don't buffer multipart/x-mixed-replace. We never want to cache these. 13 14 (WebKit::NetworkResourceLoader::didReceiveBuffer): 15 16 Limit the maximum size of the cache buffer to 10MB. This prevents unbounded memory growth if the resource 17 keeps streaming. It also prevents giant entries from pushing other data out of the cache. 18 19 (WebKit::NetworkResourceLoader::didFinishLoading): 20 1 21 2015-07-06 Zan Dobersek <zdobersek@igalia.com> 2 22 -
trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
r183861 r186355 245 245 bool shouldSendDidReceiveResponse = true; 246 246 #if ENABLE(NETWORK_CACHE) 247 if (m_response.isMultipart()) 248 m_bufferedDataForCache = nullptr; 249 247 250 if (m_cacheEntryForValidation) { 248 251 bool validationSucceeded = m_response.httpStatusCode() == 304; // 304 Not Modified … … 289 292 ASSERT(!m_cacheEntryForValidation); 290 293 291 if (m_bufferedDataForCache) 292 m_bufferedDataForCache->append(buffer.get()); 294 if (m_bufferedDataForCache) { 295 // Prevent memory growth in case of streaming data. 296 const size_t maximumCacheBufferSize = 10 * 1014 * 1024; 297 if (m_bufferedDataForCache->size() + buffer->size() <= maximumCacheBufferSize) 298 m_bufferedDataForCache->append(buffer.get()); 299 else 300 m_bufferedDataForCache = nullptr; 301 } 293 302 #endif 294 303 // FIXME: At least on OS X Yosemite we always get -1 from the resource handle. … … 328 337 329 338 bool isPrivate = sessionID().isEphemeral(); 330 if ( hasCacheableRedirect && !isPrivate) {339 if (m_bufferedDataForCache && hasCacheableRedirect && !isPrivate) { 331 340 // Keep the connection alive. 332 341 RefPtr<NetworkConnectionToWebProcess> connection(connectionToWebProcess());
Note:
See TracChangeset
for help on using the changeset viewer.