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

Unified Diff: components/printing/renderer/print_web_view_helper.h

Issue 2522313003: Check for PrintWebViewHelper validity when running nested message loops. (Closed)
Patch Set: Simplify, fix build Created 4 years, 1 month 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 | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/printing/renderer/print_web_view_helper.h
diff --git a/components/printing/renderer/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h
index 2dad908dc266d66ddaba8f4a0736e934d3d0ec4f..0730f76303b4bc8fc92b8da47e01b6ffc116694a 100644
--- a/components/printing/renderer/print_web_view_helper.h
+++ b/components/printing/renderer/print_web_view_helper.h
@@ -72,6 +72,8 @@ class FrameReference {
private:
blink::WebView* view_;
blink::WebLocalFrame* frame_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameReference);
};
// PrintWebViewHelper handles most of the printing grunt work for RenderView.
@@ -222,7 +224,9 @@ class PrintWebViewHelper
// Main printing code -------------------------------------------------------
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
- // |is_scripted| should be true when the call is coming from window.print()
+ // Print with the system dialog.
+ // |is_scripted| should be true when the call is coming from window.print().
+ // WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
bool is_scripted);
@@ -255,15 +259,18 @@ class PrintWebViewHelper
const base::DictionaryValue& passed_job_settings);
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Get final print settings from the user.
- // Return false if the user cancels or on error.
- bool GetPrintSettingsFromUser(blink::WebLocalFrame* frame,
- const blink::WebNode& node,
- int expected_pages_count,
- bool is_scripted);
+ // WARNING: |this| may be gone after this method returns.
+ void GetPrintSettingsFromUser(
+ blink::WebLocalFrame* frame,
+ const blink::WebNode& node,
+ int expected_pages_count,
+ bool is_scripted,
+ PrintMsg_PrintPages_Params* print_settings);
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
// Page Printing / Rendering ------------------------------------------------
-
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
void OnFramePreparedForPrintPages();
void PrintPages();
@@ -352,6 +359,8 @@ class PrintWebViewHelper
// Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview();
+ // WARNING: |this| may be gone after this method returns when |type| is
+ // PRINT_PREVIEW_SCRIPTED.
void RequestPrintPreview(PrintPreviewRequestType type);
// Checks whether print preview should continue or not.
« no previous file with comments | « no previous file | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698