From 23582cc9d3e224638e7493cbf36bb8b00509becc Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 3 Jul 2016 15:30:27 +0900 Subject: [PATCH] Reduce the scope of ScopedNestableTaskAllower --- atom/browser/api/atom_api_web_contents.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 7b710e5f85a..99cb2e00748 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -1208,9 +1208,6 @@ void WebContents::EndFrameSubscription() { void WebContents::StartDrag(const mate::Dictionary& item, mate::Arguments* args) { - base::MessageLoop::ScopedNestableTaskAllower allow( - base::MessageLoop::current()); - base::FilePath file; std::vector files; if (!item.Get("files", &files) && item.Get("file", &file)) { @@ -1230,6 +1227,8 @@ void WebContents::StartDrag(const mate::Dictionary& item, // Start dragging. if (!files.empty()) { + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); DragFileItems(files, icon->image(), web_contents()->GetNativeView()); } else { args->ThrowError("There is nothing to drag");