Be a little more precise in the wording of comments for process death.
[chromium-blink-merge.git] / content / public / browser / render_process_host_observer.h
blob9414f57a6e6d3e42d9996be33fd1f89fc89d2a75
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_
8 #include "base/process/kill.h"
9 #include "base/process/process_handle.h"
10 #include "content/common/content_export.h"
12 namespace content {
14 class RenderProcessHost;
16 // An observer API implemented by classes which are interested
17 // in RenderProcessHost lifecycle events.
18 class CONTENT_EXPORT RenderProcessHostObserver {
19 public:
20 // 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
22 // normally or crashed, examine the |status| parameter.
24 // 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
26 // a WebContentsObserver anyway, consider whether that API might be a better
27 // choice.
28 virtual void RenderProcessExited(RenderProcessHost* host,
29 base::TerminationStatus status,
30 int exit_code) {}
32 // This method is invoked when the observed RenderProcessHost itself is
33 // destroyed. This is guaranteed to be the last call made to the observer.
34 virtual void RenderProcessHostDestroyed(RenderProcessHost* host) {}
36 protected:
37 virtual ~RenderProcessHostObserver() {}
40 } // namespace content
42 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_OBSERVER_H_