| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 8256d033f6112937f6cf2299271e2503c2bc632f..15a96af85e3821a4e655567abdd6e407983e8718 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -390,8 +390,12 @@ WebContentsImpl::~WebContentsImpl() {
|
|
|
| // OnCloseStarted isn't called in unit tests.
|
| if (!close_start_time_.is_null()) {
|
| - UMA_HISTOGRAM_TIMES("Tab.Close",
|
| - base::TimeTicks::Now() - close_start_time_);
|
| + base::TimeTicks now = base::TimeTicks::Now();
|
| + base::TimeTicks unload_start_time = close_start_time_;
|
| + if (!before_unload_end_time_.is_null())
|
| + unload_start_time = before_unload_end_time_;
|
| + UMA_HISTOGRAM_TIMES("Tab.Close", now - close_start_time_);
|
| + UMA_HISTOGRAM_TIMES("Tab.Close.UnloadTime", now - unload_start_time);
|
| }
|
|
|
| FOR_EACH_OBSERVER(WebContentsObserver,
|
| @@ -3114,8 +3118,9 @@ void WebContentsImpl::WorkerCrashed() {
|
| }
|
|
|
| void WebContentsImpl::BeforeUnloadFiredFromRenderManager(
|
| - bool proceed,
|
| + bool proceed, const base::TimeTicks& proceed_time,
|
| bool* proceed_to_fire_unload) {
|
| + before_unload_end_time_ = proceed_time;
|
| if (delegate_)
|
| delegate_->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
|
| }
|
| @@ -3237,6 +3242,7 @@ void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh,
|
| controller_.DiscardNonCommittedEntries();
|
|
|
| close_start_time_ = base::TimeTicks();
|
| + before_unload_end_time_ = base::TimeTicks();
|
| }
|
| is_showing_before_unload_dialog_ = false;
|
| static_cast<RenderViewHostImpl*>(
|
|
|