Commit dd9c5e73 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Enable -Wimplicit-fallthrough on Android.

Fixes a bug where vr_shell counted VRMode::VR_BROWSER also as
VRMode::WEBVR and VRMode::VR_FULLSCREEN, and VRMode::WEBVR also
as VRMode::VR_FULLSCREEN in rappor.

Bug: 177475
Change-Id: I23a0c2b5fb94d34d407070ef0a9378d02fe4ba54
Reviewed-on: https://chromium-review.googlesource.com/899722Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534124}
parent cdff53de
...@@ -1429,7 +1429,8 @@ config("chromium_code") { ...@@ -1429,7 +1429,8 @@ config("chromium_code") {
# Warn on missing break statements at the end of switch cases. # Warn on missing break statements at the end of switch cases.
# For intentional fallthrough, use FALLTHROUGH; from base/compiler_specific.h # For intentional fallthrough, use FALLTHROUGH; from base/compiler_specific.h
# TODO(thakis): Enable for all platforms, https://crbug.com/177475 # TODO(thakis): Enable for all platforms, https://crbug.com/177475
if (is_clang && (is_fuchsia || (is_linux && !is_chromecast && !use_ozone))) { if (is_clang &&
(is_android || is_fuchsia || (is_linux && !is_chromecast && !use_ozone))) {
cflags += [ "-Wimplicit-fallthrough" ] cflags += [ "-Wimplicit-fallthrough" ]
} }
......
...@@ -112,6 +112,7 @@ static void JNI_BrowsingDataBridge_ClearBrowsingData( ...@@ -112,6 +112,7 @@ static void JNI_BrowsingDataBridge_ClearBrowsingData(
case browsing_data::BrowsingDataType::HOSTED_APPS_DATA: case browsing_data::BrowsingDataType::HOSTED_APPS_DATA:
// Only implemented on Desktop. // Only implemented on Desktop.
NOTREACHED(); NOTREACHED();
FALLTHROUGH;
case browsing_data::BrowsingDataType::NUM_TYPES: case browsing_data::BrowsingDataType::NUM_TYPES:
NOTREACHED(); NOTREACHED();
} }
......
...@@ -38,7 +38,8 @@ void VrMetricsUtil::LogGvrVersionForVrViewerType( ...@@ -38,7 +38,8 @@ void VrMetricsUtil::LogGvrVersionForVrViewerType(
encoded_version = kGvrTooOld; encoded_version = kGvrTooOld;
break; break;
} }
// Fall through since a version can be logged in this case. // Fall through since a version can be logged in this case.
FALLTHROUGH;
case VrCoreCompatibility::VR_CORE_COMPATIBILITY_VR_READY: case VrCoreCompatibility::VR_CORE_COMPATIBILITY_VR_READY:
encoded_version = encoded_version =
std::min(vr_core_info.gvr_sdk_version.major, 999) * 1000 * 1000 + std::min(vr_core_info.gvr_sdk_version.major, 999) * 1000 * 1000 +
......
...@@ -107,6 +107,7 @@ void SendRapporEnteredMode(const GURL& origin, vr::Mode mode) { ...@@ -107,6 +107,7 @@ void SendRapporEnteredMode(const GURL& origin, vr::Mode mode) {
case vr::Mode::kVrBrowsingFullscreen: case vr::Mode::kVrBrowsingFullscreen:
rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(), rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(),
"VR.FullScreenMode", origin); "VR.FullScreenMode", origin);
break;
default: default:
break; break;
} }
...@@ -117,12 +118,15 @@ void SendRapporEnteredVideoMode(const GURL& origin, vr::Mode mode) { ...@@ -117,12 +118,15 @@ void SendRapporEnteredVideoMode(const GURL& origin, vr::Mode mode) {
case vr::Mode::kVrBrowsingRegular: case vr::Mode::kVrBrowsingRegular:
rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(), rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(),
"VR.Video.Browser", origin); "VR.Video.Browser", origin);
break;
case vr::Mode::kWebVr: case vr::Mode::kWebVr:
rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(), rappor::SampleDomainAndRegistryFromGURL(rappor::GetDefaultService(),
"VR.Video.WebVR", origin); "VR.Video.WebVR", origin);
break;
case vr::Mode::kVrBrowsingFullscreen: case vr::Mode::kVrBrowsingFullscreen:
rappor::SampleDomainAndRegistryFromGURL( rappor::SampleDomainAndRegistryFromGURL(
rappor::GetDefaultService(), "VR.Video.FullScreenMode", origin); rappor::GetDefaultService(), "VR.Video.FullScreenMode", origin);
break;
default: default:
break; break;
} }
......
...@@ -806,7 +806,7 @@ void ChromeDownloadManagerDelegate::RequestConfirmation( ...@@ -806,7 +806,7 @@ void ChromeDownloadManagerDelegate::RequestConfirmation(
download, suggested_path, callback); download, suggested_path, callback);
return; return;
} }
// Fallthrough FALLTHROUGH;
// If we cannot reserve the path and the WebContent is already gone, there // If we cannot reserve the path and the WebContent is already gone, there
// is no way to prompt user for an infobar. This could happen after chrome // is no way to prompt user for an infobar. This could happen after chrome
......
...@@ -310,7 +310,7 @@ void GeolocationPermissionContextAndroid::UpdateLocationSettingsBackOff( ...@@ -310,7 +310,7 @@ void GeolocationPermissionContextAndroid::UpdateLocationSettingsBackOff(
break; break;
case LocationSettingsDialogBackOff::kOneMonth: case LocationSettingsDialogBackOff::kOneMonth:
backoff_level = LocationSettingsDialogBackOff::kThreeMonths; backoff_level = LocationSettingsDialogBackOff::kThreeMonths;
// fall through FALLTHROUGH;
case LocationSettingsDialogBackOff::kThreeMonths: case LocationSettingsDialogBackOff::kThreeMonths:
next_show += base::TimeDelta::FromDays(90); next_show += base::TimeDelta::FromDays(90);
break; break;
......
...@@ -208,11 +208,12 @@ PageInfoUI::IdentityInfo::GetSecurityDescription() const { ...@@ -208,11 +208,12 @@ PageInfoUI::IdentityInfo::GetSecurityDescription() const {
return CreateSecurityDescription(SecuritySummaryColor::GREEN, return CreateSecurityDescription(SecuritySummaryColor::GREEN,
IDS_PAGE_INFO_INTERNAL_PAGE, IDS_PAGE_INFO_INTERNAL_PAGE,
IDS_PAGE_INFO_INTERNAL_PAGE); IDS_PAGE_INFO_INTERNAL_PAGE);
#endif #else
// Internal pages on desktop have their own UI implementations which // Internal pages on desktop have their own UI implementations which
// should never call this function. // should never call this function.
NOTREACHED(); NOTREACHED();
FALLTHROUGH; FALLTHROUGH;
#endif
case PageInfo::SITE_IDENTITY_STATUS_CERT: case PageInfo::SITE_IDENTITY_STATUS_CERT:
case PageInfo::SITE_IDENTITY_STATUS_EV_CERT: case PageInfo::SITE_IDENTITY_STATUS_EV_CERT:
case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
......
...@@ -2397,6 +2397,7 @@ void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms( ...@@ -2397,6 +2397,7 @@ void RenderWidgetHostViewAndroid::ComputeEventLatencyOSTouchHistograms(
case ui::MotionEvent::ACTION_POINTER_UP: case ui::MotionEvent::ACTION_POINTER_UP:
UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
delta.InMicroseconds(), 1, 1000000, 50); delta.InMicroseconds(), 1, 1000000, 50);
return;
default: default:
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment