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> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/synchronization/lock.h" | |
12 #include "content/public/browser/stream_handle.h" | 11 #include "content/public/browser/stream_handle.h" |
13 | 12 |
14 namespace base { | 13 namespace base { |
15 class MessageLoopProxy; | 14 class MessageLoopProxy; |
16 } | 15 } |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 | 18 |
20 class Stream; | 19 class Stream; |
21 | 20 |
22 class StreamHandleImpl : public StreamHandle { | 21 class StreamHandleImpl : public StreamHandle { |
23 public: | 22 public: |
24 StreamHandleImpl(const base::WeakPtr<Stream>& stream, | 23 StreamHandleImpl(const base::WeakPtr<Stream>& stream); |
25 const GURL& original_url, | |
26 const std::string& mime_type, | |
27 scoped_refptr<net::HttpResponseHeaders> response_headers); | |
28 virtual ~StreamHandleImpl(); | 24 virtual ~StreamHandleImpl(); |
29 | 25 |
30 private: | 26 private: |
31 // StreamHandle overrides | 27 // StreamHandle overrides |
32 virtual const GURL& GetURL() override; | 28 virtual const GURL& GetURL() override; |
33 virtual const GURL& GetOriginalURL() override; | |
34 virtual const std::string& GetMimeType() override; | |
35 virtual scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders() override; | |
36 virtual void AddCloseListener(const base::Closure& callback) override; | 29 virtual void AddCloseListener(const base::Closure& callback) override; |
37 | 30 |
38 base::WeakPtr<Stream> stream_; | 31 base::WeakPtr<Stream> stream_; |
39 GURL url_; | 32 GURL url_; |
40 GURL original_url_; | |
41 std::string mime_type_; | |
42 scoped_refptr<net::HttpResponseHeaders> response_headers_; | |
43 base::MessageLoopProxy* stream_message_loop_; | 33 base::MessageLoopProxy* stream_message_loop_; |
44 std::vector<base::Closure> close_listeners_; | 34 std::vector<base::Closure> close_listeners_; |
45 }; | 35 }; |
46 | 36 |
47 } // namespace content | 37 } // namespace content |
48 | 38 |
49 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ | 39 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_ |
50 | 40 |
OLD | NEW |