| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/process.h" | 13 #include "base/process.h" |
| 14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "content/common/content_export.h" |
| 16 #include "ipc/ipc_channel_proxy.h" | 17 #include "ipc/ipc_channel_proxy.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 18 #include "ui/gfx/surface/transport_dib.h" | 19 #include "ui/gfx/surface/transport_dib.h" |
| 19 | 20 |
| 20 struct ViewMsg_SwapOut_Params; | 21 struct ViewMsg_SwapOut_Params; |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class SharedMemory; | 24 class SharedMemory; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 class BrowserContext; | 28 class BrowserContext; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace net { | 31 namespace net { |
| 31 class URLRequestContextGetter; | 32 class URLRequestContextGetter; |
| 32 } | 33 } |
| 33 | 34 |
| 34 // Virtual interface that represents the browser side of the browser <-> | 35 // Virtual interface that represents the browser side of the browser <-> |
| 35 // renderer communication channel. There will generally be one | 36 // renderer communication channel. There will generally be one |
| 36 // RenderProcessHost per renderer process. | 37 // RenderProcessHost per renderer process. |
| 37 // | 38 // |
| 38 // The concrete implementation of this class for normal use is the | 39 // The concrete implementation of this class for normal use is the |
| 39 // BrowserRenderProcessHost. It may also be implemented by a testing interface | 40 // BrowserRenderProcessHost. It may also be implemented by a testing interface |
| 40 // for mocking purposes. | 41 // for mocking purposes. |
| 41 class RenderProcessHost : public IPC::Channel::Sender, | 42 class CONTENT_EXPORT RenderProcessHost : public IPC::Channel::Sender, |
| 42 public IPC::Channel::Listener { | 43 public IPC::Channel::Listener { |
| 43 public: | 44 public: |
| 44 typedef IDMap<RenderProcessHost>::iterator iterator; | 45 typedef IDMap<RenderProcessHost>::iterator iterator; |
| 45 | 46 |
| 46 // We classify renderers according to their highest privilege, and try | 47 // We classify renderers according to their highest privilege, and try |
| 47 // to group pages into renderers with similar privileges. | 48 // to group pages into renderers with similar privileges. |
| 48 // Note: it may be possible for a renderer to have multiple privileges, | 49 // Note: it may be possible for a renderer to have multiple privileges, |
| 49 // in which case we call it an "extension" renderer. | 50 // in which case we call it an "extension" renderer. |
| 50 enum Type { | 51 enum Type { |
| 51 TYPE_NORMAL, // Normal renderer, no extra privileges. | 52 TYPE_NORMAL, // Normal renderer, no extra privileges. |
| 52 TYPE_WEBUI, // Renderer with WebUI privileges, like New Tab. | 53 TYPE_WEBUI, // Renderer with WebUI privileges, like New Tab. |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // Factory object for RenderProcessHosts. Using this factory allows tests to | 339 // Factory object for RenderProcessHosts. Using this factory allows tests to |
| 339 // swap out a different one to use a TestRenderProcessHost. | 340 // swap out a different one to use a TestRenderProcessHost. |
| 340 class RenderProcessHostFactory { | 341 class RenderProcessHostFactory { |
| 341 public: | 342 public: |
| 342 virtual ~RenderProcessHostFactory() {} | 343 virtual ~RenderProcessHostFactory() {} |
| 343 virtual RenderProcessHost* CreateRenderProcessHost( | 344 virtual RenderProcessHost* CreateRenderProcessHost( |
| 344 content::BrowserContext* browser_context) const = 0; | 345 content::BrowserContext* browser_context) const = 0; |
| 345 }; | 346 }; |
| 346 | 347 |
| 347 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ | 348 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |