Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 1881043003: Delete the font cache file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 3a996d66a8f5d9c7d8b9e074a54edd37fef51573..902960001f7df3a2dfaa9ef07b9f94fed52b0265 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -80,6 +80,8 @@ typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)(
const wchar_t* command_line,
DWORD flags);
+const char kFontCacheSharedSectionName[] = "ChromeDWriteFontCache";
+
void InitializeWindowProcExceptions() {
// Get the breakpad pointer from chrome.exe
base::win::WinProcExceptionFilter exception_filter =
@@ -202,6 +204,12 @@ void DetectFaultTolerantHeap() {
UMA_HISTOGRAM_ENUMERATION("FaultTolerantHeap", detected, FTH_FLAGS_COUNT);
}
+void DeleteDirectWriteFontCache(base::FilePath path) {
+ // TODO(kulshin): delete this function and associated code in 2017.
+ // Attempt to delete the font cache and ignore any errors.
+ base::DeleteFile(path, false /*recursive*/);
gab 2016/04/14 15:04:29 Define static const char kFontCacheSharedSectionN
gab 2016/04/14 15:04:29 Use kFontCacheSharedSectionName directly here inst
Ilya Kulshin 2016/04/14 21:55:37 Unfortunately I still need the path, since I need
Ilya Kulshin 2016/04/14 21:55:37 Inlined the string constant altogether, since it w
+}
+
} // namespace
void ShowCloseBrowserFirstMessageBox() {
@@ -312,6 +320,14 @@ void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
void ChromeBrowserMainPartsWin::PostProfileInit() {
ChromeBrowserMainParts::PostProfileInit();
+
+ base::FilePath path(
+ profile()->GetPath().AppendASCII(kFontCacheSharedSectionName));
+ const int kBuildFontCacheDelaySec = 30;
+ content::BrowserThread::PostDelayedTask(
gab 2016/04/14 15:04:29 Use BrowserThread::PostAfterStartupTask() instead
Ilya Kulshin 2016/04/14 21:55:37 Done.
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(DeleteDirectWriteFontCache, path),
+ base::TimeDelta::FromSeconds(kBuildFontCacheDelaySec));
}
void ChromeBrowserMainPartsWin::PostBrowserStart() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698