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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(NotificationType 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 | |
96 // shutdown. Default is to always terminate. | |
97 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); | |
98 | |
99 private: | 95 private: |
100 // By using an internal class as the ChildProcessLauncher::Client, we can | 96 // By using an internal class as the ChildProcessLauncher::Client, we can |
101 // intercept OnProcessLaunched and do our own processing before | 97 // intercept OnProcessLaunched and do our own processing before |
102 // calling the subclass' implementation. | 98 // calling the subclass' implementation. |
103 class ClientHook : public ChildProcessLauncher::Client { | 99 class ClientHook : public ChildProcessLauncher::Client { |
104 public: | 100 public: |
105 explicit ClientHook(BrowserChildProcessHost* host); | 101 explicit ClientHook(BrowserChildProcessHost* host); |
106 virtual void OnProcessLaunched(); | 102 virtual void OnProcessLaunched(); |
107 private: | 103 private: |
108 BrowserChildProcessHost* host_; | 104 BrowserChildProcessHost* host_; |
109 }; | 105 }; |
110 ClientHook client_; | 106 ClientHook client_; |
111 scoped_ptr<ChildProcessLauncher> child_process_; | 107 scoped_ptr<ChildProcessLauncher> child_process_; |
112 }; | 108 }; |
113 | 109 |
114 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 110 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
OLD | NEW |