OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // Called when the existence of the other renderer process which is connected | 249 // Called when the existence of the other renderer process which is connected |
250 // to the Worker in this renderer process has changed. | 250 // to the Worker in this renderer process has changed. |
251 // It is only called when "enable-embedded-shared-worker" flag is set. | 251 // It is only called when "enable-embedded-shared-worker" flag is set. |
252 void IncrementWorkerRefCount(); | 252 void IncrementWorkerRefCount(); |
253 void DecrementWorkerRefCount(); | 253 void DecrementWorkerRefCount(); |
254 | 254 |
255 // Call this function to resume the navigation when it was deferred | 255 // Call this function to resume the navigation when it was deferred |
256 // immediately after receiving response headers. | 256 // immediately after receiving response headers. |
257 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); | 257 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); |
258 | 258 |
259 // Activates Mojo for this process. Does nothing if Mojo is already activated. | |
260 void EnsureMojoActivated(); | |
261 | |
262 protected: | 259 protected: |
263 // A proxy for our IPC::Channel that lives on the IO thread (see | 260 // A proxy for our IPC::Channel that lives on the IO thread (see |
264 // browser_process.h) | 261 // browser_process.h) |
265 scoped_ptr<IPC::ChannelProxy> channel_; | 262 scoped_ptr<IPC::ChannelProxy> channel_; |
266 | 263 |
267 // A host object ChannelMojo needs. The lifetime is bound to | 264 // A host object ChannelMojo needs. The lifetime is bound to |
268 // the RenderProcessHostImpl, not the channel. | 265 // the RenderProcessHostImpl, not the channel. |
269 scoped_ptr<IPC::ChannelMojoHost> channel_mojo_host_; | 266 scoped_ptr<IPC::ChannelMojoHost> channel_mojo_host_; |
270 | 267 |
271 // True if fast shutdown has been performed on this RPH. | 268 // True if fast shutdown has been performed on this RPH. |
272 bool fast_shutdown_started_; | 269 bool fast_shutdown_started_; |
273 | 270 |
274 // True if we've posted a DeleteTask and will be deleted soon. | 271 // True if we've posted a DeleteTask and will be deleted soon. |
275 bool deleting_soon_; | 272 bool deleting_soon_; |
276 | 273 |
277 #ifndef NDEBUG | 274 #ifndef NDEBUG |
278 // True if this object has deleted itself. | 275 // True if this object has deleted itself. |
279 bool is_self_deleted_; | 276 bool is_self_deleted_; |
280 #endif | 277 #endif |
281 | 278 |
282 // The count of currently swapped out but pending RenderViews. We have | 279 // The count of currently swapped out but pending RenderViews. We have |
283 // started to swap these in, so the renderer process should not exit if | 280 // started to swap these in, so the renderer process should not exit if |
284 // this count is non-zero. | 281 // this count is non-zero. |
285 int32 pending_views_; | 282 int32 pending_views_; |
286 | 283 |
287 private: | 284 private: |
288 friend class VisitRelayingRenderProcessHost; | 285 friend class VisitRelayingRenderProcessHost; |
289 | 286 |
290 void MaybeActivateMojo(); | |
291 bool ShouldUseMojoChannel() const; | 287 bool ShouldUseMojoChannel() const; |
292 scoped_ptr<IPC::ChannelProxy> CreateChannelProxy( | 288 scoped_ptr<IPC::ChannelProxy> CreateChannelProxy( |
293 const std::string& channel_id); | 289 const std::string& channel_id); |
294 | 290 |
295 // Creates and adds the IO thread message filters. | 291 // Creates and adds the IO thread message filters. |
296 void CreateMessageFilters(); | 292 void CreateMessageFilters(); |
297 | 293 |
| 294 // Registers Mojo services to be exposed to the renderer. |
| 295 void RegisterMojoServices(); |
| 296 |
298 // Control message handlers. | 297 // Control message handlers. |
299 void OnShutdownRequest(); | 298 void OnShutdownRequest(); |
300 void OnDumpHandlesDone(); | 299 void OnDumpHandlesDone(); |
301 void SuddenTerminationChanged(bool enabled); | 300 void SuddenTerminationChanged(bool enabled); |
302 void OnUserMetricsRecordAction(const std::string& action); | 301 void OnUserMetricsRecordAction(const std::string& action); |
303 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); | 302 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); |
304 void OnCloseACK(int old_route_id); | 303 void OnCloseACK(int old_route_id); |
305 | 304 |
306 // Generates a command line to be used to spawn a renderer and appends the | 305 // Generates a command line to be used to spawn a renderer and appends the |
307 // results to |*command_line|. | 306 // results to |*command_line|. |
(...skipping 20 matching lines...) Expand all Loading... |
328 void RegisterAecDumpConsumerOnUIThread(int id); | 327 void RegisterAecDumpConsumerOnUIThread(int id); |
329 void UnregisterAecDumpConsumerOnUIThread(int id); | 328 void UnregisterAecDumpConsumerOnUIThread(int id); |
330 void EnableAecDumpForId(const base::FilePath& file, int id); | 329 void EnableAecDumpForId(const base::FilePath& file, int id); |
331 // Sends |file_for_transit| to the render process. | 330 // Sends |file_for_transit| to the render process. |
332 void SendAecDumpFileToRenderer(int id, | 331 void SendAecDumpFileToRenderer(int id, |
333 IPC::PlatformFileForTransit file_for_transit); | 332 IPC::PlatformFileForTransit file_for_transit); |
334 void SendDisableAecDumpToRenderer(); | 333 void SendDisableAecDumpToRenderer(); |
335 #endif | 334 #endif |
336 | 335 |
337 scoped_ptr<MojoApplicationHost> mojo_application_host_; | 336 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
338 bool mojo_activation_required_; | |
339 | 337 |
340 // The registered IPC listener objects. When this list is empty, we should | 338 // The registered IPC listener objects. When this list is empty, we should |
341 // delete ourselves. | 339 // delete ourselves. |
342 IDMap<IPC::Listener> listeners_; | 340 IDMap<IPC::Listener> listeners_; |
343 | 341 |
344 // The count of currently visible widgets. Since the host can be a container | 342 // The count of currently visible widgets. Since the host can be a container |
345 // for multiple widgets, it uses this count to determine when it should be | 343 // for multiple widgets, it uses this count to determine when it should be |
346 // backgrounded. | 344 // backgrounded. |
347 int32 visible_widgets_; | 345 int32 visible_widgets_; |
348 | 346 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 base::TimeTicks survive_for_worker_start_time_; | 454 base::TimeTicks survive_for_worker_start_time_; |
457 | 455 |
458 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 456 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
459 | 457 |
460 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 458 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
461 }; | 459 }; |
462 | 460 |
463 } // namespace content | 461 } // namespace content |
464 | 462 |
465 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 463 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |