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

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

Issue 2454293004: Printing: Fix undefined behavior for near 0 scaling (Closed)
Patch Set: Fix declaration Created 4 years, 2 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 | 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 dd8d24d5b42458d47c615562d768d84f8d291e8f..03e222d60c80fbe6c1dbb4a58ab14eb1e3c822d3 100644
--- a/components/printing/renderer/print_web_view_helper.h
+++ b/components/printing/renderer/print_web_view_helper.h
@@ -112,6 +112,11 @@ class PrintWebViewHelper
std::unique_ptr<Delegate> delegate);
~PrintWebViewHelper() override;
+ // Minimum valid value for scaling. Since scaling is originally an integer
+ // representing a percentage, it should never be less than this if it is
+ // valid.
+ static constexpr double kEpsilon = 0.01f;
+
// Disable print preview and switch to system dialog printing even if full
// printing is build-in. This method is used by CEF.
static void DisablePreview();
« 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