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

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

Issue 1548023002: Clear memory of broker related structs sent over the new Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « no previous file | mojo/edk/system/child_broker_host.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 #include "mojo/edk/system/child_broker.h" 5 #include "mojo/edk/system/child_broker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 sync_channel_lock_.Unlock(); 99 sync_channel_lock_.Unlock();
100 } 100 }
101 } 101 }
102 #endif 102 #endif
103 103
104 void ChildBroker::ConnectMessagePipe(uint64_t pipe_id, 104 void ChildBroker::ConnectMessagePipe(uint64_t pipe_id,
105 MessagePipeDispatcher* message_pipe) { 105 MessagePipeDispatcher* message_pipe) {
106 DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread()); 106 DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
107 107
108 ConnectMessagePipeMessage data; 108 ConnectMessagePipeMessage data;
109 memset(&data, 0, sizeof(data));
109 data.pipe_id = pipe_id; 110 data.pipe_id = pipe_id;
110 if (pending_connects_.find(pipe_id) != pending_connects_.end()) { 111 if (pending_connects_.find(pipe_id) != pending_connects_.end()) {
111 if (!parent_async_channel_) { 112 if (!parent_async_channel_) {
112 // On Windows, we can't create the local RoutedRawChannel yet because we 113 // On Windows, we can't create the local RoutedRawChannel yet because we
113 // don't have parent_sync_channel_. Treat all platforms the same and just 114 // don't have parent_sync_channel_. Treat all platforms the same and just
114 // queue this. 115 // queue this.
115 CHECK(pending_inprocess_connects_.find(pipe_id) == 116 CHECK(pending_inprocess_connects_.find(pipe_id) ==
116 pending_inprocess_connects_.end()); 117 pending_inprocess_connects_.end());
117 pending_inprocess_connects_[pipe_id] = message_pipe; 118 pending_inprocess_connects_[pipe_id] = message_pipe;
118 return; 119 return;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (WriteAndReadResponse(&message, handles, response_size)) { 328 if (WriteAndReadResponse(&message, handles, response_size)) {
328 server->reset(PlatformHandle(handles[0])); 329 server->reset(PlatformHandle(handles[0]));
329 client->reset(PlatformHandle(handles[1])); 330 client->reset(PlatformHandle(handles[1]));
330 } 331 }
331 } 332 }
332 333
333 #endif 334 #endif
334 335
335 } // namespace edk 336 } // namespace edk
336 } // namespace mojo 337 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/child_broker_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698