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

Side by Side Diff: mojo/edk/embedder/platform_channel_pair.h

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 5 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
6 #define MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 6 #define MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/process/launch.h" 11 #include "base/process/launch.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "mojo/edk/embedder/scoped_platform_handle.h" 13 #include "mojo/edk/embedder/scoped_platform_handle.h"
14 #include "mojo/edk/system/system_impl_export.h" 14 #include "mojo/edk/system/system_impl_export.h"
15 15
16 namespace base { 16 namespace base {
17 class CommandLine; 17 class CommandLine;
18 } 18 }
19 19
20 namespace mojo { 20 namespace mojo {
21 namespace edk { 21 namespace edk {
22 22
23 // It would be nice to refactor base/process/launch.h to have a more platform- 23 // It would be nice to refactor base/process/launch.h to have a more platform-
24 // independent way of representing handles that are passed to child processes. 24 // independent way of representing handles that are passed to child processes.
25 #if defined(OS_WIN) 25 #if defined(OS_WIN)
26 using HandlePassingInformation = base::HandlesToInheritVector; 26 using HandlePassingInformation = std::vector<HANDLE>;
27 #elif defined(OS_POSIX) 27 #elif defined(OS_POSIX)
28 using HandlePassingInformation = base::FileHandleMappingVector; 28 using HandlePassingInformation = base::FileHandleMappingVector;
29 #else 29 #else
30 #error "Unsupported." 30 #error "Unsupported."
31 #endif 31 #endif
32 32
33 // This is used to create a pair of |PlatformHandle|s that are connected by a 33 // This is used to create a pair of |PlatformHandle|s that are connected by a
34 // suitable (platform-specific) bidirectional "pipe" (e.g., socket on POSIX, 34 // suitable (platform-specific) bidirectional "pipe" (e.g., socket on POSIX,
35 // named pipe on Windows). The resulting handles can then be used in the same 35 // named pipe on Windows). The resulting handles can then be used in the same
36 // process (e.g., in tests) or between processes. (The "server" handle is the 36 // process (e.g., in tests) or between processes. (The "server" handle is the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 ScopedPlatformHandle server_handle_; 97 ScopedPlatformHandle server_handle_;
98 ScopedPlatformHandle client_handle_; 98 ScopedPlatformHandle client_handle_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair); 100 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair);
101 }; 101 };
102 102
103 } // namespace edk 103 } // namespace edk
104 } // namespace mojo 104 } // namespace mojo
105 105
106 #endif // MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ 106 #endif // MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698