Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / utility / utility_thread_impl.h
blob74908cac51eaeaa9b01e7fe3929f2149d6b1fc68
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 "base/memory/scoped_ptr.h"
14 #include "content/child/child_thread_impl.h"
15 #include "content/common/content_export.h"
16 #include "content/common/process_control.mojom.h"
17 #include "content/public/utility/utility_thread.h"
18 #include "mojo/common/weak_binding_set.h"
20 namespace base {
21 class FilePath;
24 namespace content {
25 class BlinkPlatformImpl;
26 class UtilityBlinkPlatformImpl;
27 class UtilityProcessControlImpl;
29 #if defined(COMPILER_MSVC)
30 // See explanation for other RenderViewHostImpl which is the same issue.
31 #pragma warning(push)
32 #pragma warning(disable: 4250)
33 #endif
35 // This class represents the background thread where the utility task runs.
36 class UtilityThreadImpl : public UtilityThread,
37 public ChildThreadImpl {
38 public:
39 UtilityThreadImpl();
40 // Constructor that's used when running in single process mode.
41 explicit UtilityThreadImpl(const InProcessChildThreadParams& params);
42 ~UtilityThreadImpl() override;
43 void Shutdown() override;
45 void ReleaseProcessIfNeeded() override;
47 private:
48 void Init();
50 // ChildThread implementation.
51 bool OnControlMessageReceived(const IPC::Message& msg) override;
53 // IPC message handlers.
54 void OnBatchModeStarted();
55 void OnBatchModeFinished();
57 #if defined(OS_POSIX) && defined(ENABLE_PLUGINS)
58 void OnLoadPlugins(const std::vector<base::FilePath>& plugin_paths);
59 #endif
61 void BindProcessControlRequest(
62 mojo::InterfaceRequest<content::ProcessControl> request);
64 // True when we're running in batch mode.
65 bool batch_mode_;
67 scoped_ptr<UtilityBlinkPlatformImpl> blink_platform_impl_;
69 // Process control for Mojo application hosting.
70 scoped_ptr<UtilityProcessControlImpl> process_control_;
72 // Bindings to the ProcessControl impl.
73 mojo::WeakBindingSet<ProcessControl> process_control_bindings_;
75 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl);
78 #if defined(COMPILER_MSVC)
79 #pragma warning(pop)
80 #endif
82 } // namespace content
84 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_