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

Side by Side Diff: content/browser/loader/power_save_block_resource_throttle.cc

Issue 2073353002: Merge PowerSaveBlockerImpl and PowerSaveBlocker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-power-factory
Patch Set: android Created 4 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/loader/power_save_block_resource_throttle.h" 5 #include "content/browser/loader/power_save_block_resource_throttle.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "device/power_save_blocker/power_save_blocker.h" 8 #include "device/power_save_blocker/power_save_blocker.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 23 matching lines...) Expand all
34 // Stop blocking power save after request finishes. 34 // Stop blocking power save after request finishes.
35 power_save_blocker_.reset(); 35 power_save_blocker_.reset();
36 timer_.Stop(); 36 timer_.Stop();
37 } 37 }
38 38
39 const char* PowerSaveBlockResourceThrottle::GetNameForLogging() const { 39 const char* PowerSaveBlockResourceThrottle::GetNameForLogging() const {
40 return "PowerSaveBlockResourceThrottle"; 40 return "PowerSaveBlockResourceThrottle";
41 } 41 }
42 42
43 void PowerSaveBlockResourceThrottle::ActivatePowerSaveBlocker() { 43 void PowerSaveBlockResourceThrottle::ActivatePowerSaveBlocker() {
44 power_save_blocker_ = device::PowerSaveBlocker::CreateWithTaskRunners( 44 power_save_blocker_.reset(new device::PowerSaveBlocker(
45 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 45 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
46 device::PowerSaveBlocker::kReasonOther, "Uploading data to " + host_, 46 device::PowerSaveBlocker::kReasonOther, "Uploading data to " + host_,
47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 47 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
48 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); 48 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
49 } 49 }
50 50
51 } // namespace content 51 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_request_core.cc ('k') | content/browser/media/capture/aura_window_capture_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698