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