mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
faafb5fd9d
- As suggested in PR 101, use OpenBSD assembler files. Update the NetBSD on them and use .S instead of .s, to indicate files to process (or preprocessor would fail on comments). (6a17dbacc3) - Bug 1229769 - Expose Promise interface to WorkerDebugger #ifdef SPIDERMONKEY_PROMISE;r=bz (da9e838c23) - Bug 1155969 - Make xpt.py flake8 compliant. r=ted (84f8eab5a3) - Bug 977464 - Always relink XPT files for all changed XPIDL interfaces without requiring the IID to be revved; r=khuey (9b22512c41) - Bug 977464 follow-up: Fix the indentation to use 4 spaces (bd68a8ebc3) - Bug 1240053 - Consider the order of methods, their params, and constant important when comparing XPT interfaces to decide whether to relink XPT files; r=khuey (b9253dd183) - Bug 1264377. Get rid of some unnecessary custom JSClass hook functions in xpconnect sandboxes and DOM simple globals. r=bholley (60950b416b) - Bug 1258496 - Purge message manager cached scripts on 'message-manager-flush-caches' notification. r=smaug (028b229d02) - Bug 1251298 - Null out |*idp| when necessary in DoInterfaceDescriptor. r=khuey. (dbdd15dae8) - Bug 659625 - part1: implement Console::clear in dom/base/Console.cpp;r=baku (17c4b33789) - Bug 659625 - part2: implement console.clear in devtools webconsole;r=bgrins (b72c6173ee) - Bug 1248507 - p5. DecoderDoctorDiagnostics implementation - r=jya,bz (22f68130af) - Bug 1248507 - p6. Minimal notification definition - r=bz (02f3eeb2f9) - Bug 1248507 - p7. Notify decoder-doctor-notification listeners - r=jya,bz (2c2eb33388) - Bug 1248507 - p8. FFMpeg checks: Console message - r=bz (50a993c143) - Bug 1248507 - p9. FFMpeg checks: Notification definition - r=bz (0bcdcc090c) - Bug 1248507 - p10. Detect and report when FFMpeg/Linux fails to load - r=jya (28137efda0) - Bug 1190939: Decode VP9 4:4:4 properly. r=jya (98508bb48b) - Bug 1232911 - [1.2] Allow to test for specific VPX MIME type version. r=cpearce (1b53e02981) - Bug 1251887 - Add break to unintentional switch fallthrough in GfxInfoBase.cpp to fix -Wimplicit-fallthrough warning. r=milan (9969a7bec7) - Bug 1232911 - [2.2] Add VPX decoding blocking support. r=snorp (fa860a9d4d) - Bug 1249777: Added support for 10.11 in the blocklisting code as well. r=mstange (479f629083) - Bug 1242084 - Fix GfxInfoBase nsStringBuffer leak. r=dvander (87b38ee72d) - Bug 1222201: Only use container calculated dimensions. r=cpearce (693ebdf450) - Bug 1190240 - Cannot compile WMFVideoMFTManager.cpp using Windows 10 SDK. r=cpearce (8ee2e315f5) - Bug 1248496 - Enable D3D11 DXVA. r=ajones (a79df0baf2) - Bug 1248496 - Show which DXVA API is being used in about:support. r=jya (1f6b1f0c8e) - Bug 1257028 - Fallback to d3d9 decoding if d3d11 fails. r=cpearce (5ad7c159f1) - Bug 1232045 - WebMDemuxer handles resolution changes. r=jya (18bdc79b1c) - Bug 1243538: P1. Make MediaInfo::mImage an nsIntSize again and introduce a mImageRect member. r=mattwoodrow (a446cca01e) - Bug 1243538: P2. Add convenience VideoInfo::ScaledImageRect. r=mattwoodrow (657e675b72) - Bug 1243538: P3. Adjust libvpx decoder to allow different decoding size from metadata. r=mattwoodrow (50949ce02d) - Bug 1243538: P4. Adjust ffvpx decoder to allow different decoding size from metadata. r=mattwoodrow (392c8939f5) - Bug 1243538: P5. Adjust wmf decoder to allow different decoding size from metadata. r=cpearce (f50940564f) - Bug 1239611 - Remove GonkNativeWindowClient r=nical (2c7ccb54a4) - Bug 1170589 - Force decoder to use all allocated buffers. r=bwu (7e5c02e48a) - Bug 1222923 - Enable MOZ_FMP4 on gonk L r=jolin (c04ad6ff55) - Bug 1178214 - Return INIT_ERROR when video resolution exceeds hw codec capability. r=sotaro (bf3c45cde1) - Bug 1147304 - Send codec specific data for MPEG4 codec type only. r=jya (ca48d110f4) - Bug 1243538: P6. Adjust gonk decoder to allow different decoding size from metadata. r=alfredo (257e017762) - Bug 1243538: [webm] P7. Let the decoder handle picture resizing. r=SingingTree (32dc4a5aac) - Bug 1262727: [webm] Ensure first frame returned after seek is a keyframe. r=kinetik (f16140852a) - Bug 1246536: [webm] Only use discard padding information on last packet. r=kinetik (0bac4f8855) - Bug 1266013: Fix Firefox OS compile errors. r=gerald (f021717287) - cleanup (390cdec6ee) - Bug 1264991: Don't construct invalid channel configuration. r=gerald (661828e8b8) - Bug 1265093: Fix CID 1358648. r=gerald (55468c1261) - Bug 1262659 - Report HTTP Live Streaming playback requests. r=cpearce,bsmedberg (96b8cd2810) - Bug 1265400 - Use unsigned long for AudioBuffer length and numberOfChannels; r=smaug (f74f27ea4e)
164 lines
4.3 KiB
C++
164 lines
4.3 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=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 "mozilla/dom/SimpleGlobalObject.h"
|
|
|
|
#include "jsapi.h"
|
|
#include "js/Class.h"
|
|
|
|
#include "nsContentUtils.h"
|
|
#include "nsJSPrincipals.h"
|
|
#include "nsNullPrincipal.h"
|
|
#include "nsThreadUtils.h"
|
|
|
|
#include "xpcprivate.h"
|
|
|
|
namespace mozilla {
|
|
namespace dom {
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(SimpleGlobalObject)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SimpleGlobalObject)
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
|
tmp->UnlinkHostObjectURIs();
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SimpleGlobalObject)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
|
tmp->TraverseHostObjectURIs(cb);
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(SimpleGlobalObject)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(SimpleGlobalObject)
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(SimpleGlobalObject)
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
|
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
|
|
NS_INTERFACE_MAP_END
|
|
|
|
static void
|
|
SimpleGlobal_finalize(js::FreeOp *fop, JSObject *obj)
|
|
{
|
|
SimpleGlobalObject* globalObject =
|
|
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
|
|
NS_RELEASE(globalObject);
|
|
}
|
|
|
|
static void
|
|
SimpleGlobal_moved(JSObject *obj, const JSObject *old)
|
|
{
|
|
SimpleGlobalObject* globalObject =
|
|
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
|
|
globalObject->UpdateWrapper(obj, old);
|
|
}
|
|
|
|
static const js::ClassOps SimpleGlobalClassOps = {
|
|
nullptr,
|
|
nullptr,
|
|
nullptr,
|
|
nullptr,
|
|
JS_EnumerateStandardClasses,
|
|
JS_ResolveStandardClass,
|
|
JS_MayResolveStandardClass,
|
|
SimpleGlobal_finalize,
|
|
nullptr,
|
|
nullptr,
|
|
nullptr,
|
|
JS_GlobalObjectTraceHook,
|
|
};
|
|
|
|
static const js::ClassExtension SimpleGlobalClassExtension = {
|
|
nullptr,
|
|
SimpleGlobal_moved
|
|
};
|
|
|
|
const js::Class SimpleGlobalClass = {
|
|
"",
|
|
JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
|
|
&SimpleGlobalClassOps,
|
|
JS_NULL_CLASS_SPEC,
|
|
&SimpleGlobalClassExtension,
|
|
JS_NULL_OBJECT_OPS
|
|
};
|
|
|
|
// static
|
|
JSObject*
|
|
SimpleGlobalObject::Create(GlobalType globalType, JS::Handle<JS::Value> proto)
|
|
{
|
|
JSContext* cx = nsContentUtils::GetDefaultJSContextForThread();
|
|
JSAutoRequest ar(cx);
|
|
|
|
JS::CompartmentOptions options;
|
|
options.creationOptions().setInvisibleToDebugger(true);
|
|
|
|
nsCOMPtr<nsIPrincipal> principal;
|
|
if (NS_IsMainThread()) {
|
|
principal = nsNullPrincipal::Create();
|
|
if (!principal) {
|
|
return nullptr;
|
|
}
|
|
}
|
|
|
|
JS::Rooted<JSObject*> global(cx,
|
|
JS_NewGlobalObject(cx, js::Jsvalify(&SimpleGlobalClass),
|
|
nsJSPrincipals::get(principal),
|
|
JS::DontFireOnNewGlobalHook, options));
|
|
|
|
if (!global) {
|
|
JS_ClearPendingException(cx);
|
|
return nullptr;
|
|
}
|
|
|
|
JSAutoCompartment ac(cx, global);
|
|
|
|
// It's important to create the nsIGlobalObject for our new global before we
|
|
// start trying to wrap things like the prototype into its compartment,
|
|
// because the wrap operation relies on the global having its nsIGlobalObject
|
|
// already.
|
|
RefPtr<SimpleGlobalObject> globalObject =
|
|
new SimpleGlobalObject(global, globalType);
|
|
|
|
// Pass on ownership of globalObject to |global|.
|
|
JS_SetPrivate(global, globalObject.forget().take());
|
|
|
|
if (proto.isObjectOrNull()) {
|
|
JS::Rooted<JSObject*> protoObj(cx, proto.toObjectOrNull());
|
|
if (!JS_WrapObject(cx, &protoObj)) {
|
|
JS_ClearPendingException(cx);
|
|
return nullptr;
|
|
}
|
|
|
|
if (!JS_SetPrototype(cx, global, protoObj)) {
|
|
JS_ClearPendingException(cx);
|
|
return nullptr;
|
|
}
|
|
} else if (!proto.isUndefined()) {
|
|
// Bogus proto.
|
|
return nullptr;
|
|
}
|
|
|
|
JS_FireOnNewGlobalObject(cx, global);
|
|
return global;
|
|
}
|
|
|
|
// static
|
|
SimpleGlobalObject::GlobalType
|
|
SimpleGlobalObject::SimpleGlobalType(JSObject* obj)
|
|
{
|
|
if (js::GetObjectClass(obj) != &SimpleGlobalClass) {
|
|
return SimpleGlobalObject::GlobalType::NotSimpleGlobal;
|
|
}
|
|
|
|
SimpleGlobalObject* globalObject =
|
|
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
|
|
return globalObject->Type();
|
|
}
|
|
|
|
} // namespace mozilla
|
|
} // namespace dom
|