| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/download/download_resource_handler.h" | 5 #include "content/browser/download/download_resource_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool* defer) { | 142 bool* defer) { |
| 143 // The MIME type in ResourceResponse is the product of | 143 // The MIME type in ResourceResponse is the product of |
| 144 // MimeTypeResourceHandler. | 144 // MimeTypeResourceHandler. |
| 145 return core_.OnResponseStarted(response->head.mime_type); | 145 return core_.OnResponseStarted(response->head.mime_type); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool DownloadResourceHandler::OnWillStart(const GURL& url, bool* defer) { | 148 bool DownloadResourceHandler::OnWillStart(const GURL& url, bool* defer) { |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool DownloadResourceHandler::OnBeforeNetworkStart(const GURL& url, | |
| 153 bool* defer) { | |
| 154 return true; | |
| 155 } | |
| 156 | |
| 157 // Create a new buffer, which will be handed to the download thread for file | 152 // Create a new buffer, which will be handed to the download thread for file |
| 158 // writing and deletion. | 153 // writing and deletion. |
| 159 bool DownloadResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 154 bool DownloadResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 160 int* buf_size, | 155 int* buf_size, |
| 161 int min_size) { | 156 int min_size) { |
| 162 return core_.OnWillRead(buf, buf_size, min_size); | 157 return core_.OnWillRead(buf, buf_size, min_size); |
| 163 } | 158 } |
| 164 | 159 |
| 165 // Pass the buffer to the download file writer. | 160 // Pass the buffer to the download file writer. |
| 166 bool DownloadResourceHandler::OnReadCompleted(int bytes_read, bool* defer) { | 161 bool DownloadResourceHandler::OnReadCompleted(int bytes_read, bool* defer) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 " }", | 242 " }", |
| 248 request() ? | 243 request() ? |
| 249 request()->url().spec().c_str() : | 244 request()->url().spec().c_str() : |
| 250 "<NULL request>", | 245 "<NULL request>", |
| 251 info->GetChildID(), | 246 info->GetChildID(), |
| 252 info->GetRequestID(), | 247 info->GetRequestID(), |
| 253 info->GetRouteID()); | 248 info->GetRouteID()); |
| 254 } | 249 } |
| 255 | 250 |
| 256 } // namespace content | 251 } // namespace content |
| OLD | NEW |