Use a deque in ResourcePool instead of a list.
[chromium-blink-merge.git] / content / utility / utility_thread_impl.h
blob3b1d66d65d4407269c4de80f3a6b0559e74199a9
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;
23 class UtilityBlinkPlatformImpl;
25 #if defined(COMPILER_MSVC)
26 // See explanation for other RenderViewHostImpl which is the same issue.
27 #pragma warning(push)
28 #pragma warning(disable: 4250)
29 #endif
31 // This class represents the background thread where the utility task runs.
32 class UtilityThreadImpl : public UtilityThread,
33 public ChildThreadImpl {
34 public:
35 UtilityThreadImpl();
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;
43 private:
44 void Init();
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);
55 #endif
57 // True when we're running in batch mode.
58 bool batch_mode_;
60 scoped_ptr<UtilityBlinkPlatformImpl> blink_platform_impl_;
62 DISALLOW_COPY_AND_ASSIGN(UtilityThreadImpl);
65 #if defined(COMPILER_MSVC)
66 #pragma warning(pop)
67 #endif
69 } // namespace content
71 #endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_