Title: [260129] trunk/Source
Revision
260129
Author
[email protected]
Date
2020-04-15 08:32:20 -0700 (Wed, 15 Apr 2020)

Log Message

isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked.
https://bugs.webkit.org/show_bug.cgi?id=210532

Reviewed by Tim Horton.

Source/ThirdParty/libwebrtc:

* Source/webrtc/sdk/WebKit/WebKitUtilities.h:

Source/WebCore:

Symbols whose declarations are explicitly marked as weakly imported are guaranteed to be
NULL when the library containing those symbols is not available at runtime, or when the
symbol itself isn't present in the version of the library which is available at runtime. For
symbols which are not explicitly marked as weakly imported (because, e.g., the framework
itself is weakly imported), this technique can fail. Rather than test the nullity of a
random static C++ class method with isNullFunctionPointer(), explicitly mark as weak_import
a utility method added by the WebKit project, which conveniently is already used from within
LibWebRTCProviderCocoa, and test the nullity of that method instead.

* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (260128 => 260129)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2020-04-15 15:29:28 UTC (rev 260128)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2020-04-15 15:32:20 UTC (rev 260129)
@@ -1,3 +1,12 @@
+2020-04-15  Jer Noble  <[email protected]>
+
+        isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked.
+        https://bugs.webkit.org/show_bug.cgi?id=210532
+
+        Reviewed by Tim Horton.
+
+        * Source/webrtc/sdk/WebKit/WebKitUtilities.h:
+
 2020-04-09  Keith Rollin  <[email protected]>
 
         Set ENTITLEMENTS_REQUIRED=NO for some Xcode build targets

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h (260128 => 260129)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h	2020-04-15 15:29:28 UTC (rev 260128)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.h	2020-04-15 15:32:20 UTC (rev 260129)
@@ -44,7 +44,7 @@
 std::unique_ptr<webrtc::VideoEncoderFactory> createWebKitEncoderFactory(WebKitCodecSupport);
 std::unique_ptr<webrtc::VideoDecoderFactory> createWebKitDecoderFactory(WebKitCodecSupport);
 
-void setApplicationStatus(bool isActive);
+void setApplicationStatus(bool isActive) __attribute__((weak_import));
 
 void setH264HardwareEncoderAllowed(bool);
 bool isH264HardwareEncoderAllowed();

Modified: trunk/Source/WebCore/ChangeLog (260128 => 260129)


--- trunk/Source/WebCore/ChangeLog	2020-04-15 15:29:28 UTC (rev 260128)
+++ trunk/Source/WebCore/ChangeLog	2020-04-15 15:32:20 UTC (rev 260129)
@@ -1,3 +1,22 @@
+2020-04-15  Jer Noble  <[email protected]>
+
+        isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked.
+        https://bugs.webkit.org/show_bug.cgi?id=210532
+
+        Reviewed by Tim Horton.
+
+        Symbols whose declarations are explicitly marked as weakly imported are guaranteed to be
+        NULL when the library containing those symbols is not available at runtime, or when the
+        symbol itself isn't present in the version of the library which is available at runtime. For
+        symbols which are not explicitly marked as weakly imported (because, e.g., the framework
+        itself is weakly imported), this technique can fail. Rather than test the nullity of a
+        random static C++ class method with isNullFunctionPointer(), explicitly mark as weak_import
+        a utility method added by the WebKit project, which conveniently is already used from within
+        LibWebRTCProviderCocoa, and test the nullity of that method instead.
+
+        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
+        (WebCore::LibWebRTCProvider::webRTCAvailable):
+
 2020-04-15  Claudio Saavedra  <[email protected]>
 
         [GTK] Make PlatformScreen::screenDPI() GTK4-ready

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp (260128 => 260129)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp	2020-04-15 15:29:28 UTC (rev 260128)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp	2020-04-15 15:32:20 UTC (rev 260129)
@@ -76,7 +76,7 @@
 #if PLATFORM(IOS)
     return true;
 #else
-    return !isNullFunctionPointer(rtc::LogMessage::LogToDebug);
+    return !isNullFunctionPointer(webrtc::setApplicationStatus);
 #endif
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to