refactor: remove deprecated ToInternalValue() (#40980)
* refactor: do not use deprecated ToInternalValue() in ElectronExtensionLoader::FinishExtensionLoad() * refactor: do not use deprecated ToInternalValue() in NotificationPresenterWin::SaveIconToFilesystem() * chore: rename temp variable to now_usec for clarity
This commit is contained in:
parent
6803624576
commit
021592200e
2 changed files with 7 additions and 5 deletions
|
@ -148,10 +148,11 @@ void ElectronExtensionLoader::FinishExtensionLoad(
|
||||||
ExtensionPrefs::ScopedDictionaryUpdate update(
|
ExtensionPrefs::ScopedDictionaryUpdate update(
|
||||||
extension_prefs, extension.get()->id(),
|
extension_prefs, extension.get()->id(),
|
||||||
extensions::pref_names::kPrefPreferences);
|
extensions::pref_names::kPrefPreferences);
|
||||||
|
|
||||||
auto preference = update.Create();
|
auto preference = update.Create();
|
||||||
const base::Time install_time = base::Time::Now();
|
const int64_t now_usec =
|
||||||
preference->SetString(
|
base::Time::Now().since_origin().InMicroseconds();
|
||||||
"install_time", base::NumberToString(install_time.ToInternalValue()));
|
preference->SetString("install_time", base::NumberToString(now_usec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "base/hash/md5.h"
|
#include "base/hash/md5.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
#include "base/strings/string_number_conversions.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/win/windows_version.h"
|
#include "base/win/windows_version.h"
|
||||||
|
@ -75,8 +76,8 @@ std::wstring NotificationPresenterWin::SaveIconToFilesystem(
|
||||||
if (origin.is_valid()) {
|
if (origin.is_valid()) {
|
||||||
filename = base::MD5String(origin.spec()) + ".png";
|
filename = base::MD5String(origin.spec()) + ".png";
|
||||||
} else {
|
} else {
|
||||||
base::TimeTicks now = base::TimeTicks::Now();
|
const int64_t now_usec = base::Time::Now().since_origin().InMicroseconds();
|
||||||
filename = std::to_string(now.ToInternalValue()) + ".png";
|
filename = base::NumberToString(now_usec) + ".png";
|
||||||
}
|
}
|
||||||
|
|
||||||
ScopedAllowBlockingForElectron allow_blocking;
|
ScopedAllowBlockingForElectron allow_blocking;
|
||||||
|
|
Loading…
Reference in a new issue