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

Side by Side Diff: mojo/public/system/core_cpp.h

Issue 99913002: Remove "ScopedHandleBase<H>::operator H() const" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « mojo/public/bindings/lib/connector.cc ('k') | mojo/public/tests/system_core_cpp_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MOJO_PUBLIC_SYSTEM_CORE_CPP_H_ 5 #ifndef MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
6 #define MOJO_PUBLIC_SYSTEM_CORE_CPP_H_ 6 #define MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
7 7
8 #include <assert.h> 8 #include <assert.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 16 matching lines...) Expand all
27 ScopedHandleBase() {} 27 ScopedHandleBase() {}
28 ~ScopedHandleBase() { CloseIfNecessary(); } 28 ~ScopedHandleBase() { CloseIfNecessary(); }
29 29
30 // Move-only constructor and operator=. 30 // Move-only constructor and operator=.
31 ScopedHandleBase(RValue other) : handle_(other.object->release()) {} 31 ScopedHandleBase(RValue other) : handle_(other.object->release()) {}
32 ScopedHandleBase& operator=(RValue other) { 32 ScopedHandleBase& operator=(RValue other) {
33 handle_ = other.object->release(); 33 handle_ = other.object->release();
34 return *this; 34 return *this;
35 } 35 }
36 36
37 operator HandleType() const { return handle_; }
38 const HandleType& get() const { return handle_; } 37 const HandleType& get() const { return handle_; }
39 38
40 void swap(ScopedHandleBase& other) { 39 void swap(ScopedHandleBase& other) {
41 handle_.swap(other.handle_); 40 handle_.swap(other.handle_);
42 } 41 }
43 42
44 HandleType release() MOJO_WARN_UNUSED_RESULT { 43 HandleType release() MOJO_WARN_UNUSED_RESULT {
45 HandleType rv; 44 HandleType rv;
46 rv.swap(handle_); 45 rv.swap(handle_);
47 return rv; 46 return rv;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 MojoReadMessageFlags flags) { 207 MojoReadMessageFlags flags) {
209 return MojoReadMessage(message_pipe.value(), 208 return MojoReadMessage(message_pipe.value(),
210 bytes, num_bytes, 209 bytes, num_bytes,
211 handles, num_handles, 210 handles, num_handles,
212 flags); 211 flags);
213 } 212 }
214 213
215 } // namespace mojo 214 } // namespace mojo
216 215
217 #endif // MOJO_PUBLIC_SYSTEM_CORE_CPP_H_ 216 #endif // MOJO_PUBLIC_SYSTEM_CORE_CPP_H_
OLDNEW
« no previous file with comments | « mojo/public/bindings/lib/connector.cc ('k') | mojo/public/tests/system_core_cpp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698