Be a little more precise in the wording of comments for process death.
BUG=508652
TEST=no change to functionality
Review URL: https://codereview.chromium.org/1228993005
Cr-Commit-Position: refs/heads/master@{#338422}
diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h
index 21d8a33..9c1edce 100644
--- a/content/browser/renderer_host/render_view_host_delegate.h
+++ b/content/browser/renderer_host/render_view_host_delegate.h
@@ -95,7 +95,8 @@
// The RenderView has been constructed.
virtual void RenderViewReady(RenderViewHost* render_view_host) {}
- // The RenderView died somehow (crashed or was killed by the user).
+ // The process containing the RenderView exited somehow (either cleanly,
+ // crash, or user kill).
virtual void RenderViewTerminated(RenderViewHost* render_view_host,
base::TerminationStatus status,
int error_code) {}
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index c54e4e9d..2bc572f0 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -585,8 +585,7 @@
return;
RenderWidgetHostImpl::RendererExited(status, exit_code);
- delegate_->RenderViewTerminated(
- this, static_cast<base::TerminationStatus>(status), exit_code);
+ delegate_->RenderViewTerminated(this, status, exit_code);
}
void RenderViewHostImpl::DragTargetDragEnter(
diff --git a/content/public/browser/render_process_host_observer.h b/content/public/browser/render_process_host_observer.h
index 926b66d1..9414f57 100644
--- a/content/public/browser/render_process_host_observer.h
+++ b/content/public/browser/render_process_host_observer.h
@@ -17,11 +17,14 @@
// in RenderProcessHost lifecycle events.
class CONTENT_EXPORT RenderProcessHostObserver {
public:
- // This method is invoked when a render process exited (either normally or
- // with a crash). To determine if the process closed normally or crashed,
- // examine the |status| parameter.
+ // This method is invoked when the process of the observed RenderProcessHost
+ // exits (either normally or with a crash). To determine if the process closed
+ // normally or crashed, examine the |status| parameter.
//
- // Note that this is equivalent to WebContentsObserver::RenderProcessGone().
+ // This will cause a call to WebContentsObserver::RenderProcessGone() for the
+ // active renderer process for the top-level frame; for code that needs to be
+ // a WebContentsObserver anyway, consider whether that API might be a better
+ // choice.
virtual void RenderProcessExited(RenderProcessHost* host,
base::TerminationStatus status,
int exit_code) {}
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index 501b94efb..15fa138 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -97,13 +97,16 @@
// just swapped out.
virtual void RenderViewDeleted(RenderViewHost* render_view_host) {}
- // This method is invoked when the process for the current RenderView crashes.
- // The WebContents continues to use the RenderViewHost, e.g. when the user
- // reloads the current page. When the RenderViewHost itself is deleted, the
- // RenderViewDeleted method will be invoked.
+ // This method is invoked when the process for the current main
+ // RenderFrameHost exits (usually by crashing, though possibly by other
+ // means). The WebContents continues to use the RenderFrameHost, e.g. when the
+ // user reloads the current page. When the RenderFrameHost itself is deleted,
+ // the RenderFrameDeleted method will be invoked.
//
- // Note that this is equivalent to
- // RenderProcessHostObserver::RenderProcessExited().
+ // Note that this is triggered upstream through
+ // RenderProcessHostObserver::RenderProcessExited(); for code that doesn't
+ // otherwise need to be a WebContentsObserver, that API is probably a better
+ // choice.
virtual void RenderProcessGone(base::TerminationStatus status) {}
// This method is invoked when a WebContents swaps its visible RenderViewHost