Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service.cc |
| diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc |
| index 2342d74c6a49060786494205f0e6de81c9f4ff59..b0fa350f10bdd8045604a5ca11c7abf283a84c32 100644 |
| --- a/chrome/browser/metrics/metrics_service.cc |
| +++ b/chrome/browser/metrics/metrics_service.cc |
| @@ -178,7 +178,6 @@ |
| #include "content/browser/load_notification_details.h" |
| #include "content/browser/plugin_service.h" |
| #include "content/browser/renderer_host/render_process_host.h" |
| -#include "content/common/child_process_info.h" |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/common/url_fetcher.h" |
| #include "webkit/plugins/npapi/plugin_list.h" |
| @@ -1358,7 +1357,7 @@ void MetricsService::LogChildProcessChange( |
| stats.process_crashes++; |
| // Exclude plugin crashes from the count below because we report them via |
| // a separate UMA metric. |
| - if (child_details->type() != ChildProcessInfo::PLUGIN_PROCESS) { |
| + if (!IsPluginProcess(child_details->type())) { |
| IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); |
| } |
| break; |
| @@ -1475,7 +1474,7 @@ void MetricsService::RecordPluginChanges(PrefService* pref) { |
| ChildProcessStats stats = cache_iter->second; |
| // Insert only plugins information into the plugins list. |
| - if (ChildProcessInfo::PLUGIN_PROCESS != stats.process_type) |
| + if (!IsPluginProcess(stats.process_type)) |
| continue; |
| // TODO(viettrungluu): remove conversion |
| @@ -1521,6 +1520,20 @@ void MetricsService::RecordCurrentState(PrefService* pref) { |
| RecordPluginChanges(pref); |
| } |
| +// static |
| +bool MetricsService::IsPluginProcess(ChildProcessInfo::ProcessType type) { |
| + switch (type) { |
| + case ChildProcessInfo::PLUGIN_PROCESS: |
| +#if defined(OS_CHROMEOS) |
| + case ChildProcessInfo::PPAPI_PLUGIN_PROCESS: |
|
jar (doing other things)
2011/11/08 22:16:31
Could you just use a traditional logical ||, and n
petkov
2011/11/09 14:21:07
Done.
|
| +#endif |
| + return true; |
| + default: |
| + break; |
| + } |
| + return false; |
| +} |
| + |
| static bool IsSingleThreaded() { |
| static base::PlatformThreadId thread_id = 0; |
| if (!thread_id) |