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

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

Issue 1793793002: Remove ShellConnection::WaitForInitialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/embedder.h ('k') | mojo/shell/background/tests/background_shell_unittest.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 #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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ScopedPlatformHandle server_pipe) { 47 ScopedPlatformHandle server_pipe) {
48 CHECK(internal::g_core); 48 CHECK(internal::g_core);
49 internal::g_core->AddChild(child_process, std::move(server_pipe)); 49 internal::g_core->AddChild(child_process, std::move(server_pipe));
50 } 50 }
51 51
52 void SetParentPipeHandle(ScopedPlatformHandle pipe) { 52 void SetParentPipeHandle(ScopedPlatformHandle pipe) {
53 CHECK(internal::g_core); 53 CHECK(internal::g_core);
54 internal::g_core->InitChild(std::move(pipe)); 54 internal::g_core->InitChild(std::move(pipe));
55 } 55 }
56 56
57 void SetParentPipeHandleFromCommandLine() {
58 ScopedPlatformHandle platform_channel =
59 PlatformChannelPair::PassClientHandleFromParentProcess(
60 *base::CommandLine::ForCurrentProcess());
61 if (platform_channel.is_valid())
62 SetParentPipeHandle(std::move(platform_channel));
63 }
64
57 void Init() { 65 void Init() {
58 internal::g_core = new Core(); 66 internal::g_core = new Core();
59 } 67 }
60 68
61 MojoResult AsyncWait(MojoHandle handle, 69 MojoResult AsyncWait(MojoHandle handle,
62 MojoHandleSignals signals, 70 MojoHandleSignals signals,
63 const base::Callback<void(MojoResult)>& callback) { 71 const base::Callback<void(MojoResult)>& callback) {
64 CHECK(internal::g_core); 72 CHECK(internal::g_core);
65 return internal::g_core->AsyncWait(handle, signals, callback); 73 return internal::g_core->AsyncWait(handle, signals, callback);
66 } 74 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 136 }
129 137
130 std::string GenerateRandomToken() { 138 std::string GenerateRandomToken() {
131 char random_bytes[16]; 139 char random_bytes[16];
132 crypto::RandBytes(random_bytes, 16); 140 crypto::RandBytes(random_bytes, 16);
133 return base::HexEncode(random_bytes, 16); 141 return base::HexEncode(random_bytes, 16);
134 } 142 }
135 143
136 } // namespace edk 144 } // namespace edk
137 } // namespace mojo 145 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/embedder.h ('k') | mojo/shell/background/tests/background_shell_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698