| Index: content/browser/frame_host/render_frame_host_impl.cc
|
| diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
| index 0bac45b820d0a3acd252cf705c0326a96ad2a634..4656db6f4f4857df6e80c84a94e0d4e4471c278c 100644
|
| --- a/content/browser/frame_host/render_frame_host_impl.cc
|
| +++ b/content/browser/frame_host/render_frame_host_impl.cc
|
| @@ -3218,6 +3218,12 @@ void RenderFrameHostImpl::FilesSelectedInChooser(
|
| ->GetFileSystemContext();
|
| // Grant the security access requested to the given files.
|
| for (const auto& file : files) {
|
| + // We shouldn't be given a FilePath that can't survive the conversion to a
|
| + // WebString, which we can approximate with AsUTF8Unsafe. Blink won't be
|
| + // able to handle it, and we would kill the renderer when it claims to have
|
| + // chosen an empty file path.
|
| + DCHECK(!file.file_path.AsUTF8Unsafe().empty());
|
| +
|
| if (permissions == FileChooserParams::Save) {
|
| ChildProcessSecurityPolicyImpl::GetInstance()->GrantCreateReadWriteFile(
|
| GetProcess()->GetID(), file.file_path);
|
|
|