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

Unified Diff: components/cronet/android/url_request_adapter.cc

Issue 737913005: Cronet UrlRequest onAppendChunk now checks that request is not destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix findbugs warning. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/url_request_adapter.cc
diff --git a/components/cronet/android/url_request_adapter.cc b/components/cronet/android/url_request_adapter.cc
index 8b2df90773dc35ff4143381d5f13b9132d908b38..b91f055cbf43749e5985aa1263b88b84d946d729 100644
--- a/components/cronet/android/url_request_adapter.cc
+++ b/components/cronet/android/url_request_adapter.cc
@@ -126,6 +126,10 @@ void URLRequestAdapter::Start() {
void URLRequestAdapter::OnAppendChunk(const scoped_ptr<char[]> bytes,
int bytes_len, bool is_last_chunk) {
DCHECK(OnNetworkThread());
+ // Request could have completed and got destroyed on the network thread
mmenke 2014/11/19 18:50:51 got -> been
mef 2014/11/19 19:32:36 Done.
+ // while appendChunk was posting task from application thread.
mmenke 2014/11/19 18:50:51 nit: posting the task from an application thread.
mef 2014/11/19 19:32:36 Done.
+ if (!url_request_)
+ return;
url_request_->AppendChunkToUpload(bytes.get(), bytes_len, is_last_chunk);
}

Powered by Google App Engine
This is Rietveld 408576698