OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 mojo_application_host_.reset(new MojoApplicationHost); | 181 mojo_application_host_.reset(new MojoApplicationHost); |
182 | 182 |
183 bool mojo_result = mojo_application_host_->Init(); | 183 bool mojo_result = mojo_application_host_->Init(); |
184 if (!mojo_result) | 184 if (!mojo_result) |
185 return false; | 185 return false; |
186 | 186 |
187 return StartProcess(); | 187 return StartProcess(); |
188 } | 188 } |
189 | 189 |
190 ServiceRegistry* UtilityProcessHostImpl::GetServiceRegistry() { | 190 ServiceRegistry* UtilityProcessHostImpl::GetServiceRegistry() { |
191 DCHECK(mojo_application_host_); | 191 if (mojo_application_host_) |
192 return mojo_application_host_->service_registry(); | 192 return mojo_application_host_->service_registry(); |
| 193 return nullptr; |
193 } | 194 } |
194 | 195 |
195 void UtilityProcessHostImpl::SetName(const base::string16& name) { | 196 void UtilityProcessHostImpl::SetName(const base::string16& name) { |
196 name_ = name; | 197 name_ = name; |
197 } | 198 } |
198 | 199 |
199 bool UtilityProcessHostImpl::StartProcess() { | 200 bool UtilityProcessHostImpl::StartProcess() { |
200 if (started_) | 201 if (started_) |
201 return true; | 202 return true; |
202 started_ = true; | 203 started_ = true; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 if (RenderProcessHost::run_renderer_in_process()) | 340 if (RenderProcessHost::run_renderer_in_process()) |
340 handle = base::GetCurrentProcessHandle(); | 341 handle = base::GetCurrentProcessHandle(); |
341 else | 342 else |
342 handle = process_->GetData().handle; | 343 handle = process_->GetData().handle; |
343 | 344 |
344 mojo_application_host_->Activate(this, handle); | 345 mojo_application_host_->Activate(this, handle); |
345 } | 346 } |
346 } | 347 } |
347 | 348 |
348 } // namespace content | 349 } // namespace content |
OLD | NEW |