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 "content/child/child_process.h" | 8 #include "content/child/child_process.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 | 11 |
12 // A abstract interface representing the renderer end of the browser<->renderer | 12 // A abstract interface representing the renderer end of the browser<->renderer |
13 // connection. The opposite end is the RenderProcessHost. This is a singleton | 13 // connection. The opposite end is the RenderProcessHost. This is a singleton |
14 // object for each renderer. | 14 // object for each renderer. |
15 // | 15 // |
16 // RenderProcessImpl implements this interface for the regular browser. | 16 // RenderProcessImpl implements this interface for the regular browser. |
17 // MockRenderProcess implements this interface for certain tests, especially | 17 // MockRenderProcess implements this interface for certain tests, especially |
18 // ones derived from RenderViewTest. | 18 // ones derived from RenderViewTest. |
19 class RenderProcess : public ChildProcess { | 19 class RenderProcess : public ChildProcess { |
20 public: | 20 public: |
21 RenderProcess() {} | 21 RenderProcess() {} |
22 virtual ~RenderProcess() {} | 22 ~RenderProcess() override {} |
23 | 23 |
24 // Keep track of the cumulative set of enabled bindings for this process, | 24 // Keep track of the cumulative set of enabled bindings for this process, |
25 // across any view. | 25 // across any view. |
26 virtual void AddBindings(int bindings) = 0; | 26 virtual void AddBindings(int bindings) = 0; |
27 | 27 |
28 // The cumulative set of enabled bindings for this process. | 28 // The cumulative set of enabled bindings for this process. |
29 virtual int GetEnabledBindings() const = 0; | 29 virtual int GetEnabledBindings() const = 0; |
30 | 30 |
31 // Returns a pointer to the RenderProcess singleton instance. Assuming that | 31 // Returns a pointer to the RenderProcess singleton instance. Assuming that |
32 // we're actually a renderer or a renderer test, this static cast will | 32 // we're actually a renderer or a renderer test, this static cast will |
33 // be correct. | 33 // be correct. |
34 static RenderProcess* current() { | 34 static RenderProcess* current() { |
35 return static_cast<RenderProcess*>(ChildProcess::current()); | 35 return static_cast<RenderProcess*>(ChildProcess::current()); |
36 } | 36 } |
37 | 37 |
38 private: | 38 private: |
39 DISALLOW_COPY_AND_ASSIGN(RenderProcess); | 39 DISALLOW_COPY_AND_ASSIGN(RenderProcess); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace content | 42 } // namespace content |
43 | 43 |
44 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ | 44 #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ |
OLD | NEW |