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() { |