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.
5 #ifndef CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
6 #define CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_
10 #include "base/memory/weak_ptr.h"
11 #include "base/synchronization/lock.h"
12 #include "content/public/browser/stream_handle.h"
15 class MessageLoopProxy
;
22 class StreamHandleImpl
: public StreamHandle
{
24 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();
31 // StreamHandle overrides
32 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
;
38 base::WeakPtr
<Stream
> stream_
;
41 std::string mime_type_
;
42 scoped_refptr
<net::HttpResponseHeaders
> response_headers_
;
43 base::MessageLoopProxy
* stream_message_loop_
;
44 std::vector
<base::Closure
> close_listeners_
;
47 } // namespace content
49 #endif // CONTENT_BROWSER_STREAMS_STREAM_HANDLE_IMPL_H_