Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Csoregi Natalia 2018-02-24 13:03:09 +02:00
Родитель 4bc9f77582 ecb86060b4
Коммит c9df10baff
220 изменённых файлов: 9554 добавлений и 18025 удалений

Просмотреть файл

@ -628,6 +628,12 @@ MarkupView.prototype = {
"node-inserted"
];
// If the user performed an action with a keyboard, move keyboard focus to
// the markup tree container.
if (reason && reason.endsWith("-keyboard")) {
this.getContainer(this._rootNode).elt.focus();
}
if (reasonsToNavigate.includes(reason)) {
this.getContainer(this._rootNode).elt.focus();
this.navigate(this.getContainer(nodeFront));

Просмотреть файл

@ -80,6 +80,7 @@ support-files =
skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
[browser_markup_accessibility_navigation.js]
skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
[browser_markup_accessibility_new_selection.js]
[browser_markup_accessibility_navigation_after_edit.js]
skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keyboard Access setting is set to All Control in System Keyboard Preferences
[browser_markup_accessibility_semantics.js]

Просмотреть файл

@ -0,0 +1,26 @@
/* 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/. */
"use strict";
// Test inspector markup view handling new node selection that is triggered by
// the user keyboard action. In this case markup tree container must receive
// keyboard focus so that further interactions continue within the markup tree.
add_task(function* () {
let { inspector } = yield openInspectorForURL(
"data:text/html;charset=utf-8,<h1>foo</h1><span>bar</span>");
let markup = inspector.markup;
let doc = markup.doc;
let rootContainer = markup.getContainer(markup._rootNode);
is(doc.activeElement, doc.body, "Keyboard focus by default is on document body");
yield selectNode("span", inspector, "test");
is(doc.activeElement, doc.body, "Keyboard focus remains on document body.");
yield selectNode("h1", inspector, "test-keyboard");
is(doc.activeElement, rootContainer.elt,
"Keyboard focus must be on the markup tree conainer.");
});

Просмотреть файл

@ -26,41 +26,6 @@
#include "nsIFile.h"
#include "nsUnicharUtils.h"
#include <shlwapi.h>
#define SHOCKWAVE_BASE_FILENAME L"np32dsw"
/**
* Determines whether or not SetDllDirectory should be called for this plugin.
*
* @param pluginFilePath The full path of the plugin file
* @return true if SetDllDirectory can be called for the plugin
*/
bool
ShouldProtectPluginCurrentDirectory(char16ptr_t pluginFilePath)
{
LPCWSTR passedInFilename = PathFindFileName(pluginFilePath);
if (!passedInFilename) {
return true;
}
// Somewhere in the middle of 11.6 version of Shockwave, naming of the DLL
// after its version number is introduced.
if (!wcsicmp(passedInFilename, SHOCKWAVE_BASE_FILENAME L".dll")) {
return false;
}
// Shockwave versions before 1202122 will break if you call SetDllDirectory
const uint64_t kFixedShockwaveVersion = 1202122;
uint64_t version;
int found = swscanf(passedInFilename, SHOCKWAVE_BASE_FILENAME L"_%llu.dll",
&version);
if (found && version < kFixedShockwaveVersion) {
return false;
}
// We always want to call SetDllDirectory otherwise
return true;
}
using namespace mozilla;
/* Local helper functions */
@ -283,12 +248,8 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
if (!mPlugin)
return NS_ERROR_NULL_POINTER;
bool protectCurrentDirectory = true;
nsAutoString pluginFilePath;
mPlugin->GetPath(pluginFilePath);
protectCurrentDirectory =
ShouldProtectPluginCurrentDirectory(pluginFilePath.BeginReading());
nsAutoString pluginFolderPath = pluginFilePath;
int32_t idx = pluginFilePath.RFindChar('\\');
@ -304,17 +265,14 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
NS_ASSERTION(restoreOrigDir, "Error in Loading plugin");
}
if (protectCurrentDirectory) {
SetDllDirectory(nullptr);
}
// Temporarily add the current directory back to the DLL load path.
SetDllDirectory(nullptr);
nsresult rv = mPlugin->Load(outLibrary);
if (NS_FAILED(rv))
*outLibrary = nullptr;
if (protectCurrentDirectory) {
SetDllDirectory(L"");
}
SetDllDirectory(L"");
if (restoreOrigDir) {
DebugOnly<BOOL> bCheck = SetCurrentDirectoryW(aOrigDir);

Просмотреть файл

@ -23,7 +23,6 @@ extern "C" CGError CGSSetDebugOptions(int options);
#endif
#ifdef XP_WIN
bool ShouldProtectPluginCurrentDirectory(char16ptr_t pluginFilePath);
#if defined(MOZ_SANDBOX)
#include "mozilla/sandboxTarget.h"
#endif
@ -32,14 +31,12 @@ bool ShouldProtectPluginCurrentDirectory(char16ptr_t pluginFilePath);
using mozilla::ipc::IOThreadChild;
#ifdef OS_WIN
#include "nsSetDllDirectory.h"
#include <algorithm>
#endif
namespace mozilla {
namespace plugins {
bool
PluginProcessChild::Init(int aArgc, char* aArgv[])
{
@ -111,20 +108,15 @@ PluginProcessChild::Init(int aArgc, char* aArgv[])
CommandLine::ForCurrentProcess()->GetLooseValues();
MOZ_ASSERT(values.size() >= 1, "not enough loose args");
if (ShouldProtectPluginCurrentDirectory(values[0].c_str())) {
SanitizeEnvironmentVariables();
SetDllDirectory(L"");
}
pluginFilename = WideToUTF8(values[0]);
// We don't initialize XPCOM but we need the thread manager and the
// logging framework for the FunctionBroker.
NS_SetMainThread();
mozilla::TimeStamp::Startup();
NS_LogInit();
NS_SetMainThread();
mozilla::TimeStamp::Startup();
NS_LogInit();
mozilla::LogModule::Init();
nsThreadManager::get().Init();
nsThreadManager::get().Init();
#if defined(MOZ_SANDBOX)
// This is probably the earliest we would want to start the sandbox.
@ -162,14 +154,14 @@ void
PluginProcessChild::CleanUp()
{
#if defined(OS_WIN)
MOZ_ASSERT(NS_IsMainThread());
// Shutdown components we started in Init. Note that KillClearOnShutdown
// is an event that is regularly part of XPCOM shutdown. We do not
// call XPCOM's shutdown but we need this event to be sent to avoid
// leaking objects labeled as ClearOnShutdown.
nsThreadManager::get().Shutdown();
mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownFinal);
MOZ_ASSERT(NS_IsMainThread());
// Shutdown components we started in Init. Note that KillClearOnShutdown
// is an event that is regularly part of XPCOM shutdown. We do not
// call XPCOM's shutdown but we need this event to be sent to avoid
// leaking objects labeled as ClearOnShutdown.
nsThreadManager::get().Shutdown();
mozilla::KillClearOnShutdown(ShutdownPhase::ShutdownFinal);
NS_LogTerm();
#endif

Просмотреть файл

@ -298,7 +298,7 @@ nsXBLDocumentInfo::WritePrototypeBindings()
rv = NewBufferFromStorageStream(storageStream, &buf, &len);
NS_ENSURE_SUCCESS(rv, rv);
return startupCache->PutBuffer(spec.get(), buf.get(), len);
return startupCache->PutBuffer(spec.get(), Move(buf), len);
}
void

Просмотреть файл

@ -446,7 +446,7 @@ nsXULPrototypeCache::FinishOutputStream(nsIURI* uri)
rv = PathifyURI(uri, spec);
if (NS_FAILED(rv))
return NS_ERROR_NOT_AVAILABLE;
rv = sc->PutBuffer(spec.get(), buf.get(), len);
rv = sc->PutBuffer(spec.get(), Move(buf), len);
if (NS_SUCCEEDED(rv)) {
mOutputStreamTable.Remove(uri);
mStartupCacheURITable.PutEntry(uri);
@ -591,7 +591,7 @@ nsXULPrototypeCache::BeginCaching(nsIURI* aURI)
buf = MakeUnique<char[]>(len);
rv = inputStream->Read(buf.get(), len, &amtRead);
if (NS_SUCCEEDED(rv) && len == amtRead)
rv = startupCache->PutBuffer(kXULCacheInfoKey, buf.get(), len);
rv = startupCache->PutBuffer(kXULCacheInfoKey, Move(buf), len);
else {
rv = NS_ERROR_UNEXPECTED;
}

Просмотреть файл

@ -199,6 +199,7 @@ nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
tmp = aStream->Read32(&type);
if (NS_FAILED(tmp)) {
rv = tmp;
break;
}
if ((nsXULPrototypeNode::Type)type == nsXULPrototypeNode::eType_PI) {

Просмотреть файл

@ -59,7 +59,8 @@ WebRenderCommandBuilder::BuildWebRenderCommands(wr::DisplayListBuilder& aBuilder
nsDisplayList* aDisplayList,
nsDisplayListBuilder* aDisplayListBuilder,
WebRenderScrollData& aScrollData,
wr::LayoutSize& aContentSize)
wr::LayoutSize& aContentSize,
const nsTArray<wr::WrFilterOp>& aFilters)
{
{ // scoping for StackingContextHelper RAII
@ -72,7 +73,7 @@ WebRenderCommandBuilder::BuildWebRenderCommands(wr::DisplayListBuilder& aBuilder
mScrollingHelper.BeginBuild(mManager, aBuilder);
{
StackingContextHelper pageRootSc(sc, aBuilder);
StackingContextHelper pageRootSc(sc, aBuilder, aFilters);
CreateWebRenderCommandsFromDisplayList(aDisplayList, aDisplayListBuilder,
pageRootSc, aBuilder, aResourceUpdates);
}

Просмотреть файл

@ -51,7 +51,8 @@ public:
nsDisplayList* aDisplayList,
nsDisplayListBuilder* aDisplayListBuilder,
WebRenderScrollData& aScrollData,
wr::LayoutSize& aContentSize);
wr::LayoutSize& aContentSize,
const nsTArray<wr::WrFilterOp>& aFilters);
Maybe<wr::ImageKey> CreateImageKey(nsDisplayItem* aItem,
ImageContainer* aContainer,

Просмотреть файл

@ -249,7 +249,8 @@ WebRenderLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
void
WebRenderLayerManager::EndTransactionWithoutLayer(nsDisplayList* aDisplayList,
nsDisplayListBuilder* aDisplayListBuilder)
nsDisplayListBuilder* aDisplayListBuilder,
const nsTArray<wr::WrFilterOp>& aFilters)
{
MOZ_ASSERT(aDisplayList && aDisplayListBuilder);
WrBridge()->RemoveExpiredFontKeys();
@ -282,7 +283,8 @@ WebRenderLayerManager::EndTransactionWithoutLayer(nsDisplayList* aDisplayList,
aDisplayList,
aDisplayListBuilder,
mScrollData,
contentSize);
contentSize,
aFilters);
mWidget->AddWindowOverlayWebRenderCommands(WrBridge(), builder, resourceUpdates);
mWindowOverlayChanged = false;

Просмотреть файл

@ -69,7 +69,8 @@ public:
virtual bool BeginTransaction() override;
virtual bool EndEmptyTransaction(EndTransactionFlags aFlags = END_DEFAULT) override;
void EndTransactionWithoutLayer(nsDisplayList* aDisplayList,
nsDisplayListBuilder* aDisplayListBuilder);
nsDisplayListBuilder* aDisplayListBuilder,
const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>());
virtual void EndTransaction(DrawPaintedLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags = END_DEFAULT) override;

Просмотреть файл

@ -13,6 +13,7 @@
#include "mozilla/UniquePtr.h"
#include "mozilla/UniquePtrExtensions.h"
#include "nsIInputStream.h"
#include "nsReadableUtils.h"
#include "nsXULAppAPI.h"
#include <dirent.h>
@ -726,7 +727,9 @@ public:
buf.AppendInt(entry->mFilesize);
buf.Append(';');
}
mCache->PutBuffer(CACHE_KEY, buf.get(), buf.Length() + 1);
mCache->PutBuffer(CACHE_KEY,
UniquePtr<char[]>(ToNewCString(buf)), buf.Length() + 1);
}
// This may be called more than once (if we re-load the font list).
@ -1568,8 +1571,12 @@ gfxFT2FontList::WillShutdown()
mozilla::scache::StartupCache* cache =
mozilla::scache::StartupCache::GetSingleton();
if (cache && mJarModifiedTime > 0) {
const size_t bufSize = sizeof(mJarModifiedTime);
auto buf = MakeUnique<char[]>(bufSize);
memcpy(buf.get(), &mJarModifiedTime, bufSize);
cache->PutBuffer(JAR_LAST_MODIFED_TIME,
(char*)&mJarModifiedTime, sizeof(mJarModifiedTime));
Move(buf), bufSize);
}
mFontNameCache = nullptr;
}

Просмотреть файл

@ -370,6 +370,7 @@ pub enum WrFilterOpType {
Saturate = 7,
Sepia = 8,
DropShadow = 9,
ColorMatrix = 10,
}
#[repr(C)]
@ -379,6 +380,7 @@ pub struct WrFilterOp {
argument: c_float, // holds radius for DropShadow; value for other filters
offset: LayoutVector2D, // only used for DropShadow
color: ColorF, // only used for DropShadow
matrix: [f32;20], // only used in ColorMatrix
}
/// cbindgen:derive-eq=false
@ -1424,6 +1426,7 @@ pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
WrFilterOpType::DropShadow => FilterOp::DropShadow(c_filter.offset,
c_filter.argument,
c_filter.color),
WrFilterOpType::ColorMatrix => FilterOp::ColorMatrix(c_filter.matrix),
}
}).collect();

Просмотреть файл

@ -2,7 +2,7 @@
* 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/. */
/* Generated with cbindgen:0.4.4 */
/* Generated with cbindgen:0.5.0 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file:
@ -223,6 +223,7 @@ enum class WrFilterOpType : uint32_t {
Saturate = 7,
Sepia = 8,
DropShadow = 9,
ColorMatrix = 10,
Sentinel /* this must be last for serialization purposes. */
};
@ -676,13 +677,7 @@ struct WrFilterOp {
float argument;
LayoutVector2D offset;
ColorF color;
bool operator==(const WrFilterOp& aOther) const {
return filter_type == aOther.filter_type &&
argument == aOther.argument &&
offset == aOther.offset &&
color == aOther.color;
}
float matrix[20];
};
struct FontInstanceKey {

Просмотреть файл

@ -11,10 +11,7 @@
#ifdef XP_WIN
#include <windows.h>
// we want a wmain entry point
// but we don't want its DLL load protection, because we'll handle it here
#define XRE_DONT_PROTECT_DLL_LOAD
#include "nsWindowsWMain.cpp"
#include "nsSetDllDirectory.h"
#else
// FIXME/cjones testing
#include <unistd.h>
@ -50,16 +47,6 @@ content_process_main(mozilla::Bootstrap* bootstrap, int argc, char* argv[])
bootstrap->XRE_SetProcessType(argv[--argc]);
#ifdef XP_WIN
// For plugins, this is done in PluginProcessChild::Init, as we need to
// avoid it for unsupported plugins. See PluginProcessChild::Init for
// the details.
if (bootstrap->XRE_GetProcessType() != GeckoProcessType_Plugin) {
mozilla::SanitizeEnvironmentVariables();
SetDllDirectoryW(L"");
}
#endif
nsresult rv = bootstrap->XRE_InitChildProcess(argc, argv, &childData);
return NS_FAILED(rv);
}

Просмотреть файл

@ -27,6 +27,7 @@
#include "irregexp/RegExpEngine.h"
#include "irregexp/RegExpParser.h"
#endif
#include "jit/BaselineJIT.h"
#include "jit/InlinableNatives.h"
#include "js/Debug.h"
#include "js/HashTable.h"
@ -37,6 +38,8 @@
#include "js/UniquePtr.h"
#include "js/Vector.h"
#include "js/Wrapper.h"
#include "vm/AsyncFunction.h"
#include "vm/AsyncIteration.h"
#include "vm/Debugger.h"
#include "vm/GlobalObject.h"
#include "vm/Interpreter.h"
@ -278,6 +281,17 @@ GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp)
return true;
}
static bool
ReturnStringCopy(JSContext* cx, CallArgs& args, const char* message)
{
JSString* str = JS_NewStringCopyZ(cx, message);
if (!str)
return false;
args.rval().setString(str);
return true;
}
static bool
GC(JSContext* cx, unsigned argc, Value* vp)
{
@ -327,11 +341,7 @@ GC(JSContext* cx, unsigned argc, Value* vp)
SprintfLiteral(buf, "before %zu, after %zu\n",
preBytes, cx->runtime()->gc.usage.gcBytes());
#endif
JSString* str = JS_NewStringCopyZ(cx, buf);
if (!str)
return false;
args.rval().setString(str);
return true;
return ReturnStringCopy(cx, args, buf);
}
static bool
@ -986,11 +996,7 @@ GCState(JSContext* cx, unsigned argc, Value* vp)
}
const char* state = StateName(cx->runtime()->gc.state());
JSString* str = JS_NewStringCopyZ(cx, state);
if (!str)
return false;
args.rval().setString(str);
return true;
return ReturnStringCopy(cx, args, state);
}
static bool
@ -2507,24 +2513,12 @@ testingFunc_inJit(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (!jit::IsBaselineEnabled(cx)) {
JSString* error = JS_NewStringCopyZ(cx, "Baseline is disabled.");
if(!error)
return false;
args.rval().setString(error);
return true;
}
if (!jit::IsBaselineEnabled(cx))
return ReturnStringCopy(cx, args, "Baseline is disabled.");
JSScript* script = cx->currentScript();
if (script && script->getWarmUpResetCount() >= 20) {
JSString* error = JS_NewStringCopyZ(cx, "Compilation is being repeatedly prevented. Giving up.");
if (!error)
return false;
args.rval().setString(error);
return true;
}
if (script && script->getWarmUpResetCount() >= 20)
return ReturnStringCopy(cx, args, "Compilation is being repeatedly prevented. Giving up.");
args.rval().setBoolean(cx->currentlyRunningInJit());
return true;
@ -2535,14 +2529,8 @@ testingFunc_inIon(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (!jit::IsIonEnabled(cx)) {
JSString* error = JS_NewStringCopyZ(cx, "Ion is disabled.");
if (!error)
return false;
args.rval().setString(error);
return true;
}
if (!jit::IsIonEnabled(cx))
return ReturnStringCopy(cx, args, "Ion is disabled.");
if (cx->activation()->hasWasmExitFP()) {
// Exited through wasm. Note this is false when the fast wasm->jit exit
@ -2560,14 +2548,8 @@ testingFunc_inIon(JSContext* cx, unsigned argc, Value* vp)
} else {
// Check if we missed multiple attempts at compiling the innermost script.
JSScript* script = cx->currentScript();
if (script && script->getWarmUpResetCount() >= 20) {
JSString* error = JS_NewStringCopyZ(cx, "Compilation is being repeatedly prevented. Giving up.");
if (!error)
return false;
args.rval().setString(error);
return true;
}
if (script && script->getWarmUpResetCount() >= 20)
return ReturnStringCopy(cx, args, "Compilation is being repeatedly prevented. Giving up.");
}
args.rval().setBoolean(!iter.done() && iter.isIon());
@ -3229,19 +3211,14 @@ ObjectAddress(JSContext* cx, unsigned argc, Value* vp)
#ifdef JS_MORE_DETERMINISTIC
args.rval().setInt32(0);
return true;
#else
void* ptr = js::UncheckedUnwrap(&args[0].toObject(), true);
char buffer[64];
SprintfLiteral(buffer, "%p", ptr);
JSString* str = JS_NewStringCopyZ(cx, buffer);
if (!str)
return false;
args.rval().setString(str);
return ReturnStringCopy(cx, args, buffer);
#endif
return true;
}
static bool
@ -3334,12 +3311,7 @@ GetBacktrace(JSContext* cx, unsigned argc, Value* vp)
if (!buf)
return false;
RootedString str(cx);
if (!(str = JS_NewStringCopyZ(cx, buf.get())))
return false;
args.rval().setString(str);
return true;
return ReturnStringCopy(cx, args, buf.get());
}
static bool
@ -4829,13 +4801,8 @@ GetTimeZone(JSContext* cx, unsigned argc, Value* vp)
std::time_t now = std::time(nullptr);
if (now != static_cast<std::time_t>(-1)) {
if (const char* tz = getTimeZone(&now)) {
JSString* str = JS_NewStringCopyZ(cx, tz);
if (!str)
return false;
args.rval().setString(str);
return true;
}
if (const char* tz = getTimeZone(&now))
return ReturnStringCopy(cx, args, tz);
}
args.rval().setUndefined();
@ -4993,6 +4960,129 @@ DisableExpressionClosures(JSContext* cx, unsigned argc, Value* vp)
return true;
}
JSScript*
js::TestingFunctionArgumentToScript(JSContext* cx,
HandleValue v,
JSFunction** funp /* = nullptr */)
{
if (v.isString()) {
// To convert a string to a script, compile it. Parse it as an ES6 Program.
RootedLinearString linearStr(cx, StringToLinearString(cx, v.toString()));
if (!linearStr)
return nullptr;
size_t len = GetLinearStringLength(linearStr);
AutoStableStringChars linearChars(cx);
if (!linearChars.initTwoByte(cx, linearStr))
return nullptr;
const char16_t* chars = linearChars.twoByteRange().begin().get();
RootedScript script(cx);
CompileOptions options(cx);
if (!JS::Compile(cx, options, chars, len, &script))
return nullptr;
return script;
}
RootedFunction fun(cx, JS_ValueToFunction(cx, v));
if (!fun)
return nullptr;
// Unwrap bound functions.
while (fun->isBoundFunction()) {
JSObject* target = fun->getBoundFunctionTarget();
if (target && target->is<JSFunction>())
fun = &target->as<JSFunction>();
else
break;
}
// Get unwrapped async function.
if (IsWrappedAsyncFunction(fun))
fun = GetUnwrappedAsyncFunction(fun);
if (IsWrappedAsyncGenerator(fun))
fun = GetUnwrappedAsyncGenerator(fun);
if (!fun->isInterpreted()) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_TESTING_SCRIPTS_ONLY);
return nullptr;
}
JSScript* script = JSFunction::getOrCreateScript(cx, fun);
if (!script)
return nullptr;
if (funp)
*funp = fun;
return script;
}
static bool
BaselineCompile(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RootedObject callee(cx, &args.callee());
RootedScript script(cx);
if (args.length() == 0) {
NonBuiltinScriptFrameIter iter(cx);
if (iter.done()) {
ReportUsageErrorASCII(cx, callee, "no script argument and no script caller");
return false;
}
script = iter.script();
} else {
script = TestingFunctionArgumentToScript(cx, args[0]);
if (!script)
return false;
}
bool forceDebug = false;
if (args.length() > 1) {
if (args.length() > 2) {
ReportUsageErrorASCII(cx, callee, "too many arguments");
return false;
}
if (!args[1].isBoolean() && !args[1].isUndefined()) {
ReportUsageErrorASCII(cx, callee, "forceDebugInstrumentation argument should be boolean");
return false;
}
forceDebug = ToBoolean(args[1]);
}
if (script->hasBaselineScript()) {
if (forceDebug && !script->baselineScript()->hasDebugInstrumentation()) {
// There isn't an easy way to do this for a script that might be on
// stack right now. See js::jit::RecompileOnStackBaselineScriptsForDebugMode.
ReportUsageErrorASCII(cx, callee,
"unsupported case: recompiling script for debug mode");
return false;
}
args.rval().setUndefined();
return true;
}
if (!jit::IsBaselineEnabled(cx))
return ReturnStringCopy(cx, args, "baseline disabled");
if (!script->canBaselineCompile())
return ReturnStringCopy(cx, args, "can't compile");
jit::MethodStatus status = jit::BaselineCompile(cx, script, forceDebug);
switch (status) {
case jit::Method_Error:
return false;
case jit::Method_CantCompile:
return ReturnStringCopy(cx, args, "can't compile");
case jit::Method_Skipped:
return ReturnStringCopy(cx, args, "skipped");
case jit::Method_Compiled:
args.rval().setUndefined();
}
return true;
}
static const JSFunctionSpecWithHelp TestingFunctions[] = {
JS_FN_HELP("gc", ::GC, 0, 0,
"gc([obj] | 'zone' [, 'shrinking'])",
@ -5622,6 +5712,15 @@ gc::ZealModeHelpText),
"disableExpressionClosures()",
" Disables the deprecated, non-standard expression closures.\n"),
JS_FN_HELP("baselineCompile", BaselineCompile, 2, 0,
"baselineCompile([fun/code], forceDebugInstrumentation=false)",
" Baseline-compiles the given JS function or script.\n"
" Without arguments, baseline-compiles the caller's script; but note\n"
" that extra boilerplate is needed afterwards to cause the VM to start\n"
" running the jitcode rather than staying in the interpreter:\n"
" baselineCompile(); for (var i=0; i<1; i++) {} ...\n"
" The interpreter will enter the new jitcode at the loop header.\n"),
JS_FS_HELP_END
};

Просмотреть файл

@ -20,6 +20,9 @@ testingFunc_assertFloat32(JSContext* cx, unsigned argc, Value* vp);
MOZ_MUST_USE bool
testingFunc_assertRecoveredOnBailout(JSContext* cx, unsigned argc, Value* vp);
extern JSScript*
TestingFunctionArgumentToScript(JSContext* cx, HandleValue v, JSFunction** funp = nullptr);
} /* namespace js */
#endif /* builtin_TestingFunctions_h */

Просмотреть файл

@ -182,7 +182,11 @@ js::AllocateString(JSContext* cx, InitialHeap heap)
if (!rt->gc.checkAllocatorState<allowGC>(cx, kind))
return nullptr;
if (cx->nursery().isEnabled() && heap != TenuredHeap && cx->nursery().canAllocateStrings()) {
if (cx->nursery().isEnabled() &&
heap != TenuredHeap &&
cx->nursery().canAllocateStrings() &&
cx->zone()->allocNurseryStrings)
{
auto str = static_cast<StringAllocT*>(rt->gc.tryNewNurseryString<allowGC>(cx, size, kind));
if (str)
return str;

Просмотреть файл

@ -123,7 +123,7 @@ js::Nursery::Nursery(JSRuntime* rt)
, previousPromotionRate_(0)
, profileThreshold_(0)
, enableProfiling_(false)
, canAllocateStrings_(false)
, canAllocateStrings_(true)
, reportTenurings_(0)
, minorGCTriggerReason_(JS::gcreason::NO_REASON)
, minorGcCount_(0)
@ -132,9 +132,9 @@ js::Nursery::Nursery(JSRuntime* rt)
, lastCanary_(nullptr)
#endif
{
const char* env = getenv("MOZ_ENABLE_NURSERY_STRINGS");
const char* env = getenv("MOZ_DISABLE_NURSERY_STRINGS");
if (env && *env)
canAllocateStrings_ = true;
canAllocateStrings_ = false;
}
bool
@ -738,21 +738,40 @@ js::Nursery::collect(JS::gcreason::Reason reason)
bool validPromotionRate;
const float promotionRate = calcPromotionRate(&validPromotionRate);
uint32_t pretenureCount = 0;
if (validPromotionRate) {
if (promotionRate > 0.8 || IsFullStoreBufferReason(reason)) {
JSContext* cx = TlsContext.get();
for (auto& entry : tenureCounts.entries) {
if (entry.count >= 3000) {
ObjectGroup* group = entry.group;
if (group->canPreTenure() && group->zone()->group()->canEnterWithoutYielding(cx)) {
AutoCompartment ac(cx, group);
group->setShouldPreTenure(cx);
pretenureCount++;
}
bool shouldPretenure = (validPromotionRate && promotionRate > 0.6) ||
IsFullStoreBufferReason(reason);
if (shouldPretenure) {
JSContext* cx = TlsContext.get();
for (auto& entry : tenureCounts.entries) {
if (entry.count >= 3000) {
ObjectGroup* group = entry.group;
if (group->canPreTenure() && group->zone()->group()->canEnterWithoutYielding(cx)) {
AutoCompartment ac(cx, group);
group->setShouldPreTenure(cx);
pretenureCount++;
}
}
}
}
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
if (shouldPretenure && zone->allocNurseryStrings && zone->tenuredStrings >= 30 * 1000) {
JSRuntime::AutoProhibitActiveContextChange apacc(rt);
CancelOffThreadIonCompile(zone);
bool preserving = zone->isPreservingCode();
zone->setPreservingCode(false);
zone->discardJitCode(rt->defaultFreeOp());
zone->setPreservingCode(preserving);
for (CompartmentsInZoneIter c(zone); !c.done(); c.next()) {
if (jit::JitCompartment* jitComp = c->jitCompartment()) {
jitComp->discardStubs();
jitComp->stringsCanBeInNursery = false;
}
}
zone->allocNurseryStrings = false;
}
zone->tenuredStrings = 0;
}
endProfile(ProfileKey::Pretenure);
// We ignore gcMaxBytes when allocating for minor collection. However, if we
@ -1086,7 +1105,7 @@ js::Nursery::setStartPosition()
void
js::Nursery::maybeResizeNursery(JS::gcreason::Reason reason)
{
static const double GrowThreshold = 0.05;
static const double GrowThreshold = 0.03;
static const double ShrinkThreshold = 0.01;
unsigned newMaxNurseryChunks;

Просмотреть файл

@ -46,6 +46,8 @@ JS::Zone::Zone(JSRuntime* rt, ZoneGroup* group)
usage(&rt->gc.usage),
threshold(),
gcDelayBytes(0),
tenuredStrings(group, 0),
allocNurseryStrings(group, true),
propertyTree_(group, this),
baseShapes_(group, this),
initialShapes_(group, this),

Просмотреть файл

@ -482,6 +482,9 @@ struct Zone : public JS::shadow::Zone,
// the current GC.
js::UnprotectedData<size_t> gcDelayBytes;
js::ZoneGroupData<uint32_t> tenuredStrings;
js::ZoneGroupData<bool> allocNurseryStrings;
private:
// Shared Shape property tree.
js::ZoneGroupData<js::PropertyTree> propertyTree_;

Просмотреть файл

@ -13,8 +13,10 @@ function f() {
{
for (var len of [ 3, 30, 300, 3000, 30000 ]) {
var arr = new ctor(len);
for (var i = 0; i < arr.length; i++)
assertEq(arr[i], 0, "index " + i + " of " + ctor.name + " len " + len);
for (var i = 0; i < arr.length; i++) {
if (arr[i] != 0)
assertEq(arr[i], 0, "index " + i + " of " + ctor.name + " len " + len);
}
}
}
}

Просмотреть файл

@ -0,0 +1,20 @@
// Check that the help text for baselineCompile() is accurate.
if (typeof inJit == "function" && typeof baselineCompile == "function") {
if (!inJit()) {
baselineCompile(); // compile the current script
assertEq(inJit(), false,
"We have compiled this script to baseline jitcode, but shouldn't " +
"be running it yet, according to the help text for baselineCompile() " +
"in TestingFunctions.cpp. If you fail this assertion, nice work, and " +
"please update the help text!");
for (var i=0; i<1; i++) {} // exact boilerplate suggested by the help text
assertEq(inJit(), true,
"help text in TestingFunctions.cpp claims the above loop causes " +
"the interpreter to start running the new baseline jitcode");
}
}

Просмотреть файл

@ -205,7 +205,9 @@ CompileZone::addressOfStringNurseryCurrentEnd()
bool
CompileZone::canNurseryAllocateStrings()
{
return nurseryExists() && zone()->group()->nursery().canAllocateStrings();
return nurseryExists() &&
zone()->group()->nursery().canAllocateStrings() &&
zone()->allocNurseryStrings;
}
bool

Просмотреть файл

@ -610,6 +610,13 @@ class JitCompartment
return stringConcatStub_;
}
void discardStubs() {
stringConcatStub_ = nullptr;
regExpMatcherStub_ = nullptr;
regExpSearcherStub_ = nullptr;
regExpTesterStub_ = nullptr;
}
JitCode* regExpMatcherStubNoBarrier() const {
return regExpMatcherStub_;
}

Просмотреть файл

@ -111,6 +111,24 @@ CodeGeneratorMIPSShared::branchToBlock(Assembler::FloatFormat fmt, FloatRegister
}
}
FrameSizeClass
FrameSizeClass::FromDepth(uint32_t frameDepth)
{
return FrameSizeClass::None();
}
FrameSizeClass
FrameSizeClass::ClassLimit()
{
return FrameSizeClass(0);
}
uint32_t
FrameSizeClass::frameSize() const
{
MOZ_CRASH("MIPS does not use frame size classes");
}
void
OutOfLineBailout::accept(CodeGeneratorMIPSShared* codegen)
{
@ -1507,6 +1525,17 @@ CodeGeneratorMIPSShared::visitWasmTruncateToInt32(LWasmTruncateToInt32* lir)
masm.bind(ool->rejoin());
}
void
CodeGeneratorMIPSShared::visitOutOfLineBailout(OutOfLineBailout* ool)
{
// Push snapshotOffset and make sure stack is aligned.
masm.subPtr(Imm32(sizeof(Value)), StackPointer);
masm.storePtr(ImmWord(ool->snapshot()->snapshotOffset()), Address(StackPointer, 0));
masm.jump(&deoptLabel_);
}
void
CodeGeneratorMIPSShared::visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool)
{
@ -1563,7 +1592,7 @@ CodeGeneratorMIPSShared::visitCopySignD(LCopySignD* ins)
void
CodeGeneratorMIPSShared::visitValue(LValue* value)
{
const ValueOperand out = ToOutValue(value);
const ValueOperand out = GetValueOutput(value);
masm.moveValue(value->value(), out);
}

Просмотреть файл

@ -12,9 +12,12 @@
namespace js {
namespace jit {
class CodeGeneratorMIPSShared;
class OutOfLineBailout;
class OutOfLineTableSwitch;
using OutOfLineWasmTruncateCheck = OutOfLineWasmTruncateCheckBase<CodeGeneratorMIPSShared>;
class CodeGeneratorMIPSShared : public CodeGeneratorShared
{
friend class MoveResolverMIPS;
@ -189,14 +192,11 @@ class CodeGeneratorMIPSShared : public CodeGeneratorShared
void visitWasmTruncateToInt32(LWasmTruncateToInt32* lir);
// Out of line visitors.
virtual void visitOutOfLineBailout(OutOfLineBailout* ool) = 0;
void visitOutOfLineBailout(OutOfLineBailout* ool);
void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool);
void visitCopySignD(LCopySignD* ins);
void visitCopySignF(LCopySignF* ins);
protected:
virtual ValueOperand ToOutValue(LInstruction* ins) = 0;
public:
CodeGeneratorMIPSShared(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm);

Просмотреть файл

@ -47,16 +47,6 @@ class js::jit::OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorMIPS
}
};
void
CodeGeneratorMIPS::visitOutOfLineBailout(OutOfLineBailout* ool)
{
// Push snapshotOffset and make sure stack is aligned.
masm.subPtr(Imm32(2 * sizeof(void*)), StackPointer);
masm.storePtr(ImmWord(ool->snapshot()->snapshotOffset()), Address(StackPointer, 0));
masm.jump(&deoptLabel_);
}
void
CodeGeneratorMIPS::visitOutOfLineTableSwitch(OutOfLineTableSwitch* ool)
{
@ -109,33 +99,6 @@ CodeGeneratorMIPS::emitTableSwitchDispatch(MTableSwitch* mir, Register index,
masm.branch(address);
}
static const uint32_t FrameSizes[] = { 128, 256, 512, 1024 };
FrameSizeClass
FrameSizeClass::FromDepth(uint32_t frameDepth)
{
for (uint32_t i = 0; i < mozilla::ArrayLength(FrameSizes); i++) {
if (frameDepth < FrameSizes[i])
return FrameSizeClass(i);
}
return FrameSizeClass::None();
}
FrameSizeClass
FrameSizeClass::ClassLimit()
{
return FrameSizeClass(mozilla::ArrayLength(FrameSizes));
}
uint32_t
FrameSizeClass::frameSize() const
{
MOZ_ASSERT(class_ != NO_FRAME_SIZE_CLASS_ID);
MOZ_ASSERT(class_ < mozilla::ArrayLength(FrameSizes));
return FrameSizes[class_];
}
ValueOperand
CodeGeneratorMIPS::ToValue(LInstruction* ins, size_t pos)

Просмотреть файл

@ -46,14 +46,6 @@ class js::jit::OutOfLineTableSwitch : public OutOfLineCodeBase<CodeGeneratorMIPS
}
};
void
CodeGeneratorMIPS64::visitOutOfLineBailout(OutOfLineBailout* ool)
{
masm.push(ImmWord(ool->snapshot()->snapshotOffset()));
masm.jump(&deoptLabel_);
}
void
CodeGeneratorMIPS64::visitOutOfLineTableSwitch(OutOfLineTableSwitch* ool)
{
@ -111,24 +103,6 @@ CodeGeneratorMIPS64::emitTableSwitchDispatch(MTableSwitch* mir, Register index,
masm.branch(address);
}
FrameSizeClass
FrameSizeClass::FromDepth(uint32_t frameDepth)
{
return FrameSizeClass::None();
}
FrameSizeClass
FrameSizeClass::ClassLimit()
{
return FrameSizeClass(0);
}
uint32_t
FrameSizeClass::frameSize() const
{
MOZ_CRASH("MIPS64 does not use frame size classes");
}
ValueOperand
CodeGeneratorMIPS64::ToValue(LInstruction* ins, size_t pos)
{

Просмотреть файл

@ -482,6 +482,9 @@ MSG_DEF(JSMSG_DEBUG_PROMISE_NOT_FULFILLED, 0, JSEXN_TYPEERR, "Promise hasn't bee
MSG_DEF(JSMSG_DEBUG_PROMISE_NOT_REJECTED, 0, JSEXN_TYPEERR, "Promise hasn't been rejected")
MSG_DEF(JSMSG_DEBUG_NO_BINARY_SOURCE, 0, JSEXN_ERR, "WebAssembly binary source is not available")
// Testing functions
MSG_DEF(JSMSG_TESTING_SCRIPTS_ONLY, 0, JSEXN_TYPEERR, "only works on scripts")
// Tracelogger
MSG_DEF(JSMSG_TRACELOGGER_ENABLE_FAIL, 1, JSEXN_ERR, "enabling tracelogger failed: {0}")

Просмотреть файл

@ -13,7 +13,6 @@ MSG_DEF(JSSMSG_CANT_OPEN, 2, JSEXN_ERR, "can't open {0}: {1}")
MSG_DEF(JSSMSG_LINE2PC_USAGE, 0, JSEXN_ERR, "usage: line2pc [fun] line")
MSG_DEF(JSSMSG_FILE_SCRIPTS_ONLY, 0, JSEXN_ERR, "only works on JS scripts read from files")
MSG_DEF(JSSMSG_UNEXPECTED_EOF, 1, JSEXN_ERR, "unexpected EOF in {0}")
MSG_DEF(JSSMSG_SCRIPTS_ONLY, 0, JSEXN_ERR, "only works on scripts")
MSG_DEF(JSSMSG_NOT_ENOUGH_ARGS, 1, JSEXN_ERR, "{0}: not enough arguments")
MSG_DEF(JSSMSG_TOO_MANY_ARGS, 1, JSEXN_ERR, "{0}: too many arguments")
MSG_DEF(JSSMSG_ASSERT_EQ_FAILED, 2, JSEXN_ERR, "Assertion failed: got {0}, expected {1}")

Просмотреть файл

@ -92,8 +92,6 @@
#include "threading/Thread.h"
#include "util/Windows.h"
#include "vm/ArgumentsObject.h"
#include "vm/AsyncFunction.h"
#include "vm/AsyncIteration.h"
#include "vm/Compression.h"
#include "vm/Debugger.h"
#include "vm/HelperThreads.h"
@ -2452,61 +2450,6 @@ AssertEq(JSContext* cx, unsigned argc, Value* vp)
return true;
}
static JSScript*
ValueToScript(JSContext* cx, HandleValue v, JSFunction** funp = nullptr)
{
if (v.isString()) {
// To convert a string to a script, compile it. Parse it as an ES6 Program.
RootedLinearString linearStr(cx, StringToLinearString(cx, v.toString()));
if (!linearStr)
return nullptr;
size_t len = GetLinearStringLength(linearStr);
AutoStableStringChars linearChars(cx);
if (!linearChars.initTwoByte(cx, linearStr))
return nullptr;
const char16_t* chars = linearChars.twoByteRange().begin().get();
RootedScript script(cx);
CompileOptions options(cx);
if (!JS::Compile(cx, options, chars, len, &script))
return nullptr;
return script;
}
RootedFunction fun(cx, JS_ValueToFunction(cx, v));
if (!fun)
return nullptr;
// Unwrap bound functions.
while (fun->isBoundFunction()) {
JSObject* target = fun->getBoundFunctionTarget();
if (target && target->is<JSFunction>())
fun = &target->as<JSFunction>();
else
break;
}
// Get unwrapped async function.
if (IsWrappedAsyncFunction(fun))
fun = GetUnwrappedAsyncFunction(fun);
if (IsWrappedAsyncGenerator(fun))
fun = GetUnwrappedAsyncGenerator(fun);
if (!fun->isInterpreted()) {
JS_ReportErrorNumberASCII(cx, my_GetErrorMessage, nullptr, JSSMSG_SCRIPTS_ONLY);
return nullptr;
}
JSScript* script = JSFunction::getOrCreateScript(cx, fun);
if (!script)
return nullptr;
if (funp)
*funp = fun;
return script;
}
static JSScript*
GetTopScript(JSContext* cx)
{
@ -2525,7 +2468,7 @@ GetScriptAndPCArgs(JSContext* cx, CallArgs& args, MutableHandleScript scriptp,
unsigned intarg = 0;
if (v.isObject() &&
JS_GetClass(&v.toObject()) == Jsvalify(&JSFunction::class_)) {
script = ValueToScript(cx, v);
script = TestingFunctionArgumentToScript(cx, v);
if (!script)
return false;
intarg++;
@ -2558,7 +2501,7 @@ LineToPC(JSContext* cx, unsigned argc, Value* vp)
RootedScript script(cx, GetTopScript(cx));
int32_t lineArg = 0;
if (args[0].isObject() && args[0].toObject().is<JSFunction>()) {
script = ValueToScript(cx, args[0]);
script = TestingFunctionArgumentToScript(cx, args[0]);
if (!script)
return false;
lineArg++;
@ -2764,7 +2707,7 @@ Notes(JSContext* cx, unsigned argc, Value* vp)
return false;
for (unsigned i = 0; i < args.length(); i++) {
RootedScript script (cx, ValueToScript(cx, args[i]));
RootedScript script (cx, TestingFunctionArgumentToScript(cx, args[i]));
if (!script)
return false;
@ -3002,7 +2945,7 @@ DisassembleToSprinter(JSContext* cx, unsigned argc, Value* vp, Sprinter* sprinte
if (value.isObject() && value.toObject().is<ModuleObject>())
script = value.toObject().as<ModuleObject>().script();
else
script = ValueToScript(cx, value, fun.address());
script = TestingFunctionArgumentToScript(cx, value, fun.address());
if (!script)
return false;
if (!DisassembleScript(cx, script, fun, p.lines, p.recursive, p.sourceNotes, sprinter))
@ -3122,7 +3065,7 @@ DisassWithSrc(JSContext* cx, unsigned argc, Value* vp)
RootedScript script(cx);
for (unsigned i = 0; i < args.length(); i++) {
script = ValueToScript(cx, args[i]);
script = TestingFunctionArgumentToScript(cx, args[i]);
if (!script)
return false;
@ -3317,7 +3260,7 @@ GetSLX(JSContext* cx, unsigned argc, Value* vp)
CallArgs args = CallArgsFromVp(argc, vp);
RootedScript script(cx);
script = ValueToScript(cx, args.get(0));
script = TestingFunctionArgumentToScript(cx, args.get(0));
if (!script)
return false;
args.rval().setInt32(GetScriptLineExtent(script));
@ -9140,7 +9083,7 @@ main(int argc, char** argv, char** envp)
|| !op.addBoolOption('\0', "no-ggc", "Disable Generational GC")
|| !op.addBoolOption('\0', "no-cgc", "Disable Compacting GC")
|| !op.addBoolOption('\0', "no-incremental-gc", "Disable Incremental GC")
|| !op.addBoolOption('\0', "nursery-strings", "Allocate strings in the nursery")
|| !op.addBoolOption('\0', "no-nursery-strings", "Do not allocate strings in the nursery")
|| !op.addIntOption('\0', "available-memory", "SIZE",
"Select GC settings based on available memory (MB)", 0)
|| !op.addStringOption('\0', "arm-hwcap", "[features]",
@ -9288,8 +9231,8 @@ main(int argc, char** argv, char** envp)
js::UseInternalJobQueues(cx);
if (op.getBoolOption("nursery-strings"))
cx->runtime()->gc.nursery().enableStrings();
if (op.getBoolOption("no-nursery-strings"))
cx->runtime()->gc.nursery().disableStrings();
if (!JS::InitSelfHostedCode(cx))
return 1;

Просмотреть файл

@ -219,6 +219,7 @@ GetSelectorRuntime(const CompilationSelector& selector)
{
JSRuntime* match(JSScript* script) { return script->runtimeFromActiveCooperatingThread(); }
JSRuntime* match(JSCompartment* comp) { return comp->runtimeFromActiveCooperatingThread(); }
JSRuntime* match(Zone* zone) { return zone->runtimeFromActiveCooperatingThread(); }
JSRuntime* match(ZonesInState zbs) { return zbs.runtime; }
JSRuntime* match(JSRuntime* runtime) { return runtime; }
JSRuntime* match(AllCompilations all) { return nullptr; }
@ -235,6 +236,7 @@ JitDataStructuresExist(const CompilationSelector& selector)
{
bool match(JSScript* script) { return !!script->compartment()->jitCompartment(); }
bool match(JSCompartment* comp) { return !!comp->jitCompartment(); }
bool match(Zone* zone) { return !!zone->jitZone(); }
bool match(ZonesInState zbs) { return zbs.runtime->hasJitRuntime(); }
bool match(JSRuntime* runtime) { return runtime->hasJitRuntime(); }
bool match(AllCompilations all) { return true; }
@ -253,6 +255,7 @@ IonBuilderMatches(const CompilationSelector& selector, jit::IonBuilder* builder)
bool match(JSScript* script) { return script == builder_->script(); }
bool match(JSCompartment* comp) { return comp == builder_->script()->compartment(); }
bool match(Zone* zone) { return zone == builder_->script()->zone(); }
bool match(JSRuntime* runtime) { return runtime == builder_->script()->runtimeFromAnyThread(); }
bool match(AllCompilations all) { return true; }
bool match(ZonesInState zbs) {

Просмотреть файл

@ -519,6 +519,7 @@ struct CompilationsUsingNursery { JSRuntime* runtime; };
using CompilationSelector = mozilla::Variant<JSScript*,
JSCompartment*,
Zone*,
ZonesInState,
JSRuntime*,
CompilationsUsingNursery,
@ -542,6 +543,12 @@ CancelOffThreadIonCompile(JSCompartment* comp)
CancelOffThreadIonCompile(CompilationSelector(comp), true);
}
inline void
CancelOffThreadIonCompile(Zone* zone)
{
CancelOffThreadIonCompile(CompilationSelector(zone), true);
}
inline void
CancelOffThreadIonCompile(JSRuntime* runtime, JS::Zone::GCState state)
{

Просмотреть файл

@ -62,8 +62,11 @@ WriteCachedScript(StartupCache* cache, nsACString& uri, JSContext* cx,
size_t size = buffer.length();
if (size > UINT32_MAX)
return NS_ERROR_FAILURE;
// Move the vector buffer into a unique pointer buffer.
UniquePtr<char[]> buf(reinterpret_cast<char*>(buffer.extractOrCopyRawBuffer()));
nsresult rv = cache->PutBuffer(PromiseFlatCString(uri).get(),
reinterpret_cast<char*>(buffer.begin()),
Move(buf),
size);
return rv;
}

Просмотреть файл

@ -20,7 +20,6 @@
#include <shlobj.h>
// we want a wmain entry point
#define XRE_DONT_PROTECT_DLL_LOAD
#define XRE_WANT_ENVIRON
#include "nsWindowsWMain.cpp"
#ifdef MOZ_SANDBOX

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -18,7 +18,6 @@
#include "nsThreadUtils.h"
#include "signaling/src/sdp/RsdparsaSdpParser.h"
#include "signaling/src/sdp/SipccSdpParser.h"
#include "signaling/src/sdp/SdpMediaSection.h"
#include "signaling/src/sdp/SdpAttribute.h"
@ -33,8 +32,6 @@ extern "C" {
#endif
#define CRLF "\r\n"
#define SKIP_TEST_WITH_RUST_PARSER if (!::testing::get<1>(GetParam())) {return;}
using namespace mozilla;
namespace test {
@ -1503,23 +1500,16 @@ TEST_F(SdpTest, parseIceLite) {
}
class NewSdpTest : public ::testing::Test,
public ::testing::WithParamInterface<
::testing::tuple<bool, bool> > {
public ::testing::WithParamInterface<bool> {
public:
NewSdpTest() {}
void ParseSdp(const std::string &sdp, bool expectSuccess = true) {
if (::testing::get<1>(GetParam())) {
mSdpErrorHolder = &mSipccParser;
mSdp = mozilla::Move(mSipccParser.Parse(sdp));
} else {
mSdpErrorHolder = &mRustParser;
mSdp = mozilla::Move(mRustParser.Parse(sdp));
}
mSdp = mozilla::Move(mParser.Parse(sdp));
// Are we configured to do a parse and serialize before actually
// running the test?
if (::testing::get<0>(GetParam())) {
if (GetParam()) {
std::stringstream os;
if (expectSuccess) {
@ -1530,11 +1520,7 @@ class NewSdpTest : public ::testing::Test,
if (mSdp) {
// Serialize and re-parse
mSdp->Serialize(os);
if (::testing::get<1>(GetParam())) {
mSdp = mozilla::Move(mSipccParser.Parse(os.str()));
} else {
mSdp = mozilla::Move(mRustParser.Parse(os.str()));
}
mSdp = mozilla::Move(mParser.Parse(os.str()));
// Whether we expected the parse to work or not, it should
// succeed the second time if it succeeded the first.
@ -1551,7 +1537,7 @@ class NewSdpTest : public ::testing::Test,
if (expectSuccess) {
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size())
ASSERT_EQ(0U, mParser.GetParseErrors().size())
<< "Got unexpected parse errors/warnings: "
<< GetParseErrors();
}
@ -1560,8 +1546,10 @@ class NewSdpTest : public ::testing::Test,
// For streaming parse errors
std::string GetParseErrors() const {
std::stringstream output;
for (auto e: mSdpErrorHolder->GetParseErrors()) {
output << e.first << ": " << e.second << std::endl;
for (auto e = mParser.GetParseErrors().begin();
e != mParser.GetParseErrors().end();
++e) {
output << e->first << ": " << e->second << std::endl;
}
return output.str();
}
@ -1629,9 +1617,7 @@ class NewSdpTest : public ::testing::Test,
ASSERT_EQ(expected, str.str());
}
SdpErrorHolder* mSdpErrorHolder;
SipccSdpParser mSipccParser;
RsdparsaSdpParser mRustParser;
SipccSdpParser mParser;
mozilla::UniquePtr<Sdp> mSdp;
}; // class NewSdpTest
@ -1641,7 +1627,7 @@ TEST_P(NewSdpTest, CreateDestroy) {
TEST_P(NewSdpTest, ParseEmpty) {
ParseSdp("", false);
ASSERT_FALSE(mSdp);
ASSERT_NE(0U, mSdpErrorHolder->GetParseErrors().size())
ASSERT_NE(0U, mParser.GetParseErrors().size())
<< "Expected at least one parse error.";
}
@ -1650,25 +1636,25 @@ const std::string kBadSdp = "This is SDPARTA!!!!";
TEST_P(NewSdpTest, ParseGarbage) {
ParseSdp(kBadSdp, false);
ASSERT_FALSE(mSdp);
ASSERT_NE(0U, mSdpErrorHolder->GetParseErrors().size())
ASSERT_NE(0U, mParser.GetParseErrors().size())
<< "Expected at least one parse error.";
}
TEST_P(NewSdpTest, ParseGarbageTwice) {
ParseSdp(kBadSdp, false);
ASSERT_FALSE(mSdp);
size_t errorCount = mSdpErrorHolder->GetParseErrors().size();
size_t errorCount = mParser.GetParseErrors().size();
ASSERT_NE(0U, errorCount)
<< "Expected at least one parse error.";
ParseSdp(kBadSdp, false);
ASSERT_FALSE(mSdp);
ASSERT_EQ(errorCount, mSdpErrorHolder->GetParseErrors().size())
ASSERT_EQ(errorCount, mParser.GetParseErrors().size())
<< "Expected same error count for same SDP.";
}
TEST_P(NewSdpTest, ParseMinimal) {
ParseSdp(kVideoSdp);
ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) <<
ASSERT_EQ(0U, mParser.GetParseErrors().size()) <<
"Got parse errors: " << GetParseErrors();
}
@ -1785,7 +1771,6 @@ TEST_P(NewSdpTest, CheckMediaSectionGetMissingBandwidth) {
TEST_P(NewSdpTest, CheckMediaSectionGetBandwidth) {
ParseSdp("v=0\r\n"
"o=- 4294967296 2 IN IP4 127.0.0.1\r\n"
"s=SIP Call\r\n"
"c=IN IP4 198.51.100.7\r\n"
"t=0 0\r\n"
"m=video 56436 RTP/SAVPF 120\r\n"
@ -1895,6 +1880,7 @@ const std::string kBasicAudioVideoOffer =
"m=audio 9 RTP/SAVPF 0" CRLF
"a=mid:third" CRLF
"a=rtpmap:0 PCMU/8000" CRLF
"a=ice-lite" CRLF
"a=ice-options:foo bar" CRLF
"a=msid:noappdata" CRLF
"a=bundle-only" CRLF;
@ -1904,7 +1890,6 @@ TEST_P(NewSdpTest, BasicAudioVideoSdpParse) {
}
TEST_P(NewSdpTest, CheckRemoveFmtp) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kBasicAudioVideoOffer);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(3U, mSdp->GetMediaSectionCount())
@ -2057,7 +2042,6 @@ TEST_P(NewSdpTest, CheckIdentity) {
}
TEST_P(NewSdpTest, CheckDtlsMessage) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920
ParseSdp(kBasicAudioVideoOffer);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_TRUE(mSdp->GetAttributeList().HasAttribute(
@ -2258,7 +2242,6 @@ static const std::string kAudioWithTelephoneEvent =
"a=rtpmap:101 telephone-event/8000" CRLF;
TEST_P(NewSdpTest, CheckTelephoneEventNoFmtp) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(1U, mSdp->GetMediaSectionCount())
@ -2277,7 +2260,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventNoFmtp) {
}
TEST_P(NewSdpTest, CheckTelephoneEventWithDefaultEvents) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0-15" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2288,7 +2270,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventWithDefaultEvents) {
}
TEST_P(NewSdpTest, CheckTelephoneEventWithBadCharacter) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0-5." CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2299,7 +2280,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventWithBadCharacter) {
}
TEST_P(NewSdpTest, CheckTelephoneEventIncludingCommas) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0-15,66,67" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2310,7 +2290,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventIncludingCommas) {
}
TEST_P(NewSdpTest, CheckTelephoneEventComplexEvents) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0,1,2-4,5-15,66,67" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2321,7 +2300,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventComplexEvents) {
}
TEST_P(NewSdpTest, CheckTelephoneEventNoHyphen) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 5,6,7" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2332,7 +2310,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventNoHyphen) {
}
TEST_P(NewSdpTest, CheckTelephoneEventOnlyZero) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2343,7 +2320,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventOnlyZero) {
}
TEST_P(NewSdpTest, CheckTelephoneEventOnlyOne) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 1" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2354,7 +2330,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventOnlyOne) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigit) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 123" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2366,7 +2341,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigit) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigitWithHyphen) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 0-123" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2378,7 +2352,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadThreeDigitWithHyphen) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingHyphen) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 -12" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2400,7 +2373,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingHyphenInMiddle) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingComma) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 ,2,3" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2412,7 +2384,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadLeadingComma) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadMultipleLeadingComma) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 ,,,2,3" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2424,7 +2395,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadMultipleLeadingComma) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadConsecutiveCommas) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 1,,,,,,,,3" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2436,7 +2406,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadConsecutiveCommas) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingComma) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 1,2,3," CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2448,7 +2417,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTrailingComma) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadTwoHyphens) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 1-2-3" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2460,7 +2428,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadTwoHyphens) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadSixDigit) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 112233" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2472,7 +2439,6 @@ TEST_P(NewSdpTest, CheckTelephoneEventBadSixDigit) {
}
TEST_P(NewSdpTest, CheckTelephoneEventBadRangeReversed) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kAudioWithTelephoneEvent
+ "a=fmtp:101 33-2" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
@ -2502,7 +2468,6 @@ static const std::string kVideoWithRedAndUlpfecSdp =
"a=rtpmap:123 ulpfec/90000" CRLF;
TEST_P(NewSdpTest, CheckRedNoFmtp) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kVideoWithRedAndUlpfecSdp);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(1U, mSdp->GetMediaSectionCount())
@ -2521,9 +2486,8 @@ TEST_P(NewSdpTest, CheckRedNoFmtp) {
}
TEST_P(NewSdpTest, CheckRedEmptyFmtp) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
// if serializing and re-parsing, we expect errors
if (::testing::get<0>(GetParam())) {
if (GetParam()) {
ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122" CRLF);
} else {
ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122" CRLF, false);
@ -2547,7 +2511,6 @@ TEST_P(NewSdpTest, CheckRedEmptyFmtp) {
}
TEST_P(NewSdpTest, CheckRedFmtpWith2Codecs) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122 120/121" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(1U, mSdp->GetMediaSectionCount())
@ -2572,7 +2535,6 @@ TEST_P(NewSdpTest, CheckRedFmtpWith2Codecs) {
}
TEST_P(NewSdpTest, CheckRedFmtpWith3Codecs) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kVideoWithRedAndUlpfecSdp + "a=fmtp:122 120/121/123" CRLF);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(1U, mSdp->GetMediaSectionCount())
@ -2663,10 +2625,10 @@ const std::string kH264AudioVideoOffer =
"m=audio 9 RTP/SAVPF 0" CRLF
"a=mid:third" CRLF
"a=rtpmap:0 PCMU/8000" CRLF
"a=ice-lite" CRLF
"a=msid:noappdata" CRLF;
TEST_P(NewSdpTest, CheckFormatParameters) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432918
ParseSdp(kH264AudioVideoOffer);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(3U, mSdp->GetMediaSectionCount())
@ -2819,7 +2781,6 @@ TEST_P(NewSdpTest, CheckDirections) {
}
TEST_P(NewSdpTest, CheckCandidates) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920
ParseSdp(kBasicAudioVideoOffer);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
@ -3047,14 +3008,12 @@ const std::string kBasicAudioVideoDataOffer =
"a=setup:actpass" CRLF;
TEST_P(NewSdpTest, BasicAudioVideoDataSdpParse) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922
ParseSdp(kBasicAudioVideoDataOffer);
ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) <<
ASSERT_EQ(0U, mParser.GetParseErrors().size()) <<
"Got parse errors: " << GetParseErrors();
}
TEST_P(NewSdpTest, CheckApplicationParameters) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922
ParseSdp(kBasicAudioVideoDataOffer);
ASSERT_TRUE(!!mSdp);
ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
@ -3085,7 +3044,6 @@ TEST_P(NewSdpTest, CheckApplicationParameters) {
}
TEST_P(NewSdpTest, CheckExtmap) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922
ParseSdp(kBasicAudioVideoDataOffer);
ASSERT_TRUE(!!mSdp);
ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
@ -3121,7 +3079,6 @@ TEST_P(NewSdpTest, CheckExtmap) {
}
TEST_P(NewSdpTest, CheckRtcpFb) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922
ParseSdp(kBasicAudioVideoDataOffer);
ASSERT_TRUE(!!mSdp);
ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
@ -3223,7 +3180,6 @@ TEST_P(NewSdpTest, CheckImageattr)
TEST_P(NewSdpTest, CheckSimulcast)
{
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432920
ParseSdp(kBasicAudioVideoOffer);
ASSERT_TRUE(!!mSdp);
ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
@ -3251,7 +3207,6 @@ TEST_P(NewSdpTest, CheckSimulcast)
}
TEST_P(NewSdpTest, CheckSctpmap) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432922
ParseSdp(kBasicAudioVideoDataOffer);
ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
ASSERT_EQ(3U, mSdp->GetMediaSectionCount())
@ -3295,8 +3250,7 @@ TEST_P(NewSdpTest, NewSctpportSdpParse) {
INSTANTIATE_TEST_CASE_P(RoundTripSerialize,
NewSdpTest,
::testing::Combine(::testing::Bool(),
::testing::Bool()));
::testing::Values(false, true));
const std::string kCandidateInSessionSDP =
"v=0" CRLF
@ -3747,8 +3701,7 @@ const std::string kMalformedImageattr =
TEST_P(NewSdpTest, CheckMalformedImageattr)
{
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432930
if (::testing::get<0>(GetParam())) {
if (GetParam()) {
// Don't do a parse/serialize before running this test
return;
}
@ -3758,7 +3711,6 @@ TEST_P(NewSdpTest, CheckMalformedImageattr)
}
TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchSendRid) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432931
ParseSdp("v=0" CRLF
"o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
"s=SIP Call" CRLF
@ -3774,7 +3726,6 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchSendRid) {
}
TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchRecvRid) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432932
ParseSdp("v=0" CRLF
"o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
"s=SIP Call" CRLF
@ -3790,7 +3741,6 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchRecvRid) {
}
TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchPt) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432933
ParseSdp("v=0" CRLF
"o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
"s=SIP Call" CRLF
@ -3806,7 +3756,6 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNoSuchPt) {
}
TEST_P(NewSdpTest, ParseInvalidSimulcastNotSending) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432934
ParseSdp("v=0" CRLF
"o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
"s=SIP Call" CRLF
@ -3822,7 +3771,6 @@ TEST_P(NewSdpTest, ParseInvalidSimulcastNotSending) {
}
TEST_P(NewSdpTest, ParseInvalidSimulcastNotReceiving) {
SKIP_TEST_WITH_RUST_PARSER; // See Bug 1432936
ParseSdp("v=0" CRLF
"o=- 4294967296 2 IN IP4 127.0.0.1" CRLF
"s=SIP Call" CRLF

Просмотреть файл

@ -18,14 +18,12 @@
#include "mozilla/Move.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "webrtc/config.h"
#include "signaling/src/jsep/JsepTrack.h"
#include "signaling/src/jsep/JsepTransport.h"
#include "signaling/src/sdp/RsdparsaSdpParser.h"
#include "signaling/src/sdp/Sdp.h"
#include "signaling/src/sdp/SipccSdp.h"
#include "signaling/src/sdp/SipccSdpParser.h"
@ -67,8 +65,6 @@ JsepSessionImpl::Init()
SetupDefaultCodecs();
SetupDefaultRtpExtensions();
mRunRustParser = Preferences::GetBool("media.webrtc.rsdparsa_enabled", false);
return NS_OK;
}
@ -1263,13 +1259,10 @@ JsepSessionImpl::CopyPreviousMsid(const Sdp& oldLocal, Sdp* newLocal)
nsresult
JsepSessionImpl::ParseSdp(const std::string& sdp, UniquePtr<Sdp>* parsedp)
{
UniquePtr<Sdp> parsed = mSipccParser.Parse(sdp);
if (mRunRustParser) {
UniquePtr<Sdp> rustParsed = mRsdparsaParser.Parse(sdp);
}
UniquePtr<Sdp> parsed = mParser.Parse(sdp);
if (!parsed) {
std::string error = "Failed to parse SDP: ";
mSdpHelper.appendSdpParseErrors(mSipccParser.GetParseErrors(), &error);
mSdpHelper.appendSdpParseErrors(mParser.GetParseErrors(), &error);
JSEP_SET_ERROR(error);
return NS_ERROR_INVALID_ARG;
}

Просмотреть файл

@ -14,7 +14,6 @@
#include "signaling/src/jsep/JsepTrack.h"
#include "signaling/src/jsep/JsepTransceiver.h"
#include "signaling/src/jsep/SsrcGenerator.h"
#include "signaling/src/sdp/RsdparsaSdpParser.h"
#include "signaling/src/sdp/SipccSdpParser.h"
#include "signaling/src/sdp/SdpHelper.h"
#include "signaling/src/common/PtrVector.h"
@ -284,11 +283,9 @@ private:
UniquePtr<Sdp> mPendingRemoteDescription;
PtrVector<JsepCodecDescription> mSupportedCodecs;
std::string mLastError;
SipccSdpParser mSipccParser;
SipccSdpParser mParser;
SdpHelper mSdpHelper;
SsrcGenerator mSsrcGenerator;
bool mRunRustParser;
RsdparsaSdpParser mRsdparsaParser;
};
} // namespace mozilla

Просмотреть файл

@ -1,120 +0,0 @@
/* 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/. */
#include "signaling/src/sdp/RsdparsaSdp.h"
#include <cstdlib>
#include "mozilla/UniquePtr.h"
#include "mozilla/Assertions.h"
#include "nsError.h"
#include "signaling/src/sdp/SdpErrorHolder.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/RsdparsaSdpMediaSection.h"
#ifdef CRLF
#undef CRLF
#endif
#define CRLF "\r\n"
namespace mozilla
{
RsdparsaSdp::RsdparsaSdp(RsdparsaSessionHandle session, const SdpOrigin& origin)
: mSession(Move(session))
, mOrigin(origin)
{
RsdparsaSessionHandle attributeSession(sdp_new_reference(mSession.get()));
mAttributeList.reset(new RsdparsaSdpAttributeList(Move(attributeSession)));
size_t section_count = sdp_media_section_count(mSession.get());
for (size_t level = 0; level < section_count; level++) {
RustMediaSection* mediaSection = sdp_get_media_section(mSession.get(),
level);
if (!mediaSection) {
MOZ_ASSERT(false, "sdp_get_media_section failed because level was out of"
" bounds, but we did a bounds check!");
break;
}
RsdparsaSessionHandle newSession(sdp_new_reference(mSession.get()));
RsdparsaSdpMediaSection* sdpMediaSection;
sdpMediaSection = new RsdparsaSdpMediaSection(level,
Move(newSession),
mediaSection,
mAttributeList.get());
mMediaSections.values.push_back(sdpMediaSection);
}
}
const SdpOrigin&
RsdparsaSdp::GetOrigin() const
{
return mOrigin;
}
uint32_t
RsdparsaSdp::GetBandwidth(const std::string& type) const
{
return get_sdp_bandwidth(mSession.get(), type.c_str());
}
const SdpMediaSection&
RsdparsaSdp::GetMediaSection(size_t level) const
{
if (level > mMediaSections.values.size()) {
MOZ_CRASH();
}
return *mMediaSections.values[level];
}
SdpMediaSection&
RsdparsaSdp::GetMediaSection(size_t level)
{
if (level > mMediaSections.values.size()) {
MOZ_CRASH();
}
return *mMediaSections.values[level];
}
SdpMediaSection&
RsdparsaSdp::AddMediaSection(SdpMediaSection::MediaType mediaType,
SdpDirectionAttribute::Direction dir,
uint16_t port,
SdpMediaSection::Protocol protocol,
sdp::AddrType addrType, const std::string& addr)
{
//TODO: See Bug 1436080
MOZ_CRASH("Method not implemented");
}
void
RsdparsaSdp::Serialize(std::ostream& os) const
{
os << "v=0" << CRLF << mOrigin << "s=-" << CRLF;
// We don't support creating i=, u=, e=, p=
// We don't generate c= at the session level (only in media)
BandwidthVec* bwVec = sdp_get_session_bandwidth_vec(mSession.get());
char *bwString = sdp_serialize_bandwidth(bwVec);
if (bwString) {
os << bwString;
sdp_free_string(bwString);
}
os << "t=0 0" << CRLF;
// We don't support r= or z=
// attributes
os << *mAttributeList;
// media sections
for (const SdpMediaSection* msection : mMediaSections.values) {
os << *msection;
}
}
} // namespace mozilla

Просмотреть файл

@ -1,82 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RSDPARSA_SDP_H_
#define _RSDPARSA_SDP_H_
#include "mozilla/UniquePtr.h"
#include "mozilla/Attributes.h"
#include "signaling/src/common/PtrVector.h"
#include "signaling/src/sdp/Sdp.h"
#include "signaling/src/sdp/RsdparsaSdpMediaSection.h"
#include "signaling/src/sdp/RsdparsaSdpAttributeList.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
namespace mozilla
{
class RsdparsaSdpParser;
class SdpErrorHolder;
class RsdparsaSdp final : public Sdp
{
friend class RsdparsaSdpParser;
public:
explicit RsdparsaSdp(RsdparsaSessionHandle session, const SdpOrigin& origin);
const SdpOrigin& GetOrigin() const override;
// Note: connection information is always retrieved from media sections
uint32_t GetBandwidth(const std::string& type) const override;
size_t
GetMediaSectionCount() const override
{
return sdp_media_section_count(mSession.get());
}
const SdpAttributeList&
GetAttributeList() const override
{
return *mAttributeList;
}
SdpAttributeList&
GetAttributeList() override
{
return *mAttributeList;
}
const SdpMediaSection& GetMediaSection(size_t level) const
override;
SdpMediaSection& GetMediaSection(size_t level) override;
SdpMediaSection& AddMediaSection(
SdpMediaSection::MediaType media, SdpDirectionAttribute::Direction dir,
uint16_t port, SdpMediaSection::Protocol proto, sdp::AddrType addrType,
const std::string& addr) override;
void Serialize(std::ostream&) const override;
private:
RsdparsaSdp() : mOrigin("", 0, 0, sdp::kIPv4, "") {}
RsdparsaSessionHandle mSession;
SdpOrigin mOrigin;
UniquePtr<RsdparsaSdpAttributeList> mAttributeList;
PtrVector<RsdparsaSdpMediaSection> mMediaSections;
};
} // namespace mozilla
#endif

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,158 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RSDPARSA_SDP_ATTRIBUTE_LIST_H_
#define _RSDPARSA_SDP_ATTRIBUTE_LIST_H_
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/SdpAttributeList.h"
namespace mozilla
{
class RsdparsaSdp;
class RsdparsaSdpMediaSection;
class SdpErrorHolder;
class RsdparsaSdpAttributeList : public SdpAttributeList
{
friend class RsdparsaSdpMediaSection;
friend class RsdparsaSdp;
public:
// Make sure we don't hide the default arg thunks
using SdpAttributeList::HasAttribute;
using SdpAttributeList::GetAttribute;
bool HasAttribute(AttributeType type,
bool sessionFallback) const override;
const SdpAttribute* GetAttribute(AttributeType type,
bool sessionFallback) const override;
void SetAttribute(SdpAttribute* attr) override;
void RemoveAttribute(AttributeType type) override;
void Clear() override;
uint32_t Count() const override;
const SdpConnectionAttribute& GetConnection() const override;
const SdpFingerprintAttributeList& GetFingerprint() const override;
const SdpGroupAttributeList& GetGroup() const override;
const SdpOptionsAttribute& GetIceOptions() const override;
const SdpRtcpAttribute& GetRtcp() const override;
const SdpRemoteCandidatesAttribute& GetRemoteCandidates() const override;
const SdpSetupAttribute& GetSetup() const override;
const SdpSsrcAttributeList& GetSsrc() const override;
const SdpSsrcGroupAttributeList& GetSsrcGroup() const override;
const SdpDtlsMessageAttribute& GetDtlsMessage() const override;
// These attributes can appear multiple times, so the returned
// classes actually represent a collection of values.
const std::vector<std::string>& GetCandidate() const override;
const SdpExtmapAttributeList& GetExtmap() const override;
const SdpFmtpAttributeList& GetFmtp() const override;
const SdpImageattrAttributeList& GetImageattr() const override;
const SdpSimulcastAttribute& GetSimulcast() const override;
const SdpMsidAttributeList& GetMsid() const override;
const SdpMsidSemanticAttributeList& GetMsidSemantic() const override;
const SdpRidAttributeList& GetRid() const override;
const SdpRtcpFbAttributeList& GetRtcpFb() const override;
const SdpRtpmapAttributeList& GetRtpmap() const override;
const SdpSctpmapAttributeList& GetSctpmap() const override;
// These attributes are effectively simple types, so we'll make life
// easy by just returning their value.
uint32_t GetSctpPort() const override;
uint32_t GetMaxMessageSize() const override;
const std::string& GetIcePwd() const override;
const std::string& GetIceUfrag() const override;
const std::string& GetIdentity() const override;
const std::string& GetLabel() const override;
unsigned int GetMaxptime() const override;
const std::string& GetMid() const override;
unsigned int GetPtime() const override;
SdpDirectionAttribute::Direction GetDirection() const override;
void Serialize(std::ostream&) const override;
virtual ~RsdparsaSdpAttributeList();
private:
explicit RsdparsaSdpAttributeList(RsdparsaSessionHandle session)
: mSession(Move(session))
, mSessionAttributes(nullptr)
, mIsVideo(false)
, mAttributes()
{
RustAttributeList* attributes = get_sdp_session_attributes(mSession.get());
LoadAll(attributes);
}
RsdparsaSdpAttributeList(RsdparsaSessionHandle session,
const RustMediaSection* const msection,
const RsdparsaSdpAttributeList* sessionAttributes)
: mSession(Move(session))
, mSessionAttributes(sessionAttributes)
, mAttributes()
{
mIsVideo = sdp_rust_get_media_type(msection) == kRustVideo;
RustAttributeList* attributes = sdp_get_media_attribute_list(msection);
LoadAll(attributes);
}
static const std::string kEmptyString;
static const size_t kNumAttributeTypes = SdpAttribute::kLastAttribute + 1;
const RsdparsaSessionHandle mSession;
const RsdparsaSdpAttributeList* mSessionAttributes;
bool mIsVideo;
bool
AtSessionLevel() const
{
return !mSessionAttributes;
}
bool IsAllowedHere(SdpAttribute::AttributeType type);
void LoadAll(RustAttributeList* attributeList);
void LoadAttribute(RustAttributeList* attributeList, AttributeType type);
void LoadIceUfrag(RustAttributeList* attributeList);
void LoadIcePwd(RustAttributeList* attributeList);
void LoadIdentity(RustAttributeList* attributeList);
void LoadIceOptions(RustAttributeList* attributeList);
void LoadFingerprint(RustAttributeList* attributeList);
void LoadSetup(RustAttributeList* attributeList);
void LoadSsrc(RustAttributeList* attributeList);
void LoadRtpmap(RustAttributeList* attributeList);
void LoadFmtp(RustAttributeList* attributeList);
void LoadPtime(RustAttributeList* attributeList);
void LoadFlags(RustAttributeList* attributeList);
void LoadMid(RustAttributeList* attributeList);
void LoadMsid(RustAttributeList* attributeList);
void LoadMsidSemantics(RustAttributeList* attributeList);
void LoadGroup(RustAttributeList* attributeList);
void LoadRtcp(RustAttributeList* attributeList);
void LoadImageattr(RustAttributeList* attributeList);
void LoadSctpmaps(RustAttributeList* attributeList);
void LoadDirection(RustAttributeList* attributeList);
void LoadRemoteCandidates(RustAttributeList* attributeList);
void LoadRids(RustAttributeList* attributeList);
void LoadExtmap(RustAttributeList* attributeList);
void WarnAboutMisplacedAttribute(SdpAttribute::AttributeType type,
uint32_t lineNumber,
SdpErrorHolder& errorHolder);
SdpAttribute* mAttributes[kNumAttributeTypes];
RsdparsaSdpAttributeList(const RsdparsaSdpAttributeList& orig) = delete;
RsdparsaSdpAttributeList& operator=(const RsdparsaSdpAttributeList& rhs) = delete;
};
} // namespace mozilla
#endif

Просмотреть файл

@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include <string>
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
namespace mozilla
{
std::string convertStringView(StringView str)
{
if (nullptr == str.buf) {
return std::string();
} else {
return std::string(str.buf, str.len);
}
}
std::vector<std::string> convertStringVec(StringVec* vec)
{
std::vector<std::string> ret;
size_t len = string_vec_len(vec);
for (size_t i = 0; i < len; i++) {
StringView view;
string_vec_get_view(vec, i, &view);
ret.push_back(convertStringView(view));
}
return ret;
}
sdp::AddrType convertAddressType(RustSdpAddrType addrType)
{
switch(addrType) {
case kRustAddrNone:
return sdp::kAddrTypeNone;
case kRustAddrIp4:
return sdp::kIPv4;
case kRustAddrIp6:
return sdp::kIPv6;
}
MOZ_CRASH("unknown address type");
}
}

Просмотреть файл

@ -1,31 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RUSTSDPGLUE_H_
#define _RUSTSDPGLUE_H_
#include <string>
#include <vector>
#include "signaling/src/sdp/Sdp.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
namespace mozilla
{
struct FreeRustSdpSession {
void operator()(RustSdpSession* aSess) { sdp_free_session(aSess); }
};
typedef UniquePtr<RustSdpSession, FreeRustSdpSession> RsdparsaSessionHandle;
std::string convertStringView(StringView str);
std::vector<std::string> convertStringVec(StringVec* vec);
sdp::AddrType convertAddressType(RustSdpAddrType addr);
}
#endif

Просмотреть файл

@ -1,292 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RUSTSDPINC_H_
#define _RUSTSDPINC_H_
#include "nsError.h"
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
typedef struct BandwidthVec BandwidthVec;
typedef struct RustSdpSession RustSdpSession;
typedef struct RustSdpError RustSdpError;
typedef struct RustMediaSection RustMediaSection;
typedef struct RustAttributeList RustAttributeList;
typedef struct StringVec StringVec;
typedef struct U32Vec U32Vec;
typedef struct RustHeapString RustHeapString;
enum RustSdpAddrType {
kRustAddrNone,
kRustAddrIp4,
kRustAddrIp6
};
typedef struct RustIpAddr {
RustSdpAddrType addrType;
char unicastAddr[50];
} RustIpAddr;
typedef struct StringView {
char* buf;
size_t len;
} StringView;
typedef struct RustSdpConnection {
RustIpAddr addr;
uint8_t ttl;
uint64_t amount;
} RustSdpConnection;
typedef struct RustSdpOrigin {
StringView username;
uint64_t sessionId;
uint64_t sessionVersion;
RustIpAddr addr;
} RustSdpOrigin;
enum RustSdpMediaValue {
kRustAudio,
kRustVideo,
kRustApplication
};
enum RustSdpProtocolValue {
kRustRtpSavpf,
kRustUdpTlsRtpSavpf,
kRustTcpTlsRtpSavpf,
kRustDtlsSctp,
kRustUdpDtlsSctp,
kRustTcpDtlsSctp,
};
enum RustSdpFormatType {
kRustIntegers,
kRustStrings
};
size_t string_vec_len(const StringVec* vec);
nsresult string_vec_get_view(const StringVec* vec, size_t index,
StringView* str);
size_t u32_vec_len(const U32Vec* vec);
nsresult u32_vec_get(const U32Vec* vec, size_t index, uint32_t* ret);
void sdp_free_string(char* string);
nsresult parse_sdp(const char* sdp, uint32_t length, bool fail_on_warning,
RustSdpSession** ret, RustSdpError** err);
RustSdpSession* sdp_new_reference(RustSdpSession* aSess);
void sdp_free_session(RustSdpSession* ret);
size_t sdp_get_error_line_num(const RustSdpError* err);
StringView sdp_get_error_message(const RustSdpError* err);
void sdp_free_error(RustSdpError* err);
RustSdpOrigin sdp_get_origin(const RustSdpSession* aSess);
uint32_t get_sdp_bandwidth(const RustSdpSession* aSess,
const char* aBandwidthType);
BandwidthVec* sdp_get_session_bandwidth_vec(const RustSdpSession* aSess);
BandwidthVec* sdp_get_media_bandwidth_vec(const RustMediaSection* aMediaSec);
char* sdp_serialize_bandwidth(const BandwidthVec* bandwidths);
bool sdp_session_has_connection(const RustSdpSession* aSess);
nsresult sdp_get_session_connection(const RustSdpSession* aSess,
RustSdpConnection* ret);
RustAttributeList* get_sdp_session_attributes(const RustSdpSession* aSess);
size_t sdp_media_section_count(const RustSdpSession* aSess);
RustMediaSection* sdp_get_media_section(const RustSdpSession* aSess,
size_t aLevel);
RustSdpMediaValue sdp_rust_get_media_type(const RustMediaSection* aMediaSec);
RustSdpProtocolValue
sdp_get_media_protocol(const RustMediaSection* aMediaSec);
RustSdpFormatType sdp_get_format_type(const RustMediaSection* aMediaSec);
StringVec* sdp_get_format_string_vec(const RustMediaSection* aMediaSec);
U32Vec* sdp_get_format_u32_vec(const RustMediaSection* aMediaSec);
uint32_t sdp_get_media_port(const RustMediaSection* aMediaSec);
uint32_t sdp_get_media_port_count(const RustMediaSection* aMediaSec);
uint32_t sdp_get_media_bandwidth(const RustMediaSection* aMediaSec,
const char* aBandwidthType);
bool sdp_media_has_connection(const RustMediaSection* aMediaSec);
nsresult sdp_get_media_connection(const RustMediaSection* aMediaSec,
RustSdpConnection* ret);
RustAttributeList*
sdp_get_media_attribute_list(const RustMediaSection* aMediaSec);
nsresult sdp_get_iceufrag(const RustAttributeList* aList, StringView* ret);
nsresult sdp_get_icepwd(const RustAttributeList* aList, StringView* ret);
nsresult sdp_get_identity(const RustAttributeList* aList, StringView* ret);
nsresult sdp_get_iceoptions(const RustAttributeList* aList, StringVec** ret);
typedef struct RustSdpAttributeFingerprint {
StringView hashAlgorithm;
StringView fingerprint;
} RustSdpAttributeFingerprint;
size_t sdp_get_fingerprint_count(const RustAttributeList* aList);
void sdp_get_fingerprints(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeFingerprint* ret);
enum RustSdpSetup {
kRustActive,
kRustActpass,
kRustHoldconn,
kRustPassive
};
nsresult sdp_get_setup(const RustAttributeList* aList, RustSdpSetup* ret);
typedef struct RustSdpAttributeSsrc {
uint32_t id;
StringView attribute;
StringView value;
} RustSdpAttributeSsrc;
size_t sdp_get_ssrc_count(const RustAttributeList* aList);
void sdp_get_ssrcs(const RustAttributeList* aList,
size_t listSize, RustSdpAttributeSsrc* ret);
typedef struct RustSdpAttributeRtpmap {
uint8_t payloadType;
StringView codecName;
uint32_t frequency;
uint32_t channels;
} RustSdpAttributeRtpmap;
size_t sdp_get_rtpmap_count(const RustAttributeList* aList);
void sdp_get_rtpmaps(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeRtpmap* ret);
typedef struct RustSdpAttributeFmtp {
uint8_t payloadType;
StringView codecName;
StringVec* tokens;
} RustSdpAttributeFmtp;
size_t sdp_get_fmtp_count(const RustAttributeList* aList);
size_t sdp_get_fmtp(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeFmtp* ret);
int64_t sdp_get_ptime(const RustAttributeList* aList);
typedef struct RustSdpAttributeFlags {
bool iceLite;
bool rtcpMux;
bool bundleOnly;
bool endOfCandidates;
} RustSdpAttributeFlags;
RustSdpAttributeFlags sdp_get_attribute_flags(const RustAttributeList* aList);
nsresult sdp_get_mid(const RustAttributeList* aList, StringView* ret);
typedef struct RustSdpAttributeMsid {
StringView id;
StringView appdata;
} RustSdpAttributeMsid;
size_t sdp_get_msid_count(const RustAttributeList* aList);
void sdp_get_msids(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeMsid* ret);
typedef struct RustSdpAttributeMsidSemantic {
StringView semantic;
StringVec* msids;
} RustSdpAttributeMsidSemantic;
size_t sdp_get_msid_semantic_count(RustAttributeList* aList);
void sdp_get_msid_semantics(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeMsidSemantic* ret);
enum RustSdpAttributeGroupSemantic {
kRustLipSynchronization,
kRustFlowIdentification,
kRustSingleReservationFlow,
kRustAlternateNetworkAddressType,
kRustForwardErrorCorrection,
kRustDecodingDependency,
kRustBundle,
};
typedef struct RustSdpAttributeGroup {
RustSdpAttributeGroupSemantic semantic;
StringVec* tags;
} RustSdpAttributeGroup;
size_t sdp_get_group_count(const RustAttributeList* aList);
nsresult sdp_get_groups(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeGroup* ret);
typedef struct RustSdpAttributeRtcp {
uint32_t port;
RustIpAddr unicastAddr;
} RustSdpAttributeRtcp;
nsresult sdp_get_rtcp(const RustAttributeList* aList,
RustSdpAttributeRtcp* ret);
size_t sdp_get_imageattr_count(const RustAttributeList* aList);
void sdp_get_imageattrs(const RustAttributeList* aList, size_t listSize,
StringView* ret);
typedef struct RustSdpAttributeSctpmap {
uint32_t port;
uint32_t channels;
} RustSdpAttributeSctpmap;
size_t sdp_get_sctpmap_count(const RustAttributeList* aList);
void sdp_get_sctpmaps(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeSctpmap* ret);
enum RustDirection {
kRustRecvonly,
kRustSendonly,
kRustSendrecv,
kRustInactive
};
RustDirection sdp_get_direction(const RustAttributeList* aList);
typedef struct RustSdpAttributeRemoteCandidate {
uint32_t component;
RustIpAddr address;
uint32_t port;
} RustSdpAttributeRemoteCandidate;
size_t sdp_get_remote_candidate_count(const RustAttributeList* aList);
void sdp_get_remote_candidates(const RustAttributeList* aList,
size_t listSize,
RustSdpAttributeRemoteCandidate* ret);
size_t sdp_get_rid_count(const RustAttributeList* aList);
void sdp_get_rids(const RustAttributeList* aList, size_t listSize,
StringView* ret);
// TODO: Add field indicating whether direction was specified
// See Bug 1438536.
typedef struct RustSdpAttributeExtmap {
uint16_t id;
RustDirection direction;
StringView url;
StringView extensionAttributes;
} RustSdpAttributeExtmap;
size_t sdp_get_extmap_count(const RustAttributeList* aList);
void sdp_get_extmaps(const RustAttributeList* aList, size_t listSize,
RustSdpAttributeExtmap* ret);
#ifdef __cplusplus
}
#endif
#endif

Просмотреть файл

@ -1,235 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
// Bug 1433534 tracks cleaning up the TODOs in the file
#include "signaling/src/sdp/SdpMediaSection.h"
#include "signaling/src/sdp/RsdparsaSdpMediaSection.h"
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include <ostream>
#include "signaling/src/sdp/SdpErrorHolder.h"
#ifdef CRLF
#undef CRLF
#endif
#define CRLF "\r\n"
namespace mozilla
{
RsdparsaSdpMediaSection::RsdparsaSdpMediaSection(size_t level,
RsdparsaSessionHandle session, const RustMediaSection* const section,
const RsdparsaSdpAttributeList* sessionLevel)
: SdpMediaSection(level), mSession(Move(session)),
mSection(section)
{
switch(sdp_rust_get_media_type(section)) {
case kRustAudio:
mMediaType = kAudio;
break;
case kRustVideo:
mMediaType = kVideo;
break;
case kRustApplication:
mMediaType = kApplication;
break;
}
RsdparsaSessionHandle attributeSession(sdp_new_reference(mSession.get()));
mAttributeList.reset(new RsdparsaSdpAttributeList(Move(attributeSession),
section,
sessionLevel));
LoadFormats();
LoadConnection();
}
unsigned int
RsdparsaSdpMediaSection::GetPort() const
{
return sdp_get_media_port(mSection);
}
void
RsdparsaSdpMediaSection::SetPort(unsigned int port)
{
// TODO, see Bug 1433093
}
unsigned int
RsdparsaSdpMediaSection::GetPortCount() const
{
return sdp_get_media_port_count(mSection);
}
SdpMediaSection::Protocol
RsdparsaSdpMediaSection::GetProtocol() const
{
switch(sdp_get_media_protocol(mSection)) {
case kRustRtpSavpf:
return kRtpSavpf;
case kRustUdpTlsRtpSavpf:
return kUdpTlsRtpSavpf;
case kRustTcpTlsRtpSavpf:
return kTcpTlsRtpSavpf;
case kRustDtlsSctp:
return kDtlsSctp;
case kRustUdpDtlsSctp:
return kUdpDtlsSctp;
case kRustTcpDtlsSctp:
return kTcpDtlsSctp;
}
MOZ_CRASH("invalid media protocol");
}
const SdpConnection&
RsdparsaSdpMediaSection::GetConnection() const
{
MOZ_ASSERT(mConnection);
return *mConnection;
}
SdpConnection&
RsdparsaSdpMediaSection::GetConnection()
{
MOZ_ASSERT(mConnection);
return *mConnection;
}
uint32_t
RsdparsaSdpMediaSection::GetBandwidth(const std::string& type) const
{
return sdp_get_media_bandwidth(mSection, type.c_str());
}
const std::vector<std::string>&
RsdparsaSdpMediaSection::GetFormats() const
{
return mFormats;
}
const SdpAttributeList&
RsdparsaSdpMediaSection::GetAttributeList() const
{
return *mAttributeList;
}
SdpAttributeList&
RsdparsaSdpMediaSection::GetAttributeList()
{
return *mAttributeList;
}
SdpDirectionAttribute
RsdparsaSdpMediaSection::GetDirectionAttribute() const
{
return SdpDirectionAttribute(mAttributeList->GetDirection());
}
void
RsdparsaSdpMediaSection::AddCodec(const std::string& pt,
const std::string& name,
uint32_t clockrate, uint16_t channels)
{
//TODO: see Bug 1438289
}
void
RsdparsaSdpMediaSection::ClearCodecs()
{
//TODO: see Bug 1438289
}
void
RsdparsaSdpMediaSection::AddDataChannel(const std::string& name, uint16_t port,
uint16_t streams, uint32_t message_size)
{
//TODO: See 1438290
}
void
RsdparsaSdpMediaSection::Serialize(std::ostream& os) const
{
os << "m=" << mMediaType << " " << GetPort();
if (GetPortCount()) {
os << "/" << GetPortCount();
}
os << " " << GetProtocol();
for (auto i = mFormats.begin(); i != mFormats.end(); ++i) {
os << " " << (*i);
}
os << CRLF;
// We dont do i=
if (mConnection) {
os << *mConnection;
}
BandwidthVec* bwVec = sdp_get_media_bandwidth_vec(mSection);
char* bwString = sdp_serialize_bandwidth(bwVec);
if (bwString) {
os << bwString;
sdp_free_string(bwString);
}
// We dont do k= because they're evil
os << *mAttributeList;
}
void
RsdparsaSdpMediaSection::LoadFormats()
{
RustSdpFormatType formatType = sdp_get_format_type(mSection);
if (formatType == kRustIntegers) {
U32Vec* vec = sdp_get_format_u32_vec(mSection);
size_t len = u32_vec_len(vec);
for (size_t i = 0; i < len; i++) {
uint32_t val;
u32_vec_get(vec, i, &val);
mFormats.push_back(std::to_string(val));
}
} else {
StringVec* vec = sdp_get_format_string_vec(mSection);
mFormats = convertStringVec(vec);
}
}
UniquePtr<SdpConnection> convertRustConnection(RustSdpConnection conn)
{
std::string addr(conn.addr.unicastAddr);
sdp::AddrType type = convertAddressType(conn.addr.addrType);
return MakeUnique<SdpConnection>(type, addr, conn.ttl, conn.amount);
}
void
RsdparsaSdpMediaSection::LoadConnection()
{
RustSdpConnection conn;
nsresult nr;
if (sdp_media_has_connection(mSection)) {
nr = sdp_get_media_connection(mSection, &conn);
if (NS_SUCCEEDED(nr)) {
mConnection = convertRustConnection(conn);
}
} else if (sdp_session_has_connection(mSession.get())){
// TODO: rsdparsa needs to ensure there is a connection at the session level
// if it is missing at a media level. See Bug 1438539.
nr = sdp_get_session_connection(mSession.get(), &conn);
if (NS_SUCCEEDED(nr)) {
mConnection = convertRustConnection(conn);
}
}
}
} // namespace mozilla

Просмотреть файл

@ -1,81 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RUSTSDPMEDIASECTION_H_
#define _RUSTSDPMEDIASECTION_H_
#include "mozilla/Attributes.h"
#include "mozilla/UniquePtr.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
#include "signaling/src/sdp/SdpMediaSection.h"
#include "signaling/src/sdp/RsdparsaSdpAttributeList.h"
#include <map>
namespace mozilla
{
class RsdparsaSdp;
class SdpErrorHolder;
class RsdparsaSdpMediaSection final : public SdpMediaSection
{
friend class RsdparsaSdp;
public:
~RsdparsaSdpMediaSection() {}
MediaType
GetMediaType() const override
{
return mMediaType;
}
unsigned int GetPort() const override;
void SetPort(unsigned int port) override;
unsigned int GetPortCount() const override;
Protocol GetProtocol() const override;
const SdpConnection& GetConnection() const override;
SdpConnection& GetConnection() override;
uint32_t GetBandwidth(const std::string& type) const override;
const std::vector<std::string>& GetFormats() const override;
const SdpAttributeList& GetAttributeList() const override;
SdpAttributeList& GetAttributeList() override;
SdpDirectionAttribute GetDirectionAttribute() const override;
void AddCodec(const std::string& pt, const std::string& name,
uint32_t clockrate, uint16_t channels) override;
void ClearCodecs() override;
void AddDataChannel(const std::string& name, uint16_t port,
uint16_t streams, uint32_t message_size) override;
void Serialize(std::ostream&) const override;
private:
RsdparsaSdpMediaSection(size_t level,
RsdparsaSessionHandle session,
const RustMediaSection* const section,
const RsdparsaSdpAttributeList* sessionLevel);
void LoadFormats();
void LoadConnection();
RsdparsaSessionHandle mSession;
const RustMediaSection* mSection;
MediaType mMediaType;
std::vector<std::string> mFormats;
UniquePtr<SdpConnection> mConnection;
UniquePtr<RsdparsaSdpAttributeList> mAttributeList;
};
}
#endif

Просмотреть файл

@ -1,53 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include "nsError.h"
#include "mozilla/UniquePtr.h"
#include "signaling/src/sdp/Sdp.h"
#include "signaling/src/sdp/SdpEnum.h"
#include "signaling/src/sdp/RsdparsaSdp.h"
#include "signaling/src/sdp/RsdparsaSdpParser.h"
#include "signaling/src/sdp/RsdparsaSdpInc.h"
#include "signaling/src/sdp/RsdparsaSdpGlue.h"
namespace mozilla
{
UniquePtr<Sdp>
RsdparsaSdpParser::Parse(const std::string &sdpText)
{
ClearParseErrors();
const char* rawString = sdpText.c_str();
RustSdpSession* result;
RustSdpError* err;
nsresult rv = parse_sdp(rawString, sdpText.length() + 1, false,
&result, &err);
if (rv != NS_OK) {
// TODO: err should eventually never be null if rv != NS_OK
// see Bug 1433529
if (err != nullptr) {
size_t line = sdp_get_error_line_num(err);
std::string errMsg = convertStringView(sdp_get_error_message(err));
sdp_free_error(err);
AddParseError(line, errMsg);
} else {
AddParseError(0, "Unhandled Rsdparsa parsing error");
}
return nullptr;
}
RsdparsaSessionHandle uniqueResult;
uniqueResult.reset(result);
RustSdpOrigin rustOrigin = sdp_get_origin(uniqueResult.get());
sdp::AddrType addrType = convertAddressType(rustOrigin.addr.addrType);
SdpOrigin origin(convertStringView(rustOrigin.username),
rustOrigin.sessionId, rustOrigin.sessionVersion,
addrType, std::string(rustOrigin.addr.unicastAddr));
return MakeUnique<RsdparsaSdp>(Move(uniqueResult), origin);
}
} // namespace mozilla

Просмотреть файл

@ -1,35 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef _RUSTSDPPARSER_H_
#define _RUSTSDPPARSER_H_
#include <string>
#include "mozilla/UniquePtr.h"
#include "signaling/src/sdp/Sdp.h"
#include "signaling/src/sdp/SdpErrorHolder.h"
namespace mozilla
{
class RsdparsaSdpParser final : public SdpErrorHolder
{
public:
RsdparsaSdpParser() {}
virtual ~RsdparsaSdpParser() {}
/**
* This parses the provided text into an SDP object.
* This returns a nullptr-valued pointer if things go poorly.
*/
UniquePtr<Sdp> Parse(const std::string& sdpText);
};
} // namespace mozilla
#endif

Просмотреть файл

@ -819,66 +819,6 @@ SdpHelper::GetMsectionBundleType(const Sdp& sdp,
return kNoBundle;
}
static bool
AttributeListMatch(const SdpAttributeList& list1, const SdpAttributeList& list2)
{
// TODO: Consider adding telemetry in this function to record which
// attributes don't match. See Bug 1432955.
for (int i = SdpAttribute::kFirstAttribute; i <= SdpAttribute::kLastAttribute; i++) {
auto attributeType = static_cast<SdpAttribute::AttributeType>(i);
// TODO: We should do more thorough checking here, e.g. serialize and
// compare strings. See Bug 1439690.
if (list1.HasAttribute(attributeType, false) !=
list2.HasAttribute(attributeType, false)) {
return false;
}
}
return true;
}
static bool
MediaSectionMatch(const SdpMediaSection& mediaSection1,
const SdpMediaSection& mediaSection2)
{
// TODO: We should do more thorough checking in this function.
// See Bug 1439690.
if (!AttributeListMatch(mediaSection1.GetAttributeList(),
mediaSection2.GetAttributeList())) {
return false;
}
if (mediaSection1.GetPort() != mediaSection2.GetPort()) {
return false;
}
const std::vector<std::string>& formats1 = mediaSection1.GetFormats();
const std::vector<std::string>& formats2 = mediaSection2.GetFormats();
auto formats1Set = std::set<std::string>(formats1.begin(), formats1.end());
auto formats2Set = std::set<std::string>(formats2.begin(), formats2.end());
if (formats1Set != formats2Set) {
return false;
}
return true;
}
bool
SdpHelper::SdpMatch(const Sdp& sdp1, const Sdp& sdp2)
{
if (sdp1.GetMediaSectionCount() != sdp2.GetMediaSectionCount()) {
return false;
}
if (!AttributeListMatch(sdp1.GetAttributeList(), sdp2.GetAttributeList())) {
return false;
}
for (size_t i = 0; i < sdp1.GetMediaSectionCount(); i++) {
const SdpMediaSection& mediaSection1 = sdp1.GetMediaSection(i);
const SdpMediaSection& mediaSection2 = sdp2.GetMediaSection(i);
if (!MediaSectionMatch(mediaSection1, mediaSection2)) {
return false;
}
}
return true;
}
} // namespace mozilla

Просмотреть файл

@ -120,8 +120,6 @@ class SdpHelper {
const std::vector<SdpExtmapAttributeList::Extmap>& localExtensions,
SdpMediaSection* localMsection);
bool SdpMatch(const Sdp& sdp1, const Sdp& sdp2);
private:
std::string& mLastError;

Просмотреть файл

@ -37,15 +37,8 @@ UNIFIED_SOURCES += [
'SipccSdpParser.cpp',
]
# Multiple definitions of "logTag" mean we can't use unified build here.
SOURCES += [
# Building these as part of the unified build leads to multiply defined
# symbols on windows.
'RsdparsaSdp.cpp',
'RsdparsaSdpAttributeList.cpp',
'RsdparsaSdpGlue.cpp',
'RsdparsaSdpMediaSection.cpp',
'RsdparsaSdpParser.cpp',
# Multiple definitions of "logTag" mean we can't use unified build here.
'sipcc/cpr_string.c',
'sipcc/sdp_access.c',
'sipcc/sdp_attr.c',

Просмотреть файл

@ -1,2 +0,0 @@
target
Cargo.lock

Просмотреть файл

@ -1,68 +0,0 @@
language: rust
cache: cargo
sudo: true
os:
- linux
# Taken out temporarily because it's to slow
# - osx
rust:
- nightly
- beta
- stable
# mimimum stable version because we use init shorthand
- 1.17.0
matrix:
allow_failures:
- rust: nightly
before_install:
- sudo apt-get update
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- binutils-dev
# Add clippy
before_script:
- export PATH=$PATH:~/.cargo/bin
- |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
cargo install --force clippy;
fi
script:
- cargo build --verbose --all
- |
if [[ "$TRAVIS_RUST_VERSION" == "nightly" &&
-f ~/.cargo/bin/cargo-clippy ]]; then
cargo clippy;
fi
- cargo test --verbose --all
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
kcov --version &&
for file in target/debug/rsdparsa-*[^\.d]; do echo "$file"; mkdir -p "target/cov/$(basename $file)"; kcov --verify --exclude-pattern=/.cargo,/usr/lib "target/cov/$(basename $file)" "$file"; done &&
for file in target/debug/unit_tests-*[^\.d]; do echo "$file"; mkdir -p "target/cov/$(basename $file)"; kcov --verify --exclude-pattern=/.cargo,/usr/lib "target/cov/$(basename $file)" "$file"; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"
fi

Просмотреть файл

@ -1,10 +0,0 @@
[package]
name = "rsdparsa"
version = "0.1.0"
authors = ["Nils Ohlmeier <github@ohlmeier.org>"]
[dependencies]
clippy = {version = "*", optional = true}
[features]
default = []

Просмотреть файл

@ -1,373 +0,0 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
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 it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

Просмотреть файл

@ -1,13 +0,0 @@
# rsdparsa
[![Build Status](https://travis-ci.org/nils-ohlmeier/rsdparsa.svg?branch=master)](https://travis-ci.org/nils-ohlmeier/rsdparsa)
[![Codecov coverage status](https://codecov.io/gh/nils-ohlmeier/rsdparsa/branch/master/graph/badge.svg)](https://codecov.io/gh/nils-ohlmeier/rsdparsa)
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](#License)
A SDP parser written in Rust specifically aimed for WebRTC
Requires minimum Rust 1.17
## License
Licensed under [MPL](https://www.mozilla.org/MPL/2.0/).

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,35 +0,0 @@
use std::error::Error;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
use std::env;
extern crate rsdparsa;
fn main() {
let filename = match env::args().nth(1) {
None => {
println!("Missing file name argument!");
return;
},
Some(x) => x,
};
let path = Path::new(filename.as_str());
let display = path.display();
let mut file = match File::open(&path) {
Err(why) => panic!("Failed to open {}: {}",
display,
why.description()),
Ok(file) => file
};
let mut s = String::new();
match file.read_to_string(&mut s) {
Err(why) => panic!("couldn't read {}: {}",
display,
why.description()),
Ok(s) => s
};
rsdparsa::parse_sdp(&s, true).is_ok();
}

Просмотреть файл

@ -1,13 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
t=0 0
m=video 9 RTP/SAVPF 97 120 121 122 123
c=IN IP6 ::1
a=fingerprint:sha-1 DF:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7
a=rtpmap:97 H264/90000
a=rtpmap:120 VP8/90000
a=rtpmap:121 VP9/90000
a=rtpmap:122 red/90000
a=rtpmap:123 ulpfec/90000

Просмотреть файл

@ -1,63 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=ice-ufrag:4a799b2e
a=ice-pwd:e4cc12a910f106a0a744719425510e17
a=ice-lite
a=msid-semantic:WMS stream streama
a=fingerprint:sha-256 DF:2E:AC:8A:FD:0A:8E:99:BF:5D:E8:3C:E7:FA:FB:08:3B:3C:54:1D:D7:D4:05:77:A0:72:9B:14:08:6D:0F:4C
a=group:BUNDLE first second
a=group:BUNDLE third
a=group:LS first third
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=mid:first
a=rtpmap:109 opus/48000/2
a=ptime:20
a=maxptime:20
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15,66,32-34,67
a=ice-ufrag:00000000
a=ice-pwd:0000000000000000000000000000000
a=sendonly
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=rtcp-mux
a=msid:stream track
a=candidate:0 1 UDP 2130379007 10.0.0.36 62453 typ host
a=candidate:2 1 UDP 1694236671 24.6.134.204 62453 typ srflx raddr 10.0.0.36 rport 62453
a=candidate:3 1 UDP 100401151 162.222.183.171 49761 typ relay raddr 162.222.183.171 rport 49761
a=candidate:6 1 UDP 16515071 162.222.183.171 51858 typ relay raddr 162.222.183.171 rport 51858
a=candidate:3 2 UDP 100401150 162.222.183.171 62454 typ relay raddr 162.222.183.171 rport 62454
a=candidate:2 2 UDP 1694236670 24.6.134.204 55428 typ srflx raddr 10.0.0.36 rport 55428
a=candidate:6 2 UDP 16515070 162.222.183.171 50340 typ relay raddr 162.222.183.171 rport 50340
a=candidate:0 2 UDP 2130379006 10.0.0.36 55428 typ host
m=video 9 RTP/SAVPF 97 98 120
c=IN IP6 ::1
a=mid:second
a=rtpmap:97 H264/90000
a=rtpmap:98 H264/90000
a=rtpmap:120 VP8/90000
a=recvonly
a=setup:active
a=rtcp-mux
a=msid:streama tracka
a=msid:streamb trackb
a=candidate:0 1 UDP 2130379007 10.0.0.36 59530 typ host
a=candidate:0 2 UDP 2130379006 10.0.0.36 64378 typ host
a=candidate:2 2 UDP 1694236670 24.6.134.204 64378 typ srflx raddr 10.0.0.36 rport 64378
a=candidate:6 2 UDP 16515070 162.222.183.171 64941 typ relay raddr 162.222.183.171 rport 64941
a=candidate:6 1 UDP 16515071 162.222.183.171 64800 typ relay raddr 162.222.183.171 rport 64800
a=candidate:2 1 UDP 1694236671 24.6.134.204 59530 typ srflx raddr 10.0.0.36 rport 59530
a=candidate:3 1 UDP 100401151 162.222.183.171 62935 typ relay raddr 162.222.183.171 rport 62935
a=candidate:3 2 UDP 100401150 162.222.183.171 61026 typ relay raddr 162.222.183.171 rport 61026
m=audio 9 RTP/SAVPF 0
a=mid:third
a=rtpmap:0 PCMU/8000
a=ice-lite
a=msid:noappdata

Просмотреть файл

@ -1,58 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 27987 0 IN IP4 0.0.0.0
s=SIP Call
t=0 0
a=ice-ufrag:8a39d2ae
a=ice-pwd:601d53aba51a318351b3ecf5ee00048f
a=fingerprint:sha-256 30:FF:8E:2B:AC:9D:ED:70:18:10:67:C8:AE:9E:68:F3:86:53:51:B0:AC:31:B7:BE:6D:CF:A4:2E:D3:6E:B4:28
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=rtpmap:109 opus/48000/2
a=ptime:20
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2/sendonly some_extension
a=extmap:3 some_other_extension some_params some more params
a=setup:actpass
a=rtcp-mux
m=video 9 RTP/SAVPF 120 126 97
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=sendrecv
a=rtcp-fb:120 ack rpsi
a=rtcp-fb:120 ack app foo
a=rtcp-fb:120 ack foo
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack sli
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 nack rpsi
a=rtcp-fb:120 nack app foo
a=rtcp-fb:120 nack foo
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 ccm tmmbr
a=rtcp-fb:120 ccm tstr
a=rtcp-fb:120 ccm vbcm
a=rtcp-fb:120 ccm foo
a=rtcp-fb:120 trr-int 10
a=rtcp-fb:120 goog-remb
a=rtcp-fb:120 foo
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:* ccm tmmbr
a=setup:actpass
a=rtcp-mux
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=sctpmap:5000 webrtc-datachannel 16
a=setup:actpass

Просмотреть файл

@ -1,12 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 27987 0 IN IP4 0.0.0.0
s=SIP Call
t=0 0
a=ice-ufrag:8a39d2ae
a=ice-pwd:601d53aba51a318351b3ecf5ee00048f
a=fingerprint:sha-256 30:FF:8E:2B:AC:9D:ED:70:18:10:67:C8:AE:9E:68:F3:86:53:51:B0:AC:31:B7:BE:6D:CF:A4:2E:D3:6E:B4:28
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=sctp-port:5000
a=max-message-size:10000
a=setup:actpass

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=candidate:0 1 UDP 2130379007 10.0.0.36 62453 typ host
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=rtpmap:109 opus/48000/2

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=bundle-only
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=rtpmap:109 opus/48000/2

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=fmtp:109 0-15
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=rtpmap:109 opus/48000/2

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=ice-mismatch
m=audio 9 RTP/SAVPF 109 9 0 8 101
c=IN IP4 0.0.0.0
a=rtpmap:109 opus/48000/2

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=imageattr:120 send * recv *
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=label:foobar
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,7 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=maxptime:100
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=mid:foobar
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=msid:foobar
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=ptime:50
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=remote-candidates:0 10.0.0.1 5555
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=rtcp:5555
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=rtcp-fb:120 nack
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=rtcp-mux
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=rtcp-rsize
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,8 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=rtpmap:120 VP8/90000
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0

Просмотреть файл

@ -1,34 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=rtpmap:122 red/90000
a=rtcp-fb:120 ack rpsi
a=rtcp-fb:120 ack app
a=rtcp-fb:120 ack app foo
a=rtcp-fb:120 ack foo bar
a=rtcp-fb:120 ack foo bar baz
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 nack sli
a=rtcp-fb:120 nack rpsi
a=rtcp-fb:120 nack app
a=rtcp-fb:120 nack app foo
a=rtcp-fb:120 nack app foo bar
a=rtcp-fb:120 nack foo bar baz
a=rtcp-fb:120 trr-int 0
a=rtcp-fb:120 trr-int 123
a=rtcp-fb:120 goog-remb
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 ccm tmmbr
a=rtcp-fb:120 ccm tstr
a=rtcp-fb:120 ccm vbcm 123 456 789
a=rtcp-fb:120 ccm foo
a=rtcp-fb:120 ccm foo bar baz
a=rtcp-fb:120 foo
a=rtcp-fb:120 foo bar
a=rtcp-fb:120 foo bar baz
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=sctpmap:5000
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=ssrc:5000
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
a=ssrc-group:FID 5000
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000
a=imageattr:flob

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=sendrecv

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=sendrecv

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=sendrecv

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=recvonly

Просмотреть файл

@ -1,9 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
a=sendonly

Просмотреть файл

@ -1,8 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,7 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
t=0 0
m=video 56436 RTP/SAVPF 120
c=IN IP4 198.51.100.7
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,8 +0,0 @@
v=0
o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0
s=SIP Call
c=IN IP4 224.0.0.1/100/12
t=0 0
m=video 9 RTP/SAVPF 120
c=IN IP4 0.0.0.0
a=rtpmap:120 VP8/90000

Просмотреть файл

@ -1,91 +0,0 @@
v=0
o=- 1109973417102828257 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP
m=audio 32952 UDP/TLS/RTP/SAVPF 111 103 104 0 8 107 106 105 13 126
c=IN IP4 128.64.32.16
a=rtcp:32952 IN IP4 128.64.32.16
a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0
a=candidate:77142221 2 udp 2113937151 192.168.137.1 54081 typ host generation 0
a=candidate:983072742 1 udp 2113937151 172.22.0.56 54082 typ host generation 0
a=candidate:983072742 2 udp 2113937151 172.22.0.56 54082 typ host generation 0
a=candidate:2245074553 1 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0
a=candidate:2245074553 2 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0
a=candidate:2479353907 1 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0
a=candidate:2479353907 2 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0
a=candidate:1243276349 1 tcp 1509957375 192.168.137.1 0 typ host generation 0
a=candidate:1243276349 2 tcp 1509957375 192.168.137.1 0 typ host generation 0
a=candidate:1947960086 1 tcp 1509957375 172.22.0.56 0 typ host generation 0
a=candidate:1947960086 2 tcp 1509957375 172.22.0.56 0 typ host generation 0
a=candidate:1808221584 1 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0
a=candidate:1808221584 2 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0
a=candidate:507872740 1 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0
a=candidate:507872740 2 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0
a=ice-ufrag:xQuJwjX3V3eMA81k
a=ice-pwd:ZUiRmjS2GDhG140p73dAsSVP
a=ice-options:google-ice
a=fingerprint:sha-256 59:4A:8B:73:A7:73:53:71:88:D7:4D:58:28:0C:79:72:31:29:9B:05:37:DD:58:43:C2:D4:85:A2:B3:66:38:7A
a=setup:active
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=mid:audio
a=rtcp-mux
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:/U44g3ULdtapeiSg+T3n6dDLBKIjpOhb/NXAL/2b
a=rtpmap:111 opus/48000/2
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:107 CN/48000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2271517329 cname:mKDNt7SQf6pwDlIn
a=ssrc:2271517329 msid:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0
a=ssrc:2271517329 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP
a=ssrc:2271517329 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPa0
m=video 32952 UDP/TLS/RTP/SAVPF 100 116 117
c=IN IP4 128.64.32.16
a=rtcp:32952 IN IP4 128.64.32.16
a=candidate:77142221 1 udp 2113937151 192.168.137.1 54081 typ host generation 0
a=candidate:77142221 2 udp 2113937151 192.168.137.1 54081 typ host generation 0
a=candidate:983072742 1 udp 2113937151 172.22.0.56 54082 typ host generation 0
a=candidate:983072742 2 udp 2113937151 172.22.0.56 54082 typ host generation 0
a=candidate:2245074553 1 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0
a=candidate:2245074553 2 udp 1845501695 32.64.128.1 62397 typ srflx raddr 192.168.137.1 rport 54081 generation 0
a=candidate:2479353907 1 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0
a=candidate:2479353907 2 udp 1845501695 32.64.128.1 54082 typ srflx raddr 172.22.0.56 rport 54082 generation 0
a=candidate:1243276349 1 tcp 1509957375 192.168.137.1 0 typ host generation 0
a=candidate:1243276349 2 tcp 1509957375 192.168.137.1 0 typ host generation 0
a=candidate:1947960086 1 tcp 1509957375 172.22.0.56 0 typ host generation 0
a=candidate:1947960086 2 tcp 1509957375 172.22.0.56 0 typ host generation 0
a=candidate:1808221584 1 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0
a=candidate:1808221584 2 udp 33562367 128.64.32.16 32952 typ relay raddr 32.64.128.1 rport 62398 generation 0
a=candidate:507872740 1 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0
a=candidate:507872740 2 udp 33562367 128.64.32.16 40975 typ relay raddr 32.64.128.1 rport 54085 generation 0
a=ice-ufrag:xQuJwjX3V3eMA81k
a=ice-pwd:ZUiRmjS2GDhG140p73dAsSVP
a=ice-options:google-ice
a=fingerprint:sha-256 59:4A:8B:73:A7:73:53:71:88:D7:4D:58:28:0C:79:72:31:29:9B:05:37:DD:58:43:C2:D4:85:A2:B3:66:38:7A
a=setup:active
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=mid:video
a=rtcp-mux
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:/U44g3ULdtapeiSg+T3n6dDLBKIjpOhb/NXAL/2b
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=ssrc:54724160 cname:mKDNt7SQf6pwDlIn
a=ssrc:54724160 msid:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP 1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPv0
a=ssrc:54724160 mslabel:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIP
a=ssrc:54724160 label:1PBxet5BYh0oYodwsvNM4k6KiO2eWCX40VIPv0

Просмотреть файл

@ -1,5 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
t=0 0
a=ice-lite

Просмотреть файл

@ -1,12 +0,0 @@
v=0
o=- 4294967296 2 IN IP4 127.0.0.1
s=SIP Call
c=IN IP4 198.51.100.7
b=CT:5000
b=FOOBAR:10
b=AS:4
t=0 0
m=video 56436 RTP/SAVPF 120
a=rtpmap:120 VP8/90000
m=audio 12345/2 RTP/SAVPF 0
a=rtpmap:0 PCMU/8000

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше