Skip to content

Commit

Permalink
ImageCapture: wrap references to m_logger with !RELEASE_LOG_DISABLED
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268259

Reviewed by Tim Nguyen.

m_logger is defined conditionally, but not all references use the same
condition when accessing the member.

* Source/WebCore/Modules/mediastream/ImageCapture.cpp:
(WebCore::ImageCapture::ImageCapture):
* Source/WebCore/Modules/mediastream/ImageCapture.h:

Canonical link: https://commits.webkit.org/273631@main
  • Loading branch information
elahav authored and nt1m committed Jan 28, 2024
1 parent 5cf3cdb commit 50ebd10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/Modules/mediastream/ImageCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ ExceptionOr<Ref<ImageCapture>> ImageCapture::create(Document& document, Ref<Medi
ImageCapture::ImageCapture(Document& document, Ref<MediaStreamTrack> track)
: ActiveDOMObject(document)
, m_track(track)
#if !RELEASE_LOG_DISABLED
, m_logger(track->logger())
, m_logIdentifier(track->logIdentifier())
#endif
{
ALWAYS_LOG(LOGIDENTIFIER);
}
Expand Down Expand Up @@ -124,10 +126,12 @@ const char* ImageCapture::activeDOMObjectName() const
return "ImageCapture";
}

#if !RELEASE_LOG_DISABLED
WTFLogChannel& ImageCapture::logChannel() const
{
return LogWebRTC;
}
#endif

} // namespace WebCore

Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/Modules/mediastream/ImageCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ class ImageCapture : public RefCounted<ImageCapture>, public ActiveDOMObject {
private:
ImageCapture(Document&, Ref<MediaStreamTrack>);

#if !RELEASE_LOG_DISABLED
const Logger& logger() const { return m_logger.get(); }
const void* logIdentifier() const { return m_logIdentifier; }
const char* logClassName() const { return "ImageCapture"; }
WTFLogChannel& logChannel() const;
#endif

// ActiveDOMObject API.
const char* activeDOMObjectName() const final;
Expand Down

0 comments on commit 50ebd10

Please sign in to comment.