Skip to content

Conversation

@geoffreygaren
Copy link
Contributor

@geoffreygaren geoffreygaren commented Nov 4, 2024

8f78933

Build fix for MediaRecorderPrivateEncoder in recent clang toolchains
https://bugs.webkit.org/show_bug.cgi?id=282549
rdar://139216339

Reviewed by Chris Dumez.

MediaRecorderPrivateEncoder tells the compiler "You can only use m_mimeType
inside a scope in which you assertIsMainThread()".

Recent versions of clang notice that this scope ends when a function returns,
so, in the mimeType() accessor, it is an error to return a reference to m_mimeType.

The simplest fix for now seems to be to return String instead of String&.

Latern on, maybe we can annotate the accessor in a way that shows the compiler
that assertIsMainThread() continues to be true after we return.

* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateEncoder.h:

Canonical link: https://commits.webkit.org/286111@main

9c644f1

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2 ❌ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt 🧪 mac-wk1 🛠 wpe-cairo
🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision 🧪 mac-AS-debug-wk2 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv 🛠 mac-safer-cpp
✅ 🛠 tv-sim
🛠 watch
✅ 🛠 watch-sim

@geoffreygaren geoffreygaren self-assigned this Nov 4, 2024
@geoffreygaren geoffreygaren added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Nov 4, 2024
@geoffreygaren geoffreygaren force-pushed the eng/Build-fix-for-MediaRecorderPrivateEncoder-in-recent-clang-toolchains branch from 37da508 to 9c644f1 Compare November 4, 2024 19:12
@geoffreygaren geoffreygaren added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 4, 2024
https://bugs.webkit.org/show_bug.cgi?id=282549
rdar://139216339

Reviewed by Chris Dumez.

MediaRecorderPrivateEncoder tells the compiler "You can only use m_mimeType
inside a scope in which you assertIsMainThread()".

Recent versions of clang notice that this scope ends when a function returns,
so, in the mimeType() accessor, it is an error to return a reference to m_mimeType.

The simplest fix for now seems to be to return String instead of String&.

Latern on, maybe we can annotate the accessor in a way that shows the compiler
that assertIsMainThread() continues to be true after we return.

* Source/WebCore/platform/mediarecorder/MediaRecorderPrivateEncoder.h:

Canonical link: https://commits.webkit.org/286111@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Build-fix-for-MediaRecorderPrivateEncoder-in-recent-clang-toolchains branch from 9c644f1 to 8f78933 Compare November 4, 2024 20:52
@webkit-commit-queue
Copy link
Collaborator

Committed 286111@main (8f78933): https://commits.webkit.org/286111@main

Reviewed commits have been landed. Closing PR #36135 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8f78933 into WebKit:main Nov 4, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants