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

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

Issue 2227553002: Support mojo connections between unrelated peer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/embedder.h ('k') | mojo/edk/system/core.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 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 #include "mojo/edk/embedder/embedder.h" 5 #include "mojo/edk/embedder/embedder.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 void SetParentPipeHandleFromCommandLine() { 71 void SetParentPipeHandleFromCommandLine() {
72 ScopedPlatformHandle platform_channel = 72 ScopedPlatformHandle platform_channel =
73 PlatformChannelPair::PassClientHandleFromParentProcess( 73 PlatformChannelPair::PassClientHandleFromParentProcess(
74 *base::CommandLine::ForCurrentProcess()); 74 *base::CommandLine::ForCurrentProcess());
75 CHECK(platform_channel.is_valid()); 75 CHECK(platform_channel.is_valid());
76 SetParentPipeHandle(std::move(platform_channel)); 76 SetParentPipeHandle(std::move(platform_channel));
77 } 77 }
78 78
79 ScopedMessagePipeHandle ConnectToPeerProcess(ScopedPlatformHandle pipe) {
80 CHECK(internal::g_process_delegate);
81 DCHECK(pipe.is_valid());
82 return internal::g_core->ConnectToPeerProcess(std::move(pipe));
83 }
84
79 void Init() { 85 void Init() {
80 MojoSystemThunks thunks = MakeSystemThunks(); 86 MojoSystemThunks thunks = MakeSystemThunks();
81 size_t expected_size = MojoEmbedderSetSystemThunks(&thunks); 87 size_t expected_size = MojoEmbedderSetSystemThunks(&thunks);
82 DCHECK_EQ(expected_size, sizeof(thunks)); 88 DCHECK_EQ(expected_size, sizeof(thunks));
83 89
84 internal::g_core = new Core(); 90 internal::g_core = new Core();
85 } 91 }
86 92
87 void SetDefaultProcessErrorCallback(const ProcessErrorCallback& callback) { 93 void SetDefaultProcessErrorCallback(const ProcessErrorCallback& callback) {
88 internal::g_core->SetDefaultProcessErrorCallback(callback); 94 internal::g_core->SetDefaultProcessErrorCallback(callback);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return base::HexEncode(random_bytes, 16); 175 return base::HexEncode(random_bytes, 16);
170 } 176 }
171 177
172 MojoResult SetProperty(MojoPropertyType type, const void* value) { 178 MojoResult SetProperty(MojoPropertyType type, const void* value) {
173 CHECK(internal::g_core); 179 CHECK(internal::g_core);
174 return internal::g_core->SetProperty(type, value); 180 return internal::g_core->SetProperty(type, value);
175 } 181 }
176 182
177 } // namespace edk 183 } // namespace edk
178 } // namespace mojo 184 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/embedder.h ('k') | mojo/edk/system/core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698