Nit: you can move getting oldDownloadTemplate after setting newDownloadTemplate (it is going to be actually used before the GST_TRACE and specially relevant for the purge).
Another nit: "Reconfigured" is better because the relevant action already happened.
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1395
> + // Transform "-XXXXXX" into "-??????" to get a file wildcard expression from the template.
> + for (char* p = &templateFile.get()[strlen(templateFile.get()) - 1]; p >= templateFile.get() && *p == 'X'; --p)
> + *p = '?';
Maybe you can use String::replace instead of doing this (it can take position and length.
> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1409
> + if (m_source && WEBKIT_IS_WEB_SRC(m_source.get()))
You don't need the m_source && as WEBKIT_IS_WEB_SRC checks for nulls as expected.
Comment on attachment 300398
Patch
View in context: https:/ /bugs.webkit. org/attachment. cgi?id= 300398& action= review
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:203 IS_WEB_ SRC(m_source. get()))
> + if (m_source && WEBKIT_
You don't need the m_source && as WEBKIT_IS_WEB_SRC checks for nulls as expected.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1362 late; get(element, "temp-template", &oldDownloadTem plate.outPtr( ), nullptr); late(g_ build_filename( G_DIR_SEPARATOR _S, "var", "tmp", "WebKit- Media-XXXXXX" , nullptr)); set(element, "temp-template", newDownloadTemp late.get( ), nullptr); "Reconfiguring file download template from '%s' to '%s'", oldDownloadTemp late.get( ), newDownloadTemp late.get( ));
> + GUniqueOutPtr<char> oldDownloadTemp
> + g_object_
> +
> + GUniquePtr<char> newDownloadTemp
> + g_object_
> + GST_TRACE(
Nit: you can move getting oldDownloadTemplate after setting newDownloadTemplate (it is going to be actually used before the GST_TRACE and specially relevant for the purge).
Another nit: "Reconfigured" is better because the relevant action already happened.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1395 get()[strlen( templateFile. get()) - 1]; p >= templateFile.get() && *p == 'X'; --p)
> + // Transform "-XXXXXX" into "-??????" to get a file wildcard expression from the template.
> + for (char* p = &templateFile.
> + *p = '?';
Maybe you can use String::replace instead of doing this (it can take position and length.
> Source/ WebCore/ platform/ graphics/ gstreamer/ MediaPlayerPriv ateGStreamer. cpp:1409 IS_WEB_ SRC(m_source. get()))
> + if (m_source && WEBKIT_
You don't need the m_source && as WEBKIT_IS_WEB_SRC checks for nulls as expected.