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

Unified Diff: content/child/mojo/mojo_application.cc

Issue 1585493002: [mojo] Ports EDK (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
Index: content/child/mojo/mojo_application.cc
diff --git a/content/child/mojo/mojo_application.cc b/content/child/mojo/mojo_application.cc
index cfa0e435aca810aefb22ba11b20698190ef54f79..fd0260d69fabcf44de3cdf9ff9ba4b547f8a1baf 100644
--- a/content/child/mojo/mojo_application.cc
+++ b/content/child/mojo/mojo_application.cc
@@ -18,7 +18,8 @@ namespace content {
MojoApplication::MojoApplication(
scoped_refptr<base::SequencedTaskRunner> io_task_runner)
- : io_task_runner_(io_task_runner) {
+ : io_task_runner_(io_task_runner),
+ weak_factory_(this) {
DCHECK(io_task_runner_);
}
@@ -42,13 +43,17 @@ void MojoApplication::OnActivate(
base::PlatformFile handle = file;
#endif
- mojo::ScopedMessagePipeHandle message_pipe =
- channel_init_.Init(handle, io_task_runner_);
- DCHECK(message_pipe.is_valid());
+ channel_init_.Init(handle, io_task_runner_,
+ base::Bind(&MojoApplication::OnMessagePipeCreated,
+ weak_factory_.GetWeakPtr()));
+}
+
+void MojoApplication::OnMessagePipeCreated(mojo::ScopedMessagePipeHandle pipe) {
+ DCHECK(pipe.is_valid());
ApplicationSetupPtr application_setup;
application_setup.Bind(
- mojo::InterfacePtrInfo<ApplicationSetup>(std::move(message_pipe), 0u));
+ mojo::InterfacePtrInfo<ApplicationSetup>(std::move(pipe), 0u));
mojo::ServiceProviderPtr services;
mojo::ServiceProviderPtr exposed_services;

Powered by Google App Engine
This is Rietveld 408576698