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

Unified Diff: base/mac/scoped_ionotificationportref.h

Issue 2332903002: [sensors] [mac] Implement ambient light sensor for macOS (Closed)
Patch Set: Update commit message Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | content/browser/device_sensors/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/scoped_ionotificationportref.h
diff --git a/base/mac/scoped_ionotificationportref.h b/base/mac/scoped_ionotificationportref.h
new file mode 100644
index 0000000000000000000000000000000000000000..93ebc98b65bbbc56ad66588a054bccb51912636a
--- /dev/null
+++ b/base/mac/scoped_ionotificationportref.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_MAC_SCOPED_IONOTIFICATIONPORTREF_H_
+#define BASE_MAC_SCOPED_IONOTIFICATIONPORTREF_H_
+
+#include <IOKit/IOKitLib.h>
+
+#include "base/scoped_generic.h"
+
+namespace base {
+namespace mac {
+
+namespace internal {
+
+struct ScopedIONotificationPortRefTraits {
+ static IONotificationPortRef InvalidValue() { return nullptr; }
+ static void Free(IONotificationPortRef object) {
+ IONotificationPortDestroy(object);
+ }
+};
+
+} // namepsace internal
+
+using ScopedIONotificationPortRef =
+ ScopedGeneric<IONotificationPortRef,
+ internal::ScopedIONotificationPortRefTraits>;
+
+} // namespace mac
+} // namespace base
+
+#endif // BASE_MAC_SCOPED_IONOTIFICATIONPORTREF_H_
« no previous file with comments | « base/BUILD.gn ('k') | content/browser/device_sensors/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698