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

Unified Diff: mojo/shell/public/cpp/lib/application_impl.cc

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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/public/cpp/application_impl.h ('k') | mojo/shell/public/cpp/lib/application_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/application_impl.cc
diff --git a/mojo/shell/public/cpp/lib/application_impl.cc b/mojo/shell/public/cpp/lib/application_impl.cc
index e48483f26a8cd0e7dae707465e71d6305c0d41f4..18918d5189a9a89ae825ce9cf75b20f269372220 100644
--- a/mojo/shell/public/cpp/lib/application_impl.cc
+++ b/mojo/shell/public/cpp/lib/application_impl.cc
@@ -45,6 +45,7 @@ ApplicationImpl::ApplicationImpl(ApplicationDelegate* delegate,
const Closure& termination_closure)
: delegate_(delegate),
binding_(this, std::move(request)),
+ id_(Shell::kInvalidApplicationID),
termination_closure_(termination_closure),
app_lifetime_helper_(this),
quit_requested_(false),
@@ -80,8 +81,8 @@ scoped_ptr<ApplicationConnection>
InterfaceRequest<ServiceProvider> remote_services_proxy =
GetProxy(&remote_services);
scoped_ptr<internal::ServiceRegistry> registry(new internal::ServiceRegistry(
- application_url, application_url, std::move(remote_services),
- std::move(local_request), allowed));
+ application_url, application_url, Shell::kInvalidApplicationID,
+ std::move(remote_services), std::move(local_request), allowed));
shell_->ConnectToApplication(std::move(request),
std::move(remote_services_proxy),
std::move(local_services), params->TakeFilter(),
@@ -107,22 +108,26 @@ void ApplicationImpl::Quit() {
}
}
-void ApplicationImpl::Initialize(ShellPtr shell, const mojo::String& url) {
+void ApplicationImpl::Initialize(ShellPtr shell,
+ const mojo::String& url,
+ uint32_t id) {
shell_ = std::move(shell);
shell_.set_connection_error_handler([this]() { OnConnectionError(); });
url_ = url;
+ id_ = id;
delegate_->Initialize(this);
}
void ApplicationImpl::AcceptConnection(
const String& requestor_url,
+ uint32_t requestor_id,
InterfaceRequest<ServiceProvider> services,
ServiceProviderPtr exposed_services,
Array<String> allowed_interfaces,
const String& url) {
scoped_ptr<ApplicationConnection> registry(new internal::ServiceRegistry(
- url, requestor_url, std::move(exposed_services), std::move(services),
- allowed_interfaces.To<std::set<std::string>>()));
+ url, requestor_url, requestor_id, std::move(exposed_services),
+ std::move(services), allowed_interfaces.To<std::set<std::string>>()));
if (!delegate_->ConfigureIncomingConnection(registry.get()))
return;
« no previous file with comments | « mojo/shell/public/cpp/application_impl.h ('k') | mojo/shell/public/cpp/lib/application_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698