| 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 #include "content/browser/loader/stream_resource_handler.h" | 5 #include "content/browser/loader/stream_resource_handler.h" |
| 6 | 6 #include "base/trace_event/trace_event.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 StreamResourceHandler::StreamResourceHandler(net::URLRequest* request, | 11 StreamResourceHandler::StreamResourceHandler(net::URLRequest* request, |
| 12 StreamRegistry* registry, | 12 StreamRegistry* registry, |
| 13 const GURL& origin) | 13 const GURL& origin) |
| 14 : ResourceHandler(request) { | 14 : ResourceHandler(request) { |
| 15 writer_.InitializeStream(registry, origin); | 15 writer_.InitializeStream(registry, origin); |
| 16 } | 16 } |
| 17 | 17 |
| 18 StreamResourceHandler::~StreamResourceHandler() { | 18 StreamResourceHandler::~StreamResourceHandler() { |
| 19 TRACE_EVENT0("toplevel", "StreamResourceHandler::~StreamResourceHandler"); |
| 19 } | 20 } |
| 20 | 21 |
| 21 void StreamResourceHandler::SetController(ResourceController* controller) { | 22 void StreamResourceHandler::SetController(ResourceController* controller) { |
| 22 writer_.set_controller(controller); | 23 writer_.set_controller(controller); |
| 23 ResourceHandler::SetController(controller); | 24 ResourceHandler::SetController(controller); |
| 24 } | 25 } |
| 25 | 26 |
| 26 bool StreamResourceHandler::OnRequestRedirected( | 27 bool StreamResourceHandler::OnRequestRedirected( |
| 27 const net::RedirectInfo& redirect_info, | 28 const net::RedirectInfo& redirect_info, |
| 28 ResourceResponse* resp, | 29 ResourceResponse* resp, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const std::string& sec_info, | 61 const std::string& sec_info, |
| 61 bool* defer) { | 62 bool* defer) { |
| 62 writer_.Finalize(); | 63 writer_.Finalize(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded) { | 66 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded) { |
| 66 NOTREACHED(); | 67 NOTREACHED(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace content | 70 } // namespace content |
| OLD | NEW |