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

Unified Diff: content/browser/streams/stream_registry.h

Issue 759823003: Introduce StreamRegistry::NotifyReaderAbortedBeforeRegistration() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: content/browser/streams/stream_registry.h
diff --git a/content/browser/streams/stream_registry.h b/content/browser/streams/stream_registry.h
index ce7f6b15bcb7b957a2105101282863408b3a1b22..eac067181245cd1b303465e1d869bdb79265dae2 100644
--- a/content/browser/streams/stream_registry.h
+++ b/content/browser/streams/stream_registry.h
@@ -25,7 +25,7 @@ class CONTENT_EXPORT StreamRegistry : public base::NonThreadSafe {
virtual ~StreamRegistry();
// Registers a stream, and sets its URL.
- void RegisterStream(scoped_refptr<Stream> stream);
+ void RegisterStream(Stream* stream);
// Clones a stream. Returns true on success, or false if |src_url| doesn't
// exist.
@@ -53,11 +53,17 @@ class CONTENT_EXPORT StreamRegistry : public base::NonThreadSafe {
void SetRegisterObserver(const GURL& url, StreamRegisterObserver* observer);
void RemoveRegisterObserver(const GURL& url);
+ // If the reader is aborted before the stream is registered, call this method
+ // to reduce the memory consumption. After this method is called,
+ // RegisterStream doesn't register the stream of the URL.
+ void NotifyReaderAbortedBeforeRegistration(const GURL& url);
+
private:
typedef std::map<GURL, scoped_refptr<Stream> > StreamMap;
StreamMap streams_;
std::map<GURL, StreamRegisterObserver*> register_observers_;
+ std::set<GURL> reader_aborted_urls_;
size_t total_memory_usage_;
« no previous file with comments | « no previous file | content/browser/streams/stream_registry.cc » ('j') | content/browser/streams/stream_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698