Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Issue 5009009: AU: Fix potential issues with premature destruction of HTTP fetchers. (Closed)

Created:
10 years, 1 month ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: Fix potential issues with premature destruction of HTTP fetchers. This patch adds a new TransferTerminated callback to the HttpFetcher class. It fixes two potential memory corruption issues with premature destruction of HttpFetcher instances: 1. When MultiHttpFetcher completes a range, it terminates the current fetcher and starts the next one, if any. Change so that the next fetcher is started when the TransferTerminated callback is received from the current fetcher. This prevents the multi fetcher from sending a TransferComplete/TransferTerminated callbacks before the underlying fetcher is cleaned up, which may lead to the fetchers being destroyed prematurely. 2. If the download action fails due to a failed write, terminate the transfer and then wait for the transfer terminated callback before notifying the action processor that the action is complete. Otherwise, the action may get destroyed before the transfer is actually terminated possibly leading to memory corruption, etc. Hopefully these changes fix crosbug.com/8798. BUG=8798 TEST=unit tests, tested on device with write errors Change-Id: If416b95625ab31662f2e1308df6bdd1757a2ad78 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=9ce452b

Patch Set 1 #

Patch Set 2 : fix multi_http_fetcher terminate-transfer issue #

Patch Set 3 : cleanup #

Total comments: 8

Patch Set 4 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+209 lines, -59 lines) Patch
M download_action.h View 2 chunks +5 lines, -0 lines 0 comments Download
M download_action.cc View 4 chunks +14 lines, -2 lines 0 comments Download
M download_action_unittest.cc View 10 chunks +49 lines, -10 lines 0 comments Download
M http_fetcher.h View 1 2 2 chunks +12 lines, -5 lines 0 comments Download
M http_fetcher_unittest.cc View 1 2 3 13 chunks +48 lines, -11 lines 0 comments Download
M libcurl_http_fetcher.h View 1 2 3 2 chunks +7 lines, -2 lines 0 comments Download
M libcurl_http_fetcher.cc View 1 3 chunks +15 lines, -4 lines 0 comments Download
M mock_http_fetcher.cc View 1 3 chunks +7 lines, -0 lines 0 comments Download
M multi_http_fetcher.h View 1 2 3 6 chunks +52 lines, -25 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
petkov
10 years, 1 month ago (2010-11-17 21:04:11 UTC) #1
adlr
a couple nits/questions http://codereview.chromium.org/5009009/diff/5001/http_fetcher_unittest.cc File http_fetcher_unittest.cc (right): http://codereview.chromium.org/5009009/diff/5001/http_fetcher_unittest.cc#newcode323 http_fetcher_unittest.cc:323: ADD_FAILURE(); // We should never get ...
10 years, 1 month ago (2010-11-17 21:33:50 UTC) #2
petkov
PTAL http://codereview.chromium.org/5009009/diff/5001/http_fetcher_unittest.cc File http_fetcher_unittest.cc (right): http://codereview.chromium.org/5009009/diff/5001/http_fetcher_unittest.cc#newcode323 http_fetcher_unittest.cc:323: ADD_FAILURE(); // We should never get here On ...
10 years, 1 month ago (2010-11-17 21:47:54 UTC) #3
adlr
10 years, 1 month ago (2010-11-17 22:32:41 UTC) #4
LGTM. thanks!

Powered by Google App Engine
This is Rietveld 408576698