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_
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "content/child/child_thread_impl.h"
14 #include "content/common/content_export.h"
15 #include "content/public/utility/utility_thread.h"
22 class BlinkPlatformImpl
;
23 class UtilityBlinkPlatformImpl
;
25 #if defined(COMPILER_MSVC)
26 // See explanation for other RenderViewHostImpl which is the same issue.
28 #pragma warning(disable: 4250)
31 // This class represents the background thread where the utility task runs.
32 class UtilityThreadImpl
: public UtilityThread
,
33 public ChildThreadImpl
{
36 // Constructor that's used when running in single process mode.
37 explicit UtilityThreadImpl(const InProcessChildThreadParams
& params
);
38 ~UtilityThreadImpl() override
;
39 void Shutdown() override
;
41 void ReleaseProcessIfNeeded() override
;
46 // ChildThread implementation.
47 bool OnControlMessageReceived(const IPC::Message
& msg
) override
;
49 // IPC message handlers.
50 void OnBatchModeStarted();
51 void OnBatchModeFinished();
53 #if defined(OS_POSIX) && defined(ENABLE_PLUGINS)
54 void OnLoadPlugins(const std::vector
<base::FilePath
>& plugin_paths
);
57 // True when we're running in batch mode.
60 scoped_ptr
<UtilityBlinkPlatformImpl
> blink_platform_impl_
;
62 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl
);
65 #if defined(COMPILER_MSVC)
69 } // namespace content
71 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_