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

Side by Side Diff: dbus/file_descriptor.h

Issue 1867253002: Convert //dbus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixes in //device Created 4 years, 8 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 | « dbus/exported_object.cc ('k') | dbus/message.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) 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 #ifndef DBUS_FILE_DESCRIPTOR_H_ 5 #ifndef DBUS_FILE_DESCRIPTOR_H_
6 #define DBUS_FILE_DESCRIPTOR_H_ 6 #define DBUS_FILE_DESCRIPTOR_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include <memory>
9
9 #include "base/move.h" 10 #include "base/move.h"
10 #include "dbus/dbus_export.h" 11 #include "dbus/dbus_export.h"
11 12
12 namespace dbus { 13 namespace dbus {
13 14
14 // FileDescriptor is a type used to encapsulate D-Bus file descriptors 15 // FileDescriptor is a type used to encapsulate D-Bus file descriptors
15 // and to follow the RAII idiom appropiate for use with message operations 16 // and to follow the RAII idiom appropiate for use with message operations
16 // where the descriptor might be easily leaked. To guard against this the 17 // where the descriptor might be easily leaked. To guard against this the
17 // descriptor is closed when an instance is destroyed if it is owned. 18 // descriptor is closed when an instance is destroyed if it is owned.
18 // Ownership is asserted only when PutValue is used and TakeValue can be 19 // Ownership is asserted only when PutValue is used and TakeValue can be
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 78
78 private: 79 private:
79 void Swap(FileDescriptor* other); 80 void Swap(FileDescriptor* other);
80 81
81 int value_; 82 int value_;
82 bool owner_; 83 bool owner_;
83 bool valid_; 84 bool valid_;
84 }; 85 };
85 86
86 using ScopedFileDescriptor = 87 using ScopedFileDescriptor =
87 scoped_ptr<FileDescriptor, FileDescriptor::Deleter>; 88 std::unique_ptr<FileDescriptor, FileDescriptor::Deleter>;
88 89
89 } // namespace dbus 90 } // namespace dbus
90 91
91 #endif // DBUS_FILE_DESCRIPTOR_H_ 92 #endif // DBUS_FILE_DESCRIPTOR_H_
OLDNEW
« no previous file with comments | « dbus/exported_object.cc ('k') | dbus/message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698