| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 163 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 164 "464206 ExtensionHost::CreateRenderViewNow2")); | 164 "464206 ExtensionHost::CreateRenderViewNow2")); |
| 165 DCHECK(IsRenderViewLive()); | 165 DCHECK(IsRenderViewLive()); |
| 166 if (extension_) { | 166 if (extension_) { |
| 167 std::string group_name = base::FieldTrialList::FindFullName( | 167 std::string group_name = base::FieldTrialList::FindFullName( |
| 168 "ThrottleExtensionBackgroundPages"); | 168 "ThrottleExtensionBackgroundPages"); |
| 169 if ((group_name == "ThrottlePersistent" && | 169 if ((group_name == "ThrottlePersistent" && |
| 170 extensions::BackgroundInfo::HasPersistentBackgroundPage( | 170 extensions::BackgroundInfo::HasPersistentBackgroundPage( |
| 171 extension_)) || | 171 extension_)) || |
| 172 group_name == "ThrottleAll") { | 172 group_name == "ThrottleAll") { |
| 173 host_contents_->WasHidden(); | 173 host_contents_->MarkBackgrounded(); |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed. | 176 // TODO(robliao): Remove ScopedTracker below once crbug.com/464206 is fixed. |
| 177 tracked_objects::ScopedTracker tracking_profile3( | 177 tracked_objects::ScopedTracker tracking_profile3( |
| 178 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 178 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 179 "464206 ExtensionHost::CreateRenderViewNow3")); | 179 "464206 ExtensionHost::CreateRenderViewNow3")); |
| 180 // Connect orphaned dev-tools instances. | 180 // Connect orphaned dev-tools instances. |
| 181 delegate_->OnRenderViewCreatedForBackgroundPage(this); | 181 delegate_->OnRenderViewCreatedForBackgroundPage(this); |
| 182 } | 182 } |
| 183 } | 183 } |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 } | 486 } |
| 487 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { | 487 } else if (extension_host_type_ == VIEW_TYPE_EXTENSION_POPUP) { |
| 488 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", | 488 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupLoadTime2", |
| 489 load_start_->Elapsed()); | 489 load_start_->Elapsed()); |
| 490 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupCreateTime", | 490 UMA_HISTOGRAM_MEDIUM_TIMES("Extensions.PopupCreateTime", |
| 491 create_start_.Elapsed()); | 491 create_start_.Elapsed()); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace extensions | 495 } // namespace extensions |
| OLD | NEW |