| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #elif defined(OS_POSIX) | 27 #elif defined(OS_POSIX) |
| 28 #include "base/memory/singleton.h" | 28 #include "base/memory/singleton.h" |
| 29 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 29 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 30 #include "content/browser/zygote_host_linux.h" | 30 #include "content/browser/zygote_host_linux.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 #if defined(OS_POSIX) | 33 #if defined(OS_POSIX) |
| 34 #include "base/global_descriptors_posix.h" | 34 #include "base/global_descriptors_posix.h" |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 using content::BrowserThread; |
| 38 |
| 37 // Having the functionality of ChildProcessLauncher be in an internal | 39 // Having the functionality of ChildProcessLauncher be in an internal |
| 38 // ref counted object allows us to automatically terminate the process when the | 40 // ref counted object allows us to automatically terminate the process when the |
| 39 // parent class destructs, while still holding on to state that we need. | 41 // parent class destructs, while still holding on to state that we need. |
| 40 class ChildProcessLauncher::Context | 42 class ChildProcessLauncher::Context |
| 41 : public base::RefCountedThreadSafe<ChildProcessLauncher::Context> { | 43 : public base::RefCountedThreadSafe<ChildProcessLauncher::Context> { |
| 42 public: | 44 public: |
| 43 Context() | 45 Context() |
| 44 : client_(NULL), | 46 : client_(NULL), |
| 45 client_thread_id_(BrowserThread::UI), | 47 client_thread_id_(BrowserThread::UI), |
| 46 termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION), | 48 termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION), |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 NewRunnableFunction( | 378 NewRunnableFunction( |
| 377 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 379 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 378 GetHandle(), background)); | 380 GetHandle(), background)); |
| 379 } | 381 } |
| 380 | 382 |
| 381 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 383 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 382 bool terminate_on_shutdown) { | 384 bool terminate_on_shutdown) { |
| 383 if (context_) | 385 if (context_) |
| 384 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 386 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 385 } | 387 } |
| OLD | NEW |