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

Side by Side Diff: mojo/shell/runner/host/out_of_process_native_runner.cc

Issue 1746263003: Clean up MojoShellConnection in render processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2664
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « mojo/shell/runner/host/child_process_host.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/shell/runner/host/out_of_process_native_runner.h" 5 #include "mojo/shell/runner/host/out_of_process_native_runner.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 void OutOfProcessNativeRunner::AppCompleted(int32_t result) { 61 void OutOfProcessNativeRunner::AppCompleted(int32_t result) {
62 DVLOG(2) << "OutOfProcessNativeRunner::AppCompleted(" << result << ")"; 62 DVLOG(2) << "OutOfProcessNativeRunner::AppCompleted(" << result << ")";
63 63
64 if (child_process_host_) 64 if (child_process_host_)
65 child_process_host_->Join(); 65 child_process_host_->Join();
66 child_process_host_.reset(); 66 child_process_host_.reset();
67 // This object may be deleted by this callback. 67 // This object may be deleted by this callback.
68 base::Closure app_completed_callback = app_completed_callback_; 68 base::Closure app_completed_callback = app_completed_callback_;
69 app_completed_callback_.Reset(); 69 app_completed_callback_.Reset();
70 app_completed_callback.Run(); 70 if (!app_completed_callback.is_null())
71 app_completed_callback.Run();
71 } 72 }
72 73
73 void OutOfProcessNativeRunner::OnProcessLaunched( 74 void OutOfProcessNativeRunner::OnProcessLaunched(
74 InterfaceRequest<mojom::ShellClient> request, 75 InterfaceRequest<mojom::ShellClient> request,
75 const base::Callback<void(base::ProcessId)>& pid_available_callback, 76 const base::Callback<void(base::ProcessId)>& pid_available_callback,
76 base::ProcessId pid) { 77 base::ProcessId pid) {
77 DCHECK(child_process_host_); 78 DCHECK(child_process_host_);
78 child_process_host_->StartApp( 79 child_process_host_->StartApp(
79 std::move(request), 80 std::move(request),
80 base::Bind(&OutOfProcessNativeRunner::AppCompleted, 81 base::Bind(&OutOfProcessNativeRunner::AppCompleted,
81 base::Unretained(this))); 82 base::Unretained(this)));
82 pid_available_callback.Run(pid); 83 pid_available_callback.Run(pid);
83 } 84 }
84 85
85 OutOfProcessNativeRunnerFactory::OutOfProcessNativeRunnerFactory( 86 OutOfProcessNativeRunnerFactory::OutOfProcessNativeRunnerFactory(
86 base::TaskRunner* launch_process_runner, 87 base::TaskRunner* launch_process_runner,
87 NativeRunnerDelegate* delegate) 88 NativeRunnerDelegate* delegate)
88 : launch_process_runner_(launch_process_runner), delegate_(delegate) {} 89 : launch_process_runner_(launch_process_runner), delegate_(delegate) {}
89 OutOfProcessNativeRunnerFactory::~OutOfProcessNativeRunnerFactory() {} 90 OutOfProcessNativeRunnerFactory::~OutOfProcessNativeRunnerFactory() {}
90 91
91 scoped_ptr<shell::NativeRunner> OutOfProcessNativeRunnerFactory::Create( 92 scoped_ptr<shell::NativeRunner> OutOfProcessNativeRunnerFactory::Create(
92 const base::FilePath& app_path) { 93 const base::FilePath& app_path) {
93 return make_scoped_ptr( 94 return make_scoped_ptr(
94 new OutOfProcessNativeRunner(launch_process_runner_, delegate_)); 95 new OutOfProcessNativeRunner(launch_process_runner_, delegate_));
95 } 96 }
96 97
97 } // namespace shell 98 } // namespace shell
98 } // namespace mojo 99 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/runner/host/child_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698