OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_RENDER_PROCESS_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_PROCESS_H_ |
6 #define CONTENT_RENDERER_RENDER_PROCESS_H_ | 6 #define CONTENT_RENDERER_RENDER_PROCESS_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 #include <string> |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/task_scheduler/scheduler_worker_pool_params.h" | |
12 #include "base/task_scheduler/task_scheduler.h" | 13 #include "base/task_scheduler/task_scheduler.h" |
13 #include "content/child/child_process.h" | 14 #include "content/child/child_process.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 // A abstract interface representing the renderer end of the browser<->renderer | 18 // A abstract interface representing the renderer end of the browser<->renderer |
18 // connection. The opposite end is the RenderProcessHost. This is a singleton | 19 // connection. The opposite end is the RenderProcessHost. This is a singleton |
19 // object for each renderer. | 20 // object for each renderer. |
20 // | 21 // |
21 // RenderProcessImpl implements this interface for the regular browser. | 22 // RenderProcessImpl implements this interface for the regular browser. |
22 // MockRenderProcess implements this interface for certain tests, especially | 23 // MockRenderProcess implements this interface for certain tests, especially |
23 // ones derived from RenderViewTest. | 24 // ones derived from RenderViewTest. |
24 class RenderProcess : public ChildProcess { | 25 class RenderProcess : public ChildProcess { |
25 public: | 26 public: |
26 RenderProcess() = default; | 27 RenderProcess() = default; |
27 RenderProcess( | 28 RenderProcess(const std::string& task_scheduler_name, |
28 const std::vector<base::SchedulerWorkerPoolParams>& worker_pool_params, | 29 std::unique_ptr<base::TaskScheduler::InitParams> |
29 base::TaskScheduler::WorkerPoolIndexForTraitsCallback | 30 task_scheduler_init_params); |
30 worker_pool_index_for_traits_callback); | |
31 ~RenderProcess() override {} | 31 ~RenderProcess() override {} |
32 | 32 |
33 // Keep track of the cumulative set of enabled bindings for this process, | 33 // Keep track of the cumulative set of enabled bindings for this process, |
34 // across any view. | 34 // across any view. |
35 virtual void AddBindings(int bindings) = 0; | 35 virtual void AddBindings(int bindings) = 0; |
36 | 36 |
37 // The cumulative set of enabled bindings for this process. | 37 // The cumulative set of enabled bindings for this process. |
38 virtual int GetEnabledBindings() const = 0; | 38 virtual int GetEnabledBindings() const = 0; |
39 | 39 |
40 // Returns a pointer to the RenderProcess singleton instance. Assuming that | 40 // Returns a pointer to the RenderProcess singleton instance. Assuming that |
41 // we're actually a renderer or a renderer test, this static cast will | 41 // we're actually a renderer or a renderer test, this static cast will |
42 // be correct. | 42 // be correct. |
43 static RenderProcess* current() { | 43 static RenderProcess* current() { |
44 return static_cast<RenderProcess*>(ChildProcess::current()); | 44 return static_cast<RenderProcess*>(ChildProcess::current()); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 DISALLOW_COPY_AND_ASSIGN(RenderProcess); | 48 DISALLOW_COPY_AND_ASSIGN(RenderProcess); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace content | 51 } // namespace content |
52 | 52 |
53 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ | 53 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ |
OLD | NEW |