| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_RENDERER_RENDER_PROCESS_H__ | 5 #ifndef CHROME_RENDERER_RENDER_PROCESS_H__ |
| 6 #define CHROME_RENDERER_RENDER_PROCESS_H__ | 6 #define CHROME_RENDERER_RENDER_PROCESS_H__ |
| 7 | 7 |
| 8 #include "base/timer.h" | 8 #include "base/timer.h" |
| 9 #include "chrome/common/child_process.h" | 9 #include "chrome/common/child_process.h" |
| 10 #include "chrome/renderer/render_thread.h" | 10 #include "chrome/renderer/render_thread.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 skia::PlatformCanvas* GetDrawingCanvas( | 38 skia::PlatformCanvas* GetDrawingCanvas( |
| 39 TransportDIB** memory, const gfx::Rect& rect); | 39 TransportDIB** memory, const gfx::Rect& rect); |
| 40 | 40 |
| 41 // Frees shared memory allocated by AllocSharedMemory. You should only use | 41 // Frees shared memory allocated by AllocSharedMemory. You should only use |
| 42 // this function to free the SharedMemory object. | 42 // this function to free the SharedMemory object. |
| 43 void ReleaseTransportDIB(TransportDIB* memory); | 43 void ReleaseTransportDIB(TransportDIB* memory); |
| 44 | 44 |
| 45 // Returns true if plugins should be loaded in-process. | 45 // Returns true if plugins should be loaded in-process. |
| 46 bool in_process_plugins() const { return in_process_plugins_; } | 46 bool in_process_plugins() const { return in_process_plugins_; } |
| 47 | 47 |
| 48 bool initialized_media_library() const { return initialized_media_library_; } |
| 49 |
| 48 // Returns a pointer to the RenderProcess singleton instance. | 50 // Returns a pointer to the RenderProcess singleton instance. |
| 49 static RenderProcess* current() { | 51 static RenderProcess* current() { |
| 50 return static_cast<RenderProcess*>(ChildProcess::current()); | 52 return static_cast<RenderProcess*>(ChildProcess::current()); |
| 51 } | 53 } |
| 52 | 54 |
| 53 protected: | 55 protected: |
| 54 friend class RenderThread; | 56 friend class RenderThread; |
| 55 // Just like in_process_plugins(), but called before RenderProcess is created. | 57 // Just like in_process_plugins(), but called before RenderProcess is created. |
| 56 static bool InProcessPlugins(); | 58 static bool InProcessPlugins(); |
| 57 | 59 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 // then it points to a SharedMemory object that is available for reuse. | 87 // then it points to a SharedMemory object that is available for reuse. |
| 86 TransportDIB* shared_mem_cache_[2]; | 88 TransportDIB* shared_mem_cache_[2]; |
| 87 | 89 |
| 88 // This DelayTimer cleans up our cache 5 seconds after the last use. | 90 // This DelayTimer cleans up our cache 5 seconds after the last use. |
| 89 base::DelayTimer<RenderProcess> shared_mem_cache_cleaner_; | 91 base::DelayTimer<RenderProcess> shared_mem_cache_cleaner_; |
| 90 | 92 |
| 91 // TransportDIB sequence number | 93 // TransportDIB sequence number |
| 92 uint32 sequence_number_; | 94 uint32 sequence_number_; |
| 93 | 95 |
| 94 bool in_process_plugins_; | 96 bool in_process_plugins_; |
| 97 bool initialized_media_library_; |
| 95 | 98 |
| 96 DISALLOW_COPY_AND_ASSIGN(RenderProcess); | 99 DISALLOW_COPY_AND_ASSIGN(RenderProcess); |
| 97 }; | 100 }; |
| 98 | 101 |
| 99 #endif // CHROME_RENDERER_RENDER_PROCESS_H__ | 102 #endif // CHROME_RENDERER_RENDER_PROCESS_H__ |
| OLD | NEW |