Title: [186646] trunk/Source/WebCore
- Revision
- 186646
- Author
- bfulg...@apple.com
- Date
- 2015-07-09 16:27:24 -0700 (Thu, 09 Jul 2015)
Log Message
[Mac, iOS] The mimeTypeCache should return a reference
https://bugs.webkit.org/show_bug.cgi?id=146809
Reviewed by Eric Carlson.
No new tests: No change in functionality.
Don't copy the mime type cache every time someone asks it a question. Return
by reference instead.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::mimeTypeCache):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::mimeTypeCache):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::mimeTypeCache):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (186645 => 186646)
--- trunk/Source/WebCore/ChangeLog 2015-07-09 23:21:11 UTC (rev 186645)
+++ trunk/Source/WebCore/ChangeLog 2015-07-09 23:27:24 UTC (rev 186646)
@@ -1,3 +1,22 @@
+2015-07-09 Brent Fulgham <bfulg...@apple.com>
+
+ [Mac, iOS] The mimeTypeCache should return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=146809
+
+ Reviewed by Eric Carlson.
+
+ No new tests: No change in functionality.
+
+ Don't copy the mime type cache every time someone asks it a question. Return
+ by reference instead.
+
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::mimeTypeCache):
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+ (WebCore::mimeTypeCache):
+ * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+ (WebCore::mimeTypeCache):
+
2015-07-09 Wenson Hsieh <whs...@berkeley.edu>
Rubber banding is broken when using a Mighty Mouse
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (186645 => 186646)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2015-07-09 23:21:11 UTC (rev 186645)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2015-07-09 23:27:24 UTC (rev 186646)
@@ -871,9 +871,9 @@
m_videoFrameHasDrawn = true;
}
-static HashSet<String> mimeTypeCache()
+static const HashSet<String>& mimeTypeCache()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(HashSet<String>, cache, ());
+ static NeverDestroyed<HashSet<String>> cache;
static bool typeListInitialized = false;
if (typeListInitialized)
@@ -888,7 +888,7 @@
CFIndex typeCount = CFArrayGetCount(supportedTypes.get());
for (CFIndex i = 0; i < typeCount; i++)
- cache.add(static_cast<CFStringRef>(CFArrayGetValueAtIndex(supportedTypes.get(), i)));
+ cache.get().add(static_cast<CFStringRef>(CFArrayGetValueAtIndex(supportedTypes.get(), i)));
return cache;
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (186645 => 186646)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2015-07-09 23:21:11 UTC (rev 186645)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm 2015-07-09 23:27:24 UTC (rev 186646)
@@ -210,9 +210,9 @@
&& class_getInstanceMethod(getAVSampleBufferAudioRendererClass(), @selector(setMuted:));
}
-static HashSet<String> mimeTypeCache()
+static const HashSet<String>& mimeTypeCache()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(HashSet<String>, cache, ());
+ static NeverDestroyed<HashSet<String>> cache;
static bool typeListInitialized = false;
if (typeListInitialized)
@@ -221,7 +221,7 @@
NSArray *types = [getAVURLAssetClass() audiovisualMIMETypes];
for (NSString *mimeType in types)
- cache.add(mimeType);
+ cache.get().add(mimeType);
return cache;
}
Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (186645 => 186646)
--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp 2015-07-09 23:21:11 UTC (rev 186645)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp 2015-07-09 23:27:24 UTC (rev 186646)
@@ -33,6 +33,7 @@
#include "MediaSourcePrivateClient.h"
#include "MockMediaSourcePrivate.h"
#include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -44,15 +45,15 @@
supportsType, 0, 0, 0, 0);
}
-static HashSet<String> mimeTypeCache()
+static const HashSet<String>& mimeTypeCache()
{
- DEPRECATED_DEFINE_STATIC_LOCAL(HashSet<String>, cache, ());
+ static NeverDestroyed<HashSet<String>> cache;
static bool isInitialized = false;
if (!isInitialized) {
isInitialized = true;
- cache.add(ASCIILiteral("video/mock"));
- cache.add(ASCIILiteral("audio/mock"));
+ cache.get().add(ASCIILiteral("video/mock"));
+ cache.get().add(ASCIILiteral("audio/mock"));
}
return cache;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes