OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 | 10 |
(...skipping 98 matching lines...) Loading... |
109 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); | 109 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); |
110 | 110 |
111 // Overrides from ChildProcessHost | 111 // Overrides from ChildProcessHost |
112 virtual void OnChildDied(); | 112 virtual void OnChildDied(); |
113 virtual void ShutdownStarted(); | 113 virtual void ShutdownStarted(); |
114 virtual void Notify(NotificationType type); | 114 virtual void Notify(NotificationType type); |
115 // Extends the base class implementation and removes this host from | 115 // Extends the base class implementation and removes this host from |
116 // the host list. Calls ChildProcessHost::ForceShutdown | 116 // the host list. Calls ChildProcessHost::ForceShutdown |
117 virtual void ForceShutdown(); | 117 virtual void ForceShutdown(); |
118 | 118 |
| 119 ResourceDispatcherHost* resource_dispatcher_host() { |
| 120 return resource_dispatcher_host_; |
| 121 } |
| 122 |
119 private: | 123 private: |
120 void Initialize(ResourceMessageFilter::URLRequestContextOverride* | 124 void Initialize(ResourceMessageFilter::URLRequestContextOverride* |
121 url_request_context_override); | 125 url_request_context_override); |
122 | 126 |
123 // By using an internal class as the ChildProcessLauncher::Client, we can | 127 // By using an internal class as the ChildProcessLauncher::Client, we can |
124 // intercept OnProcessLaunched and do our own processing before | 128 // intercept OnProcessLaunched and do our own processing before |
125 // calling the subclass' implementation. | 129 // calling the subclass' implementation. |
126 class ClientHook : public ChildProcessLauncher::Client { | 130 class ClientHook : public ChildProcessLauncher::Client { |
127 public: | 131 public: |
128 explicit ClientHook(BrowserChildProcessHost* host); | 132 explicit ClientHook(BrowserChildProcessHost* host); |
129 virtual void OnProcessLaunched(); | 133 virtual void OnProcessLaunched(); |
130 private: | 134 private: |
131 BrowserChildProcessHost* host_; | 135 BrowserChildProcessHost* host_; |
132 }; | 136 }; |
133 ClientHook client_; | 137 ClientHook client_; |
134 // May be NULL if this current process has no resource dispatcher host. | 138 // May be NULL if this current process has no resource dispatcher host. |
135 ResourceDispatcherHost* resource_dispatcher_host_; | 139 ResourceDispatcherHost* resource_dispatcher_host_; |
136 scoped_ptr<ChildProcessLauncher> child_process_; | 140 scoped_ptr<ChildProcessLauncher> child_process_; |
137 }; | 141 }; |
138 | 142 |
139 #endif // CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ | 143 #endif // CHROME_BROWSER_BROWSER_CHILD_PROCESS_HOST_H_ |
OLD | NEW |