Chromium Code Reviews| Index: mojo/public/cpp/system/core.h |
| diff --git a/mojo/public/cpp/system/core.h b/mojo/public/cpp/system/core.h |
| index 70221107ab0a2d6ee332d461294840c34c601d55..c786453863e9768a8f95b1d5413204c6af656c40 100644 |
| --- a/mojo/public/cpp/system/core.h |
| +++ b/mojo/public/cpp/system/core.h |
| @@ -49,6 +49,12 @@ class ScopedHandleBase { |
| const HandleType& get() const { return handle_; } |
| + template <typename Passed> |
|
viettrungluu
2014/04/03 20:42:48
Nit: Could you call this PassedHandleType?
|
| + static ScopedHandleBase<HandleType> From(ScopedHandleBase<Passed> other) { |
| + return ScopedHandleBase<HandleType>( |
|
viettrungluu
2014/04/03 20:42:48
Please add a comment:
// The |static_cast| here is
|
| + static_cast<HandleType>(other.release().value())); |
|
viettrungluu
2014/04/03 20:42:48
It should be static_cast<HandleType>(other.release
|
| + } |
| + |
| void swap(ScopedHandleBase& other) { |
| handle_.swap(other.handle_); |
| } |