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

Side by Side Diff: content/browser/power_save_blocker_mac.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 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 | Annotate | Revision Log
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/power_save_blocker_impl.h" 5 #include "content/browser/power_save_blocker_impl.h"
6 6
7 #include <IOKit/pwr_mgt/IOPMLib.h> 7 #include <IOKit/pwr_mgt/IOPMLib.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 level = kIOPMAssertionTypeNoIdleSleep; 66 level = kIOPMAssertionTypeNoIdleSleep;
67 break; 67 break;
68 case PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep: 68 case PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep:
69 level = kIOPMAssertionTypeNoDisplaySleep; 69 level = kIOPMAssertionTypeNoDisplaySleep;
70 break; 70 break;
71 default: 71 default:
72 NOTREACHED(); 72 NOTREACHED();
73 break; 73 break;
74 } 74 }
75 if (level) { 75 if (level) {
76 base::mac::ScopedCFTypeRef<CFStringRef> cf_reason( 76 base::ScopedCFTypeRef<CFStringRef> cf_reason(
77 base::SysUTF8ToCFStringRef(reason_)); 77 base::SysUTF8ToCFStringRef(reason_));
78 IOReturn result = IOPMAssertionCreateWithName(level, 78 IOReturn result = IOPMAssertionCreateWithName(level,
79 kIOPMAssertionLevelOn, 79 kIOPMAssertionLevelOn,
80 cf_reason, 80 cf_reason,
81 &assertion_); 81 &assertion_);
82 LOG_IF(ERROR, result != kIOReturnSuccess) 82 LOG_IF(ERROR, result != kIOReturnSuccess)
83 << "IOPMAssertionCreate: " << result; 83 << "IOPMAssertionCreate: " << result;
84 } 84 }
85 } 85 }
86 86
(...skipping 16 matching lines...) Expand all
103 base::Bind(&Delegate::ApplyBlock, delegate_)); 103 base::Bind(&Delegate::ApplyBlock, delegate_));
104 } 104 }
105 105
106 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { 106 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {
107 g_power_thread.Pointer()->message_loop()->PostTask( 107 g_power_thread.Pointer()->message_loop()->PostTask(
108 FROM_HERE, 108 FROM_HERE,
109 base::Bind(&Delegate::RemoveBlock, delegate_)); 109 base::Bind(&Delegate::RemoveBlock, delegate_));
110 } 110 }
111 111
112 } // namespace content 112 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gamepad/xbox_data_fetcher_mac.cc ('k') | content/browser/renderer_host/backing_store_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698