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"
11 StreamResourceHandler::StreamResourceHandler(net::URLRequest
* request
,
12 StreamRegistry
* registry
,
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::OnUploadProgress(uint64 position
,
31 bool StreamResourceHandler::OnRequestRedirected(
32 const net::RedirectInfo
& redirect_info
,
33 ResourceResponse
* resp
,
38 bool StreamResourceHandler::OnResponseStarted(ResourceResponse
* resp
,
43 bool StreamResourceHandler::OnWillStart(const GURL
& url
, bool* defer
) {
47 bool StreamResourceHandler::OnBeforeNetworkStart(const GURL
& url
, bool* defer
) {
51 bool StreamResourceHandler::OnWillRead(scoped_refptr
<net::IOBuffer
>* buf
,
54 writer_
.OnWillRead(buf
, buf_size
, min_size
);
58 bool StreamResourceHandler::OnReadCompleted(int bytes_read
, bool* defer
) {
59 writer_
.OnReadCompleted(bytes_read
, defer
);
63 void StreamResourceHandler::OnResponseCompleted(
64 const net::URLRequestStatus
& status
,
65 const std::string
& sec_info
,
70 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded
) {
74 } // namespace content