Commit adf51bed authored by Alan Screen's avatar Alan Screen Committed by Chromium LUCI CQ

Revert "Turn a DCHECK() into a CHECK() in WebLocalFrameImpl."

This reverts commit ef8825ff.

Reason for revert: A reliable method for reproducing this behavior has been identified in b/176864633.  Remove this induced crash to reduce the impact being caused to a larger number of users while we work on moving forward with a proper fix to the underlying issue.

Original change's description:
> Turn a DCHECK() into a CHECK() in WebLocalFrameImpl.
>
> Turn |blink::WebLocalFrameImpl::is_in_printing_| from a variable only
> used for DCHECKs into one that is always CHECKed. Do this to help debug
> a printing crash that happens to users but not with any printing tests.
>
> Bug: 1121077
> Change-Id: Ieac894c4efdb67f028de13fc2a4bf5ed3a84c258
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373217
> Reviewed-by: Kent Tamura <tkent@chromium.org>
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#801268}

TBR=tkent@chromium.org

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

Bug: 1121077
Change-Id: I551fbc8229eea16d6a5cd95bf9306a6a0e0a9f6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616878Reviewed-by: default avatarAlan Screen <awscreen@chromium.org>
Reviewed-by: default avatardstockwell <dstockwell@google.com>
Commit-Queue: Alan Screen <awscreen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841368}
parent eb0cda6e
......@@ -723,7 +723,9 @@ void WebLocalFrameImpl::Close() {
if (print_context_)
PrintEnd();
print_client_.reset();
#if DCHECK_IS_ON()
is_in_printing_ = false;
#endif
}
WebString WebLocalFrameImpl::AssignedName() const {
......@@ -1611,10 +1613,12 @@ WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() {
void WebLocalFrameImpl::DispatchBeforePrintEvent(
base::WeakPtr<WebPrintClient> print_client) {
CHECK(!is_in_printing_) << "DispatchAfterPrintEvent() should have been "
"called after the previous "
"DispatchBeforePrintEvent() call.";
#if DCHECK_IS_ON()
DCHECK(!is_in_printing_) << "DispatchAfterPrintEvent() should have been "
"called after the previous "
"DispatchBeforePrintEvent() call.";
is_in_printing_ = true;
#endif
print_client_ = print_client;
......@@ -1630,9 +1634,11 @@ void WebLocalFrameImpl::DispatchBeforePrintEvent(
}
void WebLocalFrameImpl::DispatchAfterPrintEvent() {
CHECK(is_in_printing_) << "DispatchBeforePrintEvent() should be called "
"before DispatchAfterPrintEvent().";
#if DCHECK_IS_ON()
DCHECK(is_in_printing_) << "DispatchBeforePrintEvent() should be called "
"before DispatchAfterPrintEvent().";
is_in_printing_ = false;
#endif
print_client_.reset();
......
......@@ -584,11 +584,11 @@ class CORE_EXPORT WebLocalFrameImpl final
// cleared upon close().
SelfKeepAlive<WebLocalFrameImpl> self_keep_alive_;
#if DCHECK_IS_ON()
// True if DispatchBeforePrintEvent() was called, and
// DispatchAfterPrintEvent() is not called yet.
// TODO(crbug.com/1121077) After fixing the bug, make this member variable
// only available when DCHECK_IS_ON().
bool is_in_printing_ = false;
#endif
// Bookkeeping to suppress redundant scroll and focus requests for an already
// scrolled and focused editable node.
......
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