summaryrefslogtreecommitdiffstats
path: root/mojo/edk/embedder/platform_handle_vector.h
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-10-02 14:01:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-02 21:02:13 +0000
commit76bcf0c21e332c08ee7a1601d0c878d1c75541a0 (patch)
tree9a1070172b98a5c0775967858a07d55585751839 /mojo/edk/embedder/platform_handle_vector.h
parentbe81c48e3a52a050a6d07d0eb558a41c02594e6e (diff)
downloadchromium_src-76bcf0c21e332c08ee7a1601d0c878d1c75541a0.zip
chromium_src-76bcf0c21e332c08ee7a1601d0c878d1c75541a0.tar.gz
chromium_src-76bcf0c21e332c08ee7a1601d0c878d1c75541a0.tar.bz2
Add a Mojo EDK for Chrome that uses one OS pipe per message pipe.
TODOs in future cls: -POSIX -use shared memory for MessagePipeDispatcher serialization -work in Windows sandbox (using master.mojom which is implemented but not hooked up in this change) -XP BUG=478251 NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1350023003 Cr-Commit-Position: refs/heads/master@{#352123}
Diffstat (limited to 'mojo/edk/embedder/platform_handle_vector.h')
-rw-r--r--mojo/edk/embedder/platform_handle_vector.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/mojo/edk/embedder/platform_handle_vector.h b/mojo/edk/embedder/platform_handle_vector.h
new file mode 100644
index 0000000..2bea729
--- /dev/null
+++ b/mojo/edk/embedder/platform_handle_vector.h
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_
+#define MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_
+
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "mojo/edk/embedder/platform_handle.h"
+#include "mojo/edk/embedder/platform_handle_utils.h"
+#include "mojo/edk/system/system_impl_export.h"
+
+namespace mojo {
+namespace edk {
+
+using PlatformHandleVector = std::vector<PlatformHandle>;
+
+// A deleter (for use with |scoped_ptr|) which closes all handles and then
+// |delete|s the |PlatformHandleVector|.
+struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandleVectorDeleter {
+ void operator()(PlatformHandleVector* platform_handles) const {
+ CloseAllPlatformHandles(platform_handles);
+ delete platform_handles;
+ }
+};
+
+using ScopedPlatformHandleVectorPtr =
+ scoped_ptr<PlatformHandleVector, PlatformHandleVectorDeleter>;
+
+} // namespace edk
+} // namespace mojo
+
+#endif // MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_