Chromium Code Reviews| 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() { |