| 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_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <queue> | 13 #include <queue> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/process/process.h" | 19 #include "base/process/process.h" |
| 20 #include "base/synchronization/waitable_event.h" | 20 #include "base/synchronization/waitable_event.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "content/browser/child_process_launcher.h" | 22 #include "content/browser/child_process_launcher.h" |
| 23 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 23 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 24 #include "content/browser/media/webrtc/webrtc_eventlog_host.h" |
| 24 #include "content/browser/power_monitor_message_broadcaster.h" | 25 #include "content/browser/power_monitor_message_broadcaster.h" |
| 25 #include "content/common/content_export.h" | 26 #include "content/common/content_export.h" |
| 26 #include "content/common/mojo/service_registry_impl.h" | 27 #include "content/common/mojo/service_registry_impl.h" |
| 27 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
| 28 #include "ipc/ipc_channel_proxy.h" | 29 #include "ipc/ipc_channel_proxy.h" |
| 29 #include "ipc/ipc_platform_file.h" | 30 #include "ipc/ipc_platform_file.h" |
| 30 #include "mojo/public/cpp/bindings/interface_ptr.h" | 31 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 31 #include "ui/gfx/gpu_memory_buffer.h" | 32 #include "ui/gfx/gpu_memory_buffer.h" |
| 32 #include "ui/gl/gpu_switching_observer.h" | 33 #include "ui/gl/gpu_switching_observer.h" |
| 33 | 34 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 bool SuddenTerminationAllowed() const override; | 137 bool SuddenTerminationAllowed() const override; |
| 137 IPC::ChannelProxy* GetChannel() override; | 138 IPC::ChannelProxy* GetChannel() override; |
| 138 void AddFilter(BrowserMessageFilter* filter) override; | 139 void AddFilter(BrowserMessageFilter* filter) override; |
| 139 bool FastShutdownForPageCount(size_t count) override; | 140 bool FastShutdownForPageCount(size_t count) override; |
| 140 bool FastShutdownStarted() const override; | 141 bool FastShutdownStarted() const override; |
| 141 base::TimeDelta GetChildProcessIdleTime() const override; | 142 base::TimeDelta GetChildProcessIdleTime() const override; |
| 142 void FilterURL(bool empty_allowed, GURL* url) override; | 143 void FilterURL(bool empty_allowed, GURL* url) override; |
| 143 #if defined(ENABLE_WEBRTC) | 144 #if defined(ENABLE_WEBRTC) |
| 144 void EnableAudioDebugRecordings(const base::FilePath& file) override; | 145 void EnableAudioDebugRecordings(const base::FilePath& file) override; |
| 145 void DisableAudioDebugRecordings() override; | 146 void DisableAudioDebugRecordings() override; |
| 146 void EnableEventLogRecordings(const base::FilePath& file) override; | 147 bool StartWebRTCEventLog(const base::FilePath& file_path) override; |
| 147 void DisableEventLogRecordings() override; | 148 bool StopWebRTCEventLog() override; |
| 148 void SetWebRtcLogMessageCallback( | 149 void SetWebRtcLogMessageCallback( |
| 149 base::Callback<void(const std::string&)> callback) override; | 150 base::Callback<void(const std::string&)> callback) override; |
| 150 void ClearWebRtcLogMessageCallback() override; | 151 void ClearWebRtcLogMessageCallback() override; |
| 151 WebRtcStopRtpDumpCallback StartRtpDump( | 152 WebRtcStopRtpDumpCallback StartRtpDump( |
| 152 bool incoming, | 153 bool incoming, |
| 153 bool outgoing, | 154 bool outgoing, |
| 154 const WebRtcRtpPacketCallback& packet_callback) override; | 155 const WebRtcRtpPacketCallback& packet_callback) override; |
| 155 #endif | 156 #endif |
| 156 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; | 157 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; |
| 157 void NotifyTimezoneChange(const std::string& timezone) override; | 158 void NotifyTimezoneChange(const std::string& timezone) override; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 void CreateSharedRendererHistogramAllocator(); | 335 void CreateSharedRendererHistogramAllocator(); |
| 335 | 336 |
| 336 // Handle termination of our process. | 337 // Handle termination of our process. |
| 337 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); | 338 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); |
| 338 | 339 |
| 339 // GpuSwitchingObserver implementation. | 340 // GpuSwitchingObserver implementation. |
| 340 void OnGpuSwitched() override; | 341 void OnGpuSwitched() override; |
| 341 | 342 |
| 342 #if defined(ENABLE_WEBRTC) | 343 #if defined(ENABLE_WEBRTC) |
| 343 void OnRegisterAecDumpConsumer(int id); | 344 void OnRegisterAecDumpConsumer(int id); |
| 344 void OnRegisterEventLogConsumer(int id); | |
| 345 void OnUnregisterAecDumpConsumer(int id); | 345 void OnUnregisterAecDumpConsumer(int id); |
| 346 void OnUnregisterEventLogConsumer(int id); | |
| 347 void RegisterAecDumpConsumerOnUIThread(int id); | 346 void RegisterAecDumpConsumerOnUIThread(int id); |
| 348 void RegisterEventLogConsumerOnUIThread(int id); | |
| 349 void UnregisterAecDumpConsumerOnUIThread(int id); | 347 void UnregisterAecDumpConsumerOnUIThread(int id); |
| 350 void UnregisterEventLogConsumerOnUIThread(int id); | |
| 351 void EnableAecDumpForId(const base::FilePath& file, int id); | 348 void EnableAecDumpForId(const base::FilePath& file, int id); |
| 352 void EnableEventLogForId(const base::FilePath& file, int id); | |
| 353 // Sends |file_for_transit| to the render process. | 349 // Sends |file_for_transit| to the render process. |
| 354 void SendAecDumpFileToRenderer(int id, | 350 void SendAecDumpFileToRenderer(int id, |
| 355 IPC::PlatformFileForTransit file_for_transit); | 351 IPC::PlatformFileForTransit file_for_transit); |
| 356 void SendEventLogFileToRenderer(int id, | |
| 357 IPC::PlatformFileForTransit file_for_transit); | |
| 358 void SendDisableAecDumpToRenderer(); | 352 void SendDisableAecDumpToRenderer(); |
| 359 void SendDisableEventLogToRenderer(); | |
| 360 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); | 353 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); |
| 361 base::FilePath GetEventLogFilePathWithExtensions(const base::FilePath& file); | |
| 362 #endif | 354 #endif |
| 363 | 355 |
| 364 std::unique_ptr<MojoChildConnection> mojo_child_connection_; | 356 std::unique_ptr<MojoChildConnection> mojo_child_connection_; |
| 365 std::unique_ptr<MojoApplicationHost> mojo_application_host_; | 357 std::unique_ptr<MojoApplicationHost> mojo_application_host_; |
| 366 | 358 |
| 367 // The registered IPC listener objects. When this list is empty, we should | 359 // The registered IPC listener objects. When this list is empty, we should |
| 368 // delete ourselves. | 360 // delete ourselves. |
| 369 IDMap<IPC::Listener> listeners_; | 361 IDMap<IPC::Listener> listeners_; |
| 370 | 362 |
| 371 // The count of currently visible widgets. Since the host can be a container | 363 // The count of currently visible widgets. Since the host can be a container |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; | 464 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; |
| 473 #endif | 465 #endif |
| 474 | 466 |
| 475 #if defined(ENABLE_WEBRTC) | 467 #if defined(ENABLE_WEBRTC) |
| 476 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; | 468 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; |
| 477 | 469 |
| 478 // Must be accessed on UI thread. | 470 // Must be accessed on UI thread. |
| 479 std::vector<int> aec_dump_consumers_; | 471 std::vector<int> aec_dump_consumers_; |
| 480 | 472 |
| 481 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; | 473 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; |
| 474 |
| 475 WebRTCEventLogHost webrtc_eventlog_host_; |
| 482 #endif | 476 #endif |
| 483 | 477 |
| 484 int worker_ref_count_; | 478 int worker_ref_count_; |
| 485 | 479 |
| 486 // Records the time when the process starts surviving for workers for UMA. | 480 // Records the time when the process starts surviving for workers for UMA. |
| 487 base::TimeTicks survive_for_worker_start_time_; | 481 base::TimeTicks survive_for_worker_start_time_; |
| 488 | 482 |
| 489 // Records the maximum # of workers simultaneously hosted in this process | 483 // Records the maximum # of workers simultaneously hosted in this process |
| 490 // for UMA. | 484 // for UMA. |
| 491 int max_worker_count_; | 485 int max_worker_count_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 513 mojo::ScopedMessagePipeHandle in_process_renderer_handle_; | 507 mojo::ScopedMessagePipeHandle in_process_renderer_handle_; |
| 514 | 508 |
| 515 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 509 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 516 | 510 |
| 517 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 511 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 518 }; | 512 }; |
| 519 | 513 |
| 520 } // namespace content | 514 } // namespace content |
| 521 | 515 |
| 522 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 516 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |