| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |