| OLD | NEW |
| 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/runner/host/child_process.h" | 5 #include "mojo/runner/host/child_process.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 void ExitNow(int32_t exit_code) override { | 248 void ExitNow(int32_t exit_code) override { |
| 249 DVLOG(2) << "ChildControllerImpl::ExitNow(" << exit_code << ")"; | 249 DVLOG(2) << "ChildControllerImpl::ExitNow(" << exit_code << ")"; |
| 250 _exit(exit_code); | 250 _exit(exit_code); |
| 251 } | 251 } |
| 252 | 252 |
| 253 private: | 253 private: |
| 254 ChildControllerImpl(AppContext* app_context, | 254 ChildControllerImpl(AppContext* app_context, |
| 255 base::NativeLibrary app_library, | 255 base::NativeLibrary app_library, |
| 256 const Blocker::Unblocker& unblocker) | 256 const Blocker::Unblocker& unblocker) |
| 257 : app_context_(app_context), | 257 : app_library_(app_library), unblocker_(unblocker), binding_(this) {} |
| 258 app_library_(app_library), | |
| 259 unblocker_(unblocker), | |
| 260 channel_info_(nullptr), | |
| 261 binding_(this) {} | |
| 262 | 258 |
| 263 static void StartAppOnMainThread( | 259 static void StartAppOnMainThread( |
| 264 base::NativeLibrary app_library, | 260 base::NativeLibrary app_library, |
| 265 InterfaceRequest<Application> application_request) { | 261 InterfaceRequest<Application> application_request) { |
| 266 if (!RunNativeApplication(app_library, std::move(application_request))) { | 262 if (!RunNativeApplication(app_library, std::move(application_request))) { |
| 267 LOG(ERROR) << "Failure to RunNativeApplication()"; | 263 LOG(ERROR) << "Failure to RunNativeApplication()"; |
| 268 } | 264 } |
| 269 } | 265 } |
| 270 | 266 |
| 271 base::ThreadChecker thread_checker_; | 267 base::ThreadChecker thread_checker_; |
| 272 AppContext* const app_context_; | |
| 273 base::NativeLibrary app_library_; | 268 base::NativeLibrary app_library_; |
| 274 Blocker::Unblocker unblocker_; | 269 Blocker::Unblocker unblocker_; |
| 275 StartAppCallback on_app_complete_; | 270 StartAppCallback on_app_complete_; |
| 276 | 271 |
| 277 embedder::ChannelInfo* channel_info_; | |
| 278 Binding<ChildController> binding_; | 272 Binding<ChildController> binding_; |
| 279 | 273 |
| 280 DISALLOW_COPY_AND_ASSIGN(ChildControllerImpl); | 274 DISALLOW_COPY_AND_ASSIGN(ChildControllerImpl); |
| 281 }; | 275 }; |
| 282 | 276 |
| 283 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 277 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
| 284 scoped_ptr<mojo::runner::LinuxSandbox> InitializeSandbox() { | 278 scoped_ptr<mojo::runner::LinuxSandbox> InitializeSandbox() { |
| 285 using sandbox::syscall_broker::BrokerFilePermission; | 279 using sandbox::syscall_broker::BrokerFilePermission; |
| 286 // Warm parts of base in the copy of base in the mojo runner. | 280 // Warm parts of base in the copy of base in the mojo runner. |
| 287 base::RandUint64(); | 281 base::RandUint64(); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // This will block, then run whatever the controller wants. | 386 // This will block, then run whatever the controller wants. |
| 393 blocker.Block(); | 387 blocker.Block(); |
| 394 | 388 |
| 395 app_context.Shutdown(); | 389 app_context.Shutdown(); |
| 396 | 390 |
| 397 return 0; | 391 return 0; |
| 398 } | 392 } |
| 399 | 393 |
| 400 } // namespace runner | 394 } // namespace runner |
| 401 } // namespace mojo | 395 } // namespace mojo |
| OLD | NEW |