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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 should_pause); | 231 should_pause); |
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(FROM_HERE, |
| 242 base::TimeDelta::FromMilliseconds(kThrottleTimeMs), this, |
242 &DownloadResourceHandler::CheckWriteProgress); | 243 &DownloadResourceHandler::CheckWriteProgress); |
243 } | 244 } |
244 | 245 |
245 std::string DownloadResourceHandler::DebugString() const { | 246 std::string DownloadResourceHandler::DebugString() const { |
246 return base::StringPrintf("{" | 247 return base::StringPrintf("{" |
247 " url_ = " "\"%s\"" | 248 " url_ = " "\"%s\"" |
248 " download_id_ = " "%d" | 249 " download_id_ = " "%d" |
249 " global_id_ = {" | 250 " global_id_ = {" |
250 " child_id = " "%d" | 251 " child_id = " "%d" |
251 " request_id = " "%d" | 252 " request_id = " "%d" |
252 " }" | 253 " }" |
253 " render_view_id_ = " "%d" | 254 " render_view_id_ = " "%d" |
254 " save_info_.file_path = \"%" PRFilePath "\"" | 255 " save_info_.file_path = \"%" PRFilePath "\"" |
255 " }", | 256 " }", |
256 request_->url().spec().c_str(), | 257 request_->url().spec().c_str(), |
257 download_id_, | 258 download_id_, |
258 global_id_.child_id, | 259 global_id_.child_id, |
259 global_id_.request_id, | 260 global_id_.request_id, |
260 render_view_id_, | 261 render_view_id_, |
261 save_info_.file_path.value().c_str()); | 262 save_info_.file_path.value().c_str()); |
262 } | 263 } |
OLD | NEW |