OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/printing/renderer/print_web_view_helper.h" | 5 #include "components/printing/renderer/print_web_view_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 Print(web_frame, blink::WebNode(), true /* is_scripted? */); | 982 Print(web_frame, blink::WebNode(), true /* is_scripted? */); |
983 #endif | 983 #endif |
984 } | 984 } |
985 // WARNING: |this| may be gone at this point. Do not do any more work here and | 985 // WARNING: |this| may be gone at this point. Do not do any more work here and |
986 // just return. | 986 // just return. |
987 } | 987 } |
988 | 988 |
989 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { | 989 bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) { |
990 // The class is not designed to handle recursive messages. This is not | 990 // The class is not designed to handle recursive messages. This is not |
991 // expected during regular flow. However, during rendering of content for | 991 // expected during regular flow. However, during rendering of content for |
992 // printing, lower level code may run nested message loop. E.g. PDF may has | 992 // printing, lower level code may run nested run loop. E.g. PDF may has |
993 // script to show message box http://crbug.com/502562. In that moment browser | 993 // script to show message box http://crbug.com/502562. In that moment browser |
994 // may receive updated printer capabilities and decide to restart print | 994 // may receive updated printer capabilities and decide to restart print |
995 // preview generation. When this happened message handling function may | 995 // preview generation. When this happened message handling function may |
996 // choose to ignore message or safely crash process. | 996 // choose to ignore message or safely crash process. |
997 ++ipc_nesting_level_; | 997 ++ipc_nesting_level_; |
998 | 998 |
999 bool handled = true; | 999 bool handled = true; |
1000 IPC_BEGIN_MESSAGE_MAP(PrintWebViewHelper, message) | 1000 IPC_BEGIN_MESSAGE_MAP(PrintWebViewHelper, message) |
1001 #if BUILDFLAG(ENABLE_BASIC_PRINTING) | 1001 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
1002 IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) | 1002 IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 blink::WebConsoleMessage::kLevelWarning, message)); | 2377 blink::WebConsoleMessage::kLevelWarning, message)); |
2378 return false; | 2378 return false; |
2379 } | 2379 } |
2380 | 2380 |
2381 void PrintWebViewHelper::ScriptingThrottler::Reset() { | 2381 void PrintWebViewHelper::ScriptingThrottler::Reset() { |
2382 // Reset counter on successful print. | 2382 // Reset counter on successful print. |
2383 count_ = 0; | 2383 count_ = 0; |
2384 } | 2384 } |
2385 | 2385 |
2386 } // namespace printing | 2386 } // namespace printing |
OLD | NEW |