[email protected] | 744c2a2 | 2012-03-15 18:42:04 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 8704f89b | 2011-04-15 00:30:05 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDER_PROCESS_H_ |
6 | #define CONTENT_RENDERER_RENDER_PROCESS_H_ | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | 10208ea | 2013-06-06 20:08:03 | [diff] [blame] | 9 | #include "content/child/child_process.h" |
[email protected] | 39008c0 | 2009-02-11 23:59:25 | [diff] [blame] | 10 | |
[email protected] | eb39819 | 2012-10-22 20:16:19 | [diff] [blame] | 11 | namespace content { |
12 | |||||
[email protected] | 00c3961 | 2010-03-06 02:53:28 | [diff] [blame] | 13 | // A abstract interface representing the renderer end of the browser<->renderer |
14 | // connection. The opposite end is the RenderProcessHost. This is a singleton | ||||
15 | // object for each renderer. | ||||
16 | // | ||||
17 | // RenderProcessImpl implements this interface for the regular browser. | ||||
18 | // MockRenderProcess implements this interface for certain tests, especially | ||||
19 | // ones derived from RenderViewTest. | ||||
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 20 | class RenderProcess : public ChildProcess { |
21 | public: | ||||
[email protected] | 00c3961 | 2010-03-06 02:53:28 | [diff] [blame] | 22 | RenderProcess() {} |
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 23 | ~RenderProcess() override {} |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 24 | |
[email protected] | 744c2a2 | 2012-03-15 18:42:04 | [diff] [blame] | 25 | // Keep track of the cumulative set of enabled bindings for this process, |
26 | // across any view. | ||||
27 | virtual void AddBindings(int bindings) = 0; | ||||
28 | |||||
29 | // The cumulative set of enabled bindings for this process. | ||||
30 | virtual int GetEnabledBindings() const = 0; | ||||
31 | |||||
[email protected] | 00c3961 | 2010-03-06 02:53:28 | [diff] [blame] | 32 | // Returns a pointer to the RenderProcess singleton instance. Assuming that |
33 | // we're actually a renderer or a renderer test, this static cast will | ||||
34 | // be correct. | ||||
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 35 | static RenderProcess* current() { |
36 | return static_cast<RenderProcess*>(ChildProcess::current()); | ||||
[email protected] | ea51de3 | 2009-02-20 07:15:17 | [diff] [blame] | 37 | } |
38 | |||||
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 39 | private: |
[email protected] | 1bc8306 | 2009-02-06 00:16:37 | [diff] [blame] | 40 | DISALLOW_COPY_AND_ASSIGN(RenderProcess); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 41 | }; |
42 | |||||
[email protected] | eb39819 | 2012-10-22 20:16:19 | [diff] [blame] | 43 | } // namespace content |
44 | |||||
[email protected] | 8704f89b | 2011-04-15 00:30:05 | [diff] [blame] | 45 | #endif // CONTENT_RENDERER_RENDER_PROCESS_H_ |