summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 21:30:13 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 21:30:13 +0000
commit679082058ce725b3bc6024c2bc01a7b99b79b3c6 (patch)
tree1b329c61f088fc8ee5888aad53413c49f0601acd /chrome/browser/metrics
parentf85ef10d2b6d6fe046523937bb530fbb1eeab0ae (diff)
downloadchromium_src-679082058ce725b3bc6024c2bc01a7b99b79b3c6.zip
chromium_src-679082058ce725b3bc6024c2bc01a7b99b79b3c6.tar.gz
chromium_src-679082058ce725b3bc6024c2bc01a7b99b79b3c6.tar.bz2
Start trimming headers included in the slowest to compile files.
Big chunk in the automation code. BUG=none TEST=none Review URL: http://codereview.chromium.org/3056007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_service.cc38
-rw-r--r--chrome/browser/metrics/metrics_service.h45
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc1
-rw-r--r--chrome/browser/metrics/metrics_service_unittest.cc1
4 files changed, 45 insertions, 40 deletions
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 87eae58..9a93091 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -164,24 +164,29 @@
#endif
#include "base/base64.h"
+#include "base/histogram.h"
#include "base/md5.h"
#include "base/thread.h"
+#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/load_notification_details.h"
#include "chrome/browser/memory_details.h"
#include "chrome/browser/metrics/histogram_synchronizer.h"
+#include "chrome/browser/metrics/metrics_log.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/common/child_process_info.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "webkit/glue/plugins/plugin_list.h"
+#include "webkit/glue/plugins/webplugininfo.h"
#include "libxml/xmlwriter.h"
#if !defined(OS_WIN)
@@ -284,6 +289,39 @@ static const size_t kMaxOngoingLogsPersisted = 8;
// checksum of the elements.
static const size_t kChecksumEntryCount = 2;
+// This is used to quickly log stats from child process related notifications in
+// MetricsService::child_stats_buffer_. The buffer's contents are transferred
+// out when Local State is periodically saved. The information is then
+// reported to the UMA server on next launch.
+struct MetricsService::ChildProcessStats {
+ public:
+ explicit ChildProcessStats(ChildProcessInfo::ProcessType type)
+ : process_launches(0),
+ process_crashes(0),
+ instances(0),
+ process_type(type) {}
+
+ // This constructor is only used by the map to return some default value for
+ // an index for which no value has been assigned.
+ ChildProcessStats()
+ : process_launches(0),
+ process_crashes(0),
+ instances(0),
+ process_type(ChildProcessInfo::UNKNOWN_PROCESS) {}
+
+ // The number of times that the given child process has been launched
+ int process_launches;
+
+ // The number of times that the given child process has crashed
+ int process_crashes;
+
+ // The number of instances of this child process that have been created.
+ // An instance is a DOM object rendered by this child process during a page
+ // load.
+ int instances;
+
+ ChildProcessInfo::ProcessType process_type;
+};
// Handles asynchronous fetching of memory details.
// Will run the provided task after finished.
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index 5066d82..9cf7831 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -8,23 +8,16 @@
#ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
#define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
-#include <list>
#include <map>
-#include <set>
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
-#include "base/histogram.h"
#include "base/scoped_ptr.h"
-#include "base/values.h"
-#include "chrome/browser/metrics/metrics_log.h"
-#include "chrome/common/child_process_info.h"
#include "chrome/common/metrics_helpers.h"
#include "chrome/common/net/url_fetcher.h"
#include "chrome/common/notification_registrar.h"
-#include "webkit/glue/plugins/webplugininfo.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/external_metrics.h"
@@ -32,9 +25,13 @@
class BookmarkModel;
class BookmarkNode;
+class DictionaryValue;
+class ListValue;
class HistogramSynchronizer;
+class MetricsLogBase;
class PrefService;
class TemplateURLModel;
+struct WebPluginInfo;
// Forward declaration of the xmlNode to avoid having tons of gyp files
// needing to depend on the libxml third party lib.
@@ -42,39 +39,6 @@ struct _xmlNode;
typedef struct _xmlNode xmlNode;
typedef xmlNode* xmlNodePtr;
-// This is used to quickly log stats from child process related notifications in
-// MetricsService::child_stats_buffer_. The buffer's contents are transferred
-// out when Local State is periodically saved. The information is then
-// reported to the UMA server on next launch.
-struct ChildProcessStats {
- public:
- explicit ChildProcessStats(ChildProcessInfo::ProcessType type)
- : process_launches(0),
- process_crashes(0),
- instances(0),
- process_type(type) {}
-
- // This constructor is only used by the map to return some default value for
- // an index for which no value has been assigned.
- ChildProcessStats()
- : process_launches(0),
- process_crashes(0),
- instances(0),
- process_type(ChildProcessInfo::UNKNOWN_PROCESS) {}
-
- // The number of times that the given child process has been launched
- int process_launches;
-
- // The number of times that the given child process has crashed
- int process_crashes;
-
- // The number of instances of this child process that have been created.
- // An instance is a DOM object rendered by this child process during a page
- // load.
- int instances;
-
- ChildProcessInfo::ProcessType process_type;
-};
class MetricsService : public NotificationObserver,
public URLFetcher::Delegate,
@@ -494,6 +458,7 @@ class MetricsService : public NotificationObserver,
// Buffer of child process notifications for quick access. See
// ChildProcessStats documentation above for more details.
+ struct ChildProcessStats;
std::map<std::wstring, ChildProcessStats> child_process_stats_buffer_;
ScopedRunnableMethodFactory<MetricsService> log_sender_factory_;
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index d705508..fcadfa2a 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
+#include "base/values.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/pref_value_store.h"
diff --git a/chrome/browser/metrics/metrics_service_unittest.cc b/chrome/browser/metrics/metrics_service_unittest.cc
index e2c822d..6a1026c 100644
--- a/chrome/browser/metrics/metrics_service_unittest.cc
+++ b/chrome/browser/metrics/metrics_service_unittest.cc
@@ -9,6 +9,7 @@
#include "base/base64.h"
#include "base/md5.h"
+#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"