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

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

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
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
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 2769f6efb0c2715f6847d044441db0dcc1dbeab8..ca149a33d2ac4892c6568d516b5a3919f352aa8c 100644
--- a/mojo/shell/public/cpp/lib/application_impl.cc
+++ b/mojo/shell/public/cpp/lib/application_impl.cc
@@ -48,7 +48,6 @@ ApplicationImpl::ApplicationImpl(
const Closure& termination_closure)
: delegate_(delegate),
binding_(this, std::move(request)),
- id_(shell::mojom::Shell::kInvalidApplicationID),
termination_closure_(termination_closure),
app_lifetime_helper_(this),
quit_requested_(false),
@@ -58,6 +57,11 @@ ApplicationImpl::~ApplicationImpl() {
app_lifetime_helper_.OnQuit();
}
+void ApplicationImpl::WaitForInitialize() {
+ DCHECK(!shell_.is_bound());
+ binding_.WaitForIncomingMethodCall();
+}
+
scoped_ptr<ApplicationConnection> ApplicationImpl::ConnectToApplication(
const std::string& url) {
ConnectParams params(url);
@@ -94,11 +98,6 @@ scoped_ptr<ApplicationConnection>
return std::move(registry);
}
-void ApplicationImpl::WaitForInitialize() {
- DCHECK(!shell_.is_bound());
- binding_.WaitForIncomingMethodCall();
-}
-
void ApplicationImpl::Quit() {
// We can't quit immediately, since there could be in-flight requests from the
// shell. So check with it first.
@@ -110,14 +109,16 @@ void ApplicationImpl::Quit() {
}
}
+scoped_ptr<AppRefCount> ApplicationImpl::CreateAppRefCount() {
+ return app_lifetime_helper_.CreateAppRefCount();
+}
+
void ApplicationImpl::Initialize(shell::mojom::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);
+ delegate_->Initialize(this, url, id);
}
void ApplicationImpl::AcceptConnection(
« no previous file with comments | « mojo/shell/public/cpp/lib/application_delegate.cc ('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