| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 RecordDownloadCount(UNTHROTTLED_COUNT); | 96 RecordDownloadCount(UNTHROTTLED_COUNT); |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool DownloadResourceHandler::OnUploadProgress(int request_id, | 99 bool DownloadResourceHandler::OnUploadProgress(int request_id, |
| 100 uint64 position, | 100 uint64 position, |
| 101 uint64 size) { | 101 uint64 size) { |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Not needed, as this event handler ought to be the final resource. | |
| 106 bool DownloadResourceHandler::OnRequestRedirected( | 105 bool DownloadResourceHandler::OnRequestRedirected( |
| 107 int request_id, | 106 int request_id, |
| 108 const GURL& url, | 107 const GURL& url, |
| 109 ResourceResponse* response, | 108 ResourceResponse* response, |
| 110 bool* defer) { | 109 bool* defer) { |
| 111 return true; | 110 return true; |
| 112 } | 111 } |
| 113 | 112 |
| 114 // Send the download creation information to the download thread. | 113 // Send the download creation information to the download thread. |
| 115 bool DownloadResourceHandler::OnResponseStarted( | 114 bool DownloadResourceHandler::OnResponseStarted( |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 480 |
| 482 // Remove output stream callback if a stream exists. | 481 // Remove output stream callback if a stream exists. |
| 483 if (stream_writer_) | 482 if (stream_writer_) |
| 484 stream_writer_->RegisterCallback(base::Closure()); | 483 stream_writer_->RegisterCallback(base::Closure()); |
| 485 | 484 |
| 486 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", | 485 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", |
| 487 base::TimeTicks::Now() - download_start_time_); | 486 base::TimeTicks::Now() - download_start_time_); |
| 488 } | 487 } |
| 489 | 488 |
| 490 } // namespace content | 489 } // namespace content |
| OLD | NEW |