OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual void SetName(const base::string16& name) OVERRIDE; | 57 virtual void SetName(const base::string16& name) OVERRIDE; |
58 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; | 58 virtual void SetHandle(base::ProcessHandle handle) OVERRIDE; |
59 | 59 |
60 // ChildProcessHostDelegate implementation: | 60 // ChildProcessHostDelegate implementation: |
61 virtual bool CanShutdown() OVERRIDE; | 61 virtual bool CanShutdown() OVERRIDE; |
62 virtual void OnChildDisconnected() OVERRIDE; | 62 virtual void OnChildDisconnected() OVERRIDE; |
63 virtual base::ProcessHandle GetHandle() const OVERRIDE; | 63 virtual base::ProcessHandle GetHandle() const OVERRIDE; |
64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
65 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 65 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
66 virtual void OnChannelError() OVERRIDE; | 66 virtual void OnChannelError() OVERRIDE; |
| 67 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; |
67 | 68 |
68 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown | 69 // Removes this host from the host list. Calls ChildProcessHost::ForceShutdown |
69 void ForceShutdown(); | 70 void ForceShutdown(); |
70 | 71 |
71 // Callers can reduce the BrowserChildProcess' priority. | 72 // Callers can reduce the BrowserChildProcess' priority. |
72 void SetBackgrounded(bool backgrounded); | 73 void SetBackgrounded(bool backgrounded); |
73 | 74 |
74 // Controls whether the child process should be terminated on browser | 75 // Controls whether the child process should be terminated on browser |
75 // shutdown. Default is to always terminate. | 76 // shutdown. Default is to always terminate. |
76 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); | 77 void SetTerminateChildOnShutdown(bool terminate_on_shutdown); |
77 | 78 |
78 // Adds an IPC message filter. | 79 // Adds an IPC message filter. |
79 void AddFilter(BrowserMessageFilter* filter); | 80 void AddFilter(BrowserMessageFilter* filter); |
80 | 81 |
81 // Called when an instance of a particular child is created in a page. | 82 // Called when an instance of a particular child is created in a page. |
82 static void NotifyProcessInstanceCreated(const ChildProcessData& data); | 83 static void NotifyProcessInstanceCreated(const ChildProcessData& data); |
83 | 84 |
| 85 static void HistogramBadMessageTerminated(int process_type); |
| 86 |
84 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } | 87 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } |
85 | 88 |
86 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; | 89 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; |
87 private: | 90 private: |
88 friend class BrowserChildProcessHostIterator; | 91 friend class BrowserChildProcessHostIterator; |
89 friend class BrowserChildProcessObserver; | 92 friend class BrowserChildProcessObserver; |
90 | 93 |
91 static BrowserChildProcessList* GetIterator(); | 94 static BrowserChildProcessList* GetIterator(); |
92 | 95 |
93 static void AddObserver(BrowserChildProcessObserver* observer); | 96 static void AddObserver(BrowserChildProcessObserver* observer); |
(...skipping 20 matching lines...) Expand all Loading... |
114 // Watches to see if the child process exits before the IPC channel has | 117 // Watches to see if the child process exits before the IPC channel has |
115 // been connected. Thereafter, its exit is determined by an error on the | 118 // been connected. Thereafter, its exit is determined by an error on the |
116 // IPC channel. | 119 // IPC channel. |
117 base::WaitableEventWatcher early_exit_watcher_; | 120 base::WaitableEventWatcher early_exit_watcher_; |
118 #endif | 121 #endif |
119 }; | 122 }; |
120 | 123 |
121 } // namespace content | 124 } // namespace content |
122 | 125 |
123 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 126 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |