| OLD | NEW |
| 1 // Copyright (c) 2011 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 "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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 is_paused_ = should_pause; | 232 is_paused_ = should_pause; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 DownloadResourceHandler::~DownloadResourceHandler() { | 236 DownloadResourceHandler::~DownloadResourceHandler() { |
| 237 } | 237 } |
| 238 | 238 |
| 239 void DownloadResourceHandler::StartPauseTimer() { | 239 void DownloadResourceHandler::StartPauseTimer() { |
| 240 if (!pause_timer_.IsRunning()) | 240 if (!pause_timer_.IsRunning()) |
| 241 pause_timer_.Start(base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, | 241 pause_timer_.Start(base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, |
| 242 &DownloadResourceHandler::CheckWriteProgress); | 242 &DownloadResourceHandler::CheckWriteProgress, FROM_HERE); |
| 243 } | 243 } |
| 244 | 244 |
| 245 std::string DownloadResourceHandler::DebugString() const { | 245 std::string DownloadResourceHandler::DebugString() const { |
| 246 return base::StringPrintf("{" | 246 return base::StringPrintf("{" |
| 247 " url_ = " "\"%s\"" | 247 " url_ = " "\"%s\"" |
| 248 " download_id_ = " "%d" | 248 " download_id_ = " "%d" |
| 249 " global_id_ = {" | 249 " global_id_ = {" |
| 250 " child_id = " "%d" | 250 " child_id = " "%d" |
| 251 " request_id = " "%d" | 251 " request_id = " "%d" |
| 252 " }" | 252 " }" |
| 253 " render_view_id_ = " "%d" | 253 " render_view_id_ = " "%d" |
| 254 " save_info_.file_path = \"%" PRFilePath "\"" | 254 " save_info_.file_path = \"%" PRFilePath "\"" |
| 255 " }", | 255 " }", |
| 256 request_->url().spec().c_str(), | 256 request_->url().spec().c_str(), |
| 257 download_id_, | 257 download_id_, |
| 258 global_id_.child_id, | 258 global_id_.child_id, |
| 259 global_id_.request_id, | 259 global_id_.request_id, |
| 260 render_view_id_, | 260 render_view_id_, |
| 261 save_info_.file_path.value().c_str()); | 261 save_info_.file_path.value().c_str()); |
| 262 } | 262 } |
| OLD | NEW |