OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ |
7 | 7 |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class RenderProcessHost; | 14 class RenderProcessHost; |
15 | 15 |
16 // An observer API implemented by classes which are interested | 16 // An observer API implemented by classes which are interested |
17 // in RenderProcessHost lifecycle events. | 17 // in RenderProcessHost lifecycle events. |
18 class CONTENT_EXPORT RenderProcessHostObserver { | 18 class CONTENT_EXPORT RenderProcessHostObserver { |
19 public: | 19 public: |
20 // This method is invoked when the process is going to exit and should not be | |
21 // used for further navigations. | |
ncarter (slow)
2015/07/21 19:07:15
I think this gets a little confusing, especially w
Avi (use Gerrit)
2015/07/21 20:45:16
Done.
| |
22 virtual void RenderProcessWillExit(RenderProcessHost* host) {} | |
23 | |
20 // This method is invoked when the process of the observed RenderProcessHost | 24 // This method is invoked when the process of the observed RenderProcessHost |
21 // exits (either normally or with a crash). To determine if the process closed | 25 // exits (either normally or with a crash). To determine if the process closed |
22 // normally or crashed, examine the |status| parameter. | 26 // normally or crashed, examine the |status| parameter. |
23 // | 27 // |
24 // This will cause a call to WebContentsObserver::RenderProcessGone() for the | 28 // This will cause a call to WebContentsObserver::RenderProcessGone() for the |
25 // active renderer process for the top-level frame; for code that needs to be | 29 // active renderer process for the top-level frame; for code that needs to be |
26 // a WebContentsObserver anyway, consider whether that API might be a better | 30 // a WebContentsObserver anyway, consider whether that API might be a better |
27 // choice. | 31 // choice. |
28 virtual void RenderProcessExited(RenderProcessHost* host, | 32 virtual void RenderProcessExited(RenderProcessHost* host, |
29 base::TerminationStatus status, | 33 base::TerminationStatus status, |
30 int exit_code) {} | 34 int exit_code) {} |
31 | 35 |
32 // This method is invoked when the observed RenderProcessHost itself is | 36 // This method is invoked when the observed RenderProcessHost itself is |
33 // destroyed. This is guaranteed to be the last call made to the observer. | 37 // destroyed. This is guaranteed to be the last call made to the observer. |
34 virtual void RenderProcessHostDestroyed(RenderProcessHost* host) {} | 38 virtual void RenderProcessHostDestroyed(RenderProcessHost* host) {} |
35 | 39 |
36 protected: | 40 protected: |
37 virtual ~RenderProcessHostObserver() {} | 41 virtual ~RenderProcessHostObserver() {} |
38 }; | 42 }; |
39 | 43 |
40 } // namespace content | 44 } // namespace content |
41 | 45 |
42 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ | 46 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_ |
OLD | NEW |