summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_process.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 07:15:17 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 07:15:17 +0000
commitea51de3307a6a5947ca047fa9d0e20359fdcf658 (patch)
treec1a49c1d41c4bfbf74ddbc28c371f840dd2848fa /chrome/renderer/render_process.h
parentb6aedfff89cd93f07c1c38a13062801e81bf26e4 (diff)
downloadchromium_src-ea51de3307a6a5947ca047fa9d0e20359fdcf658.zip
chromium_src-ea51de3307a6a5947ca047fa9d0e20359fdcf658.tar.gz
chromium_src-ea51de3307a6a5947ca047fa9d0e20359fdcf658.tar.bz2
Reverting 10080.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_process.h')
-rw-r--r--chrome/renderer/render_process.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/chrome/renderer/render_process.h b/chrome/renderer/render_process.h
index a4bc0ff5..9c4cabe 100644
--- a/chrome/renderer/render_process.h
+++ b/chrome/renderer/render_process.h
@@ -21,12 +21,11 @@ class TransportDIB;
// each renderer.
class RenderProcess : public ChildProcess {
public:
- // This constructor grabs the channel name from the command line arguments.
- RenderProcess();
- // This constructor uses the given channel name.
- RenderProcess(const std::wstring& channel_name);
+ static bool GlobalInit(const std::wstring& channel_name);
+ static void GlobalCleanup();
- ~RenderProcess();
+ // Returns true if plugins should be loaded in-process.
+ static bool ShouldLoadPluginsInProcess();
// Get a canvas suitable for drawing and transporting to the browser
// memory: (output) the transport DIB memory
@@ -35,31 +34,25 @@ class RenderProcess : public ChildProcess {
//
// When no longer needed, you should pass the TransportDIB to
// ReleaseTransportDIB so that it can be recycled.
- skia::PlatformCanvas* GetDrawingCanvas(
+ static skia::PlatformCanvas* GetDrawingCanvas(
TransportDIB** memory, const gfx::Rect& rect);
// Frees shared memory allocated by AllocSharedMemory. You should only use
// this function to free the SharedMemory object.
- void ReleaseTransportDIB(TransportDIB* memory);
+ static void ReleaseTransportDIB(TransportDIB* memory);
- // Returns true if plugins should be loaded in-process.
- bool in_process_plugins() const { return in_process_plugins_; }
-
- // Returns true if Gears should be loaded in-process.
- bool in_process_gears() const { return in_process_gears_; }
+ private:
+ friend class ChildProcessFactory<RenderProcess>;
+ explicit RenderProcess(const std::wstring& channel_name);
+ ~RenderProcess();
- // Returns a pointer to the RenderProcess singleton instance.
- static RenderProcess* current() {
- return static_cast<RenderProcess*>(ChildProcess::current());
+ // Returns a pointer to the RenderProcess singleton instance. This is
+ // guaranteed to be non-NULL between calls to GlobalInit and GlobalCleanup.
+ static RenderProcess* self() {
+ return static_cast<RenderProcess*>(child_process_);
}
- protected:
- friend class RenderThread;
- // Just like in_process_plugins(), but called before RenderProcess is created.
- static bool InProcessPlugins();
-
- private:
- void Init();
+ static ChildProcess* ClassFactory(const std::wstring& channel_name);
// Look in the shared memory cache for a suitable object to reuse.
// result: (output) the memory found
@@ -84,6 +77,12 @@ class RenderProcess : public ChildProcess {
TransportDIB* CreateTransportDIB(size_t size);
void FreeTransportDIB(TransportDIB*);
+ // ChildProcess implementation
+ virtual void Cleanup();
+
+ // The one render thread (to be replaced with a set of render threads).
+ RenderThread render_thread_;
+
// A very simplistic and small cache. If an entry in this array is non-null,
// then it points to a SharedMemory object that is available for reuse.
TransportDIB* shared_mem_cache_[2];
@@ -94,8 +93,7 @@ class RenderProcess : public ChildProcess {
// TransportDIB sequence number
uint32 sequence_number_;
- bool in_process_plugins_;
- bool in_process_gears_;
+ static bool load_plugins_in_process_;
DISALLOW_COPY_AND_ASSIGN(RenderProcess);
};