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

Side by Side Diff: chrome/browser/renderer_host/download_throttling_resource_handler.cc

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/renderer_host/download_throttling_resource_handler.h" 5 #include "chrome/browser/renderer_host/download_throttling_resource_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/renderer_host/download_resource_handler.h" 8 #include "chrome/browser/renderer_host/download_resource_handler.h"
9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 9 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
10 #include "chrome/common/resource_response.h" 10 #include "chrome/common/resource_response.h"
11 #include "net/base/io_buffer.h" 11 #include "net/base/io_buffer.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 CopyTmpBufferToDownloadHandler(); 112 CopyTmpBufferToDownloadHandler();
113 return true; 113 return true;
114 } 114 }
115 if (download_handler_.get()) 115 if (download_handler_.get())
116 return download_handler_->OnReadCompleted(request_id, bytes_read); 116 return download_handler_->OnReadCompleted(request_id, bytes_read);
117 return true; 117 return true;
118 } 118 }
119 119
120 bool DownloadThrottlingResourceHandler::OnResponseCompleted( 120 bool DownloadThrottlingResourceHandler::OnResponseCompleted(
121 int request_id, 121 int request_id,
122 const URLRequestStatus& status, 122 const net::URLRequestStatus& status,
123 const std::string& security_info) { 123 const std::string& security_info) {
124 if (download_handler_.get()) 124 if (download_handler_.get())
125 return download_handler_->OnResponseCompleted(request_id, status, 125 return download_handler_->OnResponseCompleted(request_id, status,
126 security_info); 126 security_info);
127 127
128 // For a download, if ResourceDispatcher::Read() fails, 128 // For a download, if ResourceDispatcher::Read() fails,
129 // ResourceDispatcher::OnresponseStarted() will call 129 // ResourceDispatcher::OnresponseStarted() will call
130 // OnResponseCompleted(), and we will end up here with an error 130 // OnResponseCompleted(), and we will end up here with an error
131 // status. 131 // status.
132 if (!status.is_success()) 132 if (!status.is_success())
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 int buf_size; 176 int buf_size;
177 if (download_handler_->OnWillRead(request_id_, &buffer, &buf_size, 177 if (download_handler_->OnWillRead(request_id_, &buffer, &buf_size,
178 tmp_buffer_length_)) { 178 tmp_buffer_length_)) {
179 CHECK(buf_size >= tmp_buffer_length_); 179 CHECK(buf_size >= tmp_buffer_length_);
180 memcpy(buffer->data(), tmp_buffer_->data(), tmp_buffer_length_); 180 memcpy(buffer->data(), tmp_buffer_->data(), tmp_buffer_length_);
181 download_handler_->OnReadCompleted(request_id_, &tmp_buffer_length_); 181 download_handler_->OnReadCompleted(request_id_, &tmp_buffer_length_);
182 } 182 }
183 tmp_buffer_length_ = 0; 183 tmp_buffer_length_ = 0;
184 tmp_buffer_ = NULL; 184 tmp_buffer_ = NULL;
185 } 185 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/download_resource_handler.cc ('k') | chrome/browser/renderer_host/offline_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698