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_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_PROCESS_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_PROCESS_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_PROCESS_IMPL_H_ |
7 | 7 |
8 #include "base/timer.h" | 8 #include "base/timer.h" |
9 #include "content/renderer/render_process.h" | 9 #include "content/renderer/render_process.h" |
10 | 10 |
11 namespace skia { | 11 namespace skia { |
12 class PlatformCanvas; | 12 class PlatformCanvas; |
13 } | 13 } |
14 | 14 |
15 // Implementation of the RenderProcess interface for the regular browser. | 15 // Implementation of the RenderProcess interface for the regular browser. |
16 // See also MockRenderProcess which implements the active "RenderProcess" when | 16 // See also MockRenderProcess which implements the active "RenderProcess" when |
17 // running under certain unit tests. | 17 // running under certain unit tests. |
18 class RenderProcessImpl : public RenderProcess { | 18 class RenderProcessImpl : public RenderProcess { |
19 public: | 19 public: |
20 RenderProcessImpl(); | 20 RenderProcessImpl(); |
21 virtual ~RenderProcessImpl(); | 21 virtual ~RenderProcessImpl(); |
22 | 22 |
| 23 // Create a new transport DIB of, at least, the given size. Return NULL on |
| 24 // error. |
| 25 TransportDIB* CreateTransportDIB(size_t size); |
| 26 void FreeTransportDIB(TransportDIB*); |
| 27 |
23 // RenderProcess implementation. | 28 // RenderProcess implementation. |
24 virtual skia::PlatformCanvas* GetDrawingCanvas( | 29 virtual skia::PlatformCanvas* GetDrawingCanvas( |
25 TransportDIB** memory, | 30 TransportDIB** memory, |
26 const gfx::Rect& rect) OVERRIDE; | 31 const gfx::Rect& rect) OVERRIDE; |
27 virtual void ReleaseTransportDIB(TransportDIB* memory) OVERRIDE; | 32 virtual void ReleaseTransportDIB(TransportDIB* memory) OVERRIDE; |
28 virtual bool UseInProcessPlugins() const OVERRIDE; | 33 virtual bool UseInProcessPlugins() const OVERRIDE; |
29 virtual void AddBindings(int bindings) OVERRIDE; | 34 virtual void AddBindings(int bindings) OVERRIDE; |
30 virtual int GetEnabledBindings() const OVERRIDE; | 35 virtual int GetEnabledBindings() const OVERRIDE; |
31 virtual TransportDIB* CreateTransportDIB(size_t size) OVERRIDE; | |
32 virtual void FreeTransportDIB(TransportDIB*) OVERRIDE; | |
33 | 36 |
34 // Like UseInProcessPlugins(), but called before RenderProcess is created | 37 // Like UseInProcessPlugins(), but called before RenderProcess is created |
35 // and does not allow overriding by tests. This just checks the command line | 38 // and does not allow overriding by tests. This just checks the command line |
36 // each time. | 39 // each time. |
37 static bool InProcessPlugins(); | 40 static bool InProcessPlugins(); |
38 | 41 |
39 private: | 42 private: |
40 // Look in the shared memory cache for a suitable object to reuse. | 43 // Look in the shared memory cache for a suitable object to reuse. |
41 // result: (output) the memory found | 44 // result: (output) the memory found |
42 // size: the resulting memory will be >= this size, in bytes | 45 // size: the resulting memory will be >= this size, in bytes |
(...skipping 25 matching lines...) Expand all Loading... |
68 bool in_process_plugins_; | 71 bool in_process_plugins_; |
69 | 72 |
70 // Bitwise-ORed set of extra bindings that have been enabled anywhere in this | 73 // Bitwise-ORed set of extra bindings that have been enabled anywhere in this |
71 // process. See BindingsPolicy for details. | 74 // process. See BindingsPolicy for details. |
72 int enabled_bindings_; | 75 int enabled_bindings_; |
73 | 76 |
74 DISALLOW_COPY_AND_ASSIGN(RenderProcessImpl); | 77 DISALLOW_COPY_AND_ASSIGN(RenderProcessImpl); |
75 }; | 78 }; |
76 | 79 |
77 #endif // CONTENT_RENDERER_RENDER_PROCESS_IMPL_H_ | 80 #endif // CONTENT_RENDERER_RENDER_PROCESS_IMPL_H_ |
OLD | NEW |