Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: content/browser/download/download_resource_handler.cc

Issue 1301103002: moved upload progress logic from ResourceLoader to AsyncResourceHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: single quotes, nits, and return success on success Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 DownloadRequestHandle(AsWeakPtr(), request_info->GetChildID(), 135 DownloadRequestHandle(AsWeakPtr(), request_info->GetChildID(),
136 request_info->GetRouteID(), 136 request_info->GetRouteID(),
137 request_info->GetRequestID(), 137 request_info->GetRequestID(),
138 request_info->frame_tree_node_id()), 138 request_info->frame_tree_node_id()),
139 tab_info_.get())); 139 tab_info_.get()));
140 power_save_blocker_ = PowerSaveBlocker::Create( 140 power_save_blocker_ = PowerSaveBlocker::Create(
141 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 141 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
142 PowerSaveBlocker::kReasonOther, "Download in progress"); 142 PowerSaveBlocker::kReasonOther, "Download in progress");
143 } 143 }
144 144
145 bool DownloadResourceHandler::OnUploadProgress(uint64 position,
146 uint64 size) {
147 return true;
148 }
149
150 bool DownloadResourceHandler::OnRequestRedirected( 145 bool DownloadResourceHandler::OnRequestRedirected(
151 const net::RedirectInfo& redirect_info, 146 const net::RedirectInfo& redirect_info,
152 ResourceResponse* response, 147 ResourceResponse* response,
153 bool* defer) { 148 bool* defer) {
154 return true; 149 return true;
155 } 150 }
156 151
157 // Send the download creation information to the download thread. 152 // Send the download creation information to the download thread.
158 bool DownloadResourceHandler::OnResponseStarted( 153 bool DownloadResourceHandler::OnResponseStarted(
159 ResourceResponse* response, 154 ResourceResponse* response,
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 BrowserThread::PostTask( 542 BrowserThread::PostTask(
548 BrowserThread::UI, FROM_HERE, 543 BrowserThread::UI, FROM_HERE,
549 base::Bind(&DeleteOnUIThread, base::Passed(&tab_info_))); 544 base::Bind(&DeleteOnUIThread, base::Passed(&tab_info_)));
550 } 545 }
551 546
552 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", 547 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration",
553 base::TimeTicks::Now() - download_start_time_); 548 base::TimeTicks::Now() - download_start_time_);
554 } 549 }
555 550
556 } // namespace content 551 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.h ('k') | content/browser/download/save_file_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698