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

Side by Side Diff: extensions/browser/extension_host.cc

Issue 1154373007: Revert of Revert of Revert of Flip extension background page throttling on by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/extension_host.h" 5 #include "extensions/browser/extension_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 FROM_HERE_WITH_EXPLICIT_FUNCTION( 146 FROM_HERE_WITH_EXPLICIT_FUNCTION(
147 "464206 ExtensionHost::CreateRenderViewNow1")); 147 "464206 ExtensionHost::CreateRenderViewNow1"));
148 LoadInitialURL(); 148 LoadInitialURL();
149 if (IsBackgroundPage()) { 149 if (IsBackgroundPage()) {
150 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed. 150 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed.
151 tracked_objects::ScopedTracker tracking_profile2( 151 tracked_objects::ScopedTracker tracking_profile2(
152 FROM_HERE_WITH_EXPLICIT_FUNCTION( 152 FROM_HERE_WITH_EXPLICIT_FUNCTION(
153 "464206 ExtensionHost::CreateRenderViewNow2")); 153 "464206 ExtensionHost::CreateRenderViewNow2"));
154 DCHECK(IsRenderViewLive()); 154 DCHECK(IsRenderViewLive());
155 if (extension_) { 155 if (extension_) {
156 if (extensions::BackgroundInfo::HasPersistentBackgroundPage(extension_) && 156 std::string group_name = base::FieldTrialList::FindFullName(
157 base::FieldTrialList::FindFullName( 157 "ThrottleExtensionBackgroundPages");
158 "ThrottleExtensionBackgroundPages") != "Disabled") { 158 if ((group_name == "ThrottlePersistent" &&
159 extensions::BackgroundInfo::HasPersistentBackgroundPage(
160 extension_)) ||
161 group_name == "ThrottleAll") {
159 host_contents_->WasHidden(); 162 host_contents_->WasHidden();
160 } 163 }
161 } 164 }
162 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed. 165 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed.
163 tracked_objects::ScopedTracker tracking_profile3( 166 tracked_objects::ScopedTracker tracking_profile3(
164 FROM_HERE_WITH_EXPLICIT_FUNCTION( 167 FROM_HERE_WITH_EXPLICIT_FUNCTION(
165 "464206 ExtensionHost::CreateRenderViewNow3")); 168 "464206 ExtensionHost::CreateRenderViewNow3"));
166 // Connect orphaned dev-tools instances. 169 // Connect orphaned dev-tools instances.
167 delegate_->OnRenderViewCreatedForBackgroundPage(this); 170 delegate_->OnRenderViewCreatedForBackgroundPage(this);
168 } 171 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2", 471 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2",
469 load_start_->Elapsed()); 472 load_start_->Elapsed());
470 } 473 }
471 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { 474 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) {
472 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", 475 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2",
473 load_start_->Elapsed()); 476 load_start_->Elapsed());
474 } 477 }
475 } 478 }
476 479
477 } // namespace extensions 480 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698