Reduce the scope of ScopedNestableTaskAllower
This commit is contained in:
parent
ba1fe322e9
commit
23582cc9d3
1 changed files with 2 additions and 3 deletions
|
@ -1208,9 +1208,6 @@ void WebContents::EndFrameSubscription() {
|
||||||
|
|
||||||
void WebContents::StartDrag(const mate::Dictionary& item,
|
void WebContents::StartDrag(const mate::Dictionary& item,
|
||||||
mate::Arguments* args) {
|
mate::Arguments* args) {
|
||||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
|
||||||
base::MessageLoop::current());
|
|
||||||
|
|
||||||
base::FilePath file;
|
base::FilePath file;
|
||||||
std::vector<base::FilePath> files;
|
std::vector<base::FilePath> files;
|
||||||
if (!item.Get("files", &files) && item.Get("file", &file)) {
|
if (!item.Get("files", &files) && item.Get("file", &file)) {
|
||||||
|
@ -1230,6 +1227,8 @@ void WebContents::StartDrag(const mate::Dictionary& item,
|
||||||
|
|
||||||
// Start dragging.
|
// Start dragging.
|
||||||
if (!files.empty()) {
|
if (!files.empty()) {
|
||||||
|
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||||
|
base::MessageLoop::current());
|
||||||
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
|
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
|
||||||
} else {
|
} else {
|
||||||
args->ThrowError("There is nothing to drag");
|
args->ThrowError("There is nothing to drag");
|
||||||
|
|
Loading…
Reference in a new issue