Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 1855193002: Move the call to enable the WebRTC event log from PeerConnectionFactory to PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed content/public/ interface, used RenderProcessHost instead. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_callback_handler.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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void AddPendingView() override; 134 void AddPendingView() override;
134 void RemovePendingView() override; 135 void RemovePendingView() override;
135 void SetSuddenTerminationAllowed(bool enabled) override; 136 void SetSuddenTerminationAllowed(bool enabled) override;
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)
ncarter (slow) 2016/05/18 21:49:56 These WebRTC calls don't really make sense in Rend
Ivo-OOO until feb 6 2016/05/20 14:58:48 You're absolutely right that it would be nicer be
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 void DisableEventLogRecordings() override;
148 void SetWebRtcLogMessageCallback( 147 void SetWebRtcLogMessageCallback(
149 base::Callback<void(const std::string&)> callback) override; 148 base::Callback<void(const std::string&)> callback) override;
150 void ClearWebRtcLogMessageCallback() override; 149 void ClearWebRtcLogMessageCallback() override;
151 WebRtcStopRtpDumpCallback StartRtpDump( 150 WebRtcStopRtpDumpCallback StartRtpDump(
152 bool incoming, 151 bool incoming,
153 bool outgoing, 152 bool outgoing,
154 const WebRtcRtpPacketCallback& packet_callback) override; 153 const WebRtcRtpPacketCallback& packet_callback) override;
154 void RegisterEventLogHandler(
155 const RenderProcessHost::EventLogStartFunc& start_logging_callback,
156 const RenderProcessHost::EventLogStopFunc& stop_logging_callback)
157 override;
158 void RegisterPeerConnectionCallbacks(
159 const RenderProcessHost::PeerConnectionAddedFunc& pc_added_callback,
160 const RenderProcessHost::PeerConnectionRemovedFunc& pc_removed_callback)
161 override;
162
163 // Trigger the registered callback to start or stop the WebRTC event log.
164 void SignalStartEventLog(const base::FilePath& file_path);
165 void SignalStopEventLog();
166
167 // Trigger the registered callbacks to indicate a PeerConnection was added or
168 // removed.
169 void SignalPeerConnectionAdded(int connection_id);
170 void SignalPeerConnectionRemoved(int connection_id);
171
155 #endif 172 #endif
156 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; 173 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override;
157 void NotifyTimezoneChange(const std::string& timezone) override; 174 void NotifyTimezoneChange(const std::string& timezone) override;
158 ServiceRegistry* GetServiceRegistry() override; 175 ServiceRegistry* GetServiceRegistry() override;
159 shell::Connection* GetChildConnection() override; 176 shell::Connection* GetChildConnection() override;
160 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() 177 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
161 override; 178 override;
162 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override; 179 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override;
163 #if defined(ENABLE_BROWSER_CDMS) 180 #if defined(ENABLE_BROWSER_CDMS)
164 scoped_refptr<media::MediaKeys> GetCdm(int render_frame_id, 181 scoped_refptr<media::MediaKeys> GetCdm(int render_frame_id,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 void CreateSharedRendererHistogramAllocator(); 351 void CreateSharedRendererHistogramAllocator();
335 352
336 // Handle termination of our process. 353 // Handle termination of our process.
337 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); 354 void ProcessDied(bool already_dead, RendererClosedDetails* known_details);
338 355
339 // GpuSwitchingObserver implementation. 356 // GpuSwitchingObserver implementation.
340 void OnGpuSwitched() override; 357 void OnGpuSwitched() override;
341 358
342 #if defined(ENABLE_WEBRTC) 359 #if defined(ENABLE_WEBRTC)
343 void OnRegisterAecDumpConsumer(int id); 360 void OnRegisterAecDumpConsumer(int id);
344 void OnRegisterEventLogConsumer(int id);
345 void OnUnregisterAecDumpConsumer(int id); 361 void OnUnregisterAecDumpConsumer(int id);
346 void OnUnregisterEventLogConsumer(int id);
347 void RegisterAecDumpConsumerOnUIThread(int id); 362 void RegisterAecDumpConsumerOnUIThread(int id);
348 void RegisterEventLogConsumerOnUIThread(int id);
349 void UnregisterAecDumpConsumerOnUIThread(int id); 363 void UnregisterAecDumpConsumerOnUIThread(int id);
350 void UnregisterEventLogConsumerOnUIThread(int id);
351 void EnableAecDumpForId(const base::FilePath& file, int id); 364 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. 365 // Sends |file_for_transit| to the render process.
354 void SendAecDumpFileToRenderer(int id, 366 void SendAecDumpFileToRenderer(int id,
355 IPC::PlatformFileForTransit file_for_transit); 367 IPC::PlatformFileForTransit file_for_transit);
356 void SendEventLogFileToRenderer(int id,
357 IPC::PlatformFileForTransit file_for_transit);
358 void SendDisableAecDumpToRenderer(); 368 void SendDisableAecDumpToRenderer();
359 void SendDisableEventLogToRenderer();
360 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file); 369 base::FilePath GetAecDumpFilePathWithExtensions(const base::FilePath& file);
361 base::FilePath GetEventLogFilePathWithExtensions(const base::FilePath& file);
362 #endif 370 #endif
363 371
364 std::unique_ptr<MojoChildConnection> mojo_child_connection_; 372 std::unique_ptr<MojoChildConnection> mojo_child_connection_;
365 std::unique_ptr<MojoApplicationHost> mojo_application_host_; 373 std::unique_ptr<MojoApplicationHost> mojo_application_host_;
366 374
367 // The registered IPC listener objects. When this list is empty, we should 375 // The registered IPC listener objects. When this list is empty, we should
368 // delete ourselves. 376 // delete ourselves.
369 IDMap<IPC::Listener> listeners_; 377 IDMap<IPC::Listener> listeners_;
370 378
371 // The count of currently visible widgets. Since the host can be a container 379 // 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
472 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; 480 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_;
473 #endif 481 #endif
474 482
475 #if defined(ENABLE_WEBRTC) 483 #if defined(ENABLE_WEBRTC)
476 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_; 484 scoped_refptr<P2PSocketDispatcherHost> p2p_socket_dispatcher_host_;
477 485
478 // Must be accessed on UI thread. 486 // Must be accessed on UI thread.
479 std::vector<int> aec_dump_consumers_; 487 std::vector<int> aec_dump_consumers_;
480 488
481 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_; 489 WebRtcStopRtpDumpCallback stop_rtp_dump_callback_;
490
491 WebRTCEventLogCallbackHandler eventlog_callback_handler_;
482 #endif 492 #endif
483 493
484 int worker_ref_count_; 494 int worker_ref_count_;
485 495
486 // Records the time when the process starts surviving for workers for UMA. 496 // Records the time when the process starts surviving for workers for UMA.
487 base::TimeTicks survive_for_worker_start_time_; 497 base::TimeTicks survive_for_worker_start_time_;
488 498
489 // Records the maximum # of workers simultaneously hosted in this process 499 // Records the maximum # of workers simultaneously hosted in this process
490 // for UMA. 500 // for UMA.
491 int max_worker_count_; 501 int max_worker_count_;
(...skipping 21 matching lines...) Expand all
513 mojo::ScopedMessagePipeHandle in_process_renderer_handle_; 523 mojo::ScopedMessagePipeHandle in_process_renderer_handle_;
514 524
515 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 525 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
516 526
517 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 527 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
518 }; 528 };
519 529
520 } // namespace content 530 } // namespace content
521 531
522 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 532 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698