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

Unified Diff: content/browser/streams/stream.cc

Issue 2146773002: [Stream] Notify ReadObserver of Stream abortion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 5 months 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 | content/browser/streams/stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/streams/stream.cc
diff --git a/content/browser/streams/stream.cc b/content/browser/streams/stream.cc
index 1d6c67abb7dad01c9050d1096cb7b11f79eeb0ab..d4e772755c61f815ed2e78546a4b13cf96eb430f 100644
--- a/content/browser/streams/stream.cc
+++ b/content/browser/streams/stream.cc
@@ -77,6 +77,11 @@ void Stream::Abort() {
ClearBuffer();
can_add_data_ = false;
registry_->UnregisterStream(url());
+ // Notify the observer that something happens. Read will return
+ // STREAM_ABORTED.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(&Stream::OnDataAvailable, weak_ptr_factory_.GetWeakPtr()));
}
void Stream::AddData(scoped_refptr<net::IOBuffer> buffer, size_t size) {
« no previous file with comments | « no previous file | content/browser/streams/stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698