OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UTILITY_UTILITY_THREAD_IMPL_H_ | 5 #ifndef CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ |
6 #define CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ | 6 #define CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "content/common/child_thread.h" | 13 #include "content/common/child_thread.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/utility/utility_thread.h" | 15 #include "content/public/utility/utility_thread.h" |
16 | 16 |
17 class FilePath; | 17 class FilePath; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class WebKitPlatformSupportImpl; | 20 class WebKitPlatformSupportImpl; |
21 } | |
22 | 21 |
23 // This class represents the background thread where the utility task runs. | 22 // This class represents the background thread where the utility task runs. |
24 class UtilityThreadImpl : public content::UtilityThread, | 23 class UtilityThreadImpl : public UtilityThread, |
25 public ChildThread { | 24 public ChildThread { |
26 public: | 25 public: |
27 UtilityThreadImpl(); | 26 UtilityThreadImpl(); |
28 virtual ~UtilityThreadImpl(); | 27 virtual ~UtilityThreadImpl(); |
29 | 28 |
30 virtual bool Send(IPC::Message* msg) OVERRIDE; | 29 virtual bool Send(IPC::Message* msg) OVERRIDE; |
31 virtual void ReleaseProcessIfNeeded() OVERRIDE; | 30 virtual void ReleaseProcessIfNeeded() OVERRIDE; |
32 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
33 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; | 32 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; |
34 virtual void ReleaseCachedFonts() OVERRIDE; | 33 virtual void ReleaseCachedFonts() OVERRIDE; |
35 #endif | 34 #endif |
36 | 35 |
37 private: | 36 private: |
38 // ChildThread implementation. | 37 // ChildThread implementation. |
39 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 38 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
40 | 39 |
41 // IPC message handlers. | 40 // IPC message handlers. |
42 void OnBatchModeStarted(); | 41 void OnBatchModeStarted(); |
43 void OnBatchModeFinished(); | 42 void OnBatchModeFinished(); |
44 | 43 |
45 #if defined(OS_POSIX) | 44 #if defined(OS_POSIX) |
46 void OnLoadPlugins(const std::vector<FilePath>& plugin_paths); | 45 void OnLoadPlugins(const std::vector<FilePath>& plugin_paths); |
47 #endif // OS_POSIX | 46 #endif // OS_POSIX |
48 | 47 |
49 // True when we're running in batch mode. | 48 // True when we're running in batch mode. |
50 bool batch_mode_; | 49 bool batch_mode_; |
51 | 50 |
52 scoped_ptr<content::WebKitPlatformSupportImpl> webkit_platform_support_; | 51 scoped_ptr<WebKitPlatformSupportImpl> webkit_platform_support_; |
53 | 52 |
54 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl); | 53 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl); |
55 }; | 54 }; |
56 | 55 |
| 56 } // namespace content |
| 57 |
57 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ | 58 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ |
OLD | NEW |