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

Unified Diff: base/mac/scoped_ioobject.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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/mac/scoped_cftyperef.h ('k') | base/mac/scoped_ioplugininterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/scoped_ioobject.h
diff --git a/base/mac/scoped_ioobject.h b/base/mac/scoped_ioobject.h
deleted file mode 100644
index 854039b5537dd215fa94c66f057512f32fb8d540..0000000000000000000000000000000000000000
--- a/base/mac/scoped_ioobject.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 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_IOOBJECT_H_
-#define BASE_MAC_SCOPED_IOOBJECT_H_
-
-#include <IOKit/IOKitLib.h>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-
-namespace base {
-namespace mac {
-
-// Just like ScopedCFTypeRef but for io_object_t and subclasses.
-template<typename IOT>
-class ScopedIOObject {
- public:
- typedef IOT element_type;
-
- explicit ScopedIOObject(IOT object = IO_OBJECT_NULL)
- : object_(object) {
- }
-
- ~ScopedIOObject() {
- if (object_)
- IOObjectRelease(object_);
- }
-
- void reset(IOT object = IO_OBJECT_NULL) {
- if (object_)
- IOObjectRelease(object_);
- object_ = object;
- }
-
- bool operator==(IOT that) const {
- return object_ == that;
- }
-
- bool operator!=(IOT that) const {
- return object_ != that;
- }
-
- operator IOT() const {
- return object_;
- }
-
- IOT get() const {
- return object_;
- }
-
- void swap(ScopedIOObject& that) {
- IOT temp = that.object_;
- that.object_ = object_;
- object_ = temp;
- }
-
- IOT release() WARN_UNUSED_RESULT {
- IOT temp = object_;
- object_ = IO_OBJECT_NULL;
- return temp;
- }
-
- private:
- IOT object_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedIOObject);
-};
-
-} // namespace mac
-} // namespace base
-
-#endif // BASE_MAC_SCOPED_IOOBJECT_H_
« no previous file with comments | « base/mac/scoped_cftyperef.h ('k') | base/mac/scoped_ioplugininterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698