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

Unified Diff: services/shell/public/cpp/lib/shell_connection.cc

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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: services/shell/public/cpp/lib/shell_connection.cc
diff --git a/services/shell/public/cpp/lib/shell_connection.cc b/services/shell/public/cpp/lib/shell_connection.cc
index 53e85917cee34afc0c4505bb72a7c61d05f98218..c72f9732fdfabe516b47f66d3fc311813767eba7 100644
--- a/services/shell/public/cpp/lib/shell_connection.cc
+++ b/services/shell/public/cpp/lib/shell_connection.cc
@@ -10,7 +10,6 @@
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "services/shell/public/cpp/capabilities.h"
-#include "services/shell/public/cpp/connector.h"
#include "services/shell/public/cpp/lib/connection_impl.h"
#include "services/shell/public/cpp/lib/connector_impl.h"
#include "services/shell/public/cpp/shell_client.h"
@@ -21,11 +20,16 @@ namespace shell {
// ShellConnection, public:
ShellConnection::ShellConnection(shell::ShellClient* client,
- mojom::ShellClientRequest request)
- : client_(client), binding_(this) {
- mojom::ConnectorPtr connector;
- pending_connector_request_ = GetProxy(&connector);
- connector_.reset(new ConnectorImpl(std::move(connector)));
+ mojom::ShellClientRequest request,
+ std::unique_ptr<Connector> connector,
+ mojom::ConnectorRequest connector_request)
+ : pending_connector_request_(std::move(connector_request)),
+ client_(client), binding_(this), connector_(std::move(connector)) {
+ if (!connector_) {
+ connector_ = Connector::Create(&pending_connector_request_);
+ } else {
+ DCHECK(pending_connector_request_.is_pending());
+ }
DCHECK(request.is_pending());
binding_.Bind(std::move(request));

Powered by Google App Engine
This is Rietveld 408576698