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

Side by Side Diff: mojo/edk/embedder/pending_process_connection.cc

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 years, 9 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 | « mojo/edk/embedder/pending_process_connection.h ('k') | mojo/edk/embedder/platform_handle.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/embedder/pending_process_connection.h" 5 #include "mojo/edk/embedder/pending_process_connection.h"
6 6
7 #include "mojo/edk/embedder/embedder.h" 7 #include "mojo/edk/embedder/embedder.h"
8 #include "mojo/edk/embedder/embedder_internal.h" 8 #include "mojo/edk/embedder/embedder_internal.h"
9 #include "mojo/edk/system/core.h" 9 #include "mojo/edk/system/core.h"
10 10
(...skipping 15 matching lines...) Expand all
26 ScopedMessagePipeHandle PendingProcessConnection::CreateMessagePipe( 26 ScopedMessagePipeHandle PendingProcessConnection::CreateMessagePipe(
27 std::string* token) { 27 std::string* token) {
28 has_message_pipes_ = true; 28 has_message_pipes_ = true;
29 DCHECK(internal::g_core); 29 DCHECK(internal::g_core);
30 *token = GenerateRandomToken(); 30 *token = GenerateRandomToken();
31 return internal::g_core->CreateParentMessagePipe(*token, process_token_); 31 return internal::g_core->CreateParentMessagePipe(*token, process_token_);
32 } 32 }
33 33
34 void PendingProcessConnection::Connect( 34 void PendingProcessConnection::Connect(
35 base::ProcessHandle process, 35 base::ProcessHandle process,
36 ScopedPlatformHandle channel, 36 ConnectionParam connection_param,
37 const ProcessErrorCallback& error_callback) { 37 const ProcessErrorCallback& error_callback) {
38 // It's now safe to avoid cleanup in the destructor, as the lifetime of any 38 // It's now safe to avoid cleanup in the destructor, as the lifetime of any
39 // associated resources is effectively bound to the |channel| passed to 39 // associated resources is effectively bound to the |channel| passed to
40 // AddChild() below. 40 // AddChild() below.
41 DCHECK(!connected_); 41 DCHECK(!connected_);
42 connected_ = true; 42 connected_ = true;
43 43
44 DCHECK(internal::g_core); 44 DCHECK(internal::g_core);
45 internal::g_core->AddChild(process, std::move(channel), process_token_, 45 internal::g_core->AddChild(process, std::move(connection_param),
46 error_callback); 46 process_token_, error_callback);
47 } 47 }
48 48
49 } // namespace edk 49 } // namespace edk
50 } // namespace mojo 50 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/pending_process_connection.h ('k') | mojo/edk/embedder/platform_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698