| Index: content/browser/streams/stream_registry.cc
|
| diff --git a/content/browser/streams/stream_registry.cc b/content/browser/streams/stream_registry.cc
|
| index d2321c874b8e6a5a0746d4f1ccc6af62f8b58ffb..64738c515f7f575713582a562dc017dac7cf5c21 100644
|
| --- a/content/browser/streams/stream_registry.cc
|
| +++ b/content/browser/streams/stream_registry.cc
|
| @@ -23,15 +23,21 @@ StreamRegistry::~StreamRegistry() {
|
| DCHECK(register_observers_.empty());
|
| }
|
|
|
| -void StreamRegistry::RegisterStream(scoped_refptr<Stream> stream) {
|
| +void StreamRegistry::RegisterStream(Stream* stream) {
|
| DCHECK(CalledOnValidThread());
|
| - DCHECK(stream.get());
|
| + DCHECK(stream);
|
| DCHECK(!stream->url().is_empty());
|
| +
|
| + auto aborted_url_itr = reader_aborted_urls_.find(stream->url());
|
| + if (aborted_url_itr != reader_aborted_urls_.end()) {
|
| + reader_aborted_urls_.erase(aborted_url_itr);
|
| + return;
|
| + }
|
| streams_[stream->url()] = stream;
|
|
|
| auto itr = register_observers_.find(stream->url());
|
| if (itr != register_observers_.end())
|
| - itr->second->OnStreamRegistered(stream.get());
|
| + itr->second->OnStreamRegistered(stream);
|
| }
|
|
|
| scoped_refptr<Stream> StreamRegistry::GetStream(const GURL& url) {
|
| @@ -107,5 +113,9 @@ void StreamRegistry::RemoveRegisterObserver(const GURL& url) {
|
| register_observers_.erase(url);
|
| }
|
|
|
| +void StreamRegistry::NotifyReaderAbortedBeforeRegistration(const GURL& url) {
|
| + DCHECK(CalledOnValidThread());
|
| + reader_aborted_urls_.insert(url);
|
| +}
|
|
|
| } // namespace content
|
|
|