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

Unified Diff: chrome/browser/performance_monitor/performance_monitor.h

Issue 10837003: CPM Refactor and Cleanup (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_startup_times
Patch Set: Merged with latest master Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/performance_monitor/performance_monitor.h
diff --git a/chrome/browser/performance_monitor/performance_monitor.h b/chrome/browser/performance_monitor/performance_monitor.h
index b0875669102ed7b08c4961d1deedbb4280649486..167e3a9e4d715b3af184f28b76fbe8d273a54e02 100644
--- a/chrome/browser/performance_monitor/performance_monitor.h
+++ b/chrome/browser/performance_monitor/performance_monitor.h
@@ -22,14 +22,17 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/render_process_host.h"
+
+namespace extensions {
+class Extension;
+}
namespace performance_monitor {
class Database;
class PerformanceMonitor : public content::NotificationObserver {
public:
- typedef base::Callback<void(const std::string&)> StateValueCallback;
-
typedef std::map<base::ProcessHandle,
linked_ptr<base::ProcessMetrics> > MetricsMap;
@@ -48,9 +51,6 @@ class PerformanceMonitor : public content::NotificationObserver {
// start collecting data.
void Start();
- // Gathers CPU usage and memory usage of all Chrome processes.
- void GatherStatisticsOnBackgroundThread();
-
// content::NotificationObserver
// Wait for various notifications; insert events into the database upon
// occurance.
@@ -63,7 +63,7 @@ class PerformanceMonitor : public content::NotificationObserver {
private:
friend struct DefaultSingletonTraits<PerformanceMonitor>;
- FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorBrowserTest, NewVersionEvent);
+ friend class PerformanceMonitorBrowserTest;
FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorUncleanExitBrowserTest,
OneProfileUncleanExit);
FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorUncleanExitBrowserTest,
@@ -99,6 +99,21 @@ class PerformanceMonitor : public content::NotificationObserver {
void AddEventOnBackgroundThread(scoped_ptr<Event> event);
+ // Notify any listeners that PerformanceMonitor has finished the initializing.
+ void NotifyInitialized();
+
+ // Perform any collections that are done on a timed basis.
+ void DoTimedCollections();
+
+ // Update the database record of the last time the active profiles were
+ // running; this is used in determining when an unclean exit occurred.
+ void UpdateLiveProfiles();
+ void UpdateLiveProfilesHelper(
+ scoped_ptr<std::set<std::string> > active_profiles, std::string time);
+
+ // Gathers CPU usage and memory usage of all Chrome processes in order to.
+ void GatherStatisticsOnBackgroundThread();
+
// Gathers the CPU usage of every Chrome process that has been running since
// the last call to GatherStatistics().
void GatherCPUUsageOnBackgroundThread();
@@ -109,23 +124,15 @@ class PerformanceMonitor : public content::NotificationObserver {
// Updates the ProcessMetrics map with the current list of processes.
void UpdateMetricsMapOnBackgroundThread();
- // Gets the corresponding value of |key| from the database, and then runs
- // |callback| on the UI thread with that value as a parameter.
- void GetStateValueOnBackgroundThread(
- const std::string& key,
- const StateValueCallback& callback);
-
- // Notify any listeners that PerformanceMonitor has finished the initializing.
- void NotifyInitialized();
-
- // Update the database record of the last time the active profiles were
- // running; this is used in determining when an unclean exit occurred.
- void UpdateLiveProfiles();
- void UpdateLiveProfilesHelper(
- scoped_ptr<std::set<std::string> > active_profiles, std::string time);
+ // Generate an appropriate ExtensionEvent for an extension-related occurrance
+ // and insert it in the database.
+ void AddExtensionEvent(EventType type,
+ const extensions::Extension* extension);
- // Perform any collections that are done on a timed basis.
- void DoTimedCollections();
+ // Generate an appropriate CrashEvent for a renderer crash and insert it in
+ // the database.
+ void AddCrashEvent(
+ const content::RenderProcessHost::RendererClosedDetails& details);
// The location at which the database files are stored; if empty, the database
// will default to '<user_data_dir>/performance_monitor_dbs'.
« no previous file with comments | « chrome/browser/performance_monitor/events.json ('k') | chrome/browser/performance_monitor/performance_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698