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

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

Issue 1163983004: Revert of 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 std::string group_name = base::FieldTrialList::FindFullName( 156 if (extensions::BackgroundInfo::HasPersistentBackgroundPage(extension_) &&
157 "ThrottleExtensionBackgroundPages"); 157 base::FieldTrialList::FindFullName(
158 if ((group_name == "ThrottlePersistent" && 158 "ThrottleExtensionBackgroundPages") != "Disabled") {
159 extensions::BackgroundInfo::HasPersistentBackgroundPage(
160 extension_)) ||
161 group_name == "ThrottleAll") {
162 host_contents_->WasHidden(); 159 host_contents_->WasHidden();
163 } 160 }
164 } 161 }
165 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed. 162 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed.
166 tracked_objects::ScopedTracker tracking_profile3( 163 tracked_objects::ScopedTracker tracking_profile3(
167 FROM_HERE_WITH_EXPLICIT_FUNCTION( 164 FROM_HERE_WITH_EXPLICIT_FUNCTION(
168 "464206 ExtensionHost::CreateRenderViewNow3")); 165 "464206 ExtensionHost::CreateRenderViewNow3"));
169 // Connect orphaned dev-tools instances. 166 // Connect orphaned dev-tools instances.
170 delegate_->OnRenderViewCreatedForBackgroundPage(this); 167 delegate_->OnRenderViewCreatedForBackgroundPage(this);
171 } 168 }
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2", 468 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.BackgroundPageLoadTime2",
472 load_start_->Elapsed()); 469 load_start_->Elapsed());
473 } 470 }
474 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { 471 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) {
475 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", 472 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2",
476 load_start_->Elapsed()); 473 load_start_->Elapsed());
477 } 474 }
478 } 475 }
479 476
480 } // namespace extensions 477 } // 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