Commit e5755433 authored by raymes's avatar raymes Committed by Commit bot

Fix crash caused by NULL response_headers passed to StreamHandleImpl

This fixes a bug introduced in https://codereview.chromium.org/588643002
which caused a crash if NULL response_headers were passed to StreamhandleImpl.

Review URL: https://codereview.chromium.org/587173002

Cr-Commit-Position: refs/heads/master@{#296104}
parent 11383c4f
......@@ -30,11 +30,15 @@ StreamHandleImpl::StreamHandleImpl(
url_(stream->url()),
original_url_(original_url),
mime_type_(mime_type),
// Make a copy of the response headers so it is safe to pass this across
// threads.
response_headers_(
new net::HttpResponseHeaders(response_headers->raw_headers())),
stream_message_loop_(base::MessageLoopProxy::current().get()) {}
response_headers_(NULL),
stream_message_loop_(base::MessageLoopProxy::current().get()) {
// Make a copy of the response headers so it is safe to pass this across
// threads.
if (response_headers.get()) {
response_headers_ =
new net::HttpResponseHeaders(response_headers->raw_headers());
}
}
StreamHandleImpl::~StreamHandleImpl() {
stream_message_loop_->PostTaskAndReply(FROM_HERE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment