Commit 9243b4bb authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Clear callbacks map when JS disallowed

In normal print preview dialogs, the handler is destroyed with the web
contents, but for the special case of chrome://print this does not
occur, and old preview requests should be cleared in
OnJavascriptDisallowed().

Bug: 853672
Change-Id: I5681680dc64fe020f389c6893d992694e8fcdb95
Reviewed-on: https://chromium-review.googlesource.com/1104877Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568121}
parent 8f074984
......@@ -589,6 +589,7 @@ void PrintPreviewHandler::OnJavascriptDisallowed() {
// Normally the handler and print preview will be destroyed together, but
// this is necessary for refresh or navigation from the chrome://print page.
weak_factory_.InvalidateWeakPtrs();
preview_callbacks_.clear();
UnregisterForGaiaCookieChanges();
}
......
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