Skip to content
Snippets Groups Projects
Unverified Commit c9c159db authored by trop[bot]'s avatar trop[bot] Committed by GitHub
Browse files

refactor: remove deprecated ToInternalValue() (#41020)


* refactor: do not use deprecated ToInternalValue() in ElectronExtensionLoader::FinishExtensionLoad()

Co-authored-by: default avatarCharles Kerr <charles@charleskerr.com>

* refactor: do not use deprecated ToInternalValue() in NotificationPresenterWin::SaveIconToFilesystem()

Co-authored-by: default avatarCharles Kerr <charles@charleskerr.com>

* chore: rename temp variable to now_usec for clarity

Co-authored-by: default avatarCharles Kerr <charles@charleskerr.com>

---------

Co-authored-by: default avatartrop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: default avatarCharles Kerr <charles@charleskerr.com>
parent b3ca1a1f
Branches
Tags
No related merge requests found
......@@ -148,10 +148,11 @@ void ElectronExtensionLoader::FinishExtensionLoad(
ExtensionPrefs::ScopedDictionaryUpdate update(
extension_prefs, extension.get()->id(),
extensions::pref_names::kPrefPreferences);
auto preference = update.Create();
const base::Time install_time = base::Time::Now();
preference->SetString(
"install_time", base::NumberToString(install_time.ToInternalValue()));
const int64_t now_usec =
base::Time::Now().since_origin().InMicroseconds();
preference->SetString("install_time", base::NumberToString(now_usec));
}
}
......
......@@ -14,6 +14,7 @@
#include "base/files/file_util.h"
#include "base/hash/md5.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "base/win/windows_version.h"
......@@ -75,8 +76,8 @@ std::wstring NotificationPresenterWin::SaveIconToFilesystem(
if (origin.is_valid()) {
filename = base::MD5String(origin.spec()) + ".png";
} else {
base::TimeTicks now = base::TimeTicks::Now();
filename = std::to_string(now.ToInternalValue()) + ".png";
const int64_t now_usec = base::Time::Now().since_origin().InMicroseconds();
filename = base::NumberToString(now_usec) + ".png";
}
ScopedAllowBlockingForElectron allow_blocking;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment