Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: content/renderer/render_process.h

Issue 2687903003: Add TaskScheduler initialization arguments to ChildProcess. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <vector>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/task_scheduler/scheduler_worker_pool_params.h"
12 #include "base/task_scheduler/task_scheduler.h"
9 #include "content/child/child_process.h" 13 #include "content/child/child_process.h"
10 14
11 namespace content { 15 namespace content {
12 16
13 // A abstract interface representing the renderer end of the browser<->renderer 17 // A abstract interface representing the renderer end of the browser<->renderer
14 // connection. The opposite end is the RenderProcessHost. This is a singleton 18 // connection. The opposite end is the RenderProcessHost. This is a singleton
15 // object for each renderer. 19 // object for each renderer.
16 // 20 //
17 // RenderProcessImpl implements this interface for the regular browser. 21 // RenderProcessImpl implements this interface for the regular browser.
18 // MockRenderProcess implements this interface for certain tests, especially 22 // MockRenderProcess implements this interface for certain tests, especially
19 // ones derived from RenderViewTest. 23 // ones derived from RenderViewTest.
20 class RenderProcess : public ChildProcess { 24 class RenderProcess : public ChildProcess {
21 public: 25 public:
22 RenderProcess() {} 26 RenderProcess(
27 const std::vector<base::SchedulerWorkerPoolParams>& worker_pool_params,
28 base::TaskScheduler::WorkerPoolIndexForTraitsCallback
29 worker_pool_index_for_traits_callback);
23 ~RenderProcess() override {} 30 ~RenderProcess() override {}
24 31
25 // Keep track of the cumulative set of enabled bindings for this process, 32 // Keep track of the cumulative set of enabled bindings for this process,
26 // across any view. 33 // across any view.
27 virtual void AddBindings(int bindings) = 0; 34 virtual void AddBindings(int bindings) = 0;
28 35
29 // The cumulative set of enabled bindings for this process. 36 // The cumulative set of enabled bindings for this process.
30 virtual int GetEnabledBindings() const = 0; 37 virtual int GetEnabledBindings() const = 0;
31 38
32 // Returns a pointer to the RenderProcess singleton instance. Assuming that 39 // Returns a pointer to the RenderProcess singleton instance. Assuming that
33 // we're actually a renderer or a renderer test, this static cast will 40 // we're actually a renderer or a renderer test, this static cast will
34 // be correct. 41 // be correct.
35 static RenderProcess* current() { 42 static RenderProcess* current() {
36 return static_cast<RenderProcess*>(ChildProcess::current()); 43 return static_cast<RenderProcess*>(ChildProcess::current());
37 } 44 }
38 45
39 private: 46 private:
40 DISALLOW_COPY_AND_ASSIGN(RenderProcess); 47 DISALLOW_COPY_AND_ASSIGN(RenderProcess);
41 }; 48 };
42 49
43 } // namespace content 50 } // namespace content
44 51
45 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ 52 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698