OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ |
6 #define CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ | 6 #define CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
12 | 12 |
| 13 #if defined(OS_WIN) |
| 14 #include <windows.h> |
| 15 #endif |
| 16 |
13 namespace content { | 17 namespace content { |
14 | 18 |
15 class CONTENT_EXPORT UtilityThread : public IPC::Message::Sender { | 19 class CONTENT_EXPORT UtilityThread : public IPC::Message::Sender { |
16 public: | 20 public: |
17 // Returns the one utility thread for this process. Note that this can only | 21 // Returns the one utility thread for this process. Note that this can only |
18 // be accessed when running on the utility thread itself. | 22 // be accessed when running on the utility thread itself. |
19 static UtilityThread* Get(); | 23 static UtilityThread* Get(); |
20 | 24 |
21 UtilityThread(); | 25 UtilityThread(); |
22 virtual ~UtilityThread(); | 26 virtual ~UtilityThread(); |
23 | 27 |
24 // Releases the process if we are not (or no longer) in batch mode. | 28 // Releases the process if we are not (or no longer) in batch mode. |
25 virtual void ReleaseProcessIfNeeded() = 0; | 29 virtual void ReleaseProcessIfNeeded() = 0; |
| 30 |
| 31 #if defined(OS_WIN) |
| 32 // Request that the given font be loaded by the browser so it's cached by the |
| 33 // OS. Please see ChildProcessHost::PreCacheFont for details. |
| 34 virtual void PreCacheFont(const LOGFONT& log_font) = 0; |
| 35 |
| 36 // Release cached font. |
| 37 virtual void ReleaseCachedFonts() = 0; |
| 38 #endif |
26 }; | 39 }; |
27 | 40 |
28 } // namespace content | 41 } // namespace content |
29 | 42 |
30 #endif // CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ | 43 #endif // CONTENT_PUBLIC_UTILITY_UTILITY_THREAD_H_ |
OLD | NEW |