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

Side by Side Diff: content/browser/streams/chrome_stream_registry.cc

Issue 12212031: Add support for redirecting ResourceHandlers to a blob: URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 10 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 #include "content/browser/streams/chrome_stream_registry.h"
6
7 #include <string>
8
9 #include "base/guid.h"
10 #include "base/stl_util.h"
11 #include "base/string_number_conversions.h"
12 #include "content/browser/streams/chrome_stream.h"
13 #include "content/public/common/url_constants.h"
14
15 namespace content {
16
17 ChromeStreamRegistry::ChromeStreamRegistry() {
18 }
19
20 ChromeStreamRegistry::~ChromeStreamRegistry() {
21 }
22
23 void ChromeStreamRegistry::RegisterStream(scoped_refptr<ChromeStream> stream) {
24 GURL url(std::string(chrome::kBlobScheme) + ":" +
25 stream->security_origin().spec() +
26 base::GenerateGUID());
27 stream->SetStreamUrl(url);
28 stream->AddObserver(this);
29 streams_[url] = stream;
30 }
31
32 scoped_refptr<ChromeStream> ChromeStreamRegistry::GetStream(const GURL& url) {
33 std::map<GURL, scoped_refptr<ChromeStream> >::iterator stream =
34 streams_.find(url);
35 if (stream != streams_.end()) {
36 return stream->second;
37 } else {
38 return NULL;
39 }
40 }
41
42 void ChromeStreamRegistry::OnDataAvailable(ChromeStream* stream) {
43 }
44
45 void ChromeStreamRegistry::OnStreamComplete(ChromeStream* stream) {
darin (slow to review) 2013/02/13 09:18:12 so does OnStreamComplete mean that the stream was
Zachary Kuznia 2013/02/13 16:37:14 Changed to OnStreamConsumed and now this is called
46 stream->RemoveObserver(this);
47 streams_.erase(stream->stream_url());
48 }
49
50 void ChromeStreamRegistry::OnBufferAvailable(ChromeStream* stream) {
51 }
52
53 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698