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/md5.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "base/time/time.h"
|
#include "base/time/time.h"
|
||||||
|
#include "base/threading/thread_restrictions.h"
|
||||||
#include "base/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
#include "brightray/browser/win/notification_presenter_win7.h"
|
#include "brightray/browser/win/notification_presenter_win7.h"
|
||||||
#include "brightray/browser/win/windows_toast_notification.h"
|
#include "brightray/browser/win/windows_toast_notification.h"
|
||||||
|
@ -68,6 +69,7 @@ NotificationPresenterWin::~NotificationPresenterWin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NotificationPresenterWin::Init() {
|
bool NotificationPresenterWin::Init() {
|
||||||
|
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
return temp_dir_.CreateUniqueTempDir();
|
return temp_dir_.CreateUniqueTempDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +84,7 @@ base::string16 NotificationPresenterWin::SaveIconToFilesystem(
|
||||||
filename = std::to_string(now.ToInternalValue()) + ".png";
|
filename = std::to_string(now.ToInternalValue()) + ".png";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToUTF16(filename));
|
base::FilePath path = temp_dir_.GetPath().Append(base::UTF8ToUTF16(filename));
|
||||||
if (base::PathExists(path))
|
if (base::PathExists(path))
|
||||||
return path.value();
|
return path.value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue