Bug 1065111 - Remove obsolete SetCFDict helpers. r=jya

We use CFDictionaryCreate with array literals for the keys and values
now instead.
This commit is contained in:
Ralph Giles 2014-11-27 13:20:00 -08:00
parent a60e22203d
commit 091ee0e924
2 changed files with 0 additions and 55 deletions

View File

@ -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<CFStringRef> keyRef =
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
AutoCFRelease<CFStringRef> valueRef =
CFStringCreateWithCString(NULL, value, kCFStringEncodingUTF8);
CFDictionarySetValue(dict, keyRef, valueRef);
}
void
AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
const char* key,
int32_t value)
{
AutoCFRelease<CFNumberRef> valueRef =
CFNumberCreate(NULL, kCFNumberSInt32Type, &value);
AutoCFRelease<CFStringRef> keyRef =
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
CFDictionarySetValue(dict, keyRef, valueRef);
}
void
AppleUtils::SetCFDict(CFMutableDictionaryRef dict,
const char* key,
bool value)
{
AutoCFRelease<CFStringRef> keyRef =
CFStringCreateWithCString(NULL, key, kCFStringEncodingUTF8);
CFDictionarySetValue(dict, keyRef, value ? kCFBooleanTrue : kCFBooleanFalse);
}
} // namespace mozilla

View File

@ -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 <class T>