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

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

Issue 2444793002: Allow custom security descriptors when creating named pipes on Windows. (Closed)
Patch Set: Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_NAMED_PLATFORM_HANDLE_UTILS_H_ 5 #ifndef MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_UTILS_H_
6 #define MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_UTILS_H_ 6 #define MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_UTILS_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "mojo/edk/embedder/scoped_platform_handle.h" 9 #include "mojo/edk/embedder/scoped_platform_handle.h"
10 #include "mojo/edk/system/system_impl_export.h" 10 #include "mojo/edk/system/system_impl_export.h"
11 11
12 #if defined(OS_WIN)
13 #include "base/strings/string16.h"
14 #endif
15
12 namespace mojo { 16 namespace mojo {
13 namespace edk { 17 namespace edk {
14 18
15 struct NamedPlatformHandle; 19 struct NamedPlatformHandle;
16 20
21 struct CreateServerHandleOptions {
22 #if defined(OS_WIN)
23 // If true, creating a server handle will fail if another pipe with the same
24 // name exists.
25 bool enforce_uniqueness = true;
26
27 // If non-empty, a security descriptor to use when creating the pipe. If
28 // empty, a default security descriptor will be used. See
29 // kDefaultSecurityDescriptor in named_platform_handle_utils_win.cc.
30 base::string16 security_descriptor;
31 #endif
32 };
33
17 // Creates a client platform handle from |handle|. This may block until |handle| 34 // Creates a client platform handle from |handle|. This may block until |handle|
18 // is ready to receive connections. 35 // is ready to receive connections.
19 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle 36 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle
20 CreateClientHandle(const NamedPlatformHandle& handle); 37 CreateClientHandle(const NamedPlatformHandle& handle);
21 38
22 // Creates a server platform handle from |handle|. On Windows, if 39 // Creates a server platform handle from |handle|.
23 // |enforce_uniqueness| is true, this will fail if another pipe with the same
24 // name exists. On other platforms, |enforce_uniqueness| must be false.
25 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle 40 MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle
26 CreateServerHandle(const NamedPlatformHandle& handle, bool enforce_uniqueness); 41 CreateServerHandle(const NamedPlatformHandle& handle,
42 const CreateServerHandleOptions& options = {});
27 43
28 } // namespace edk 44 } // namespace edk
29 } // namespace mojo 45 } // namespace mojo
30 46
31 #endif // MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_UTILS_H_ 47 #endif // MOJO_EDK_EMBEDDER_NAMED_PLATFORM_HANDLE_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/edk/embedder/named_platform_channel_pair_win.cc ('k') | mojo/edk/embedder/named_platform_handle_utils_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698