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_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/process.h" | 12 #include "base/process.h" |
13 #include "base/ref_counted.h" | 13 #include "base/ref_counted.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "chrome/common/transport_dib.h" | 18 #include "chrome/common/transport_dib.h" |
19 #include "chrome/browser/renderer_host/audio_renderer_host.h" | 19 #include "chrome/browser/renderer_host/audio_renderer_host.h" |
20 #include "chrome/browser/renderer_host/render_process_host.h" | 20 #include "chrome/browser/renderer_host/render_process_host.h" |
21 #include "chrome/common/notification_observer.h" | 21 #include "chrome/common/notification_observer.h" |
22 #include "webkit/glue/cache_manager.h" | 22 #include "webkit/glue/cache_manager.h" |
23 | 23 |
24 class CommandLine; | 24 class CommandLine; |
25 class GURL; | 25 class GURL; |
26 class PrefService; | |
27 class RendererMainThread; | 26 class RendererMainThread; |
28 class RenderWidgetHelper; | 27 class RenderWidgetHelper; |
29 class WebContents; | 28 class WebContents; |
30 | 29 |
31 namespace gfx { | 30 namespace gfx { |
32 class Size; | 31 class Size; |
33 } | 32 } |
34 | 33 |
35 // Implements a concrete RenderProcessHost for the browser process for talking | 34 // Implements a concrete RenderProcessHost for the browser process for talking |
36 // to actual renderer processes (as opposed to mocks). | 35 // to actual renderer processes (as opposed to mocks). |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); | 68 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); |
70 | 69 |
71 // IPC::Channel::Sender via RenderProcessHost. | 70 // IPC::Channel::Sender via RenderProcessHost. |
72 virtual bool Send(IPC::Message* msg); | 71 virtual bool Send(IPC::Message* msg); |
73 | 72 |
74 // IPC::Channel::Listener via RenderProcessHost. | 73 // IPC::Channel::Listener via RenderProcessHost. |
75 virtual void OnMessageReceived(const IPC::Message& msg); | 74 virtual void OnMessageReceived(const IPC::Message& msg); |
76 virtual void OnChannelConnected(int32 peer_pid); | 75 virtual void OnChannelConnected(int32 peer_pid); |
77 virtual void OnChannelError(); | 76 virtual void OnChannelError(); |
78 | 77 |
79 static void RegisterPrefs(PrefService* prefs); | |
80 | |
81 // If the a process has sent a message that cannot be decoded, it is deemed | 78 // If the a process has sent a message that cannot be decoded, it is deemed |
82 // corrupted and thus needs to be terminated using this call. This function | 79 // corrupted and thus needs to be terminated using this call. This function |
83 // can be safely called from any thread. | 80 // can be safely called from any thread. |
84 static void BadMessageTerminateProcess(uint16 msg_type, | 81 static void BadMessageTerminateProcess(uint16 msg_type, |
85 base::ProcessHandle renderer); | 82 base::ProcessHandle renderer); |
86 | 83 |
87 // NotificationObserver implementation. | 84 // NotificationObserver implementation. |
88 virtual void Observe(NotificationType type, | 85 virtual void Observe(NotificationType type, |
89 const NotificationSource& source, | 86 const NotificationSource& source, |
90 const NotificationDetails& details); | 87 const NotificationDetails& details); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // This is used to clear our cache five seconds after the last use. | 157 // This is used to clear our cache five seconds after the last use. |
161 base::DelayTimer<BrowserRenderProcessHost> cached_dibs_cleaner_; | 158 base::DelayTimer<BrowserRenderProcessHost> cached_dibs_cleaner_; |
162 | 159 |
163 // Used in single-process mode. | 160 // Used in single-process mode. |
164 scoped_ptr<RendererMainThread> in_process_renderer_; | 161 scoped_ptr<RendererMainThread> in_process_renderer_; |
165 | 162 |
166 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 163 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
167 }; | 164 }; |
168 | 165 |
169 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 166 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |