Add a name to the proxy resolver utility process and display it in the task manager.
[chromium-blink-merge.git] / content / utility / utility_thread_impl.h
blob4f0fa3f18916e7a7cc3f942661b4097e0ee24389
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/child/child_thread_impl.h"
14 #include "content/common/content_export.h"
15 #include "content/public/utility/utility_thread.h"
17 namespace base {
18 class FilePath;
21 namespace content {
22 class BlinkPlatformImpl;
24 #if defined(COMPILER_MSVC)
25 // See explanation for other RenderViewHostImpl which is the same issue.
26 #pragma warning(push)
27 #pragma warning(disable: 4250)
28 #endif
30 // This class represents the background thread where the utility task runs.
31 class UtilityThreadImpl : public UtilityThread,
32 public ChildThreadImpl {
33 public:
34 UtilityThreadImpl();
35 // Constructor that's used when running in single process mode.
36 explicit UtilityThreadImpl(const InProcessChildThreadParams& params);
37 ~UtilityThreadImpl() override;
38 void Shutdown() override;
40 void ReleaseProcessIfNeeded() override;
42 private:
43 void Init();
45 // ChildThread implementation.
46 bool OnControlMessageReceived(const IPC::Message& msg) override;
48 // IPC message handlers.
49 void OnBatchModeStarted();
50 void OnBatchModeFinished();
52 #if defined(OS_POSIX) && defined(ENABLE_PLUGINS)
53 void OnLoadPlugins(const std::vector<base::FilePath>& plugin_paths);
54 #endif
56 // True when we're running in batch mode.
57 bool batch_mode_;
59 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_;
61 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl);
64 #if defined(COMPILER_MSVC)
65 #pragma warning(pop)
66 #endif
68 } // namespace content
70 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_