OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
9 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
10 #include "content/public/browser/stream_handle.h" | 12 #include "content/public/browser/stream_handle.h" |
11 | 13 |
12 namespace base { | 14 namespace base { |
13 class MessageLoopProxy; | 15 class MessageLoopProxy; |
14 } | 16 } |
15 | 17 |
16 namespace content { | 18 namespace content { |
17 | 19 |
18 class Stream; | 20 class Stream; |
19 | 21 |
20 class StreamHandleImpl : public StreamHandle { | 22 class StreamHandleImpl : public StreamHandle { |
21 public: | 23 public: |
22 StreamHandleImpl(const base::WeakPtr<Stream>& stream, | 24 StreamHandleImpl(const base::WeakPtr<Stream>& stream, |
23 const GURL& original_url, | 25 const GURL& original_url, |
24 const std::string& mime_type, | 26 const std::string& mime_type, |
25 scoped_refptr<net::HttpResponseHeaders> response_headers); | 27 scoped_refptr<net::HttpResponseHeaders> response_headers); |
26 virtual ~StreamHandleImpl(); | 28 virtual ~StreamHandleImpl(); |
27 | 29 |
28 private: | 30 private: |
29 // StreamHandle overrides | 31 // StreamHandle overrides |
30 virtual const GURL& GetURL() OVERRIDE; | 32 virtual const GURL& GetURL() OVERRIDE; |
31 virtual const GURL& GetOriginalURL() OVERRIDE; | 33 virtual const GURL& GetOriginalURL() OVERRIDE; |
32 virtual const std::string& GetMimeType() OVERRIDE; | 34 virtual const std::string& GetMimeType() OVERRIDE; |
33 virtual scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders() OVERRIDE; | 35 virtual scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders() OVERRIDE; |
| 36 virtual void AddCloseListener(const base::Closure& callback) OVERRIDE; |
34 | 37 |
35 base::WeakPtr<Stream> stream_; | 38 base::WeakPtr<Stream> stream_; |
36 GURL url_; | 39 GURL url_; |
37 GURL original_url_; | 40 GURL original_url_; |
38 std::string mime_type_; | 41 std::string mime_type_; |
39 scoped_refptr<net::HttpResponseHeaders> response_headers_; | 42 scoped_refptr<net::HttpResponseHeaders> response_headers_; |
40 base::MessageLoopProxy* stream_message_loop_; | 43 base::MessageLoopProxy* stream_message_loop_; |
| 44 std::vector<base::Closure> close_listeners_; |
41 }; | 45 }; |
42 | 46 |
43 } // namespace content | 47 } // namespace content |
44 | 48 |
45 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ | 49 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ |
46 | 50 |
OLD | NEW |