Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: headless/lib/browser/headless_print_manager.cc

Issue 2890133002: check whether the printing render frame host has been initialised before accepting a message in the… (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_print_manager.cc
diff --git a/headless/lib/browser/headless_print_manager.cc b/headless/lib/browser/headless_print_manager.cc
index 036c7471fcdc7cee8c35a46ad69b0121eb12c853..7a69f75ae0ea01c23b7c517aedea81af4ded3c04 100644
--- a/headless/lib/browser/headless_print_manager.cc
+++ b/headless/lib/browser/headless_print_manager.cc
@@ -173,6 +173,13 @@ HeadlessPrintManager::GetPrintParamsFromSettings(
bool HeadlessPrintManager::OnMessageReceived(
const IPC::Message& message,
content::RenderFrameHost* render_frame_host) {
+ if (!printing_rfh_) {
+ DLOG(WARNING)
+ << "Unexpected message received before GetPDFContents is called.";
+ render_frame_host->Send(new IPC::Message());
jzfeng 2017/05/18 08:12:47 use DLOG(ERROR), and add the message type into the
+ return true;
+ }
+
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(HeadlessPrintManager, message)
IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698