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

Side by Side Diff: src/pkg/power_management/power_management_extension_macos.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 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
« no previous file with comments | « src/pkg/power_management/power_management_extension_linux.cc ('k') | src/shared/asan_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #if defined(FLETCH_TARGET_OS_MACOS) 5 #if defined(DARTINO_TARGET_OS_MACOS)
6 6
7 #include <IOKit/pwr_mgt/IOPMLib.h> 7 #include <IOKit/pwr_mgt/IOPMLib.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_native_api.h" 10 #include "include/dart_native_api.h"
11 11
12 #include "power_management_extension.h" 12 #include "power_management_extension.h"
13 13
14 int64_t HandleDisableSleep(const char* reason) { 14 int64_t HandleDisableSleep(const char* reason) {
15 CFStringRef reasonForActivity = 15 CFStringRef reasonForActivity =
16 CFStringCreateWithCString(NULL, reason, kCFStringEncodingUTF8); 16 CFStringCreateWithCString(NULL, reason, kCFStringEncodingUTF8);
17 17
18 IOPMAssertionID assertionID; 18 IOPMAssertionID assertionID;
19 IOReturn success = IOPMAssertionCreateWithName( 19 IOReturn success = IOPMAssertionCreateWithName(
20 kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, 20 kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn,
21 reasonForActivity, &assertionID); 21 reasonForActivity, &assertionID);
22 if (success == kIOReturnSuccess) { 22 if (success == kIOReturnSuccess) {
23 return assertionID; 23 return assertionID;
24 } else { 24 } else {
25 return -1; 25 return -1;
26 } 26 }
27 } 27 }
28 28
29 void HandleEnableSleep(int64_t disable_id) { 29 void HandleEnableSleep(int64_t disable_id) {
30 IOPMAssertionRelease(disable_id); 30 IOPMAssertionRelease(disable_id);
31 } 31 }
32 32
33 #endif // FLETCH_TARGET_OS_MACOS 33 #endif // DARTINO_TARGET_OS_MACOS
OLDNEW
« no previous file with comments | « src/pkg/power_management/power_management_extension_linux.cc ('k') | src/shared/asan_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698