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

Side by Side Diff: mojo/edk/system/child_broker.h

Issue 1524333002: Fix race condition with multiplexed message pipes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « mojo/edk/system/broker_state.cc ('k') | mojo/edk/system/child_broker.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_SYSTEM_CHILD_BROKER_H_ 5 #ifndef MOJO_EDK_SYSTEM_CHILD_BROKER_H_
6 #define MOJO_EDK_SYSTEM_CHILD_BROKER_H_ 6 #define MOJO_EDK_SYSTEM_CHILD_BROKER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // Callback for when a RoutedRawChannel is destroyed for cleanup. 64 // Callback for when a RoutedRawChannel is destroyed for cleanup.
65 void ChannelDestructed(RoutedRawChannel* channel); 65 void ChannelDestructed(RoutedRawChannel* channel);
66 66
67 // Sends a message over |parent_async_channel_|, queueing it if necessary. 67 // Sends a message over |parent_async_channel_|, queueing it if necessary.
68 void WriteAsyncMessage(scoped_ptr<MessageInTransit> message); 68 void WriteAsyncMessage(scoped_ptr<MessageInTransit> message);
69 69
70 // Initializes |parent_async_channel_|. 70 // Initializes |parent_async_channel_|.
71 void InitAsyncChannel(ScopedPlatformHandle parent_async_channel_handle); 71 void InitAsyncChannel(ScopedPlatformHandle parent_async_channel_handle);
72 72
73 // Helper method to connect the given MessagePipe to the channel.
74 void AttachMessagePipe(MessagePipeDispatcher* message_pipe,
75 uint64_t pipe_id,
76 RoutedRawChannel* raw_channel);
77
73 #if defined(OS_WIN) 78 #if defined(OS_WIN)
74 // Helper method to write the given message and read back the result. 79 // Helper method to write the given message and read back the result.
75 bool WriteAndReadResponse(BrokerMessage* message, 80 bool WriteAndReadResponse(BrokerMessage* message,
76 void* response, 81 void* response,
77 uint32_t response_size); 82 uint32_t response_size);
78 83
79 void CreatePlatformChannelPairNoLock(ScopedPlatformHandle* server, 84 void CreatePlatformChannelPairNoLock(ScopedPlatformHandle* server,
80 ScopedPlatformHandle* client); 85 ScopedPlatformHandle* client);
81 86
82 // Guards access to |parent_sync_channel_|. 87 // Guards access to |parent_sync_channel_|.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 RoutedRawChannel* in_process_pipes_channel1_; 139 RoutedRawChannel* in_process_pipes_channel1_;
135 RoutedRawChannel* in_process_pipes_channel2_; 140 RoutedRawChannel* in_process_pipes_channel2_;
136 141
137 DISALLOW_COPY_AND_ASSIGN(ChildBroker); 142 DISALLOW_COPY_AND_ASSIGN(ChildBroker);
138 }; 143 };
139 144
140 } // namespace edk 145 } // namespace edk
141 } // namespace mojo 146 } // namespace mojo
142 147
143 #endif // MOJO_EDK_SYSTEM_CHILD_BROKER_H_ 148 #endif // MOJO_EDK_SYSTEM_CHILD_BROKER_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/broker_state.cc ('k') | mojo/edk/system/child_broker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698