| 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_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <queue> | 10 #include <queue> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/process.h" | 14 #include "base/process.h" |
| 15 #include "base/synchronization/waitable_event_watcher.h" | 15 #include "base/synchronization/waitable_event_watcher.h" |
| 16 #include "base/timer.h" | 16 #include "base/timer.h" |
| 17 #include "content/browser/child_process_launcher.h" | 17 #include "content/browser/child_process_launcher.h" |
| 18 #include "content/common/content_export.h" |
| 18 #include "content/browser/renderer_host/render_process_host.h" | 19 #include "content/browser/renderer_host/render_process_host.h" |
| 19 #include "ui/gfx/surface/transport_dib.h" | 20 #include "ui/gfx/surface/transport_dib.h" |
| 20 | 21 |
| 21 class CommandLine; | 22 class CommandLine; |
| 22 class RendererMainThread; | 23 class RendererMainThread; |
| 23 class RenderWidgetHelper; | 24 class RenderWidgetHelper; |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class SharedMemory; | 27 class SharedMemory; |
| 27 class WaitableEvent; | 28 class WaitableEvent; |
| 28 } | 29 } |
| 29 | 30 |
| 30 // Implements a concrete RenderProcessHost for the browser process for talking | 31 // Implements a concrete RenderProcessHost for the browser process for talking |
| 31 // to actual renderer processes (as opposed to mocks). | 32 // to actual renderer processes (as opposed to mocks). |
| 32 // | 33 // |
| 33 // Represents the browser side of the browser <--> renderer communication | 34 // Represents the browser side of the browser <--> renderer communication |
| 34 // channel. There will be one RenderProcessHost per renderer process. | 35 // channel. There will be one RenderProcessHost per renderer process. |
| 35 // | 36 // |
| 36 // This object is refcounted so that it can release its resources when all | 37 // This object is refcounted so that it can release its resources when all |
| 37 // hosts using it go away. | 38 // hosts using it go away. |
| 38 // | 39 // |
| 39 // This object communicates back and forth with the RenderProcess object | 40 // This object communicates back and forth with the RenderProcess object |
| 40 // running in the renderer process. Each RenderProcessHost and RenderProcess | 41 // running in the renderer process. Each RenderProcessHost and RenderProcess |
| 41 // keeps a list of RenderView (renderer) and TabContents (browser) which | 42 // keeps a list of RenderView (renderer) and TabContents (browser) which |
| 42 // are correlated with IDs. This way, the Views and the corresponding ViewHosts | 43 // are correlated with IDs. This way, the Views and the corresponding ViewHosts |
| 43 // communicate through the two process objects. | 44 // communicate through the two process objects. |
| 44 class BrowserRenderProcessHost : public RenderProcessHost, | 45 class CONTENT_EXPORT BrowserRenderProcessHost |
| 45 public ChildProcessLauncher::Client, | 46 : public RenderProcessHost, |
| 46 public base::WaitableEventWatcher::Delegate { | 47 public ChildProcessLauncher::Client, |
| 48 public base::WaitableEventWatcher::Delegate { |
| 47 public: | 49 public: |
| 48 explicit BrowserRenderProcessHost(content::BrowserContext* browser_context); | 50 explicit BrowserRenderProcessHost(content::BrowserContext* browser_context); |
| 49 virtual ~BrowserRenderProcessHost(); | 51 virtual ~BrowserRenderProcessHost(); |
| 50 | 52 |
| 51 // RenderProcessHost implementation (public portion). | 53 // RenderProcessHost implementation (public portion). |
| 52 virtual void EnableSendQueue(); | 54 virtual void EnableSendQueue(); |
| 53 virtual bool Init(bool is_accessibility_enabled); | 55 virtual bool Init(bool is_accessibility_enabled); |
| 54 virtual int GetNextRoutingID(); | 56 virtual int GetNextRoutingID(); |
| 55 virtual void CancelResourceRequests(int render_widget_id); | 57 virtual void CancelResourceRequests(int render_widget_id); |
| 56 virtual void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); | 58 virtual void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 166 |
| 165 #if defined(OS_WIN) | 167 #if defined(OS_WIN) |
| 166 // Used to wait until the renderer dies to get an accurrate exit code. | 168 // Used to wait until the renderer dies to get an accurrate exit code. |
| 167 base::WaitableEventWatcher child_process_watcher_; | 169 base::WaitableEventWatcher child_process_watcher_; |
| 168 #endif | 170 #endif |
| 169 | 171 |
| 170 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 172 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 175 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |