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

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

Issue 946643002: Use PowerSaveBlocker for audio and video on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply nits Created 5 years, 10 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/logging.h" 10 #include "base/logging.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 BrowserThread::UI, 124 BrowserThread::UI,
125 FROM_HERE, 125 FROM_HERE,
126 base::Bind(&InitializeDownloadTabInfoOnUIThread, 126 base::Bind(&InitializeDownloadTabInfoOnUIThread,
127 DownloadRequestHandle(AsWeakPtr(), 127 DownloadRequestHandle(AsWeakPtr(),
128 request_info->GetChildID(), 128 request_info->GetChildID(),
129 request_info->GetRouteID(), 129 request_info->GetRouteID(),
130 request_info->GetRequestID()), 130 request_info->GetRequestID()),
131 tab_info_)); 131 tab_info_));
132 power_save_blocker_ = PowerSaveBlocker::Create( 132 power_save_blocker_ = PowerSaveBlocker::Create(
133 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 133 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
134 "Download in progress"); 134 PowerSaveBlocker::kReasonOther, "Download in progress");
135 } 135 }
136 136
137 bool DownloadResourceHandler::OnUploadProgress(uint64 position, 137 bool DownloadResourceHandler::OnUploadProgress(uint64 position,
138 uint64 size) { 138 uint64 size) {
139 return true; 139 return true;
140 } 140 }
141 141
142 bool DownloadResourceHandler::OnRequestRedirected( 142 bool DownloadResourceHandler::OnRequestRedirected(
143 const net::RedirectInfo& redirect_info, 143 const net::RedirectInfo& redirect_info,
144 ResourceResponse* response, 144 ResourceResponse* response,
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // tab_info_ must be destroyed on UI thread, since 531 // tab_info_ must be destroyed on UI thread, since
532 // InitializeDownloadTabInfoOnUIThread might still be using it. 532 // InitializeDownloadTabInfoOnUIThread might still be using it.
533 if (tab_info_) 533 if (tab_info_)
534 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, tab_info_); 534 BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, tab_info_);
535 535
536 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration", 536 UMA_HISTOGRAM_TIMES("SB2.DownloadDuration",
537 base::TimeTicks::Now() - download_start_time_); 537 base::TimeTicks::Now() - download_start_time_);
538 } 538 }
539 539
540 } // namespace content 540 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | content/browser/loader/power_save_block_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698