OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHILD_CHILD_THREAD_H_ | 5 #ifndef CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_ |
6 #define CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_ | 6 #define CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "ipc/attachment_broker.h" | |
10 #include "ipc/ipc_sender.h" | 9 #include "ipc/ipc_sender.h" |
11 | 10 |
12 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
13 #include <windows.h> | 12 #include <windows.h> |
14 #endif | 13 #endif |
15 | 14 |
16 namespace content { | 15 namespace content { |
17 | 16 |
18 // An abstract base class that contains logic shared between most child | 17 // An abstract base class that contains logic shared between most child |
19 // processes of the embedder. | 18 // processes of the embedder. |
20 class CONTENT_EXPORT ChildThread | 19 class CONTENT_EXPORT ChildThread : public IPC::Sender { |
21 : public IPC::Sender, | |
22 virtual public IPC::SupportsAttachmentBrokering { | |
23 public: | 20 public: |
24 // Returns the one child thread for this process. Note that this can only be | 21 // Returns the one child thread for this process. Note that this can only be |
25 // accessed when running on the child thread itself. | 22 // accessed when running on the child thread itself. |
26 static ChildThread* Get(); | 23 static ChildThread* Get(); |
27 | 24 |
28 ~ChildThread() override {} | 25 ~ChildThread() override {} |
29 | 26 |
30 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
31 // Request that the given font be loaded by the browser so it's cached by the | 28 // Request that the given font be loaded by the browser so it's cached by the |
32 // OS. Please see ChildProcessHost::PreCacheFont for details. | 29 // OS. Please see ChildProcessHost::PreCacheFont for details. |
33 virtual void PreCacheFont(const LOGFONT& log_font) = 0; | 30 virtual void PreCacheFont(const LOGFONT& log_font) = 0; |
34 | 31 |
35 // Release cached font. | 32 // Release cached font. |
36 virtual void ReleaseCachedFonts() = 0; | 33 virtual void ReleaseCachedFonts() = 0; |
37 #endif | 34 #endif |
38 }; | 35 }; |
39 | 36 |
40 } // namespace content | 37 } // namespace content |
41 | 38 |
42 #endif // CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_ | 39 #endif // CONTENT_PUBLIC_CHILD_CHILD_THREAD_H_ |
OLD | NEW |