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/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
21 #include "base/synchronization/waitable_event.h" | 21 #include "base/synchronization/waitable_event.h" |
22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
23 #include "content/browser/bluetooth/bluetooth_adapter_factory_wrapper.h" | 23 #include "content/browser/bluetooth/bluetooth_adapter_factory_wrapper.h" |
24 #include "content/browser/child_process_launcher.h" | 24 #include "content/browser/child_process_launcher.h" |
25 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 25 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 26 #include "content/browser/media/webrtc/webrtc_eventlog_host.h" |
26 #include "content/browser/power_monitor_message_broadcaster.h" | 27 #include "content/browser/power_monitor_message_broadcaster.h" |
27 #include "content/common/content_export.h" | 28 #include "content/common/content_export.h" |
28 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
29 #include "ipc/ipc_channel_proxy.h" | 30 #include "ipc/ipc_channel_proxy.h" |
30 #include "ipc/ipc_platform_file.h" | 31 #include "ipc/ipc_platform_file.h" |
31 #include "mojo/public/cpp/bindings/interface_ptr.h" | 32 #include "mojo/public/cpp/bindings/interface_ptr.h" |
32 #include "services/shell/public/interfaces/service.mojom.h" | 33 #include "services/shell/public/interfaces/service.mojom.h" |
33 #include "ui/gfx/gpu_memory_buffer.h" | 34 #include "ui/gfx/gpu_memory_buffer.h" |
34 #include "ui/gl/gpu_switching_observer.h" | 35 #include "ui/gl/gpu_switching_observer.h" |
35 | 36 |
(...skipping 100 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 void CreateSharedRendererHistogramAllocator(); | 337 void CreateSharedRendererHistogramAllocator(); |
337 | 338 |
338 // Handle termination of our process. | 339 // Handle termination of our process. |
339 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); | 340 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); |
340 | 341 |
341 // GpuSwitchingObserver implementation. | 342 // GpuSwitchingObserver implementation. |
342 void OnGpuSwitched() override; | 343 void OnGpuSwitched() override; |
343 | 344 |
344 #if defined(ENABLE_WEBRTC) | 345 #if defined(ENABLE_WEBRTC) |
345 void OnRegisterAecDumpConsumer(int id); | 346 void OnRegisterAecDumpConsumer(int id); |
346 void OnRegisterEventLogConsumer(int id); | |
347 void OnUnregisterAecDumpConsumer(int id); | 347 void OnUnregisterAecDumpConsumer(int id); |
348 void OnUnregisterEventLogConsumer(int id); | |
349 void RegisterAecDumpConsumerOnUIThread(int id); | 348 void RegisterAecDumpConsumerOnUIThread(int id); |
350 void RegisterEventLogConsumerOnUIThread(int id); | |
351 void UnregisterAecDumpConsumerOnUIThread(int id); | 349 void UnregisterAecDumpConsumerOnUIThread(int id); |
352 void UnregisterEventLogConsumerOnUIThread(int id); | |
353 void EnableAecDumpForId(const base::FilePath& file, int id); | 350 void EnableAecDumpForId(const base::FilePath& file, int id); |
354 void EnableEventLogForId(const base::FilePath& file, int id); | |
355 // Sends |file_for_transit| to the render process. | 351 // Sends |file_for_transit| to the render process. |
356 void SendAecDumpFileToRenderer(int id, | 352 void SendAecDumpFileToRenderer(int id, |
357 IPC::PlatformFileForTransit file_for_transit); | 353 IPC::PlatformFileForTransit file_for_transit); |
358 void SendEventLogFileToRenderer(int id, | |
359 IPC::PlatformFileForTransit file_for_transit); | |
360 void SendDisableAecDumpToRenderer(); | 354 void SendDisableAecDumpToRenderer(); |
361 void SendDisableEventLogToRenderer(); | |
362 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); | 355 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); |
363 base::FilePath GetEventLogFilePathWithExtensions(const base::FilePath& file); | |
364 #endif | 356 #endif |
365 | 357 |
366 static void OnMojoError( | 358 static void OnMojoError( |
367 base::WeakPtr<RenderProcessHostImpl> process, | 359 base::WeakPtr<RenderProcessHostImpl> process, |
368 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 360 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
369 const std::string& error); | 361 const std::string& error); |
370 | 362 |
371 std::string child_token_; | 363 std::string child_token_; |
372 | 364 |
373 std::unique_ptr<MojoChildConnection> mojo_child_connection_; | 365 std::unique_ptr<MojoChildConnection> mojo_child_connection_; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; | 473 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; |
482 #endif | 474 #endif |
483 | 475 |
484 #if defined(ENABLE_WEBRTC) | 476 #if defined(ENABLE_WEBRTC) |
485 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; | 477 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; |
486 | 478 |
487 // Must be accessed on UI thread. | 479 // Must be accessed on UI thread. |
488 std::vector<int> aec_dump_consumers_; | 480 std::vector<int> aec_dump_consumers_; |
489 | 481 |
490 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; | 482 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; |
| 483 |
| 484 WebRTCEventLogHost webrtc_eventlog_host_; |
491 #endif | 485 #endif |
492 | 486 |
493 int worker_ref_count_; | 487 int worker_ref_count_; |
494 | 488 |
495 // Records the time when the process starts surviving for workers for UMA. | 489 // Records the time when the process starts surviving for workers for UMA. |
496 base::TimeTicks survive_for_worker_start_time_; | 490 base::TimeTicks survive_for_worker_start_time_; |
497 | 491 |
498 // Records the maximum # of workers simultaneously hosted in this process | 492 // Records the maximum # of workers simultaneously hosted in this process |
499 // for UMA. | 493 // for UMA. |
500 int max_worker_count_; | 494 int max_worker_count_; |
(...skipping 21 matching lines...) Expand all Loading... |
522 mojo::ScopedMessagePipeHandle in_process_renderer_handle_; | 516 mojo::ScopedMessagePipeHandle in_process_renderer_handle_; |
523 | 517 |
524 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 518 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
525 | 519 |
526 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 520 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
527 }; | 521 }; |
528 | 522 |
529 } // namespace content | 523 } // namespace content |
530 | 524 |
531 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 525 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |