| OLD | NEW |
| 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 #include "mojo/shell/scoped_message_pipe.h" | 5 #include "mojo/common/scoped_message_pipe.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 namespace shell { | 8 namespace common { |
| 9 | 9 |
| 10 ScopedMessagePipe::ScopedMessagePipe() | 10 ScopedMessagePipe::ScopedMessagePipe() |
| 11 : handle_0_(MOJO_HANDLE_INVALID), | 11 : handle_0_(MOJO_HANDLE_INVALID), |
| 12 handle_1_(MOJO_HANDLE_INVALID) { | 12 handle_1_(MOJO_HANDLE_INVALID) { |
| 13 MojoCreateMessagePipe(&handle_0_, &handle_1_); | 13 MojoCreateMessagePipe(&handle_0_, &handle_1_); |
| 14 } | 14 } |
| 15 | 15 |
| 16 ScopedMessagePipe::~ScopedMessagePipe() { | 16 ScopedMessagePipe::~ScopedMessagePipe() { |
| 17 if (handle_0_ != MOJO_HANDLE_INVALID) | 17 if (handle_0_ != MOJO_HANDLE_INVALID) |
| 18 MojoClose(handle_0_); | 18 MojoClose(handle_0_); |
| 19 | 19 |
| 20 if (handle_1_ != MOJO_HANDLE_INVALID) | 20 if (handle_1_ != MOJO_HANDLE_INVALID) |
| 21 MojoClose(handle_1_); | 21 MojoClose(handle_1_); |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // namespace shell | 24 } // namespace common |
| 25 } // namespace mojo | 25 } // namespace mojo |
| OLD | NEW |