win: Fix assertion when creating Notification
This commit is contained in:
parent
14de22a8c7
commit
d6068759b6
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue