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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2517953003: Move enable_webrtc to a buildflag header. (Closed)
Patch Set: Fix Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/webrtc/webrtc_internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 39292080edc53292143a9d17e006f2aea4b7d6eb..a9db38c4e80d175983907baad30eec1fc6eea026 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -173,6 +173,7 @@
#include "ipc/ipc_channel_mojo.h"
#include "ipc/ipc_logging.h"
#include "media/base/media_switches.h"
+#include "media/media_features.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
#include "net/url_request/url_request_context_getter.h"
@@ -230,7 +231,7 @@
#include "content/browser/plugin_service_impl.h"
#endif
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
#include "content/browser/renderer_host/media/media_stream_track_metrics_host.h"
#include "content/browser/renderer_host/p2p/socket_dispatcher_host.h"
#include "content/browser/webrtc/webrtc_internals.h"
@@ -253,7 +254,7 @@ namespace {
const char kSiteProcessMapKeyName[] = "content_site_process_map";
-#ifdef ENABLE_WEBRTC
+#if BUILDFLAG(ENABLE_WEBRTC)
const base::FilePath::CharType kAecDumpFileNameAddition[] =
FILE_PATH_LITERAL("aec_dump");
#endif
@@ -292,7 +293,7 @@ void GetContexts(
GetRequestContext(request_context, media_request_context, resource_type);
}
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
// Creates a file used for handing over to the renderer.
IPC::PlatformFileForTransit CreateFileForProcess(base::FilePath file_path) {
@@ -675,7 +676,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
gpu_observer_registered_(false),
delayed_cleanup_needed_(false),
within_process_died_observer_(false),
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
webrtc_eventlog_host_(id_),
#endif
max_worker_count_(0),
@@ -1083,7 +1084,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
storage_partition_impl_->GetIndexedDBContext(),
blob_storage_context.get()));
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(
GetID(), webrtc_eventlog_host_.GetWeakPtr());
AddFilter(peer_connection_tracker_host_.get());
@@ -1149,7 +1150,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
storage_partition_impl_->GetServiceWorkerContext()),
message_port_message_filter_.get()));
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost(
resource_context, request_context.get());
AddFilter(p2p_socket_dispatcher_host_.get());
@@ -1782,7 +1783,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
#if BUILDFLAG(ENABLE_PLUGINS)
switches::kEnablePepperTesting,
#endif
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
switches::kDisableWebRtcHWDecoding,
switches::kDisableWebRtcHWEncoding,
switches::kEnableWebRtcStunOrigin,
@@ -1833,7 +1834,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
browser_cmd.GetSwitchValueASCII(switches::kTraceStartup));
}
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
// Only run the Stun trials in the first renderer.
if (!has_done_stun_trials &&
browser_cmd.HasSwitch(switches::kWebRtcStunProbeTrialParameter)) {
@@ -1985,7 +1986,7 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
OnUserMetricsRecordAction)
IPC_MESSAGE_HANDLER(ViewHostMsg_Close_ACK, OnCloseACK)
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
IPC_MESSAGE_HANDLER(AecDumpMsg_RegisterAecDumpConsumer,
OnRegisterAecDumpConsumer)
IPC_MESSAGE_HANDLER(AecDumpMsg_UnregisterAecDumpConsumer,
@@ -2111,7 +2112,7 @@ void RenderProcessHostImpl::Cleanup() {
if (!listeners_.IsEmpty() || worker_ref_count() != 0)
return;
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
if (is_initialized_)
ClearWebRtcLogMessageCallback();
#endif
@@ -2216,7 +2217,7 @@ void RenderProcessHostImpl::FilterURL(bool empty_allowed, GURL* url) {
FilterURL(this, empty_allowed, url);
}
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
void RenderProcessHostImpl::EnableAudioDebugRecordings(
const base::FilePath& file) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -2272,14 +2273,14 @@ bool RenderProcessHostImpl::StopWebRTCEventLog() {
void RenderProcessHostImpl::SetWebRtcLogMessageCallback(
base::Callback<void(const std::string&)> callback) {
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
BrowserMainLoop::GetInstance()->media_stream_manager()->
RegisterNativeLogCallback(GetID(), callback);
#endif
}
void RenderProcessHostImpl::ClearWebRtcLogMessageCallback() {
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
BrowserMainLoop::GetInstance()
->media_stream_manager()
->UnregisterNativeLogCallback(GetID());
@@ -2862,7 +2863,7 @@ void RenderProcessHostImpl::OnProcessLaunched() {
observer.RenderProcessReady(this);
}
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) {
EnableAudioDebugRecordings(
WebRTCInternals::GetInstance()->GetAudioDebugRecordingsFilePath());
@@ -2904,7 +2905,7 @@ void RenderProcessHostImpl::OnGpuSwitched() {
RecomputeAndUpdateWebKitPreferences();
}
-#if defined(ENABLE_WEBRTC)
+#if BUILDFLAG(ENABLE_WEBRTC)
void RenderProcessHostImpl::OnRegisterAecDumpConsumer(int id) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -2968,7 +2969,7 @@ base::FilePath RenderProcessHostImpl::GetAecDumpFilePathWithExtensions(
return file.AddExtension(IntToStringType(base::GetProcId(GetHandle())))
.AddExtension(kAecDumpFileNameAddition);
}
-#endif // defined(ENABLE_WEBRTC)
+#endif // BUILDFLAG(ENABLE_WEBRTC)
void RenderProcessHostImpl::GetAudioOutputControllers(
const GetAudioOutputControllersCallback& callback) const {
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/webrtc/webrtc_internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698