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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 2804793002: Print Preview: Fix failure to save with long page title (Closed)
Patch Set: Created 3 years, 8 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: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index f22ec21c31edb955798a638f74905ae4002f377c..6a9c1d874a3eadf177d5baae0d7b40b1ee97fc08 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -1030,7 +1030,9 @@ void PrintPreviewHandler::PrintToPdf() {
#endif
base::i18n::ReplaceIllegalCharactersInPath(&print_job_title, '_');
- base::FilePath default_filename(print_job_title);
+ // Take at most 251 characters - need 4 for the extension and max length
Lei Zhang 2017/04/05 20:06:07 We may want to use PATH_MAX instead. On Windows th
+ // on most platforms is 255.
+ base::FilePath default_filename(print_job_title.substr(0, 251));
default_filename =
default_filename.ReplaceExtension(FILE_PATH_LITERAL("pdf"));
« 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