Skip to content

Commit

Permalink
Fix Extensions.EventPageIdleTime histogram.
Browse files Browse the repository at this point in the history
It was incorrectly logging when non-event pages were loaded.

BUG=no


Review URL: https://chromiumcodereview.appspot.com/11411187

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169563 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mpcomplete@chromium.org committed Nov 27, 2012
1 parent 8806636 commit 759f34d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions chrome/browser/extensions/extension_process_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -687,15 +687,17 @@ Profile* ExtensionProcessManager::GetProfile() const {
void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
bool is_background) {
DCHECK_EQ(site_instance_->GetBrowserContext(), host->profile());
if (is_background)
if (is_background) {
background_hosts_.insert(host);
if (host->extension()->has_lazy_background_page()) {
linked_ptr<PerfTimer> since_unloaded(
background_page_data_[host->extension()->id()].
since_unloaded.release());
if (since_unloaded.get()) {
UMA_HISTOGRAM_LONG_TIMES("Extensions.EventPageIdleTime",
since_unloaded->Elapsed());

if (host->extension()->has_lazy_background_page()) {
linked_ptr<PerfTimer> since_unloaded(
background_page_data_[host->extension()->id()].
since_unloaded.release());
if (since_unloaded.get()) {
UMA_HISTOGRAM_LONG_TIMES("Extensions.EventPageIdleTime",
since_unloaded->Elapsed());
}
}
}
}
Expand Down

0 comments on commit 759f34d

Please sign in to comment.