Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1201)

Side by Side Diff: content/browser/loader/stream_resource_handler.cc

Issue 2368913002: Fix stream errors that occur after a stream starts not propagating. (Closed)
Patch Set: review comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_resource_handler.cc ('k') | content/browser/loader/stream_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698