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

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

Issue 1675083002: Rename ApplicationDelegate to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate
Patch Set: . Created 4 years, 10 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/lib/application_delegate.cc ('k') | mojo/shell/public/cpp/lib/application_runner.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 ca149a33d2ac4892c6568d516b5a3919f352aa8c..d51e5aa089cbb1814f6d4bf05e9b0432f1c349f7 100644
--- a/mojo/shell/public/cpp/lib/application_impl.cc
+++ b/mojo/shell/public/cpp/lib/application_impl.cc
@@ -10,9 +10,9 @@
#include "mojo/converters/network/network_type_converters.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
#include "mojo/public/cpp/environment/logging.h"
-#include "mojo/shell/public/cpp/application_delegate.h"
#include "mojo/shell/public/cpp/application_impl.h"
#include "mojo/shell/public/cpp/lib/service_registry.h"
+#include "mojo/shell/public/cpp/shell_client.h"
namespace mojo {
@@ -36,17 +36,17 @@ ApplicationImpl::ConnectParams::ConnectParams(URLRequestPtr request)
ApplicationImpl::ConnectParams::~ConnectParams() {}
ApplicationImpl::ApplicationImpl(
- ApplicationDelegate* delegate,
+ ShellClient* client,
InterfaceRequest<shell::mojom::Application> request)
- : ApplicationImpl(delegate,
+ : ApplicationImpl(client,
std::move(request),
base::Bind(&DefaultTerminationClosure)) {}
ApplicationImpl::ApplicationImpl(
- ApplicationDelegate* delegate,
+ ShellClient* client,
InterfaceRequest<shell::mojom::Application> request,
const Closure& termination_closure)
- : delegate_(delegate),
+ : client_(client),
binding_(this, std::move(request)),
termination_closure_(termination_closure),
app_lifetime_helper_(this),
@@ -62,15 +62,15 @@ void ApplicationImpl::WaitForInitialize() {
binding_.WaitForIncomingMethodCall();
}
-scoped_ptr<ApplicationConnection> ApplicationImpl::ConnectToApplication(
+scoped_ptr<Connection> ApplicationImpl::ConnectToApplication(
const std::string& url) {
ConnectParams params(url);
params.set_filter(CreatePermissiveCapabilityFilter());
return ConnectToApplication(&params);
}
-scoped_ptr<ApplicationConnection>
- ApplicationImpl::ConnectToApplication(ConnectParams* params) {
+scoped_ptr<Connection> ApplicationImpl::ConnectToApplication(
+ ConnectParams* params) {
if (!shell_)
return nullptr;
DCHECK(params);
@@ -118,7 +118,7 @@ void ApplicationImpl::Initialize(shell::mojom::ShellPtr shell,
uint32_t id) {
shell_ = std::move(shell);
shell_.set_connection_error_handler([this]() { OnConnectionError(); });
- delegate_->Initialize(this, url, id);
+ client_->Initialize(this, url, id);
}
void ApplicationImpl::AcceptConnection(
@@ -128,10 +128,10 @@ void ApplicationImpl::AcceptConnection(
ServiceProviderPtr exposed_services,
Array<String> allowed_interfaces,
const String& url) {
- scoped_ptr<ApplicationConnection> registry(new internal::ServiceRegistry(
+ scoped_ptr<Connection> registry(new internal::ServiceRegistry(
url, requestor_url, requestor_id, std::move(exposed_services),
std::move(services), allowed_interfaces.To<std::set<std::string>>()));
- if (!delegate_->AcceptConnection(registry.get()))
+ if (!client_->AcceptConnection(registry.get()))
return;
// If we were quitting because we thought there were no more services for this
@@ -154,11 +154,11 @@ void ApplicationImpl::OnQuitRequested(const Callback<void(bool)>& callback) {
void ApplicationImpl::OnConnectionError() {
base::WeakPtr<ApplicationImpl> ptr(weak_factory_.GetWeakPtr());
- // We give the delegate notice first, since it might want to do something on
+ // We give the client notice first, since it might want to do something on
// shell connection errors other than immediate termination of the run
// loop. The application might want to continue servicing connections other
// than the one to the shell.
- bool quit_now = delegate_->ShellConnectionLost();
+ bool quit_now = client_->ShellConnectionLost();
if (quit_now)
QuitNow();
if (!ptr)
@@ -167,7 +167,7 @@ void ApplicationImpl::OnConnectionError() {
}
void ApplicationImpl::QuitNow() {
- delegate_->Quit();
+ client_->Quit();
termination_closure_.Run();
}
« no previous file with comments | « mojo/shell/public/cpp/lib/application_delegate.cc ('k') | mojo/shell/public/cpp/lib/application_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698