Bug 1317726 - sdp_file_parser should not depend on xpcom glue; r?drno
MozReview-Commit-ID: KDv3RzGurQx
--- a/media/webrtc/signaling/fuzztest/moz.build
+++ b/media/webrtc/signaling/fuzztest/moz.build
@@ -1,32 +1,32 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
-
-if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'uikit':
+if CONFIG['OS_TARGET'] == 'Linux' or CONFIG['OS_TARGET'] == 'Darwin':
DISABLE_STL_WRAPPING = True
+ DEFINES['CPR_STRING_USE_FALLIBLE_MALLOC'] = True
DEFINES['MOZ_NO_MOZALLOC'] = True
if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES['SIP_OS_OSX'] = True
else:
DEFINES['SIP_OS_LINUX'] = True
LOCAL_INCLUDES += [
'../..',
'/media/mtransport',
'/media/webrtc/signaling/src/common/browser_logging',
]
USE_LIBS += [
'/media/webrtc/trunk/testing/gtest_gtest/gtest',
- 'nspr'
+ 'nspr',
]
SOURCES = [
'/media/webrtc/signaling/src/sdp/SdpAttribute.cpp',
'/media/webrtc/signaling/src/sdp/SdpHelper.cpp',
'/media/webrtc/signaling/src/sdp/SdpMediaSection.cpp',
'/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c',
'/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c',
@@ -40,9 +40,9 @@ if CONFIG['OS_TARGET'] != 'WINNT' and CO
'/media/webrtc/signaling/src/sdp/sipcc/sdp_utils.c',
'/media/webrtc/signaling/src/sdp/SipccSdp.cpp',
'/media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp',
'/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.cpp',
'/media/webrtc/signaling/src/sdp/SipccSdpParser.cpp',
'sdp_file_parser.cpp',
]
- GeckoProgram('sdp_file_parser')
+ Program('sdp_file_parser')
--- a/media/webrtc/signaling/fuzztest/sdp_file_parser.cpp
+++ b/media/webrtc/signaling/fuzztest/sdp_file_parser.cpp
@@ -21,16 +21,26 @@ void CSFLog(CSFLogLevel priority, const
va_start(ap, format);
printf("%s\n:", tag);
vprintf(format, ap);
va_end(ap);
}
+extern "C" {
+void NS_DebugBreak(uint32_t aSeverity,
+ const char* aStr, const char* aExpr,
+ const char* aFile, int32_t aLine)
+{
+ fprintf(stderr, "NS_DebugBreak: %u %s %s %s %u", aSeverity, aStr, aExpr,
+ aFile, aLine);
+}
+} // end extern "C".
+
namespace mozilla {
enum class LogLevel {
};
namespace detail {
--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.c
@@ -5,23 +5,29 @@
#include <stdarg.h>
#include "mozilla/Assertions.h"
#include "cpr_types.h"
#include "cpr_string.h"
#include "cpr_strings.h"
/* From cpr_stdlib.h */
+#ifdef CPR_STRING_USE_FALLIBLE_MALLOC
+#define cpr_malloc(a) malloc(a)
+#define cpr_calloc(a, b) calloc(a, b)
+#define cpr_realloc(a, b) realloc(a, b)
+#define cpr_free(a) free(a)
+#else
#include "mozilla/mozalloc.h"
#define cpr_malloc(a) moz_xmalloc(a)
#define cpr_calloc(a, b) moz_xcalloc(a, b)
#define cpr_realloc(a, b) moz_xrealloc(a, b)
#define cpr_free(a) free(a)
-
+#endif
/**
* sstrncpy
*
* This is Cisco's *safe* version of strncpy. The string will always
* be NUL terminated (which is not ANSI compliant).
*
* Parameters: s1 - first string
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -148,17 +148,16 @@ ALLOWED_XPCOM_GLUE = {
('TestTXMgr', 'editor/txmgr/tests'),
('test_IHistory', 'toolkit/components/places/tests/cpp'),
('testcrasher', 'toolkit/crashreporter/test'),
('TestStartupCache', 'startupcache/test'),
('jsep_session_unittest', 'media/webrtc/signaling/test'),
('jsep_track_unittest', 'media/webrtc/signaling/test'),
('mediaconduit_unittests', 'media/webrtc/signaling/test'),
('mediapipeline_unittest', 'media/webrtc/signaling/test'),
- ('sdp_file_parser', 'media/webrtc/signaling/fuzztest'),
('sdp_unittests', 'media/webrtc/signaling/test'),
('signaling_unittests', 'media/webrtc/signaling/test'),
('TestMailCookie', 'mailnews/base/test'),
}
class TreeMetadataEmitter(LoggingMixin):
"""Converts the executed mozbuild files into data structures.