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

Unified Diff: chrome/browser/file_select_helper.cc

Issue 2811533002: Exclude files from FileSelectChooser if they can't convert to WebStrings. (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 | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper.cc
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index 91aa51e1411d34e09b7c3cecd23a8174cc2f082d..1f106cf5e7f7d32fdb2ed37347f0d9c19fe78939 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -320,6 +320,11 @@ void FileSelectHelper::NotifyRenderFrameHostAndEnd(
std::vector<content::FileChooserFileInfo> chooser_files;
for (const auto& file : files) {
+ // Exclude files whose paths can't be converted into WebStrings, since Blink
+ // won't be able to handle those.
+ if (file.local_path.AsUTF8Unsafe().empty())
asanka 2017/04/13 17:21:22 Shall we move this logic to a static function and
Charlie Reis 2017/04/14 19:28:15 Thanks for the suggestion! If we're going to be f
+ continue;
+
content::FileChooserFileInfo chooser_file;
chooser_file.file_path = file.local_path;
chooser_file.display_name = file.display_name;
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698