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

Unified Diff: content/common/mojo/mojo_shell_connection_impl.cc

Issue 1780973004: Kill ShellConnection::WaitForInitialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fuse-api
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 side-by-side diff with in-line comments
Download patch
Index: content/common/mojo/mojo_shell_connection_impl.cc
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc
index 839e206abcf42ab7aac256c581a94c2fcdfed34d..df4aa98b399d4daec5ad5acb70b141019dc4d11c 100644
--- a/content/common/mojo/mojo_shell_connection_impl.cc
+++ b/content/common/mojo/mojo_shell_connection_impl.cc
@@ -50,7 +50,6 @@ void MojoShellConnectionImpl::Create(
connection->shell_connection_.reset(
new mojo::ShellConnection(connection, std::move(request)));
- connection->shell_connection_->WaitForInitialize();
}
// static
@@ -60,26 +59,22 @@ MojoShellConnectionImpl* MojoShellConnectionImpl::Get() {
void MojoShellConnectionImpl::BindToCommandLinePlatformChannel() {
DCHECK(IsRunningInMojoShell());
- if (initialized_)
- return;
- WaitForShell(mojo::ScopedMessagePipeHandle());
+ ConnectToShell(mojo::ScopedMessagePipeHandle());
}
void MojoShellConnectionImpl::BindToMessagePipe(
mojo::ScopedMessagePipeHandle handle) {
- if (initialized_)
- return;
- WaitForShell(std::move(handle));
+ ConnectToShell(std::move(handle));
}
-MojoShellConnectionImpl::MojoShellConnectionImpl(bool external) :
- external_(external), initialized_(false) {}
+MojoShellConnectionImpl::MojoShellConnectionImpl(bool external)
+ : external_(external) {}
MojoShellConnectionImpl::~MojoShellConnectionImpl() {
STLDeleteElements(&listeners_);
}
-void MojoShellConnectionImpl::WaitForShell(
+void MojoShellConnectionImpl::ConnectToShell(
mojo::ScopedMessagePipeHandle handle) {
mojo::shell::mojom::ShellClientRequest request;
runner_connection_.reset(mojo::shell::RunnerConnection::ConnectToRunner(
@@ -91,13 +86,11 @@ void MojoShellConnectionImpl::WaitForShell(
return;
}
shell_connection_.reset(new mojo::ShellConnection(this, std::move(request)));
- shell_connection_->WaitForInitialize();
}
void MojoShellConnectionImpl::Initialize(mojo::Connector* connector,
const mojo::Identity& identity,
uint32_t id) {
- initialized_ = true;
}
bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) {
@@ -108,7 +101,6 @@ bool MojoShellConnectionImpl::AcceptConnection(mojo::Connection* connection) {
}
mojo::Connector* MojoShellConnectionImpl::GetConnector() {
- DCHECK(initialized_);
return shell_connection_->connector();
}
« no previous file with comments | « content/common/mojo/mojo_shell_connection_impl.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