Bug 1065111 - Remove obsolete SetCFDict helpers. r=jya
authorRalph Giles <giles@mozilla.com>
Thu, 27 Nov 2014 13:20:00 -0800
changeset 243932 5c94f77346f3d873aa17b917254be049b571abbe
parent 243916 187125e5da1021293bfa1b8d19022da2d40ff7d0
child 243933 20056b650c74d20ce70817cbdb3722e34470a44e
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1065111
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/media/fmp4/apple/AppleUtils.h
--- a/dom/media/fmp4/apple/AppleUtils.cpp
+++ b/dom/media/fmp4/apple/AppleUtils.cpp
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Utility functions to help with Apple API calls.
 
 #include "AppleUtils.h"
 #include "prlog.h"
-#include "nsAutoPtr.h"
 
 #ifdef PR_LOGGING
 PRLogModuleInfo* GetAppleMediaLog() {
   static PRLogModuleInfo* log = nullptr;
   if (!log) {
     log = PR_NewLogModule("AppleMedia");
   }
   return log;
@@ -21,47 +20,8 @@ PRLogModuleInfo* GetAppleMediaLog() {
 #define WARN(...)
 #endif
 
 #define PROPERTY_ID_FORMAT "%c%c%c%c"
 #define PROPERTY_ID_PRINT(x) ((x) >> 24), \
                              ((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
--- a/dom/media/fmp4/apple/AppleUtils.h
+++ b/dom/media/fmp4/apple/AppleUtils.h
@@ -8,31 +8,16 @@
 #define mozilla_AppleUtils_h
 
 #include <AudioToolbox/AudioToolbox.h>
 #include "mozilla/Attributes.h"
 #include "nsError.h"
 
 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>
 class AutoCFRelease {
 public:
   MOZ_IMPLICIT AutoCFRelease(T aRef)
     : mRef(aRef)
   {