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