Bug 1531309 - Don't use __PRETTY_FUNCTION__ or __FUNCTION__ as format strings. r...
authorMike Hommey <mh+mozilla@glandium.org>
Sun, 18 Aug 2019 11:19:35 +0000 (20:19 +0900)
committerMike Hommey <glandium@debian.org>
Tue, 11 Feb 2020 21:50:33 +0000 (21:50 +0000)
__PRETTY_FUNCTION__ and __FUNCTION__ are not guaranteed to be a string
literal, and only string literals should be used as format strings. GCC
9 complains about this with -Werror=format-security.

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1531309-Don-t-use-__PRETTY_FUNCTION__-or-__FUNCT.patch

dom/media/systemservices/CamerasChild.cpp
dom/media/systemservices/CamerasParent.cpp
dom/media/systemservices/MediaParent.cpp
dom/media/systemservices/VideoEngine.cpp
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp

index e661eff0d60997e25c2499fd1c201712c34efbd0..605a16a315e30c51198b67dc92047d6c7cf222cc 100644 (file)
@@ -158,7 +158,7 @@ int CamerasChild::AddDeviceChangeCallback(DeviceChangeCallback* aCallback) {
 }
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplyFailure(void) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = false;
@@ -167,7 +167,7 @@ mozilla::ipc::IPCResult CamerasChild::RecvReplyFailure(void) {
 }
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplySuccess(void) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -177,7 +177,7 @@ mozilla::ipc::IPCResult CamerasChild::RecvReplySuccess(void) {
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplyNumberOfCapabilities(
     const int& numdev) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -262,7 +262,7 @@ bool CamerasChild::DispatchToParent(nsIRunnable* aRunnable,
 
 int CamerasChild::NumberOfCapabilities(CaptureEngine aCapEngine,
                                        const char* deviceUniqueIdUTF8) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("NumberOfCapabilities for %s", deviceUniqueIdUTF8));
   nsCString unique_id(deviceUniqueIdUTF8);
   nsCOMPtr<nsIRunnable> runnable =
@@ -275,7 +275,7 @@ int CamerasChild::NumberOfCapabilities(CaptureEngine aCapEngine,
 }
 
 int CamerasChild::NumberOfCaptureDevices(CaptureEngine aCapEngine) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable = mozilla::NewRunnableMethod<CaptureEngine>(
       "camera::PCamerasChild::SendNumberOfCaptureDevices", this,
       &CamerasChild::SendNumberOfCaptureDevices, aCapEngine);
@@ -286,7 +286,7 @@ int CamerasChild::NumberOfCaptureDevices(CaptureEngine aCapEngine) {
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplyNumberOfCaptureDevices(
     const int& numdev) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -296,7 +296,7 @@ mozilla::ipc::IPCResult CamerasChild::RecvReplyNumberOfCaptureDevices(
 }
 
 int CamerasChild::EnsureInitialized(CaptureEngine aCapEngine) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable = mozilla::NewRunnableMethod<CaptureEngine>(
       "camera::PCamerasChild::SendEnsureInitialized", this,
       &CamerasChild::SendEnsureInitialized, aCapEngine);
@@ -325,7 +325,7 @@ int CamerasChild::GetCaptureCapability(
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplyGetCaptureCapability(
     const VideoCaptureCapability& ipcCapability) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -343,7 +343,7 @@ int CamerasChild::GetCaptureDevice(
     CaptureEngine aCapEngine, unsigned int list_number, char* device_nameUTF8,
     const unsigned int device_nameUTF8Length, char* unique_idUTF8,
     const unsigned int unique_idUTF8Length, bool* scary) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod<CaptureEngine, unsigned int>(
           "camera::PCamerasChild::SendGetCaptureDevice", this,
@@ -364,7 +364,7 @@ int CamerasChild::GetCaptureDevice(
 mozilla::ipc::IPCResult CamerasChild::RecvReplyGetCaptureDevice(
     const nsCString& device_name, const nsCString& device_id,
     const bool& scary) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -379,7 +379,7 @@ int CamerasChild::AllocateCaptureDevice(
     CaptureEngine aCapEngine, const char* unique_idUTF8,
     const unsigned int unique_idUTF8Length, int& aStreamId,
     const mozilla::ipc::PrincipalInfo& aPrincipalInfo) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCString unique_id(unique_idUTF8);
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod<CaptureEngine, nsCString,
@@ -397,7 +397,7 @@ int CamerasChild::AllocateCaptureDevice(
 
 mozilla::ipc::IPCResult CamerasChild::RecvReplyAllocateCaptureDevice(
     const int& numdev) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MonitorAutoLock monitor(mReplyMonitor);
   mReceivedReply = true;
   mReplySuccess = true;
@@ -408,7 +408,7 @@ mozilla::ipc::IPCResult CamerasChild::RecvReplyAllocateCaptureDevice(
 
 int CamerasChild::ReleaseCaptureDevice(CaptureEngine aCapEngine,
                                        const int capture_id) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod<CaptureEngine, int>(
           "camera::PCamerasChild::SendReleaseCaptureDevice", this,
@@ -442,7 +442,7 @@ void CamerasChild::RemoveCallback(const CaptureEngine aCapEngine,
 int CamerasChild::StartCapture(CaptureEngine aCapEngine, const int capture_id,
                                webrtc::VideoCaptureCapability& webrtcCaps,
                                FrameRelay* cb) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   AddCallback(aCapEngine, capture_id, cb);
   VideoCaptureCapability capCap(
       webrtcCaps.width, webrtcCaps.height, webrtcCaps.maxFPS,
@@ -457,7 +457,7 @@ int CamerasChild::StartCapture(CaptureEngine aCapEngine, const int capture_id,
 
 int CamerasChild::FocusOnSelectedSource(CaptureEngine aCapEngine,
                                         const int aCaptureId) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod<CaptureEngine, int>(
           "camera::PCamerasChild::SendFocusOnSelectedSource", this,
@@ -467,7 +467,7 @@ int CamerasChild::FocusOnSelectedSource(CaptureEngine aCapEngine,
 }
 
 int CamerasChild::StopCapture(CaptureEngine aCapEngine, const int capture_id) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod<CaptureEngine, int>(
           "camera::PCamerasChild::SendStopCapture", this,
index e3b2603d05650be2b4430660f871ed184c71b42c..385c50f6bfac45324c3f3aca964758346f682a59 100644 (file)
@@ -102,7 +102,7 @@ StaticMutex CamerasParent::sMutex;
 
 // InputObserver is owned by CamerasParent, and it has a ref to CamerasParent
 void InputObserver::OnDeviceChange() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MOZ_ASSERT(mParent);
 
   RefPtr<InputObserver> self(this);
@@ -201,7 +201,7 @@ nsresult CamerasParent::DispatchToVideoCaptureThread(RefPtr<Runnable> event) {
 }
 
 void CamerasParent::StopVideoCapture() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   // We are called from the main thread (xpcom-shutdown) or
   // from PBackground (when the Actor shuts down).
   // Shut down the WebRTC stack (on the capture thread)
@@ -283,7 +283,7 @@ ShmemBuffer CamerasParent::GetBuffer(size_t aSize) {
 }
 
 void CallbackHelper::OnFrame(const webrtc::VideoFrame& aVideoFrame) {
-  LOG_VERBOSE((__PRETTY_FUNCTION__));
+  LOG_VERBOSE(("%s", __PRETTY_FUNCTION__));
   RefPtr<DeliverFrameRunnable> runnable = nullptr;
   // Get frame properties
   camera::VideoFrameProperties properties;
@@ -319,7 +319,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvReleaseFrame(
 }
 
 bool CamerasParent::SetupEngine(CaptureEngine aCapEngine) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   StaticRefPtr<VideoEngine>& engine = sEngines[aCapEngine];
 
   if (!engine) {
@@ -371,7 +371,7 @@ bool CamerasParent::SetupEngine(CaptureEngine aCapEngine) {
 }
 
 void CamerasParent::CloseEngines() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   if (!mWebRTCAlive) {
     return;
   }
@@ -411,7 +411,7 @@ void CamerasParent::CloseEngines() {
 }
 
 VideoEngine* CamerasParent::EnsureInitialized(int aEngine) {
-  LOG_VERBOSE((__PRETTY_FUNCTION__));
+  LOG_VERBOSE(("%s", __PRETTY_FUNCTION__));
   // We're shutting down, don't try to do new WebRTC ops.
   if (!mWebRTCAlive) {
     return nullptr;
@@ -432,7 +432,7 @@ VideoEngine* CamerasParent::EnsureInitialized(int aEngine) {
 // perhaps via Promises.
 mozilla::ipc::IPCResult CamerasParent::RecvNumberOfCaptureDevices(
     const CaptureEngine& aCapEngine) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("CaptureEngine=%d", aCapEngine));
   RefPtr<CamerasParent> self(this);
   RefPtr<Runnable> webrtc_runnable = NewRunnableFrom([self, aCapEngine]() {
@@ -466,7 +466,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvNumberOfCaptureDevices(
 
 mozilla::ipc::IPCResult CamerasParent::RecvEnsureInitialized(
     const CaptureEngine& aCapEngine) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 
   RefPtr<CamerasParent> self(this);
   RefPtr<Runnable> webrtc_runnable = NewRunnableFrom([self, aCapEngine]() {
@@ -496,7 +496,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvEnsureInitialized(
 
 mozilla::ipc::IPCResult CamerasParent::RecvNumberOfCapabilities(
     const CaptureEngine& aCapEngine, const nsCString& unique_id) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("Getting caps for %s", unique_id.get()));
 
   RefPtr<CamerasParent> self(this);
@@ -533,7 +533,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvNumberOfCapabilities(
 mozilla::ipc::IPCResult CamerasParent::RecvGetCaptureCapability(
     const CaptureEngine& aCapEngine, const nsCString& unique_id,
     const int& num) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("RecvGetCaptureCapability: %s %d", unique_id.get(), num));
 
   RefPtr<CamerasParent> self(this);
@@ -586,7 +586,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvGetCaptureCapability(
 
 mozilla::ipc::IPCResult CamerasParent::RecvGetCaptureDevice(
     const CaptureEngine& aCapEngine, const int& aListNumber) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 
   RefPtr<CamerasParent> self(this);
   RefPtr<Runnable> webrtc_runnable = NewRunnableFrom([self, aCapEngine,
@@ -756,7 +756,7 @@ int CamerasParent::ReleaseCaptureDevice(const CaptureEngine& aCapEngine,
 
 mozilla::ipc::IPCResult CamerasParent::RecvReleaseCaptureDevice(
     const CaptureEngine& aCapEngine, const int& numdev) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("RecvReleaseCamera device nr %d", numdev));
 
   RefPtr<CamerasParent> self(this);
@@ -788,12 +788,12 @@ mozilla::ipc::IPCResult CamerasParent::RecvReleaseCaptureDevice(
 mozilla::ipc::IPCResult CamerasParent::RecvStartCapture(
     const CaptureEngine& aCapEngine, const int& capnum,
     const VideoCaptureCapability& ipcCaps) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 
   RefPtr<CamerasParent> self(this);
   RefPtr<Runnable> webrtc_runnable = NewRunnableFrom([self, aCapEngine, capnum,
                                                       ipcCaps]() {
-    LOG((__PRETTY_FUNCTION__));
+    LOG(("%s", __PRETTY_FUNCTION__));
     CallbackHelper** cbh;
     int error = -1;
     if (self->EnsureInitialized(aCapEngine)) {
@@ -915,7 +915,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvStartCapture(
 
 mozilla::ipc::IPCResult CamerasParent::RecvFocusOnSelectedSource(
     const CaptureEngine& aCapEngine, const int& aCapNum) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   RefPtr<Runnable> webrtc_runnable = NewRunnableFrom(
       [self = RefPtr<CamerasParent>(this), aCapEngine, aCapNum]() {
         if (auto engine = self->EnsureInitialized(aCapEngine)) {
@@ -977,7 +977,7 @@ void CamerasParent::StopCapture(const CaptureEngine& aCapEngine,
 
 mozilla::ipc::IPCResult CamerasParent::RecvStopCapture(
     const CaptureEngine& aCapEngine, const int& capnum) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 
   RefPtr<CamerasParent> self(this);
   RefPtr<Runnable> webrtc_runnable =
@@ -1015,7 +1015,7 @@ void CamerasParent::StopIPC() {
 }
 
 mozilla::ipc::IPCResult CamerasParent::RecvAllDone() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   // Don't try to send anything to the child now
   mChildIsAlive = false;
   IProtocol* mgr = Manager();
@@ -1027,7 +1027,7 @@ mozilla::ipc::IPCResult CamerasParent::RecvAllDone() {
 
 void CamerasParent::ActorDestroy(ActorDestroyReason aWhy) {
   // No more IPC from here
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   StopIPC();
   // Shut down WebRTC (if we're not in full shutdown, else this
   // will already have happened)
index bf293b28b9607109c1137f536aa11384ac1bb62a..f85665f6d58b7100fe1d0e5fdffbc74cedc23e72 100644 (file)
@@ -378,7 +378,7 @@ class OriginKeyStore : public nsISupports {
   virtual ~OriginKeyStore() {
     StaticMutexAutoLock lock(sOriginKeyStoreMutex);
     sOriginKeyStore = nullptr;
-    LOG((__FUNCTION__));
+    LOG(("%s", __FUNCTION__));
   }
 
  public:
@@ -509,7 +509,7 @@ template <class Super>
 void Parent<Super>::ActorDestroy(ActorDestroyReason aWhy) {
   // No more IPC from here
   mDestroyed = true;
-  LOG((__FUNCTION__));
+  LOG(("%s", __FUNCTION__));
 }
 
 template <class Super>
index b7ce5ce879f39b3917dbe66ec331b6072bf0777a..08fd6c441132ea40e82eccb112a864cd961e8c3a 100644 (file)
@@ -28,7 +28,7 @@ mozilla::LazyLogModule gVideoEngineLog("VideoEngine");
 int VideoEngine::sId = 0;
 #if defined(ANDROID)
 int VideoEngine::SetAndroidObjects() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 
   JavaVM* const javaVM = mozilla::jni::GetVM();
   if (!javaVM || webrtc::SetCaptureAndroidVM(javaVM) != 0) {
@@ -47,7 +47,7 @@ int VideoEngine::SetAndroidObjects() {
 
 void VideoEngine::CreateVideoCapture(int32_t& id,
                                      const char* deviceUniqueIdUTF8) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   MOZ_ASSERT(deviceUniqueIdUTF8);
 
   id = GenerateId();
@@ -140,7 +140,7 @@ int VideoEngine::ReleaseVideoCapture(const int32_t id) {
 
 std::shared_ptr<webrtc::VideoCaptureModule::DeviceInfo>
 VideoEngine::GetOrCreateVideoCaptureDeviceInfo() {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   int64_t currentTime = 0;
 
   const char* capDevTypeName =
@@ -215,7 +215,7 @@ const UniquePtr<const webrtc::Config>& VideoEngine::GetConfiguration() {
 
 already_AddRefed<VideoEngine> VideoEngine::Create(
     UniquePtr<const webrtc::Config>&& aConfig) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
   LOG(("Creating new VideoEngine with CaptureDeviceType %s",
        aConfig->Get<webrtc::CaptureDeviceInfo>().TypeName()));
   return do_AddRef(new VideoEngine(std::move(aConfig)));
@@ -263,7 +263,7 @@ VideoEngine::VideoEngine(UniquePtr<const webrtc::Config>&& aConfig)
       mCaptureDevInfo(aConfig->Get<webrtc::CaptureDeviceInfo>()),
       mDeviceInfo(nullptr),
       mConfig(std::move(aConfig)) {
-  LOG((__PRETTY_FUNCTION__));
+  LOG(("%s", __PRETTY_FUNCTION__));
 }
 
 }  // namespace camera
index 3589146d47dbeb382288464da89f28f362ca8f22..17aa118726e54599703acbe83a423a496c8420b6 100644 (file)
@@ -68,7 +68,7 @@ dom::MediaSourceEnum MediaEngineRemoteVideoSource::GetMediaSource() const {
 }
 
 void MediaEngineRemoteVideoSource::Init() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   char deviceName[kMaxDeviceNameLength];
@@ -89,7 +89,7 @@ void MediaEngineRemoteVideoSource::Init() {
 }
 
 void MediaEngineRemoteVideoSource::Shutdown() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   if (!mInitDone) {
@@ -109,7 +109,7 @@ void MediaEngineRemoteVideoSource::Shutdown() {
 }
 
 void MediaEngineRemoteVideoSource::SetName(nsString aName) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   mDeviceName = std::move(aName);
@@ -193,7 +193,7 @@ nsresult MediaEngineRemoteVideoSource::Allocate(
     const nsString& aDeviceId,
     const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
     const char** aOutBadConstraint) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(mState == kReleased);
@@ -231,7 +231,7 @@ nsresult MediaEngineRemoteVideoSource::Allocate(
 }
 
 nsresult MediaEngineRemoteVideoSource::Deallocate() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(mState == kStopped || mState == kAllocated);
@@ -267,7 +267,7 @@ nsresult MediaEngineRemoteVideoSource::Deallocate() {
 void MediaEngineRemoteVideoSource::SetTrack(
     const RefPtr<SourceMediaStream>& aStream, TrackID aTrackID,
     const PrincipalHandle& aPrincipal) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(mState == kAllocated);
@@ -292,7 +292,7 @@ void MediaEngineRemoteVideoSource::SetTrack(
 }
 
 nsresult MediaEngineRemoteVideoSource::Start() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(mState == kAllocated || mState == kStopped);
@@ -345,7 +345,7 @@ nsresult MediaEngineRemoteVideoSource::Start() {
 }
 
 nsresult MediaEngineRemoteVideoSource::FocusOnSelectedSource() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   int result;
@@ -355,7 +355,7 @@ nsresult MediaEngineRemoteVideoSource::FocusOnSelectedSource() {
 }
 
 nsresult MediaEngineRemoteVideoSource::Stop() {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   if (mState == kStopped || mState == kAllocated) {
@@ -381,7 +381,7 @@ nsresult MediaEngineRemoteVideoSource::Stop() {
 nsresult MediaEngineRemoteVideoSource::Reconfigure(
     const MediaTrackConstraints& aConstraints, const MediaEnginePrefs& aPrefs,
     const nsString& aDeviceId, const char** aOutBadConstraint) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(mInitDone);
@@ -762,7 +762,7 @@ bool MediaEngineRemoteVideoSource::ChooseCapability(
     const NormalizedConstraints& aConstraints, const MediaEnginePrefs& aPrefs,
     const nsString& aDeviceId, webrtc::CaptureCapability& aCapability,
     const DistanceCalculation aCalculate) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   if (MOZ_LOG_TEST(gMediaManagerLog, LogLevel::Debug)) {
@@ -928,7 +928,7 @@ void MediaEngineRemoteVideoSource::GetSettings(
 }
 
 void MediaEngineRemoteVideoSource::Refresh(int aIndex) {
-  LOG(__PRETTY_FUNCTION__);
+  LOG("%s", __PRETTY_FUNCTION__);
   AssertIsOnOwningThread();
 
   // NOTE: mCaptureIndex might have changed when allocated!