Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / content / browser / loader / stream_resource_handler.cc
blobdaf41e574dbc1e5dc585b12a6a4ad396d9737309
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 #include "content/browser/loader/stream_resource_handler.h"
7 #include "base/logging.h"
9 namespace content {
11 StreamResourceHandler::StreamResourceHandler(net::URLRequest* request,
12 StreamRegistry* registry,
13 const GURL& origin)
14 : ResourceHandler(request) {
15 writer_.InitializeStream(registry, origin);
18 StreamResourceHandler::~StreamResourceHandler() {
21 void StreamResourceHandler::SetController(ResourceController* controller) {
22 writer_.set_controller(controller);
23 ResourceHandler::SetController(controller);
26 bool StreamResourceHandler::OnRequestRedirected(
27 const net::RedirectInfo& redirect_info,
28 ResourceResponse* resp,
29 bool* defer) {
30 return true;
33 bool StreamResourceHandler::OnResponseStarted(ResourceResponse* resp,
34 bool* defer) {
35 return true;
38 bool StreamResourceHandler::OnWillStart(const GURL& url, bool* defer) {
39 return true;
42 bool StreamResourceHandler::OnBeforeNetworkStart(const GURL& url, bool* defer) {
43 return true;
46 bool StreamResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
47 int* buf_size,
48 int min_size) {
49 writer_.OnWillRead(buf, buf_size, min_size);
50 return true;
53 bool StreamResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
54 writer_.OnReadCompleted(bytes_read, defer);
55 return true;
58 void StreamResourceHandler::OnResponseCompleted(
59 const net::URLRequestStatus& status,
60 const std::string& sec_info,
61 bool* defer) {
62 writer_.Finalize();
65 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded) {
66 NOTREACHED();
69 } // namespace content