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

Side by Side Diff: chrome/common/ipc_channel_handle.h

Issue 155905: Separates ipc code from common (http://crbug.com/16829) (Closed)
Patch Set: Fixes reference to 'common_message_traits' it's actually 'common_param_traits' Created 11 years, 5 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 | « chrome/common/ipc_channel.h ('k') | chrome/common/ipc_channel_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_IPC_CHANNEL_HANDLE_H_
6 #define CHROME_COMMON_IPC_CHANNEL_HANDLE_H_
7
8 #include "build/build_config.h"
9
10 #if defined(OS_POSIX)
11 #include "base/file_descriptor_posix.h"
12 #endif
13
14 // On Windows, any process can create an IPC channel and others can fetch
15 // it by name. We pass around the channel names over IPC.
16 // On POSIX, we instead pass around handles to channel endpoints via IPC.
17 // When it's time to IPC a new channel endpoint around, we send both the
18 // channel name as well as a base::FileDescriptor, which is itself a special
19 // type that knows how to copy a socket endpoint over IPC.
20 //
21 // In sum, when passing a handle to a channel over IPC, use this data structure
22 // to work on both Windows and POSIX.
23
24 namespace IPC {
25
26 struct ChannelHandle {
27 // Note that serialization for this object is defined in the ParamTraits
28 // template specialization in ipc_message_utils.h.
29 std::string name;
30 #if defined(OS_POSIX)
31 base::FileDescriptor socket;
32 #endif
33
34 ChannelHandle() {}
35 #if defined(OS_POSIX)
36 ChannelHandle(const std::string& n, const base::FileDescriptor& s)
37 : name(n), socket(s) {}
38 #else
39 ChannelHandle(const std::string& n) : name(n) {}
40 #endif
41 };
42
43 } // namespace IPC
44
45 #endif // CHROME_COMMON_IPC_CHANNEL_HANDLE_H_
OLDNEW
« no previous file with comments | « chrome/common/ipc_channel.h ('k') | chrome/common/ipc_channel_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698