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

Unified Diff: content/child/url_response_body_consumer.cc

Issue 2463753002: Add virtual tests for XHR with mojo-loading (Closed)
Patch Set: fix Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/site-per-process » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/url_response_body_consumer.cc
diff --git a/content/child/url_response_body_consumer.cc b/content/child/url_response_body_consumer.cc
index 5016ee3a5b6c0646e383d43c26b745bbcdd6c816..0bbb44d6db7b99ab23d5318401c58900d71ef3a8 100644
--- a/content/child/url_response_body_consumer.cc
+++ b/content/child/url_response_body_consumer.cc
@@ -87,6 +87,9 @@ void URLResponseBodyConsumer::OnReadable(MojoResult unused) {
if (has_been_cancelled_ || has_seen_end_of_data_)
return;
+ // Protect |this| as RequestPeer::OnReceivedData may call deref.
+ scoped_refptr<URLResponseBodyConsumer> protect(this);
+
// TODO(yhirano): Suppress notification when deferred.
while (!has_been_cancelled_) {
const void* buffer = nullptr;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/site-per-process » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698