| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index 3a26bb55bf5c717fe77f9e30ebd92979c8be6e6f..10c1fb9512496e5586ae736e0b465466d5917722 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -2332,6 +2332,11 @@ bool RenderFrameImpl::ScheduleFileChooser(
|
| const FileChooserParams& params,
|
| blink::WebFileChooserCompletion* completion) {
|
| static const size_t kMaximumPendingFileChooseRequests = 4;
|
| +
|
| + // Do not open the file dialog in a hidden RenderFrame.
|
| + if (IsHidden())
|
| + return false;
|
| +
|
| if (file_chooser_completions_.size() > kMaximumPendingFileChooseRequests) {
|
| // This sanity check prevents too many file choose requests from getting
|
| // queued which could DoS the user. Getting these is most likely a
|
| @@ -4018,9 +4023,6 @@ bool RenderFrameImpl::runModalBeforeUnloadDialog(bool is_reload) {
|
| bool RenderFrameImpl::runFileChooser(
|
| const blink::WebFileChooserParams& params,
|
| blink::WebFileChooserCompletion* chooser_completion) {
|
| - // Do not open the file dialog in a hidden RenderFrame.
|
| - if (IsHidden())
|
| - return false;
|
|
|
| FileChooserParams ipc_params;
|
| if (params.directory)
|
| @@ -4032,8 +4034,6 @@ bool RenderFrameImpl::runFileChooser(
|
| else
|
| ipc_params.mode = FileChooserParams::Open;
|
| ipc_params.title = params.title;
|
| - ipc_params.default_file_name =
|
| - blink::WebStringToFilePath(params.initialValue).BaseName();
|
| ipc_params.accept_types.reserve(params.acceptTypes.size());
|
| for (const auto& type : params.acceptTypes)
|
| ipc_params.accept_types.push_back(type);
|
|
|