| 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 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // Returns the termination status of a child. |exit_code| is the | 81 // Returns the termination status of a child. |exit_code| is the |
| 82 // status returned when the process exited (for posix, as returned | 82 // status returned when the process exited (for posix, as returned |
| 83 // from waitpid(), for Windows, as returned from | 83 // from waitpid(), for Windows, as returned from |
| 84 // GetExitCodeProcess()). |exit_code| may be NULL. | 84 // GetExitCodeProcess()). |exit_code| may be NULL. |
| 85 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); | 85 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); |
| 86 | 86 |
| 87 // Overrides from ChildProcessHost | 87 // Overrides from ChildProcessHost |
| 88 virtual void OnChildDied(); | 88 virtual void OnChildDied(); |
| 89 virtual void ShutdownStarted(); | 89 virtual void ShutdownStarted(); |
| 90 virtual void Notify(NotificationType type); | 90 virtual void Notify(int type); |
| 91 // Extends the base class implementation and removes this host from | 91 // Extends the base class implementation and removes this host from |
| 92 // the host list. Calls ChildProcessHost::ForceShutdown | 92 // the host list. Calls ChildProcessHost::ForceShutdown |
| 93 virtual void ForceShutdown(); | 93 virtual void ForceShutdown(); |
| 94 | 94 |
| 95 // Controls whether the child process should be terminated on browser | 95 // Controls whether the child process should be terminated on browser |
| 96 // shutdown. Default is to always terminate. | 96 // shutdown. Default is to always terminate. |
| 97 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); | 97 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 // By using an internal class as the ChildProcessLauncher::Client, we can | 100 // By using an internal class as the ChildProcessLauncher::Client, we can |
| 101 // intercept OnProcessLaunched and do our own processing before | 101 // intercept OnProcessLaunched and do our own processing before |
| 102 // calling the subclass' implementation. | 102 // calling the subclass' implementation. |
| 103 class ClientHook : public ChildProcessLauncher::Client { | 103 class ClientHook : public ChildProcessLauncher::Client { |
| 104 public: | 104 public: |
| 105 explicit ClientHook(BrowserChildProcessHost* host); | 105 explicit ClientHook(BrowserChildProcessHost* host); |
| 106 virtual void OnProcessLaunched(); | 106 virtual void OnProcessLaunched(); |
| 107 private: | 107 private: |
| 108 BrowserChildProcessHost* host_; | 108 BrowserChildProcessHost* host_; |
| 109 }; | 109 }; |
| 110 ClientHook client_; | 110 ClientHook client_; |
| 111 scoped_ptr<ChildProcessLauncher> child_process_; | 111 scoped_ptr<ChildProcessLauncher> child_process_; |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 114 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
| OLD | NEW |