Commit 6d695657 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Revert "Enable -Wunreachable-code on Windows."

This reverts commit e334b16e.

Reason for revert: Breaks win-asan

https://ci.chromium.org/p/chromium/builders/ci/win-asan/11193

../../sandbox/win/src/process_mitigations_dyncode_unittest.cc(414,31): error: code will never be executed [-Werror,-Wunreachable-code]
std::wstring test_command = L"CheckPolicy ";
^~~~~~~~~~~~~~~
../../sandbox/win/src/process_mitigations_dyncode_unittest.cc(490,31): error: code will never be executed [-Werror,-Wunreachable-code]
std::wstring test_command = L"CheckPolicy ";
^~~~~~~~~~~~~~~


Original change's description:
> Enable -Wunreachable-code on Windows.
> 
> TBR=reillyg
> 
> Bug: 346399
> Change-Id: I7f52d34dd3be08485c1aace38f2f61d1d4f14176
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122428
> Commit-Queue: Nico Weber <thakis@chromium.org>
> Auto-Submit: Nico Weber <thakis@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#753741}

TBR=thakis@chromium.org,reillyg@chromium.org,rsesek@chromium.org

Change-Id: I289e69d3147aa774a5637fffa850f55015ea5d67
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 346399
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122434Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753767}
parent f64a3fd8
...@@ -1593,7 +1593,7 @@ config("chromium_code") { ...@@ -1593,7 +1593,7 @@ config("chromium_code") {
# use_libfuzzer: https://crbug.com/1063180 # use_libfuzzer: https://crbug.com/1063180
if (!is_nacl && !use_libfuzzer && if (!is_nacl && !use_libfuzzer &&
(target_os == "android" || target_os == "chromeos" || (target_os == "android" || target_os == "chromeos" ||
target_os == "fuchsia" || target_os == "linux" || target_os == "win")) { target_os == "fuchsia" || target_os == "linux")) {
cflags += [ "-Wunreachable-code" ] cflags += [ "-Wunreachable-code" ]
} }
......
...@@ -453,23 +453,23 @@ void UpgradeDetectorImpl::Init() { ...@@ -453,23 +453,23 @@ void UpgradeDetectorImpl::Init() {
// Register for experiment notifications. // Register for experiment notifications.
variations::VariationsService* variations_service = variations::VariationsService* variations_service =
g_browser_process->variations_service(); g_browser_process->variations_service();
if (variations_service) { if (variations_service)
variations_service->AddObserver(this); variations_service->AddObserver(this);
}
// On Windows, only enable upgrade notifications for Google Chrome builds.
// Chromium does not use an auto-updater.
#if !defined(OS_WIN) || BUILDFLAG(GOOGLE_CHROME_BRANDING)
// On macOS, only enable upgrade notifications if the updater (Keystone) is #if defined(OS_WIN)
// present. // Only enable upgrade notifications for Google Chrome builds. Chromium does
#if defined(OS_MACOSX) // not use an auto-updater.
if (!BUILDFLAG(GOOGLE_CHROME_BRANDING))
return;
#elif defined(OS_MACOSX)
// Only enable upgrade notifications if the updater (Keystone) is present.
if (!keystone_glue::KeystoneEnabled()) if (!keystone_glue::KeystoneEnabled())
return; return;
#endif #elif defined(OS_POSIX)
// Always enable upgrade notifications regardless of branding.
// On non-macOS non-Windows, always enable upgrade notifications regardless #else
// of branding. #error Unsupported platform
#endif // defined(OS_WIN)
// Start checking for outdated builds sometime after startup completes. // Start checking for outdated builds sometime after startup completes.
base::PostTask( base::PostTask(
...@@ -482,7 +482,6 @@ void UpgradeDetectorImpl::Init() { ...@@ -482,7 +482,6 @@ void UpgradeDetectorImpl::Init() {
auto* const build_state = g_browser_process->GetBuildState(); auto* const build_state = g_browser_process->GetBuildState();
build_state->AddObserver(this); build_state->AddObserver(this);
installed_version_poller_.emplace(build_state); installed_version_poller_.emplace(build_state);
#endif
} }
void UpgradeDetectorImpl::Shutdown() { void UpgradeDetectorImpl::Shutdown() {
......
...@@ -37,17 +37,14 @@ ComPtr<ISoftwareBitmap> CreateWinBitmapFromSkBitmap( ...@@ -37,17 +37,14 @@ ComPtr<ISoftwareBitmap> CreateWinBitmapFromSkBitmap(
} }
ComPtr<ISoftwareBitmap> win_bitmap; ComPtr<ISoftwareBitmap> win_bitmap;
#if SK_PMCOLOR_BYTE_ORDER(R, G, B, A) const BitmapPixelFormat pixelFormat =
const BitmapPixelFormat pixel_format = (kN32_SkColorType == kRGBA_8888_SkColorType)
ABI::Windows::Graphics::Imaging::BitmapPixelFormat_Rgba8; ? ABI::Windows::Graphics::Imaging::BitmapPixelFormat_Rgba8
#else : ABI::Windows::Graphics::Imaging::BitmapPixelFormat_Bgra8;
const BitmapPixelFormat pixel_format =
ABI::Windows::Graphics::Imaging::BitmapPixelFormat_Bgra8;
#endif
// Create ISoftwareBitmap from SKBitmap that is kN32_SkColorType and copy the // Create ISoftwareBitmap from SKBitmap that is kN32_SkColorType and copy the
// IBuffer into it. // IBuffer into it.
hr = bitmap_factory->CreateCopyFromBuffer( hr = bitmap_factory->CreateCopyFromBuffer(
buffer.Get(), pixel_format, bitmap.width(), bitmap.height(), &win_bitmap); buffer.Get(), pixelFormat, bitmap.width(), bitmap.height(), &win_bitmap);
if (FAILED(hr)) { if (FAILED(hr)) {
DLOG(ERROR) << "Create ISoftwareBitmap from buffer failed: " DLOG(ERROR) << "Create ISoftwareBitmap from buffer failed: "
<< logging::SystemErrorCodeToString(hr); << logging::SystemErrorCodeToString(hr);
......
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