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

Unified Diff: mojo/shell/public/cpp/lib/shell_connection.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
« no previous file with comments | « mojo/shell/background/tests/background_shell_unittest.cc ('k') | mojo/shell/public/cpp/lib/shell_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/shell_connection.cc
diff --git a/mojo/shell/public/cpp/lib/shell_connection.cc b/mojo/shell/public/cpp/lib/shell_connection.cc
index 2e2a7ec9b4f2170134506bc5bc446454aefaab72..214a822c9601d290da1db132ad1a66cd2ba584aa 100644
--- a/mojo/shell/public/cpp/lib/shell_connection.cc
+++ b/mojo/shell/public/cpp/lib/shell_connection.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/shell/public/cpp/capabilities.h"
#include "mojo/shell/public/cpp/connector.h"
#include "mojo/shell/public/cpp/lib/connection_impl.h"
@@ -23,22 +24,24 @@ ShellConnection::ShellConnection(
InterfaceRequest<shell::mojom::ShellClient> request)
: client_(client),
binding_(this, std::move(request)),
- weak_factory_(this) {}
+ weak_factory_(this) {
+ shell::mojom::ConnectorPtr connector;
+ pending_connector_request_ = GetProxy(&connector);
+ connector_.reset(new ConnectorImpl(std::move(connector)));
+}
ShellConnection::~ShellConnection() {}
-void ShellConnection::WaitForInitialize() {
- DCHECK(!connector_);
- binding_.WaitForIncomingMethodCall();
-}
-
////////////////////////////////////////////////////////////////////////////////
// ShellConnection, shell::mojom::ShellClient implementation:
void ShellConnection::Initialize(shell::mojom::ConnectorPtr connector,
shell::mojom::IdentityPtr identity,
uint32_t id) {
- connector_.reset(new ConnectorImpl(std::move(connector)));
+ CHECK(pending_connector_request_.is_pending());
+ CHECK(FuseInterface(std::move(pending_connector_request_),
+ connector.PassInterface()));
+
binding_.set_connection_error_handler(
base::Bind(&ShellConnection::OnConnectionError,
weak_factory_.GetWeakPtr()));
« no previous file with comments | « mojo/shell/background/tests/background_shell_unittest.cc ('k') | mojo/shell/public/cpp/lib/shell_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698