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

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

Issue 874643003: Add UMA histogram timers for ProcessManager and BackgroundContentsService startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 g_event_page_suspending_time_msec = suspending_time_msec; 744 g_event_page_suspending_time_msec = suspending_time_msec;
745 } 745 }
746 746
747 void ProcessManager::Observe(int type, 747 void ProcessManager::Observe(int type,
748 const content::NotificationSource& source, 748 const content::NotificationSource& source,
749 const content::NotificationDetails& details) { 749 const content::NotificationDetails& details) {
750 switch (type) { 750 switch (type) {
751 case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: { 751 case extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED: {
752 // TODO(jamescook): Convert this to use ExtensionSystem::ready() instead 752 // TODO(jamescook): Convert this to use ExtensionSystem::ready() instead
753 // of a notification. 753 // of a notification.
754 const base::TimeTicks start_time = base::TimeTicks::Now();
754 MaybeCreateStartupBackgroundHosts(); 755 MaybeCreateStartupBackgroundHosts();
756 UMA_HISTOGRAM_TIMES("Extensions.ProcessManagerStartupHostsTime",
757 base::TimeTicks::Now() - start_time);
755 break; 758 break;
756 } 759 }
757 760
758 case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: { 761 case extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: {
759 BrowserContext* context = content::Source<BrowserContext>(source).ptr(); 762 BrowserContext* context = content::Source<BrowserContext>(source).ptr();
760 ExtensionSystem* system = ExtensionSystem::Get(context); 763 ExtensionSystem* system = ExtensionSystem::Get(context);
761 if (system->ready().is_signaled()) { 764 if (system->ready().is_signaled()) {
762 // The extension system is ready, so create the background host. 765 // The extension system is ready, so create the background host.
763 const Extension* extension = 766 const Extension* extension =
764 content::Details<const Extension>(details).ptr(); 767 content::Details<const Extension>(details).ptr();
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 if (extension && !IncognitoInfo::IsSplitMode(extension)) { 1028 if (extension && !IncognitoInfo::IsSplitMode(extension)) {
1026 BrowserContext* original_context = 1029 BrowserContext* original_context =
1027 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext()); 1030 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext());
1028 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); 1031 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url);
1029 } 1032 }
1030 1033
1031 return ProcessManager::GetSiteInstanceForURL(url); 1034 return ProcessManager::GetSiteInstanceForURL(url);
1032 } 1035 }
1033 1036
1034 } // namespace extensions 1037 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698