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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 883023003: Add UMA for startup load time of component extensions. At the moment there is (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const Created 5 years, 10 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 | « chrome/browser/extensions/component_loader.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit 1401 // Calling UnloadAllExtensionsForTest here triggers a false-positive presubmit
1402 // warning about calling test code in production. 1402 // warning about calling test code in production.
1403 UnloadAllExtensionsInternal(); 1403 UnloadAllExtensionsInternal();
1404 component_loader_->LoadAll(); 1404 component_loader_->LoadAll();
1405 extensions::InstalledLoader(this).LoadAllExtensions(); 1405 extensions::InstalledLoader(this).LoadAllExtensions();
1406 // Don't call SetReadyAndNotifyListeners() since tests call this multiple 1406 // Don't call SetReadyAndNotifyListeners() since tests call this multiple
1407 // times. 1407 // times.
1408 } 1408 }
1409 1409
1410 void ExtensionService::SetReadyAndNotifyListeners() { 1410 void ExtensionService::SetReadyAndNotifyListeners() {
1411 const base::TimeTicks start_time = base::TimeTicks::Now();
1411 ready_->Signal(); 1412 ready_->Signal();
1412 content::NotificationService::current()->Notify( 1413 content::NotificationService::current()->Notify(
1413 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, 1414 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
1414 content::Source<Profile>(profile_), 1415 content::Source<Profile>(profile_),
1415 content::NotificationService::NoDetails()); 1416 content::NotificationService::NoDetails());
1417 UMA_HISTOGRAM_TIMES("Extensions.ExtensionServiceNotifyReadyListenersTime",
1418 base::TimeTicks::Now() - start_time);
1416 } 1419 }
1417 1420
1418 void ExtensionService::OnLoadedInstalledExtensions() { 1421 void ExtensionService::OnLoadedInstalledExtensions() {
1419 if (updater_) 1422 if (updater_)
1420 updater_->Start(); 1423 updater_->Start();
1421 1424
1422 OnBlacklistUpdated(); 1425 OnBlacklistUpdated();
1423 } 1426 }
1424 1427
1425 void ExtensionService::AddExtension(const Extension* extension) { 1428 void ExtensionService::AddExtension(const Extension* extension) {
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 } 2532 }
2530 2533
2531 void ExtensionService::OnProfileDestructionStarted() { 2534 void ExtensionService::OnProfileDestructionStarted() {
2532 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2535 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2533 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2536 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2534 it != ids_to_unload.end(); 2537 it != ids_to_unload.end();
2535 ++it) { 2538 ++it) {
2536 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2539 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2537 } 2540 }
2538 } 2541 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698