blob: 8ae66115cedc7647348d4a0f039800a8c0a16d51 [file] [log] [blame]
[email protected]00c39612010-03-06 02:53:281// Copyright (c) 2010 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
[email protected]8704f89b2011-04-15 00:30:055#ifndef CONTENT_RENDERER_RENDER_PROCESS_H_
6#define CONTENT_RENDERER_RENDER_PROCESS_H_
[email protected]32b76ef2010-07-26 23:08:247#pragma once
initial.commit09911bf2008-07-26 23:55:298
[email protected]7ef40ffe12011-03-08 05:05:289#include "content/common/child_process.h"
[email protected]e68e62fa2009-02-20 02:00:0410#include "skia/ext/platform_canvas.h"
initial.commit09911bf2008-07-26 23:55:2911
[email protected]00c39612010-03-06 02:53:2812class TransportDIB;
13
[email protected]e68e62fa2009-02-20 02:00:0414namespace gfx {
15class Rect;
[email protected]39008c02009-02-11 23:59:2516}
17
[email protected]00c39612010-03-06 02:53:2818namespace skia {
19class PlatformCanvas;
20}
[email protected]e68e62fa2009-02-20 02:00:0421
[email protected]00c39612010-03-06 02:53:2822// A abstract interface representing the renderer end of the browser<->renderer
23// connection. The opposite end is the RenderProcessHost. This is a singleton
24// object for each renderer.
25//
26// RenderProcessImpl implements this interface for the regular browser.
27// MockRenderProcess implements this interface for certain tests, especially
28// ones derived from RenderViewTest.
initial.commit09911bf2008-07-26 23:55:2929class RenderProcess : public ChildProcess {
30 public:
[email protected]00c39612010-03-06 02:53:2831 RenderProcess() {}
32 virtual ~RenderProcess() {}
initial.commit09911bf2008-07-26 23:55:2933
[email protected]e68e62fa2009-02-20 02:00:0434 // Get a canvas suitable for drawing and transporting to the browser
35 // memory: (output) the transport DIB memory
36 // rect: the rectangle which will be painted, use for sizing the canvas
37 // returns: NULL on error
38 //
39 // When no longer needed, you should pass the TransportDIB to
40 // ReleaseTransportDIB so that it can be recycled.
[email protected]00c39612010-03-06 02:53:2841 virtual skia::PlatformCanvas* GetDrawingCanvas(TransportDIB** memory,
42 const gfx::Rect& rect) = 0;
initial.commit09911bf2008-07-26 23:55:2943
44 // Frees shared memory allocated by AllocSharedMemory. You should only use
45 // this function to free the SharedMemory object.
[email protected]00c39612010-03-06 02:53:2846 virtual void ReleaseTransportDIB(TransportDIB* memory) = 0;
[email protected]514e7112009-02-20 05:23:3647
[email protected]00c39612010-03-06 02:53:2848 // Returns true if plugisn should be loaded in-process.
49 virtual bool UseInProcessPlugins() const = 0;
[email protected]ea51de32009-02-20 07:15:1750
[email protected]00c39612010-03-06 02:53:2851 // Returns a pointer to the RenderProcess singleton instance. Assuming that
52 // we're actually a renderer or a renderer test, this static cast will
53 // be correct.
[email protected]8930d472009-02-21 08:05:2854 static RenderProcess* current() {
55 return static_cast<RenderProcess*>(ChildProcess::current());
[email protected]ea51de32009-02-20 07:15:1756 }
57
[email protected]8930d472009-02-21 08:05:2858 private:
[email protected]1bc83062009-02-06 00:16:3759 DISALLOW_COPY_AND_ASSIGN(RenderProcess);
initial.commit09911bf2008-07-26 23:55:2960};
61
[email protected]8704f89b2011-04-15 00:30:0562#endif // CONTENT_RENDERER_RENDER_PROCESS_H_