From 3360120bb302ba6f63f1d07800f0110ea6f75e7a Mon Sep 17 00:00:00 2001 From: avi Date: Fri, 10 Jul 2015 18:39:26 -0700 Subject: [PATCH] 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} --- content/browser/renderer_host/render_view_host_delegate.h | 3 ++- content/browser/renderer_host/render_view_host_impl.cc | 3 +-- content/public/browser/render_process_host_observer.h | 11 +++++++---- content/public/browser/web_contents_observer.h | 15 +++++++++------ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/content/browser/renderer_host/render_view_host_delegate.h b/content/browser/renderer_host/render_view_host_delegate.h index 21d8a337452b..9c1edce2de45 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 @@ class CONTENT_EXPORT RenderViewHostDelegate { // 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 c54e4e9dce2b..2bc572f0a3b7 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 @@ void RenderViewHostImpl::RenderProcessExited(RenderProcessHost* host, return; RenderWidgetHostImpl::RendererExited(status, exit_code); - delegate_->RenderViewTerminated( - this, static_cast(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 926b66d1dd3d..9414f57a6e6d 100644 --- a/content/public/browser/render_process_host_observer.h +++ b/content/public/browser/render_process_host_observer.h @@ -17,11 +17,14 @@ class RenderProcessHost; // 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 501b94efb0c9..15fa138690fa 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h @@ -97,13 +97,16 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener, // 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 -- 2.11.4.GIT