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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 12662019: Split the ProcessType enum into process types that content knows about (which will remain in src\co… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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/metrics/metrics_service.cc
===================================================================
--- chrome/browser/metrics/metrics_service.cc (revision 189692)
+++ chrome/browser/metrics/metrics_service.cc (working copy)
@@ -187,6 +187,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_otr_state.h"
#include "chrome/common/child_process_logging.h"
+#include "chrome/common/chrome_process_type.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
@@ -335,12 +336,12 @@
// reported to the UMA server on next launch.
struct MetricsService::ChildProcessStats {
public:
- explicit ChildProcessStats(content::ProcessType type)
+ explicit ChildProcessStats(int process_type)
: process_launches(0),
process_crashes(0),
instances(0),
loading_errors(0),
- process_type(type) {}
+ process_type(process_type) {}
// This constructor is only used by the map to return some default value for
// an index for which no value has been assigned.
@@ -366,7 +367,7 @@
// process.
int loading_errors;
- content::ProcessType process_type;
+ int process_type;
};
// Handles asynchronous fetching of memory details.
@@ -649,7 +650,7 @@
GetChildProcessStats(data).process_crashes++;
// Exclude plugin crashes from the count below because we report them via
// a separate UMA metric.
- if (!IsPluginProcess(data.type))
+ if (!IsPluginProcess(data.process_type))
IncrementPrefValue(prefs::kStabilityChildProcessCrashCount);
}
@@ -1008,7 +1009,7 @@
void MetricsService::ReceivedProfilerData(
const tracked_objects::ProcessDataSnapshot& process_data,
- content::ProcessType process_type) {
+ int process_type) {
DCHECK_EQ(INIT_TASK_SCHEDULED, state_);
// Upon the first callback, create the initial log so that we can immediately
@@ -1723,8 +1724,10 @@
MetricsService::ChildProcessStats& MetricsService::GetChildProcessStats(
const content::ChildProcessData& data) {
const string16& child_name = data.name;
- if (!ContainsKey(child_process_stats_buffer_, child_name))
- child_process_stats_buffer_[child_name] = ChildProcessStats(data.type);
+ if (!ContainsKey(child_process_stats_buffer_, child_name)) {
+ child_process_stats_buffer_[child_name] =
+ ChildProcessStats(data.process_type);
+ }
return child_process_stats_buffer_[child_name];
}
@@ -1847,10 +1850,10 @@
}
// static
-bool MetricsService::IsPluginProcess(content::ProcessType type) {
- return (type == content::PROCESS_TYPE_PLUGIN ||
- type == content::PROCESS_TYPE_PPAPI_PLUGIN ||
- type == content::PROCESS_TYPE_PPAPI_BROKER);
+bool MetricsService::IsPluginProcess(int process_type) {
+ return (process_type == content::PROCESS_TYPE_PLUGIN ||
+ process_type == content::PROCESS_TYPE_PPAPI_PLUGIN ||
+ process_type == content::PROCESS_TYPE_PPAPI_BROKER);
}
#if defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698