<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[180481] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/180481">180481</a></dd>
<dt>Author</dt> <dd>ddkilzer@apple.com</dd>
<dt>Date</dt> <dd>2015-02-21 13:49:57 -0800 (Sat, 21 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add SOFT_LINK_CONSTANT_SOURCE() cross-platform macro and start using it
&lt;http://webkit.org/b/141816&gt;

Reviewed by Alexey Proskuryakov.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
- Remove CoreMediaSoftLinking.h.

* platform/cf/CoreMediaSoftLink.cpp:
- Add kCMTimeZero constant.
* platform/cf/CoreMediaSoftLink.h:
- Add SOFT_LINK_FRAMEWORK_HEADER() macro for CoreMedia.
- Add kCMTimeZero constant.

* platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Remove.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
- Remove reference to CoreMediaSoftLinking.h and update comment.
(WebCore::MediaPlayerPrivateAVFoundationCF::isAvailable):
- Switch to using new method to check if a framework is
  available.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
- Remove all local soft-linking macros for CoreMedia.
  CoreMediaSoftLink.h handles everything now.
(WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
- Switch to using new method to check if a framework is
  available.

* platform/mac/SoftLinking.h:
(SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
is_Name_FrameworkAvailable() macro.
(SOFT_LINK_FRAMEWORK_SOURCE): Update to make it work with
optional framework checks without a separate macro.
(SOFT_LINK_CONSTANT_HEADER): Add.
(SOFT_LINK_CONSTANT_SOURCE): Add.
- Support soft-links to constants.

* platform/win/SoftLinking.h:
(SOFT_LINK_FRAMEWORK_HELPER): Add.  Copied from
SOFT_LINK_LIBRARY_HELPER, with addition of namespace and
non-static function.
(SOFT_LINK_FRAMEWORK): Add.  Copied from SOFT_LINK_LIBRARY.
(SOFT_LINK_DEBUG_FRAMEWORK): Add.  Copied from
SOFT_LINK_DEBUG_LIBRARY.
(SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
is_Name_FrameworkAvailable() macro.
(SOFT_LINK_FRAMEWORK_SOURCE): Redefine in terms of
SOFT_LINK_FRAMEWORK/SOFT_LINK_DEBUG_FRAMEWORK.
(SOFT_LINK_CONSTANT_HEADER): Add.
(SOFT_LINK_CONSTANT_SOURCE): Add.
- Support soft-links to constants.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkh">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSoftLinkingh">trunk/Source/WebCore/platform/mac/SoftLinking.h</a></li>
<li><a href="#trunkSourceWebCoreplatformwinSoftLinkingh">trunk/Source/WebCore/platform/win/SoftLinking.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfCoreMediaSoftLinkingh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/ChangeLog        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2015-02-21  David Kilzer  &lt;ddkilzer@apple.com&gt;
+
+        Add SOFT_LINK_CONSTANT_SOURCE() cross-platform macro and start using it
+        &lt;http://webkit.org/b/141816&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        - Remove CoreMediaSoftLinking.h.
+
+        * platform/cf/CoreMediaSoftLink.cpp:
+        - Add kCMTimeZero constant.
+        * platform/cf/CoreMediaSoftLink.h:
+        - Add SOFT_LINK_FRAMEWORK_HEADER() macro for CoreMedia.
+        - Add kCMTimeZero constant.
+
+        * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Remove.
+
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        - Remove reference to CoreMediaSoftLinking.h and update comment.
+        (WebCore::MediaPlayerPrivateAVFoundationCF::isAvailable):
+        - Switch to using new method to check if a framework is
+          available.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        - Remove all local soft-linking macros for CoreMedia.
+          CoreMediaSoftLink.h handles everything now.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
+        - Switch to using new method to check if a framework is
+          available.
+
+        * platform/mac/SoftLinking.h:
+        (SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
+        is_Name_FrameworkAvailable() macro.
+        (SOFT_LINK_FRAMEWORK_SOURCE): Update to make it work with
+        optional framework checks without a separate macro.
+        (SOFT_LINK_CONSTANT_HEADER): Add.
+        (SOFT_LINK_CONSTANT_SOURCE): Add.
+        - Support soft-links to constants.
+
+        * platform/win/SoftLinking.h:
+        (SOFT_LINK_FRAMEWORK_HELPER): Add.  Copied from
+        SOFT_LINK_LIBRARY_HELPER, with addition of namespace and
+        non-static function.
+        (SOFT_LINK_FRAMEWORK): Add.  Copied from SOFT_LINK_LIBRARY.
+        (SOFT_LINK_DEBUG_FRAMEWORK): Add.  Copied from
+        SOFT_LINK_DEBUG_LIBRARY.
+        (SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
+        is_Name_FrameworkAvailable() macro.
+        (SOFT_LINK_FRAMEWORK_SOURCE): Redefine in terms of
+        SOFT_LINK_FRAMEWORK/SOFT_LINK_DEBUG_FRAMEWORK.
+        (SOFT_LINK_CONSTANT_HEADER): Add.
+        (SOFT_LINK_CONSTANT_SOURCE): Add.
+        - Support soft-links to constants.
+
</ins><span class="cx"> 2015-02-20  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -20002,7 +20002,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\MediaPlayerPrivateAVFoundation.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\MediaTimeAVFoundation.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\AVFoundationCFSoftLinking.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\CoreMediaSoftLinking.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\AuthenticationChallengeBase.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\network\AuthenticationClient.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -8691,9 +8691,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\AVFoundationCFSoftLinking.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\avfoundation\cf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\CoreMediaSoftLinking.h&quot;&gt;
-      &lt;Filter&gt;platform\graphics\avfoundation\cf&lt;/Filter&gt;
-    &lt;/ClInclude&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\avfoundation\cf\MediaPlayerPrivateAVFoundationCF.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\avfoundation\cf&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
</span><span class="cx"> SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</span><span class="cx"> 
</span><ins>+SOFT_LINK_CONSTANT_SOURCE(WebCore, CoreMedia, kCMTimeZero, CMTime);
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
</span><span class="cx"> SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include &quot;SoftLinking.h&quot;
</span><span class="cx"> #include &lt;CoreMedia/CoreMedia.h&gt;
</span><span class="cx"> 
</span><ins>+SOFT_LINK_FRAMEWORK_HEADER(WebCore, CoreMedia)
+
</ins><span class="cx"> SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
</span><span class="cx"> #define CMTimeCompare softLink_CoreMedia_CMTimeCompare
</span><span class="cx"> SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
</span><span class="lines">@@ -43,6 +45,9 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</span><span class="cx"> #define CMTimeRangeGetEnd softLink_CoreMedia_CMTimeRangeGetEnd
</span><span class="cx"> 
</span><ins>+SOFT_LINK_CONSTANT_HEADER(WebCore, CoreMedia, kCMTimeZero, CMTime);
+#define kCMTimeZero get_CoreMedia_kCMTimeZero()
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfCoreMediaSoftLinkingh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -1,39 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include &quot;SoftLinking.h&quot;
-
-// Soft-link against CoreMedia functions and variables required by MediaPlayerPrivateAVFoundationCF.cpp.
-
-#ifdef DEBUG_ALL
-SOFT_LINK_DEBUG_LIBRARY(CoreMedia)
-#else
-SOFT_LINK_LIBRARY(CoreMedia)
-#endif
-
-// Variables
-
-SOFT_LINK_VARIABLE_DLL_IMPORT(CoreMedia, kCMTimeZero, const CMTime);
-#define kCMTimeZero getkCMTimeZero()
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -71,10 +71,9 @@
</span><span class="cx"> #include &lt;wtf/text/StringView.h&gt;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> 
</span><del>-// The softlink header files must be included after the AVCF and CoreMedia header files.
</del><ins>+// Soft-linking headers must be included last since they #define functions, constants, etc.
</ins><span class="cx"> #include &quot;AVFoundationCFSoftLinking.h&quot;
</span><span class="cx"> #include &quot;CoreMediaSoftLink.h&quot;
</span><del>-#include &quot;CoreMediaSoftLinking.h&quot;
</del><span class="cx"> 
</span><span class="cx"> // We don't bother softlinking against libdispatch since it's already been loaded by AAS.
</span><span class="cx"> #ifdef DEBUG_ALL
</span><span class="lines">@@ -940,7 +939,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateAVFoundationCF::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationCFLibrary() &amp;&amp; CoreMediaLibrary();
</del><ins>+    return AVFoundationCFLibrary() &amp;&amp; isCoreMediaFrameworkAvailable();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #import &quot;BlockExceptions.h&quot;
</span><span class="cx"> #import &quot;CDMSessionAVFoundationObjC.h&quot;
</span><span class="cx"> #import &quot;Cookie.h&quot;
</span><del>-#import &quot;CoreMediaSoftLink.h&quot;
</del><span class="cx"> #import &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #import &quot;FloatConversion.h&quot;
</span><span class="cx"> #import &quot;FloatConversion.h&quot;
</span><span class="lines">@@ -145,8 +144,12 @@
</span><span class="cx"> typedef AVMediaSelectionGroup AVMediaSelectionGroupType;
</span><span class="cx"> typedef AVMediaSelectionOption AVMediaSelectionOptionType;
</span><span class="cx"> 
</span><ins>+#pragma mark - Soft Linking
+
+// Soft-linking headers must be included last since they #define functions, constants, etc.
+#import &quot;CoreMediaSoftLink.h&quot;
+
</ins><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</span><del>-SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
</del><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(CoreImage)
</span><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(CoreVideo)
</span><span class="cx"> 
</span><span class="lines">@@ -196,8 +199,6 @@
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_POINTER_OPTIONAL(AVFoundation, AVURLAssetClientBundleIdentifierKey, NSString *)
</span><span class="cx"> 
</span><del>-SOFT_LINK_CONSTANT(CoreMedia, kCMTimeZero, CMTime)
-
</del><span class="cx"> #define AVPlayer getAVPlayerClass()
</span><span class="cx"> #define AVPlayerItem getAVPlayerItemClass()
</span><span class="cx"> #define AVPlayerLayer getAVPlayerLayerClass()
</span><span class="lines">@@ -283,12 +284,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVURLAssetBoundNetworkInterfaceName, NSString *)
</span><del>-
</del><span class="cx"> #define AVURLAssetBoundNetworkInterfaceName getAVURLAssetBoundNetworkInterfaceName()
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#define kCMTimeZero getkCMTimeZero()
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> enum MediaPlayerAVFoundationObservationContext {
</span><span class="lines">@@ -1754,7 +1752,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MediaPlayerPrivateAVFoundationObjC::isAvailable()
</span><span class="cx"> {
</span><del>-    return AVFoundationLibrary() &amp;&amp; CoreMediaLibrary();
</del><ins>+    return AVFoundationLibrary() &amp;&amp; isCoreMediaFrameworkAvailable();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaTime MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue(const MediaTime&amp; timeValue) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SoftLinking.h (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SoftLinking.h        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/mac/SoftLinking.h        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -293,20 +293,57 @@
</span><span class="cx"> 
</span><span class="cx"> // See Source/WebCore/platform/cf/CoreMediaSoftLink.{cpp,h} for an example implementation.
</span><span class="cx"> 
</span><ins>+#define SOFT_LINK_FRAMEWORK_HEADER(functionNamespace, framework) \
+    namespace functionNamespace { \
+    extern void* framework##Library(bool isOptional = false); \
+    bool is##framework##FrameworkAvailable(); \
+    inline bool is##framework##FrameworkAvailable() { \
+        return framework##Library(true) != nullptr; \
+    } \
+    }
+
</ins><span class="cx"> #define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
</span><span class="cx">     namespace functionNamespace { \
</span><del>-    static void* framework##Library() \
</del><ins>+    void* framework##Library(bool isOptional = false); \
+    void* framework##Library(bool isOptional) \
</ins><span class="cx">     { \
</span><span class="cx">         static void* frameworkLibrary; \
</span><span class="cx">         static dispatch_once_t once; \
</span><span class="cx">         dispatch_once(&amp;once, ^{ \
</span><span class="cx">             frameworkLibrary = dlopen(&quot;/System/Library/Frameworks/&quot; #framework &quot;.framework/&quot; #framework, RTLD_NOW); \
</span><del>-            ASSERT_WITH_MESSAGE(frameworkLibrary, &quot;%s&quot;, dlerror()); \
</del><span class="cx">         }); \
</span><ins>+        ASSERT_WITH_MESSAGE_UNUSED(isOptional, isOptional || frameworkLibrary, &quot;%s&quot;, dlerror()); \
</ins><span class="cx">         return frameworkLibrary; \
</span><span class="cx">     } \
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#define SOFT_LINK_CONSTANT_HEADER(functionNamespace, framework, variableName, variableType) \
+    WTF_EXTERN_C_BEGIN \
+    extern const variableType variableName; \
+    WTF_EXTERN_C_END \
+    namespace functionNamespace { \
+    const variableType get_##framework##_##variableName(); \
+    }
+
+#define SOFT_LINK_CONSTANT_SOURCE(functionNamespace, framework, variableName, variableType) \
+    WTF_EXTERN_C_BEGIN \
+    extern const variableType variableName; \
+    WTF_EXTERN_C_END \
+    namespace functionNamespace { \
+    const variableType get_##framework##_##variableName(); \
+    const variableType get_##framework##_##variableName() \
+    { \
+        static variableType constant##framework##variableName; \
+        static dispatch_once_t once; \
+        dispatch_once(&amp;once, ^{ \
+            void* constant = dlsym(framework##Library(), #variableName); \
+            ASSERT_WITH_MESSAGE(constant, &quot;%s&quot;, dlerror()); \
+            constant##framework##variableName = *static_cast&lt;variableType*&gt;(constant); \
+        }); \
+        return constant##framework##variableName; \
+    } \
+    }
+
</ins><span class="cx"> #define SOFT_LINK_FUNCTION_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
</span><span class="cx">     WTF_EXTERN_C_BEGIN \
</span><span class="cx">     resultType functionName parameterDeclarations; \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/SoftLinking.h (180480 => 180481)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/SoftLinking.h        2015-02-21 20:22:07 UTC (rev 180480)
+++ trunk/Source/WebCore/platform/win/SoftLinking.h        2015-02-21 21:49:57 UTC (rev 180481)
</span><span class="lines">@@ -175,18 +175,57 @@
</span><span class="cx"> 
</span><span class="cx"> // See Source/WebCore/platform/cf/CoreMediaSoftLink.{cpp,h} for an example implementation.
</span><span class="cx"> 
</span><del>-#ifdef DEBUG_ALL
-#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
</del><ins>+#define SOFT_LINK_FRAMEWORK_HEADER(functionNamespace, framework) \
</ins><span class="cx">     namespace functionNamespace { \
</span><del>-    SOFT_LINK_DEBUG_LIBRARY(framework) \
</del><ins>+    extern HMODULE framework##Library(bool isOptional = false); \
+    bool is##framework##FrameworkAvailable(); \
+    inline bool is##framework##FrameworkAvailable() { \
+        return framework##Library(true) != nullptr; \
+    } \
</ins><span class="cx">     }
</span><del>-#else
-#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
</del><ins>+
+#define SOFT_LINK_FRAMEWORK_HELPER(functionNamespace, framework, suffix) \
</ins><span class="cx">     namespace functionNamespace { \
</span><del>-    SOFT_LINK_LIBRARY(framework) \
</del><ins>+    HMODULE framework##Library(bool isOptional = false); \
+    HMODULE framework##Library(bool isOptional) \
+    { \
+        static HMODULE library = LoadLibraryW(L###framework suffix); \
+        ASSERT_WITH_MESSAGE_UNUSED(isOptional, isOptional || library, &quot;Could not load %s&quot;, L###framework suffix); \
+        return library; \
+    } \
</ins><span class="cx">     }
</span><ins>+
+#define SOFT_LINK_FRAMEWORK(functionNamespace, framework) SOFT_LINK_FRAMEWORK_HELPER(functionNamespace, framework, L&quot;.dll&quot;)
+#define SOFT_LINK_DEBUG_FRAMEWORK(functionNamespace, framework) SOFT_LINK_FRAMEWORK_HELPER(functionNamespace, framework, L&quot;_debug.dll&quot;)
+
+#ifdef DEBUG_ALL
+#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) SOFT_LINK_DEBUG_FRAMEWORK(functionNamespace, framework)
+#else
+#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) SOFT_LINK_FRAMEWORK(functionNamespace, framework)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#define SOFT_LINK_CONSTANT_HEADER(functionNamespace, framework, variableName, variableType) \
+    namespace functionNamespace { \
+    const variableType get_##framework##_##variableName(); \
+    }
+
+#define SOFT_LINK_CONSTANT_SOURCE(functionNamespace, framework, variableName, variableType) \
+    namespace functionNamespace { \
+    static void init##framework##variableName(void* context) { \
+        variableType* ptr = reinterpret_cast&lt;variableType*&gt;(SOFT_LINK_GETPROCADDRESS(framework##Library(), #variableName)); \
+        ASSERT(ptr); \
+        *static_cast&lt;variableType*&gt;(context) = *ptr; \
+    } \
+    const variableType get_##framework##_##variableName(); \
+    const variableType get_##framework##_##variableName() \
+    { \
+        static variableType constant##framework##variableName; \
+        static dispatch_once_t once; \
+        dispatch_once_f(&amp;once, static_cast&lt;void*&gt;(&amp;constant##framework##variableName), init##framework##variableName); \
+        return constant##framework##variableName; \
+    } \
+    }
+
</ins><span class="cx"> #define SOFT_LINK_FUNCTION_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
</span><span class="cx">     namespace functionNamespace { \
</span><span class="cx">     extern resultType(__cdecl*softLink##framework##functionName) parameterDeclarations; \
</span></span></pre>
</div>
</div>

</body>
</html>