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

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

Issue 12645004: Add Resource Handler for creating Streams to forward to extensions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code review fixes 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_HANDLE_IMPL_H_
6 #define CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop_proxy.h"
10 #include "base/synchronization/lock.h"
11 #include "content/public/browser/stream_handle.h"
12
13 namespace content {
14
15 class Stream;
16
17 class StreamHandleImpl : public StreamHandle {
18 public:
19 StreamHandleImpl(const base::WeakPtr<Stream>& stream,
20 const GURL& original_url,
21 const std::string& mime_type);
22 virtual ~StreamHandleImpl();
23
24 void OnStreamConsumed();
25
26 private:
27 // StreamHandle overrides
28 virtual const GURL& GetURL() OVERRIDE;
29 virtual const GURL& GetOriginalURL() OVERRIDE;
30 virtual const std::string& GetMimeType() OVERRIDE;
31 virtual void NotifyWhenConsumed(const base::Closure& callback) OVERRIDE;
32
33 base::WeakPtr<Stream> stream_;
34 GURL url_;
35 GURL original_url_;
36 std::string mime_type_;
37 base::MessageLoopProxy* stream_message_loop_;
38 base::MessageLoopProxy* callback_message_loop_;
39 base::Closure callback_;
40 // callback_lock_ protects callback_message_loop_ and callback_.
41 base::Lock callback_lock_;
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
47
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698