summaryrefslogtreecommitdiffstats
path: root/content/browser/streams
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/streams')
-rw-r--r--content/browser/streams/stream.cc4
-rw-r--r--content/browser/streams/stream.h8
-rw-r--r--content/browser/streams/stream_handle_impl.cc12
-rw-r--r--content/browser/streams/stream_handle_impl.h6
4 files changed, 18 insertions, 12 deletions
diff --git a/content/browser/streams/stream.cc b/content/browser/streams/stream.cc
index ca0cf1b..d10770c 100644
--- a/content/browser/streams/stream.cc
+++ b/content/browser/streams/stream.cc
@@ -7,11 +7,13 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/values.h"
#include "content/browser/streams/stream_handle_impl.h"
#include "content/browser/streams/stream_read_observer.h"
#include "content/browser/streams/stream_registry.h"
#include "content/browser/streams/stream_write_observer.h"
#include "net/base/io_buffer.h"
+#include "net/http/http_response_headers.h"
namespace {
// Start throttling the connection at about 1MB.
@@ -161,7 +163,7 @@ Stream::StreamState Stream::ReadRawData(net::IOBuffer* buf,
scoped_ptr<StreamHandle> Stream::CreateHandle(
const GURL& original_url,
const std::string& mime_type,
- const std::string& response_headers) {
+ scoped_refptr<net::HttpResponseHeaders> response_headers) {
CHECK(!stream_handle_);
stream_handle_ = new StreamHandleImpl(weak_ptr_factory_.GetWeakPtr(),
original_url,
diff --git a/content/browser/streams/stream.h b/content/browser/streams/stream.h
index e439b72..e7e9586 100644
--- a/content/browser/streams/stream.h
+++ b/content/browser/streams/stream.h
@@ -13,6 +13,7 @@
#include "url/gurl.h"
namespace net {
+class HttpResponseHeaders;
class IOBuffer;
}
@@ -77,9 +78,10 @@ class CONTENT_EXPORT Stream : public base::RefCountedThreadSafe<Stream> {
// and STREAM_COMPLETE if the stream is finalized and all data has been read.
StreamState ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read);
- scoped_ptr<StreamHandle> CreateHandle(const GURL& original_url,
- const std::string& mime_type,
- const std::string& response_headers);
+ scoped_ptr<StreamHandle> CreateHandle(
+ const GURL& original_url,
+ const std::string& mime_type,
+ scoped_refptr<net::HttpResponseHeaders> response_headers);
void CloseHandle();
// Indicates whether there is space in the buffer to add more data.
diff --git a/content/browser/streams/stream_handle_impl.cc b/content/browser/streams/stream_handle_impl.cc
index cdba12b..d13bdc6 100644
--- a/content/browser/streams/stream_handle_impl.cc
+++ b/content/browser/streams/stream_handle_impl.cc
@@ -8,13 +8,15 @@
#include "base/location.h"
#include "base/message_loop/message_loop_proxy.h"
#include "content/browser/streams/stream.h"
+#include "net/http/http_response_headers.h"
namespace content {
-StreamHandleImpl::StreamHandleImpl(const base::WeakPtr<Stream>& stream,
- const GURL& original_url,
- const std::string& mime_type,
- const std::string& response_headers)
+StreamHandleImpl::StreamHandleImpl(
+ const base::WeakPtr<Stream>& stream,
+ const GURL& original_url,
+ const std::string& mime_type,
+ scoped_refptr<net::HttpResponseHeaders> response_headers)
: stream_(stream),
url_(stream->url()),
original_url_(original_url),
@@ -39,7 +41,7 @@ const std::string& StreamHandleImpl::GetMimeType() {
return mime_type_;
}
-const std::string& StreamHandleImpl::GetResponseHeaders() {
+scoped_refptr<net::HttpResponseHeaders> StreamHandleImpl::GetResponseHeaders() {
return response_headers_;
}
diff --git a/content/browser/streams/stream_handle_impl.h b/content/browser/streams/stream_handle_impl.h
index deb094f..fc8f5355 100644
--- a/content/browser/streams/stream_handle_impl.h
+++ b/content/browser/streams/stream_handle_impl.h
@@ -22,7 +22,7 @@ class StreamHandleImpl : public StreamHandle {
StreamHandleImpl(const base::WeakPtr<Stream>& stream,
const GURL& original_url,
const std::string& mime_type,
- const std::string& response_headers);
+ scoped_refptr<net::HttpResponseHeaders> response_headers);
virtual ~StreamHandleImpl();
private:
@@ -30,13 +30,13 @@ class StreamHandleImpl : public StreamHandle {
virtual const GURL& GetURL() OVERRIDE;
virtual const GURL& GetOriginalURL() OVERRIDE;
virtual const std::string& GetMimeType() OVERRIDE;
- virtual const std::string& GetResponseHeaders() OVERRIDE;
+ virtual scoped_refptr<net::HttpResponseHeaders> GetResponseHeaders() OVERRIDE;
base::WeakPtr<Stream> stream_;
GURL url_;
GURL original_url_;
std::string mime_type_;
- std::string response_headers_;
+ scoped_refptr<net::HttpResponseHeaders> response_headers_;
base::MessageLoopProxy* stream_message_loop_;
};