Suppress a few -Wunreachable-code warnings.
No behavior change. Bug: 346399 Change-Id: I9d9e855d94fc646faecd69580ef280a6763ba28b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2102631 Commit-Queue: Nico Weber <thakis@chromium.org> Auto-Submit: Nico Weber <thakis@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#750287}
This commit is contained in:
chrome/browser
components/optimization_guide
content/browser/media
pdf/pdfium
third_party/blink/renderer
@ -91,7 +91,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
|
||||
// between URL schemes with handers and those without. This will
|
||||
// make the default behaviour be search on Linux.
|
||||
return metrics::OmniboxInputType::EMPTY;
|
||||
#endif // defined(OS_LINUX)
|
||||
#else
|
||||
// If block state is unknown, check if there is an application registered
|
||||
// for the url scheme.
|
||||
GURL url(scheme + "://");
|
||||
@ -99,6 +99,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
|
||||
shell_integration::GetApplicationNameForProtocol(url);
|
||||
return application_name.empty() ? metrics::OmniboxInputType::EMPTY
|
||||
: metrics::OmniboxInputType::URL;
|
||||
#endif // defined(OS_LINUX)
|
||||
}
|
||||
}
|
||||
NOTREACHED();
|
||||
|
@ -57,8 +57,7 @@ bool ShouldShowFirstRunDialog() {
|
||||
#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
// On non-official builds, only --force-first-run-dialog will show the dialog.
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#else
|
||||
base::FilePath local_state_path;
|
||||
base::PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
|
||||
if (base::PathExists(local_state_path))
|
||||
@ -83,6 +82,7 @@ bool ShouldShowFirstRunDialog() {
|
||||
is_opt_in ? metrics::EnableMetricsDefault::OPT_IN
|
||||
: metrics::EnableMetricsDefault::OPT_OUT);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
#endif // !OS_CHROMEOS
|
||||
|
||||
|
@ -397,12 +397,10 @@ class OptimizationGuideStoreTest : public testing::Test {
|
||||
const auto& hint_entry = db_store_.find(hint_entry_key);
|
||||
if (hint_entry == db_store_.end()) {
|
||||
FAIL() << "No entry found for component hint: " << hint_entry_key;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hint_entry->second.has_hint()) {
|
||||
FAIL() << "Component hint entry does not have hint: " << hint_entry_key;
|
||||
continue;
|
||||
}
|
||||
|
||||
EXPECT_EQ(hint_entry->second.hint().key(), host_suffix);
|
||||
@ -1277,7 +1275,6 @@ TEST_F(OptimizationGuideStoreTest, LoadHintSuccessInitialData) {
|
||||
OptimizationGuideStore::EntryKey hint_entry_key;
|
||||
if (!guide_store()->FindHintEntryKey(host_suffix, &hint_entry_key)) {
|
||||
FAIL() << "Hint entry not found for host suffix: " << host_suffix;
|
||||
continue;
|
||||
}
|
||||
|
||||
guide_store()->LoadHint(
|
||||
@ -1291,7 +1288,6 @@ TEST_F(OptimizationGuideStoreTest, LoadHintSuccessInitialData) {
|
||||
EXPECT_EQ(last_loaded_entry_key(), hint_entry_key);
|
||||
if (!last_loaded_hint()) {
|
||||
FAIL() << "Loaded hint was null for entry key: " << hint_entry_key;
|
||||
continue;
|
||||
}
|
||||
|
||||
EXPECT_EQ(last_loaded_hint()->hint()->key(), host_suffix);
|
||||
@ -1321,7 +1317,6 @@ TEST_F(OptimizationGuideStoreTest, LoadHintSuccessUpdateData) {
|
||||
OptimizationGuideStore::EntryKey hint_entry_key;
|
||||
if (!guide_store()->FindHintEntryKey(host_suffix, &hint_entry_key)) {
|
||||
FAIL() << "Hint entry not found for host suffix: " << host_suffix;
|
||||
continue;
|
||||
}
|
||||
|
||||
guide_store()->LoadHint(
|
||||
@ -1335,7 +1330,6 @@ TEST_F(OptimizationGuideStoreTest, LoadHintSuccessUpdateData) {
|
||||
EXPECT_EQ(last_loaded_entry_key(), hint_entry_key);
|
||||
if (!last_loaded_hint()) {
|
||||
FAIL() << "Loaded hint was null for entry key: " << hint_entry_key;
|
||||
continue;
|
||||
}
|
||||
|
||||
EXPECT_EQ(last_loaded_hint()->hint()->key(), host_suffix);
|
||||
@ -1998,7 +1992,6 @@ TEST_F(OptimizationGuideStoreTest, LoadHostModelFeaturesForHost) {
|
||||
if (!last_loaded_host_model_features()) {
|
||||
FAIL() << "Loaded host model features was null for entry key: "
|
||||
<< entry_key;
|
||||
continue;
|
||||
}
|
||||
|
||||
EXPECT_EQ(last_loaded_host_model_features()->host(), host_suffix);
|
||||
|
@ -118,9 +118,7 @@ void GetHardwareSecureDecryptionCaps(
|
||||
#if !BUILDFLAG(ENABLE_MOJO_VIDEO_DECODER)
|
||||
DVLOG(1) << "Hardware secure codecs not supported because mojo video "
|
||||
"decode was disabled at buildtime";
|
||||
return;
|
||||
#endif
|
||||
|
||||
#else
|
||||
base::flat_set<media::VideoCodec> video_codec_set;
|
||||
base::flat_set<media::EncryptionScheme> encryption_scheme_set;
|
||||
|
||||
@ -130,6 +128,7 @@ void GetHardwareSecureDecryptionCaps(
|
||||
|
||||
*video_codecs = SetToVector(video_codec_set);
|
||||
*encryption_schemes = SetToVector(encryption_scheme_set);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -1575,7 +1575,8 @@ void PDFiumEngine::StartFind(const std::string& text, bool case_sensitive) {
|
||||
base::string16 str = base::UTF8ToUTF16(text);
|
||||
// Don't use PDFium to search for now, since it doesn't support unicode
|
||||
// text. Leave the code for now to avoid bit-rot, in case it's fixed later.
|
||||
if (0) {
|
||||
// The extra parens suppress a -Wunreachable-code warning.
|
||||
if ((0)) {
|
||||
SearchUsingPDFium(str, case_sensitive, first_search,
|
||||
character_to_start_searching_from, current_page);
|
||||
} else {
|
||||
|
@ -4438,9 +4438,7 @@ void LocalFrameView::UpdateLayerDebugInfoEnabled() {
|
||||
DCHECK(frame_->IsLocalRoot());
|
||||
#if DCHECK_IS_ON()
|
||||
DCHECK(layer_debug_info_enabled_);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#else
|
||||
bool should_enable =
|
||||
cc::frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() ||
|
||||
WebTestSupport::IsRunningWebTest() ||
|
||||
@ -4449,6 +4447,7 @@ void LocalFrameView::UpdateLayerDebugInfoEnabled() {
|
||||
layer_debug_info_enabled_ = should_enable;
|
||||
SetPaintArtifactCompositorNeedsUpdate();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
OverlayInterstitialAdDetector&
|
||||
|
@ -1621,9 +1621,7 @@ TEST_P(PaintControllerTest, DuplicatedSubsequences) {
|
||||
#if DCHECK_IS_ON()
|
||||
EXPECT_DEATH(paint_duplicated_subsequences(),
|
||||
"Multiple subsequences for client: \"test\"");
|
||||
return;
|
||||
#endif
|
||||
|
||||
#else
|
||||
// The following is for non-DCHECK path. No security CHECK should trigger.
|
||||
paint_duplicated_subsequences();
|
||||
// Paint again.
|
||||
@ -1642,6 +1640,7 @@ TEST_P(PaintControllerTest, DuplicatedSubsequences) {
|
||||
DrawRect(context, client, kForegroundType, FloatRect(100, 100, 100, 100));
|
||||
}
|
||||
CommitAndFinishCycle();
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_P(PaintControllerTest, DeletedClientInUnderInvaldiatedSubsequence) {
|
||||
|
Reference in New Issue
Block a user