Changeset 143329 in webkit
- Timestamp:
- Feb 19, 2013 7:16:07 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143328 r143329 1 2013-02-19 Sergio Villar Senin <svillar@igalia.com> 2 3 [Soup] Use synchronous calls to close completely processed streams 4 https://bugs.webkit.org/show_bug.cgi?id=107432 5 6 Reviewed by Martin Robinson. 7 8 There is no need to close already processed streams in asynchronous 9 calls since they won't block. Using the synchronous call will save 10 us some code and unnecessary asynchronous burden. This is kind of 11 a code refactor so no new tests needed. 12 13 * platform/network/soup/ResourceHandleSoup.cpp: 14 (WebCore): 15 (WebCore::redirectSkipCallback): 16 (WebCore::readCallback): 17 1 18 2013-02-19 Andrey Adaikin <aandrey@chromium.org> 2 19 -
trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r141981 r143329 232 232 static void sendRequestCallback(GObject*, GAsyncResult*, gpointer); 233 233 static void readCallback(GObject*, GAsyncResult*, gpointer); 234 static void closeCallback(GObject*, GAsyncResult*, gpointer);235 234 static gboolean requestTimeoutCallback(void*); 236 235 #if ENABLE(WEB_TIMING) … … 500 499 } 501 500 502 static void redirectCloseCallback(GObject*, GAsyncResult* result, gpointer data)503 {504 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);505 506 if (handle->cancelledOrClientless()) {507 cleanupSoupRequestOperation(handle.get());508 return;509 }510 511 ResourceHandleInternal* d = handle->getInternal();512 g_input_stream_close_finish(d->m_inputStream.get(), result, 0);513 doRedirect(handle.get());514 }515 516 501 static void redirectSkipCallback(GObject*, GAsyncResult* asyncResult, gpointer data) 517 502 { … … 539 524 } 540 525 541 g_input_stream_close_async(d->m_inputStream.get(), G_PRIORITY_DEFAULT, 0, redirectCloseCallback, handle.get()); 526 g_input_stream_close(d->m_inputStream.get(), 0, 0); 527 doRedirect(handle.get()); 542 528 } 543 529 … … 1306 1292 } 1307 1293 1308 static void closeCallback(GObject*, GAsyncResult* res, gpointer data)1309 {1310 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);1311 ResourceHandleInternal* d = handle->getInternal();1312 1313 g_input_stream_close_finish(d->m_inputStream.get(), res, 0);1314 1315 if (handle->client() && loadingSynchronousRequest)1316 handle->client()->didFinishLoading(handle.get(), 0);1317 1318 cleanupSoupRequestOperation(handle.get());1319 }1320 1321 1294 static void readCallback(GObject*, GAsyncResult* asyncResult, gpointer data) 1322 1295 { … … 1352 1325 } 1353 1326 1354 // We inform WebCore of load completion now instead of waiting for the input 1355 // stream to close because the input stream is closed asynchronously. If this 1356 // is a synchronous request, we wait until the closeCallback, because we don't 1357 // want to halt the internal main loop before the input stream closes. 1358 if (handle->client() && !loadingSynchronousRequest) { 1359 handle->client()->didFinishLoading(handle.get(), 0); 1360 handle->setClient(0); // Unset the client so that we do not try to access th 1361 // client in the closeCallback. 1362 } 1363 g_input_stream_close_async(d->m_inputStream.get(), G_PRIORITY_DEFAULT, 0, closeCallback, handle.get()); 1327 g_input_stream_close(d->m_inputStream.get(), 0, 0); 1328 1329 handle->client()->didFinishLoading(handle.get(), 0); 1330 cleanupSoupRequestOperation(handle.get()); 1364 1331 return; 1365 1332 }
Note: See TracChangeset
for help on using the changeset viewer.