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

Unified Diff: services/shell/tests/connect/connect_test_class_app.cc

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
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 side-by-side diff with in-line comments
Download patch
Index: services/shell/tests/connect/connect_test_class_app.cc
diff --git a/services/shell/tests/connect/connect_test_class_app.cc b/services/shell/tests/connect/connect_test_class_app.cc
index b7045b73d404aa698ecffb5208031c9d51e2ac8a..1431e5f52b1c7e8227b6d07fbcf31b11b770d912 100644
--- a/services/shell/tests/connect/connect_test_class_app.cc
+++ b/services/shell/tests/connect/connect_test_class_app.cc
@@ -10,6 +10,7 @@
#include "services/shell/public/c/main.h"
#include "services/shell/public/cpp/connector.h"
#include "services/shell/public/cpp/interface_factory.h"
+#include "services/shell/public/cpp/interface_registry.h"
#include "services/shell/public/cpp/service.h"
#include "services/shell/public/cpp/service_runner.h"
#include "services/shell/public/interfaces/connector.mojom.h"
@@ -34,13 +35,14 @@ class ConnectTestClassApp
void OnStart(const Identity& identity) override {
identity_ = identity;
}
- bool OnConnect(Connection* connection) override {
- connection->AddInterface<test::mojom::ConnectTestService>(this);
- connection->AddInterface<test::mojom::ClassInterface>(this);
- inbound_connections_.insert(connection);
- connection->SetConnectionLostClosure(
+ bool OnConnect(const Identity& remote_identity,
+ InterfaceRegistry* registry) override {
+ registry->AddInterface<test::mojom::ConnectTestService>(this);
+ registry->AddInterface<test::mojom::ClassInterface>(this);
+ inbound_connections_.insert(registry);
+ registry->SetConnectionLostClosure(
base::Bind(&ConnectTestClassApp::OnConnectionError,
- base::Unretained(this), connection));
+ base::Unretained(this), registry));
return true;
}
@@ -69,8 +71,8 @@ class ConnectTestClassApp
callback.Run("PONG");
}
- void OnConnectionError(Connection* connection) {
- auto it = inbound_connections_.find(connection);
+ void OnConnectionError(InterfaceRegistry* registry) {
+ auto it = inbound_connections_.find(registry);
DCHECK(it != inbound_connections_.end());
inbound_connections_.erase(it);
if (inbound_connections_.empty())
@@ -78,7 +80,7 @@ class ConnectTestClassApp
}
Identity identity_;
- std::set<Connection*> inbound_connections_;
+ std::set<InterfaceRegistry*> inbound_connections_;
mojo::BindingSet<test::mojom::ConnectTestService> bindings_;
mojo::BindingSet<test::mojom::ClassInterface> class_interface_bindings_;
« no previous file with comments | « services/shell/tests/connect/connect_test_app.cc ('k') | services/shell/tests/connect/connect_test_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698