summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 21:57:08 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 21:57:08 +0000
commitacf9e551cd396dfaf31babe2907d94ae2b2f85ef (patch)
treeba9cc89f66f80e53bb423b201709d8069be9bb9b /chrome/renderer
parent6f0a3f42637fe732dbeafa291bf82caa6e8572fc (diff)
downloadchromium_src-acf9e551cd396dfaf31babe2907d94ae2b2f85ef.zip
chromium_src-acf9e551cd396dfaf31babe2907d94ae2b2f85ef.tar.gz
chromium_src-acf9e551cd396dfaf31babe2907d94ae2b2f85ef.tar.bz2
Fix a Chrome renderer crash which occurs on closing the print dialog right after it was opened. This is because of attempting to
calculate the printable area while the settings are invalid leading to a divide by zero crash. Fixes bug http://code.google.com/p/chromium/issues/detail?id=48493 Bug=48493 Review URL: http://codereview.chromium.org/2809053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/print_web_view_helper.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index d816a8d..ef0dd14 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -132,10 +132,9 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) {
return;
}
- UpdatePrintableSizeInPrintParameters(frame, &default_settings);
-
// Continue only if the settings are valid.
if (default_settings.dpi && default_settings.document_cookie) {
+ UpdatePrintableSizeInPrintParameters(frame, &default_settings);
int expected_pages_count = 0;
bool use_browser_overlays = true;
@@ -176,11 +175,10 @@ void PrintWebViewHelper::Print(WebFrame* frame, bool script_initiated) {
if (Send(msg)) {
msg = NULL;
- UpdatePrintableSizeInPrintParameters(frame, &print_settings.params);
-
// If the settings are invalid, early quit.
if (print_settings.params.dpi &&
print_settings.params.document_cookie) {
+ UpdatePrintableSizeInPrintParameters(frame, &print_settings.params);
if (print_settings.params.selection_only) {
CopyAndPrint(print_settings, frame);
} else {