Bug 1403154 - Don't MOZ_CRASH in PerformanceNavigationTiming::Type if the navigation type is TYPE_RESERVED r=baku
MozReview-Commit-ID: A9lwpjRb3G6
--- a/dom/performance/PerformanceNavigationTiming.cpp
+++ b/dom/performance/PerformanceNavigationTiming.cpp
@@ -78,17 +78,18 @@ PerformanceNavigationTiming::Type()
break;
case nsDOMNavigationTiming::TYPE_RELOAD:
return NavigationType::Reload;
break;
case nsDOMNavigationTiming::TYPE_BACK_FORWARD:
return NavigationType::Back_forward;
break;
default:
- MOZ_CRASH(); // Should not happen
+ // The type is TYPE_RESERVED or some other value that was later added.
+ // We fallback to the default of Navigate.
return NavigationType::Navigate;
}
}
uint16_t
PerformanceNavigationTiming::RedirectCount()
{
return mTiming->GetRedirectCount();