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

Unified Diff: content/browser/browser_child_process_host_impl.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
« no previous file with comments | « content/browser/browser_child_process_host_impl.h ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_child_process_host_impl.cc
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 15f619a089d7b7ba5f2ebaeed8e229b9a6e4693f..0956c8beb6d5447f8e570d7f9b9295a610047f9e 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -312,7 +312,7 @@ void BrowserChildProcessHostImpl::BindInterface(
}
void BrowserChildProcessHostImpl::HistogramBadMessageTerminated(
- int process_type) {
+ ProcessType process_type) {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.BadMessgeTerminated", process_type,
PROCESS_TYPE_MAX);
}
@@ -369,7 +369,7 @@ void BrowserChildProcessHostImpl::OnBadMessageReceived(
void BrowserChildProcessHostImpl::TerminateOnBadMessageReceived(
const std::string& error) {
- HistogramBadMessageTerminated(data_.process_type);
+ HistogramBadMessageTerminated(static_cast<ProcessType>(data_.process_type));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableKillAfterBadIPC)) {
return;
@@ -409,7 +409,7 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
BrowserThread::UI, FROM_HERE,
base::Bind(&NotifyProcessCrashed, data_, exit_code));
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed2",
- data_.process_type,
+ static_cast<ProcessType>(data_.process_type),
PROCESS_TYPE_MAX);
break;
}
@@ -426,25 +426,25 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
base::Bind(&NotifyProcessKilled, data_, exit_code));
// Report that this child process was killed.
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2",
- data_.process_type,
+ static_cast<ProcessType>(data_.process_type),
PROCESS_TYPE_MAX);
break;
}
case base::TERMINATION_STATUS_STILL_RUNNING: {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.DisconnectedAlive2",
- data_.process_type,
+ static_cast<ProcessType>(data_.process_type),
PROCESS_TYPE_MAX);
}
default:
break;
}
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected2",
- data_.process_type,
+ static_cast<ProcessType>(data_.process_type),
PROCESS_TYPE_MAX);
#if defined(OS_CHROMEOS)
if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM) {
UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2.OOM",
- data_.process_type,
+ static_cast<ProcessType>(data_.process_type),
PROCESS_TYPE_MAX);
}
#endif
@@ -584,7 +584,8 @@ void BrowserChildProcessHostImpl::OnMojoError(
}
if (!process)
return;
- HistogramBadMessageTerminated(process->data_.process_type);
+ HistogramBadMessageTerminated(
+ static_cast<ProcessType>(process->data_.process_type));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableKillAfterBadIPC)) {
return;
« no previous file with comments | « content/browser/browser_child_process_host_impl.h ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698