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 namespace base { |
17 class FilePath; | 18 class FilePath; |
| 19 } |
18 | 20 |
19 namespace content { | 21 namespace content { |
20 class WebKitPlatformSupportImpl; | 22 class WebKitPlatformSupportImpl; |
21 | 23 |
22 // This class represents the background thread where the utility task runs. | 24 // This class represents the background thread where the utility task runs. |
23 class UtilityThreadImpl : public UtilityThread, | 25 class UtilityThreadImpl : public UtilityThread, |
24 public ChildThread { | 26 public ChildThread { |
25 public: | 27 public: |
26 UtilityThreadImpl(); | 28 UtilityThreadImpl(); |
27 virtual ~UtilityThreadImpl(); | 29 virtual ~UtilityThreadImpl(); |
28 | 30 |
29 virtual bool Send(IPC::Message* msg) OVERRIDE; | 31 virtual bool Send(IPC::Message* msg) OVERRIDE; |
30 virtual void ReleaseProcessIfNeeded() OVERRIDE; | 32 virtual void ReleaseProcessIfNeeded() OVERRIDE; |
31 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
32 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; | 34 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE; |
33 virtual void ReleaseCachedFonts() OVERRIDE; | 35 virtual void ReleaseCachedFonts() OVERRIDE; |
34 #endif | 36 #endif |
35 | 37 |
36 private: | 38 private: |
37 // ChildThread implementation. | 39 // ChildThread implementation. |
38 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 40 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
39 | 41 |
40 // IPC message handlers. | 42 // IPC message handlers. |
41 void OnBatchModeStarted(); | 43 void OnBatchModeStarted(); |
42 void OnBatchModeFinished(); | 44 void OnBatchModeFinished(); |
43 | 45 |
44 #if defined(OS_POSIX) | 46 #if defined(OS_POSIX) |
45 void OnLoadPlugins(const std::vector<FilePath>& plugin_paths); | 47 void OnLoadPlugins(const std::vector<base::FilePath>& plugin_paths); |
46 #endif // OS_POSIX | 48 #endif // OS_POSIX |
47 | 49 |
48 // True when we're running in batch mode. | 50 // True when we're running in batch mode. |
49 bool batch_mode_; | 51 bool batch_mode_; |
50 | 52 |
51 scoped_ptr<WebKitPlatformSupportImpl> webkit_platform_support_; | 53 scoped_ptr<WebKitPlatformSupportImpl> webkit_platform_support_; |
52 | 54 |
53 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl); | 55 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl); |
54 }; | 56 }; |
55 | 57 |
56 } // namespace content | 58 } // namespace content |
57 | 59 |
58 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ | 60 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_ |
OLD | NEW |