Commit 03c30d39 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix crash on browser shutdown during SAML PIN

Skip making the closePinDialog() JavaScript call when the state says
that no JavaScript calls are allowed. This may happen inside the
GaiaScreenHandler destructor if the security token PIN dialog is active.

Before this CL, the implementation was trying to close the active PIN
dialog, which was causing a crash. Part of the example stack trace:

  base::debug::CollectStackTrace()
  base::debug::StackTrace::StackTrace()
  base::debug::(anonymous namespace)::StackDumpSignalHandler()
  <unknown>
  gsignal
  abort
  std::__terminate()
  __cxxabiv1::failed_throw()
  __cxa_throw
  std::__Cr::__throw_length_error()
  std::__Cr::__vector_base_common<>::__throw_length_error()
  std::__Cr::vector<>::__emplace_back_slow_path<>()
  chromeos::BaseWebUIHandler::CallJS<>()
  chromeos::GaiaScreenHandler::CloseSecurityTokenPinDialog()
  chromeos::PinDialogManager::CloseActiveDialog()
  chromeos::PinDialogManager::RemovePinDialogHost()
  chromeos::GaiaScreenHandler::~GaiaScreenHandler()
  chromeos::GaiaScreenHandler::~GaiaScreenHandler()
  content::WebUIImpl::~WebUIImpl()
  content::WebUIImpl::~WebUIImpl()
  content::RenderFrameHostManager::ClearWebUIInstances()
  content::WebContentsImpl::~WebContentsImpl()
  content::WebContentsImpl::~WebContentsImpl()
  views::WebView::SetWebContents()
  views::WebView::~WebView()
  views::View::~View()
  chromeos::OobeWebDialogView::~OobeWebDialogView()
  views::View::DoRemoveChildView()
  views::View::RemoveAllChildViews()
  views::Widget::~Widget()
  views::(anonymous namespace)::BubbleWidget::~BubbleWidget()

Bug: 964069
Test: enroll a "target_os=chromeos" build, configure device policies to force-install smart card middleware onto Login Screen, start logging in using a SAML account that uses smart card authentication, wait until PIN dialog appears, close Chrome by clicking "x", check that there was no crash
Change-Id: I3f2f927830d71209c61c7e4b66250d16bb1039ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750003
Commit-Queue: Denis Kuznetsov <antrim@chromium.org>
Reviewed-by: default avatarDenis Kuznetsov <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692024}
parent 7e8fde84
......@@ -1239,7 +1239,11 @@ void GaiaScreenHandler::CloseSecurityTokenPinDialog() {
security_token_pin_entered_callback_.Reset();
security_token_pin_dialog_closed_callback_.Reset();
CallJS("login.GaiaSigninScreen.closePinDialog");
// Notify the page, unless it's already being shut down (which may happen if
// we're called from the destructor).
if (IsJavascriptAllowed())
CallJS("login.GaiaSigninScreen.closePinDialog");
}
bool GaiaScreenHandler::IsOfflineLoginActive() const {
......
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