From d6068759b67ec29f6f03b77b6fcd39f826ed903a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 3 Jan 2018 17:25:19 +0900 Subject: [PATCH] win: Fix assertion when creating Notification --- brightray/browser/win/notification_presenter_win.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brightray/browser/win/notification_presenter_win.cc b/brightray/browser/win/notification_presenter_win.cc index 71f166e21f..309b928253 100644 --- a/brightray/browser/win/notification_presenter_win.cc +++ b/brightray/browser/win/notification_presenter_win.cc @@ -14,6 +14,7 @@ #include "base/md5.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "base/threading/thread_restrictions.h" #include "base/win/windows_version.h" #include "brightray/browser/win/notification_presenter_win7.h" #include "brightray/browser/win/windows_toast_notification.h" @@ -68,6 +69,7 @@ NotificationPresenterWin::~NotificationPresenterWin() { } bool NotificationPresenterWin::Init() { + base::ThreadRestrictions::ScopedAllowIO allow_io; return temp_dir_.CreateUniqueTempDir(); } @@ -82,6 +84,7 @@ base::string16 NotificationPresenterWin::SaveIconToFilesystem( filename = std::to_string(now.ToInternalValue()) + ".png"; } + base::ThreadRestrictions::ScopedAllowIO allow_io; base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToUTF16(filename)); if (base::PathExists(path)) return path.value();