From 091ee0e924874c18d21395bcf3b7bc4583196097 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Thu, 27 Nov 2014 13:20:00 -0800 Subject: [PATCH] Bug 1065111 - Remove obsolete SetCFDict helpers. r=jya We use CFDictionaryCreate with array literals for the keys and values now instead. --- dom/media/fmp4/apple/AppleUtils.cpp | 40 ----------------------------- dom/media/fmp4/apple/AppleUtils.h | 15 ----------- 2 files changed, 55 deletions(-) diff --git a/dom/media/fmp4/apple/AppleUtils.cpp b/dom/media/fmp4/apple/AppleUtils.cpp index dbe3dbeb714..d08c389d69f 100644 --- a/dom/media/fmp4/apple/AppleUtils.cpp +++ b/dom/media/fmp4/apple/AppleUtils.cpp @@ -6,7 +6,6 @@ #include "AppleUtils.h" #include "prlog.h" -#include "nsAutoPtr.h" #ifdef PR_LOGGING PRLogModuleInfo* GetAppleMediaLog() { @@ -26,42 +25,3 @@ PRLogModuleInfo* GetAppleMediaLog() { ((x) >> 16) & 0xff, \ ((x) >> 8) & 0xff, \ (x) & 0xff - -namespace mozilla { - -void -AppleUtils::SetCFDict(CFMutableDictionaryRef dict, - const char* key, - const char* value) -{ - // We avoid using the CFSTR macros because there's no way to release those. - AutoCFRelease keyRef = - CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8); - AutoCFRelease valueRef = - CFStringCreateWithCString(NULL, value, kCFStringEncodingUTF8); - CFDictionarySetValue(dict, keyRef, valueRef); -} - -void -AppleUtils::SetCFDict(CFMutableDictionaryRef dict, - const char* key, - int32_t value) -{ - AutoCFRelease valueRef = - CFNumberCreate(NULL, kCFNumberSInt32Type, &value); - AutoCFRelease keyRef = - CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8); - CFDictionarySetValue(dict, keyRef, valueRef); -} - -void -AppleUtils::SetCFDict(CFMutableDictionaryRef dict, - const char* key, - bool value) -{ - AutoCFRelease keyRef = - CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8); - CFDictionarySetValue(dict, keyRef, value ? kCFBooleanTrue : kCFBooleanFalse); -} - -} // namespace mozilla diff --git a/dom/media/fmp4/apple/AppleUtils.h b/dom/media/fmp4/apple/AppleUtils.h index f8adbd644ae..e841fa35ad2 100644 --- a/dom/media/fmp4/apple/AppleUtils.h +++ b/dom/media/fmp4/apple/AppleUtils.h @@ -13,21 +13,6 @@ namespace mozilla { -struct AppleUtils { - // Helper to set a string, string pair on a CFMutableDictionaryRef. - static void SetCFDict(CFMutableDictionaryRef dict, - const char* key, - const char* value); - // Helper to set a string, int32_t pair on a CFMutableDictionaryRef. - static void SetCFDict(CFMutableDictionaryRef dict, - const char* key, - int32_t value); - // Helper to set a string, bool pair on a CFMutableDictionaryRef. - static void SetCFDict(CFMutableDictionaryRef dict, - const char* key, - bool value); -}; - // Wrapper class to call CFRelease on reference types // when they go out of scope. template