Commit c86fd7fd authored by Robert Kroeger's avatar Robert Kroeger Committed by Commit Bot

Revert "Hook up the delay load failure function in the renderer processes (Take 2)"

This reverts commit 9a315e8e.

Reason for revert: https://crbug.com/978199: hook would appear to break the tab capture tests.

Original change's description:
> Hook up the delay load failure function in the renderer processes (Take 2)
> 
> (reland of
> https://chromium-review.googlesource.com/c/chromium/src/+/1655909 with
> the code living in a different compiland).
> 
> The problem with the previous CL was that renderer_main_platform_delegate_win.cc
> is linked into browser_tests.exe, which caused the hook to be used by the browser
> code.
> 
> I've verified this change by checking out the 3814, applying the fix to it and
> navigating to  https://opensource.salesforce.com/ to confirm that this was
> generating a crash report.
> 
> -------- Original CL description -------------
> 
> This allows getting a crash report when failing to delay load a DLL.
> 
> Example of the stack trace that this will provide:
> chrome_child!base::debug::BreakDebugger+0xc [C:\src\chrome\src\base\debug\debugger_win.cc @ 28]
> chrome_child!logging::LogMessage::~LogMessage+0x3f5 [C:\src\chrome\src\base\logging.cc @ 939]
> chrome_child!DllLoadHook+0x75 [C:\src\chrome\src\chrome\child\delay_load_failure_hook.cc @ 24]
> chrome_child!__delayLoadHelper2+0x13f [d:\agent\_work\3\s\src\vctools\delayimp\delayhlp.cpp @ 305]
> chrome_child!RtlUnwind+0x470
> chrome_child!SkFontMgr::legacyMakeTypeface+0x13 [C:\src\chrome\src\third_party\skia\src\core\SkFontMgr.cpp @ 164]
> chrome_child!blink::DWriteVersionSupportsVariations+0x7f
> chrome_child!blink::WebFontTypefaceFactory::FontManagerForVariations+0xc
> 
> 
> Bug: 970893, 976241
> Change-Id: Ifeb5e79ee141c5eb121e379ff928a9c3d941e71c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665913
> Reviewed-by: Will Harris <wfh@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Auto-Submit: Sébastien Marchand <sebmarchand@chromium.org>
> Commit-Queue: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#670968}

TBR=sky@chromium.org,wfh@chromium.org,sebmarchand@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 970893, 976241
Change-Id: I08cf199c5ad21966530f0a325c2f5097786d5882
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1674610Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Robert Kroeger <rjkroege@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671874}
parent aba1a495
...@@ -14,7 +14,6 @@ static_library("child") { ...@@ -14,7 +14,6 @@ static_library("child") {
if (is_win) { if (is_win) {
sources += [ sources += [
"delay_load_failure_hook.cc",
"v8_crashpad_support_win.cc", "v8_crashpad_support_win.cc",
"v8_crashpad_support_win.h", "v8_crashpad_support_win.h",
] ]
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// windows.h needs to be included before delayimp.h.
#include <windows.h>
#include <delayimp.h>
#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
namespace {
// Delay load failure hook that generates a crash report. By default a failure
// to delay load will trigger an exception handled by the delay load runtime and
// this won't generate a crash report.
extern "C" FARPROC WINAPI DelayLoadFailureHook(unsigned reason,
DelayLoadInfo* dll_info) {
char dll_name[256];
base::strlcpy(dll_name, dll_info->szDll, base::size(dll_name));
base::debug::Alias(&dll_name);
CHECK(false);
return 0;
}
} // namespace
// Set the delay load failure hook to the function above.
//
// The |__pfnDliFailureHook2| failure notification hook gets called
// automatically by the delay load runtime in case of failure, see
// https://docs.microsoft.com/en-us/cpp/build/reference/failure-hooks?view=vs-2019
// for more information about this.
extern "C" const PfnDliHook __pfnDliFailureHook2 = DelayLoadFailureHook;
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