Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 IPC_IPC_CHANNEL_HANDLE_H_ | 5 #ifndef IPC_IPC_CHANNEL_HANDLE_H_ |
| 6 #define IPC_IPC_CHANNEL_HANDLE_H_ | 6 #define IPC_IPC_CHANNEL_HANDLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 // to work on both Windows and POSIX. | 25 // to work on both Windows and POSIX. |
| 26 | 26 |
| 27 namespace IPC { | 27 namespace IPC { |
| 28 | 28 |
| 29 struct ChannelHandle { | 29 struct ChannelHandle { |
| 30 // Note that serialization for this object is defined in the ParamTraits | 30 // Note that serialization for this object is defined in the ParamTraits |
| 31 // template specialization in ipc_message_utils.h. | 31 // template specialization in ipc_message_utils.h. |
| 32 std::string name; | 32 std::string name; |
| 33 #if defined(OS_POSIX) | 33 #if defined(OS_POSIX) |
| 34 base::FileDescriptor socket; | 34 base::FileDescriptor socket; |
| 35 #endif | 35 #endif // defined(OS_POSIX) |
| 36 | 36 |
| 37 ChannelHandle() {} | 37 ChannelHandle() {} |
|
agl
2010/12/08 15:38:57
Constructors are typically first in a class/struct
| |
| 38 #if defined(OS_POSIX) | 38 #if defined(OS_POSIX) |
| 39 ChannelHandle(const std::string& n, const base::FileDescriptor& s) | 39 ChannelHandle(const std::string& n, const base::FileDescriptor& s) |
| 40 : name(n), socket(s) {} | 40 : name(n), socket(s) {} |
| 41 #else | 41 #endif // defined(OS_POSIX) |
| 42 ChannelHandle(const std::string& n) : name(n) {} | 42 ChannelHandle(const std::string& n) : name(n) {} |
| 43 #endif | 43 ChannelHandle(const char* n) : name(n) {} |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 } // namespace IPC | 46 } // namespace IPC |
| 47 | 47 |
| 48 #endif // IPC_IPC_CHANNEL_HANDLE_H_ | 48 #endif // IPC_IPC_CHANNEL_HANDLE_H_ |
| OLD | NEW |