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

Side by Side Diff: chrome/utility/font_cache_handler_win.h

Issue 1011023002: Change for building font cache into separate thread inside utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed thread name. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/utility/font_cache_handler_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_ 5 #ifndef CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_
6 #define CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_ 6 #define CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
9 #include "chrome/utility/utility_message_handler.h" 11 #include "chrome/utility/utility_message_handler.h"
10 12
13 namespace base {
14 class TaskRunner;
15 class Thread;
16 }
17
11 // Handles requests to build a static direct write font cache. Must be invoked 18 // Handles requests to build a static direct write font cache. Must be invoked
12 // in a non-sandboxed utility process. We build static font cache in utility 19 // in a non-sandboxed utility process. We build static font cache in utility
13 // process as it is time consuming as well as crash prone thing. We already 20 // process as it is time consuming as well as crash prone thing. We already
14 // have fall back of loading fonts from system fonts directory in place, so even 21 // have fall back of loading fonts from system fonts directory in place, so even
15 // if we fail to build static cache in utility process, chrome will still 22 // if we fail to build static cache in utility process, chrome will still
16 // continue to run as is. 23 // continue to run as is.
17 class FontCacheHandler : public UtilityMessageHandler { 24 class FontCacheHandler : public UtilityMessageHandler {
18 public: 25 public:
19 FontCacheHandler() {} 26 FontCacheHandler() {}
20 virtual ~FontCacheHandler() {} 27 virtual ~FontCacheHandler() {}
21 28
22 // IPC::Listener implementation 29 // IPC::Listener implementation
23 virtual bool OnMessageReceived(const IPC::Message& message) override; 30 virtual bool OnMessageReceived(const IPC::Message& message) override;
24 31
25 private: 32 private:
26 void OnBuildFontCache(const base::FilePath& full_path); 33 void OnBuildFontCache(const base::FilePath& full_path);
34 void StartBuildingFontCache(const base::FilePath& full_path);
35 void Cleanup();
36
37 scoped_refptr<base::TaskRunner> utility_task_runner_;
38
39 // Thread that caching process runs on, while FontCacheHandler handles
40 // messages from the browser process.
41 scoped_ptr<base::Thread> cache_thread_;
27 42
28 DISALLOW_COPY_AND_ASSIGN(FontCacheHandler); 43 DISALLOW_COPY_AND_ASSIGN(FontCacheHandler);
29 }; 44 };
30 45
31 #endif // CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_ 46 #endif // CHROME_UTILITY_FONT_CACHE_HANDLER_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/utility/font_cache_handler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698