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

Side by Side Diff: mojo/embedder/platform_handle_vector.h

Issue 292983007: Mojo: Make PlatformChannelRecvmsg() append handles to a deque instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « mojo/embedder/platform_handle_utils.h ('k') | mojo/embedder/platform_handle_vector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_ 5 #ifndef MOJO_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_
6 #define MOJO_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_ 6 #define MOJO_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "mojo/embedder/platform_handle.h" 11 #include "mojo/embedder/platform_handle.h"
12 #include "mojo/embedder/platform_handle_utils.h"
12 #include "mojo/system/system_impl_export.h" 13 #include "mojo/system/system_impl_export.h"
13 14
14 namespace mojo { 15 namespace mojo {
15 namespace embedder { 16 namespace embedder {
16 17
17 typedef std::vector<PlatformHandle> PlatformHandleVector; 18 typedef std::vector<PlatformHandle> PlatformHandleVector;
18 19
19 MOJO_SYSTEM_IMPL_EXPORT void CloseAllHandles(
20 PlatformHandleVector* platform_handles);
21
22 // A deleter (for use with |scoped_ptr|) which closes all handles and then 20 // A deleter (for use with |scoped_ptr|) which closes all handles and then
23 // |delete|s the |PlatformHandleVector|. 21 // |delete|s the |PlatformHandleVector|.
24 struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandleVectorDeleter { 22 struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandleVectorDeleter {
25 void operator()(PlatformHandleVector* platform_handles) const { 23 void operator()(PlatformHandleVector* platform_handles) const {
26 CloseAllHandles(platform_handles); 24 CloseAllPlatformHandles(platform_handles);
27 delete platform_handles; 25 delete platform_handles;
28 } 26 }
29 }; 27 };
30 28
31 typedef scoped_ptr<PlatformHandleVector, PlatformHandleVectorDeleter> 29 typedef scoped_ptr<PlatformHandleVector, PlatformHandleVectorDeleter>
32 ScopedPlatformHandleVectorPtr; 30 ScopedPlatformHandleVectorPtr;
33 31
34 } // namespace embedder 32 } // namespace embedder
35 } // namespace mojo 33 } // namespace mojo
36 34
37 #endif // MOJO_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_ 35 #endif // MOJO_EMBEDDER_PLATFORM_HANDLE_VECTOR_H_
OLDNEW
« no previous file with comments | « mojo/embedder/platform_handle_utils.h ('k') | mojo/embedder/platform_handle_vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698