Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 17151010: Move histograms and supporting code that don't belong in content out. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
===================================================================
--- content/browser/web_contents/web_contents_impl.cc (revision 207139)
+++ content/browser/web_contents/web_contents_impl.cc (working copy)
@@ -397,23 +397,6 @@
}
#endif
- // OnCloseStarted isn't called in unit tests.
- if (!close_start_time_.is_null()) {
- base::TimeTicks now = base::TimeTicks::Now();
- base::TimeDelta close_time = now - close_start_time_;
- UMA_HISTOGRAM_TIMES("Tab.Close", close_time);
-
- base::TimeTicks unload_start_time = close_start_time_;
- base::TimeTicks unload_end_time = now;
- if (!before_unload_end_time_.is_null())
- unload_start_time = before_unload_end_time_;
- if (!unload_detached_start_time_.is_null())
- unload_end_time = unload_detached_start_time_;
- base::TimeDelta unload_time = unload_end_time - unload_start_time;
- UMA_HISTOGRAM_TIMES("Tab.Close.UnloadTime", unload_time);
-
- }
-
FOR_EACH_OBSERVER(WebContentsObserver,
observers_,
WebContentsImplDestroyed());
@@ -1951,38 +1934,10 @@
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::OnCloseCanceled() {
- close_start_time_ = base::TimeTicks();
- before_unload_end_time_ = base::TimeTicks();
- unload_detached_start_time_ = base::TimeTicks();
-}
-
-void WebContentsImpl::OnUnloadStarted() {
- before_unload_end_time_ = base::TimeTicks::Now();
-}
-
-void WebContentsImpl::OnUnloadDetachedStarted() {
- if (unload_detached_start_time_.is_null())
- unload_detached_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())
@@ -3505,9 +3460,11 @@
void WebContentsImpl::BeforeUnloadFiredFromRenderManager(
bool proceed, const base::TimeTicks& proceed_time,
bool* proceed_to_fire_unload) {
- before_unload_end_time_ = proceed_time;
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ BeforeUnloadFired(proceed_time));
if (delegate_)
delegate_->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
+ // Note: |this| can be deleted at this point.
Avi (use Gerrit) 2013/06/19 05:00:01 "can be deleted" sounds like permission. Perhaps "
}
void WebContentsImpl::RenderViewGoneFromRenderManager(
@@ -3647,7 +3604,9 @@
// spinning, since we forced it to start spinning in Navigate.
DidStopLoading(rvh);
controller_.DiscardNonCommittedEntries();
- OnCloseCanceled();
+
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ BeforeUnloadDialogCancelled());
}
is_showing_before_unload_dialog_ = false;
static_cast<RenderViewHostImpl*>(
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698