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

Unified Diff: mojo/shell/in_process_dynamic_service_runner.cc

Issue 419683006: Revert of mojo: fix little bug in DynamicServiceLoader/Runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/in_process_dynamic_service_runner.cc
diff --git a/mojo/shell/in_process_dynamic_service_runner.cc b/mojo/shell/in_process_dynamic_service_runner.cc
index 3bfb163462ce500a29cc80b8d3d235397d6ea136..834f20a4fe0411a21ee786ab1cc065d3c00fbb6b 100644
--- a/mojo/shell/in_process_dynamic_service_runner.cc
+++ b/mojo/shell/in_process_dynamic_service_runner.cc
@@ -16,14 +16,14 @@
InProcessDynamicServiceRunner::InProcessDynamicServiceRunner(
Context* context)
- : keep_alive_(context) {
+ : keep_alive_(context),
+ thread_(this, "app_thread") {
}
InProcessDynamicServiceRunner::~InProcessDynamicServiceRunner() {
- if (thread_) {
- DCHECK(thread_->HasBeenStarted());
- DCHECK(!thread_->HasBeenJoined());
- thread_->Join();
+ if (thread_.HasBeenStarted()) {
+ DCHECK(!thread_.HasBeenJoined());
+ thread_.Join();
}
// It is important to let the thread exit before unloading the DSO because
@@ -47,9 +47,8 @@
FROM_HERE,
app_completed_callback);
- DCHECK(!thread_);
- thread_.reset(new base::DelegateSimpleThread(this, "app_thread"));
- thread_->Start();
+ DCHECK(!thread_.HasBeenStarted());
+ thread_.Start();
}
void InProcessDynamicServiceRunner::Run() {
« no previous file with comments | « mojo/shell/in_process_dynamic_service_runner.h ('k') | mojo/shell/in_process_dynamic_service_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698