[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / content / utility / utility_thread_impl.h
blob12c76de80e0e27222d9477d6534a2d73b0b895b8
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_
6 #define CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "content/common/child_thread.h"
14 #include "content/common/content_export.h"
15 #include "content/public/utility/utility_thread.h"
17 class FilePath;
19 namespace content {
20 class WebKitPlatformSupportImpl;
22 // This class represents the background thread where the utility task runs.
23 class UtilityThreadImpl : public UtilityThread,
24 public ChildThread {
25 public:
26 UtilityThreadImpl();
27 virtual ~UtilityThreadImpl();
29 virtual bool Send(IPC::Message* msg) OVERRIDE;
30 virtual void ReleaseProcessIfNeeded() OVERRIDE;
31 #if defined(OS_WIN)
32 virtual void PreCacheFont(const LOGFONT& log_font) OVERRIDE;
33 virtual void ReleaseCachedFonts() OVERRIDE;
34 #endif
36 private:
37 // ChildThread implementation.
38 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
40 // IPC message handlers.
41 void OnBatchModeStarted();
42 void OnBatchModeFinished();
44 #if defined(OS_POSIX)
45 void OnLoadPlugins(const std::vector<FilePath>& plugin_paths);
46 #endif // OS_POSIX
48 // True when we're running in batch mode.
49 bool batch_mode_;
51 scoped_ptr<WebKitPlatformSupportImpl> webkit_platform_support_;
53 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl);
56 } // namespace content
58 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_