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

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: AbortPendingStream Created 6 years 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_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..05c53100f04896f23d7a69a4550d7e02b49b7e11 100644
--- a/content/browser/streams/stream_registry.h
+++ b/content/browser/streams/stream_registry.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_STREAMS_STREAM_REGISTRY_H_
#include <map>
+#include <set>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
@@ -25,7 +26,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 +54,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 AbortPendingStream(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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698