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/location.h" | 10 #include "base/location.h" |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 total_pause_time_ += (base::TimeTicks::Now() - last_stream_pause_time_); | 492 total_pause_time_ += (base::TimeTicks::Now() - last_stream_pause_time_); |
493 last_stream_pause_time_ = base::TimeTicks(); | 493 last_stream_pause_time_ = base::TimeTicks(); |
494 } | 494 } |
495 | 495 |
496 controller()->Resume(); | 496 controller()->Resume(); |
497 } | 497 } |
498 | 498 |
499 void DownloadResourceHandler::CancelRequest() { | 499 void DownloadResourceHandler::CancelRequest() { |
500 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 500 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
501 | 501 |
502 const ResourceRequestInfo* info = GetRequestInfo(); | 502 const ResourceRequestInfoImpl* info = GetRequestInfo(); |
503 ResourceDispatcherHostImpl::Get()->CancelRequest( | 503 ResourceDispatcherHostImpl::Get()->CancelRequest( |
504 info->GetChildID(), | 504 info->GetChildID(), |
505 info->GetRequestID()); | 505 info->GetRequestID()); |
506 // This object has been deleted. | 506 // This object has been deleted. |
507 } | 507 } |
508 | 508 |
509 std::string DownloadResourceHandler::DebugString() const { | 509 std::string DownloadResourceHandler::DebugString() const { |
510 const ResourceRequestInfo* info = GetRequestInfo(); | 510 const ResourceRequestInfoImpl* info = GetRequestInfo(); |
511 return base::StringPrintf("{" | 511 return base::StringPrintf("{" |
512 " url_ = " "\"%s\"" | 512 " url_ = " "\"%s\"" |
513 " info = {" | 513 " info = {" |
514 " child_id = " "%d" | 514 " child_id = " "%d" |
515 " request_id = " "%d" | 515 " request_id = " "%d" |
516 " route_id = " "%d" | 516 " route_id = " "%d" |
517 " }" | 517 " }" |
518 " }", | 518 " }", |
519 request() ? | 519 request() ? |
520 request()->url().spec().c_str() : | 520 request()->url().spec().c_str() : |
(...skipping 21 matching lines...) Expand all Loading... |
542 BrowserThread::PostTask( | 542 BrowserThread::PostTask( |
543 BrowserThread::UI, FROM_HERE, | 543 BrowserThread::UI, FROM_HERE, |
544 base::Bind(&DeleteOnUIThread, base::Passed(&tab_info_))); | 544 base::Bind(&DeleteOnUIThread, base::Passed(&tab_info_))); |
545 } | 545 } |
546 | 546 |
547 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", | 547 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", |
548 base::TimeTicks::Now() - download_start_time_); | 548 base::TimeTicks::Now() - download_start_time_); |
549 } | 549 } |
550 | 550 |
551 } // namespace content | 551 } // namespace content |
OLD | NEW |