OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void ReceivedBadMessage(uint32 msg_type); | 71 virtual void ReceivedBadMessage(uint32 msg_type); |
72 virtual void WidgetRestored(); | 72 virtual void WidgetRestored(); |
73 virtual void WidgetHidden(); | 73 virtual void WidgetHidden(); |
74 virtual void ViewCreated(); | 74 virtual void ViewCreated(); |
75 virtual void SendVisitedLinkTable(base::SharedMemory* table_memory); | 75 virtual void SendVisitedLinkTable(base::SharedMemory* table_memory); |
76 virtual void AddVisitedLinks(const VisitedLinkCommon::Fingerprints& links); | 76 virtual void AddVisitedLinks(const VisitedLinkCommon::Fingerprints& links); |
77 virtual void ResetVisitedLinks(); | 77 virtual void ResetVisitedLinks(); |
78 virtual bool FastShutdownIfPossible(); | 78 virtual bool FastShutdownIfPossible(); |
79 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); | 79 virtual bool SendWithTimeout(IPC::Message* msg, int timeout_ms); |
80 virtual base::ProcessHandle GetHandle(); | 80 virtual base::ProcessHandle GetHandle(); |
81 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); | 81 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id, |
| 82 TransportDIB::Handle dib_handle); |
82 | 83 |
83 // IPC::Channel::Sender via RenderProcessHost. | 84 // IPC::Channel::Sender via RenderProcessHost. |
84 virtual bool Send(IPC::Message* msg); | 85 virtual bool Send(IPC::Message* msg); |
85 | 86 |
86 // IPC::Channel::Listener via RenderProcessHost. | 87 // IPC::Channel::Listener via RenderProcessHost. |
87 virtual void OnMessageReceived(const IPC::Message& msg); | 88 virtual void OnMessageReceived(const IPC::Message& msg); |
88 virtual void OnChannelConnected(int32 peer_pid); | 89 virtual void OnChannelConnected(int32 peer_pid); |
89 virtual void OnChannelError(); | 90 virtual void OnChannelError(); |
90 | 91 |
91 // If the a process has sent a message that cannot be decoded, it is deemed | 92 // If the a process has sent a message that cannot be decoded, it is deemed |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // The host of audio renderers in the renderer process. | 179 // The host of audio renderers in the renderer process. |
179 scoped_refptr<AudioRendererHost> audio_renderer_host_; | 180 scoped_refptr<AudioRendererHost> audio_renderer_host_; |
180 | 181 |
181 // A map of transport DIB ids to cached TransportDIBs | 182 // A map of transport DIB ids to cached TransportDIBs |
182 std::map<TransportDIB::Id, TransportDIB*> cached_dibs_; | 183 std::map<TransportDIB::Id, TransportDIB*> cached_dibs_; |
183 enum { | 184 enum { |
184 // This is the maximum size of |cached_dibs_| | 185 // This is the maximum size of |cached_dibs_| |
185 MAX_MAPPED_TRANSPORT_DIBS = 3, | 186 MAX_MAPPED_TRANSPORT_DIBS = 3, |
186 }; | 187 }; |
187 | 188 |
188 // Map a transport DIB from its Id and return it. Returns NULL on error. | 189 // Map a transport DIB from its handle. On Mac, the ID is necessary to find |
189 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id); | 190 // the appropriate file descriptor. Returns NULL on error. |
| 191 TransportDIB* MapTransportDIB(TransportDIB::Id dib_id, |
| 192 TransportDIB::Handle dib_handle); |
190 | 193 |
191 void ClearTransportDIBCache(); | 194 void ClearTransportDIBCache(); |
192 // This is used to clear our cache five seconds after the last use. | 195 // This is used to clear our cache five seconds after the last use. |
193 base::DelayTimer<BrowserRenderProcessHost> cached_dibs_cleaner_; | 196 base::DelayTimer<BrowserRenderProcessHost> cached_dibs_cleaner_; |
194 | 197 |
195 // Used in single-process mode. | 198 // Used in single-process mode. |
196 scoped_ptr<RendererMainThread> in_process_renderer_; | 199 scoped_ptr<RendererMainThread> in_process_renderer_; |
197 | 200 |
198 // Buffer visited links and send them to to renderer. | 201 // Buffer visited links and send them to to renderer. |
199 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; | 202 scoped_ptr<VisitedLinkUpdater> visited_link_updater_; |
(...skipping 11 matching lines...) Expand all Loading... |
211 // Messages we queue while waiting for the process handle. We queue them here | 214 // Messages we queue while waiting for the process handle. We queue them here |
212 // instead of in the channel so that we ensure they're sent after init related | 215 // instead of in the channel so that we ensure they're sent after init related |
213 // messages that are sent once the process handle is available. This is | 216 // messages that are sent once the process handle is available. This is |
214 // because the queued messages may have dependencies on the init messages. | 217 // because the queued messages may have dependencies on the init messages. |
215 std::queue<IPC::Message*> queued_messages_; | 218 std::queue<IPC::Message*> queued_messages_; |
216 | 219 |
217 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); | 220 DISALLOW_COPY_AND_ASSIGN(BrowserRenderProcessHost); |
218 }; | 221 }; |
219 | 222 |
220 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ | 223 #endif // CHROME_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |