Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: content/browser/browser_child_process_host_impl.h

Issue 283313002: Ensure that any IPC sent from a child process that couldn't be deserialized causes that p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: switch to histograms Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698