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

Side by Side Diff: content/browser/streams/stream_registry.h

Issue 12335087: Implement the Stream registry in content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix unittests Created 7 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_REGISTRY_H_
6 #define CONTENT_BROWSER_STREAMS_STREAM_REGISTRY_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/threading/non_thread_safe.h"
13 #include "content/common/content_export.h"
14 #include "googleurl/src/gurl.h"
15
16 namespace content {
17
18 class Stream;
19
20 // Maintains a mapping of blob: URLs to active streams.
21 class CONTENT_EXPORT StreamRegistry : public base::NonThreadSafe {
22 public:
23 StreamRegistry();
24 virtual ~StreamRegistry();
25
26 // Registers a stream, and sets its URL.
27 void RegisterStream(scoped_refptr<Stream> stream);
28
29 // Clones a stream. Returns true on success, or false if |src_url| doesn't
30 // exist.
31 bool CloneStream(const GURL& url, const GURL& src_url);
32
33 void UnregisterStream(const GURL& url);
34
35 // Gets the stream associated with |url|. Returns NULL if there is no such
36 // stream.
37 scoped_refptr<Stream> GetStream(const GURL& url);
38
39 private:
40 std::map<GURL, scoped_refptr<Stream> > streams_;
darin (slow to review) 2013/03/09 00:43:05 nit: I recommend creating a typedef for this std::
Zachary Kuznia 2013/03/11 01:32:44 Done.
41
42 DISALLOW_COPY_AND_ASSIGN(StreamRegistry);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_STREAMS_STREAM_REGISTRY_H_
48
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698