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 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/url_request/url_request_status.h" |
8 | 9 |
9 namespace content { | 10 namespace content { |
10 | 11 |
11 StreamResourceHandler::StreamResourceHandler(net::URLRequest* request, | 12 StreamResourceHandler::StreamResourceHandler(net::URLRequest* request, |
12 StreamRegistry* registry, | 13 StreamRegistry* registry, |
13 const GURL& origin) | 14 const GURL& origin) |
14 : ResourceHandler(request) { | 15 : ResourceHandler(request) { |
15 writer_.InitializeStream(registry, origin); | 16 writer_.InitializeStream(registry, origin); |
16 } | 17 } |
17 | 18 |
(...skipping 29 matching lines...) Expand all Loading... |
47 } | 48 } |
48 | 49 |
49 bool StreamResourceHandler::OnReadCompleted(int bytes_read, bool* defer) { | 50 bool StreamResourceHandler::OnReadCompleted(int bytes_read, bool* defer) { |
50 writer_.OnReadCompleted(bytes_read, defer); | 51 writer_.OnReadCompleted(bytes_read, defer); |
51 return true; | 52 return true; |
52 } | 53 } |
53 | 54 |
54 void StreamResourceHandler::OnResponseCompleted( | 55 void StreamResourceHandler::OnResponseCompleted( |
55 const net::URLRequestStatus& status, | 56 const net::URLRequestStatus& status, |
56 bool* defer) { | 57 bool* defer) { |
57 writer_.Finalize(); | 58 writer_.Finalize(status.error()); |
58 } | 59 } |
59 | 60 |
60 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded) { | 61 void StreamResourceHandler::OnDataDownloaded(int bytes_downloaded) { |
61 NOTREACHED(); | 62 NOTREACHED(); |
62 } | 63 } |
63 | 64 |
64 } // namespace content | 65 } // namespace content |
OLD | NEW |