summaryrefslogtreecommitdiffstats
path: root/content/browser/web_contents/web_contents_impl.cc
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 05:16:44 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 05:16:44 +0000
commited1bb720731ea7c7644c208da970f0609a7e3b62 (patch)
tree5d66f86a406225f13f3c87485db4e2dbdde688b0 /content/browser/web_contents/web_contents_impl.cc
parent8dc0d4052bbc6e023577e372679d471da9717236 (diff)
downloadchromium_src-ed1bb720731ea7c7644c208da970f0609a7e3b62.zip
chromium_src-ed1bb720731ea7c7644c208da970f0609a7e3b62.tar.gz
chromium_src-ed1bb720731ea7c7644c208da970f0609a7e3b62.tar.bz2
Revert Fast tab closure and dependent CL
Revert r205149 (Fast tab closure) and dependent CL r207181 (Move histograms and supporting code that don't belong in content out) since it breaks a bunch of systems. Mechanical revert of problematic CLs, setting NOTRY so we can land this in the face of flaky bots. BUG=142458,156896,249289,246999,246634,248998,250863 TBR=sky@chromium.org,joi@chromium.org,jam@chromium.org NOTRY=True Review URL: https://chromiumcodereview.appspot.com/17487002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/web_contents/web_contents_impl.cc')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc32
1 files changed, 26 insertions, 6 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7a4e607..ee3eaa4 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
-#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/metrics/stats_counters.h"
#include "base/strings/string16.h"
@@ -399,6 +398,16 @@ WebContentsImpl::~WebContentsImpl() {
}
#endif
+ // OnCloseStarted isn't called in unit tests.
+ if (!close_start_time_.is_null()) {
+ 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,
observers_,
WebContentsImplDestroyed());
@@ -1939,10 +1948,23 @@ RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() {
return &renderer_preferences_;
}
+void WebContentsImpl::SetNewTabStartTime(const base::TimeTicks& time) {
+ new_tab_start_time_ = time;
+}
+
+base::TimeTicks WebContentsImpl::GetNewTabStartTime() const {
+ return new_tab_start_time_;
+}
+
void WebContentsImpl::Close() {
Close(GetRenderViewHost());
}
+void WebContentsImpl::OnCloseStarted() {
+ if (close_start_time_.is_null())
+ close_start_time_ = base::TimeTicks::Now();
+}
+
void WebContentsImpl::DragSourceEndedAt(int client_x, int client_y,
int screen_x, int screen_y, WebKit::WebDragOperation operation) {
if (browser_plugin_embedder_.get())
@@ -3476,11 +3498,9 @@ void WebContentsImpl::WorkerCrashed() {
void WebContentsImpl::BeforeUnloadFiredFromRenderManager(
bool proceed, const base::TimeTicks& proceed_time,
bool* proceed_to_fire_unload) {
- FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- BeforeUnloadFired(proceed_time));
+ before_unload_end_time_ = proceed_time;
if (delegate_)
delegate_->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
- // Note: |this| can be deleted at this point.
}
void WebContentsImpl::RenderViewGoneFromRenderManager(
@@ -3621,8 +3641,8 @@ void WebContentsImpl::OnDialogClosed(RenderViewHost* rvh,
DidStopLoading(rvh);
controller_.DiscardNonCommittedEntries();
- FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- BeforeUnloadDialogCancelled());
+ close_start_time_ = base::TimeTicks();
+ before_unload_end_time_ = base::TimeTicks();
}
is_showing_before_unload_dialog_ = false;
static_cast<RenderViewHostImpl*>(