OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/service_manager/background/background_service_manager.h" | 5 #include "services/service_manager/background/background_service_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void Run() override { | 92 void Run() override { |
93 // The construction/destruction order is very finicky and has to be done | 93 // The construction/destruction order is very finicky and has to be done |
94 // in the order here. | 94 // in the order here. |
95 std::unique_ptr<base::MessageLoop> message_loop(message_loop_); | 95 std::unique_ptr<base::MessageLoop> message_loop(message_loop_); |
96 | 96 |
97 std::unique_ptr<Context::InitParams> context_init_params( | 97 std::unique_ptr<Context::InitParams> context_init_params( |
98 new Context::InitParams); | 98 new Context::InitParams); |
99 if (init_params_) { | 99 if (init_params_) { |
100 context_init_params->catalog_store = | 100 context_init_params->catalog_store = |
101 std::move(init_params_->catalog_store); | 101 std::move(init_params_->catalog_store); |
102 context_init_params->native_runner_delegate = | 102 context_init_params->service_process_launcher_delegate = |
103 init_params_->native_runner_delegate; | 103 init_params_->service_process_launcher_delegate; |
104 context_init_params->init_edk = init_params_->init_edk; | 104 context_init_params->init_edk = init_params_->init_edk; |
105 } | 105 } |
106 if (context_init_params->init_edk) | 106 if (context_init_params->init_edk) |
107 Context::EnsureEmbedderIsInitialized(); | 107 Context::EnsureEmbedderIsInitialized(); |
108 | 108 |
109 message_loop_->BindToCurrentThread(); | 109 message_loop_->BindToCurrentThread(); |
110 | 110 |
111 std::unique_ptr<Context> context(new Context); | 111 std::unique_ptr<Context> context(new Context); |
112 context_ = context.get(); | 112 context_ = context.get(); |
113 context_->Init(std::move(context_init_params)); | 113 context_->Init(std::move(context_init_params)); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 void BackgroundServiceManager::ExecuteOnServiceManagerThread( | 172 void BackgroundServiceManager::ExecuteOnServiceManagerThread( |
173 const ServiceManagerThreadCallback& callback) { | 173 const ServiceManagerThreadCallback& callback) { |
174 thread_->message_loop()->task_runner()->PostTask( | 174 thread_->message_loop()->task_runner()->PostTask( |
175 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback, | 175 FROM_HERE, base::Bind(&MojoThread::RunServiceManagerCallback, |
176 base::Unretained(thread_.get()), callback)); | 176 base::Unretained(thread_.get()), callback)); |
177 } | 177 } |
178 | 178 |
179 } // namespace service_manager | 179 } // namespace service_manager |
OLD | NEW |