mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1147951, part 2 - Remove unused JAVASCRIPT definition from nsJSEnvironment.cpp. r=baku (607909217) - Bug 1147951, part 1 - Remove uses of JAVASCRIPT2 from Console.cpp. r=baku (46cde7cfa) - pointer style (5504c22d4) - Bug 1165384 - Add a typedef for the statistics phase table; r=sfink (484a24237) - Bug 1165385 - Remove the rarely used !fullFormat mode of MOZ_GCTIMER; r=sfink (ab8b17eb1) - Bug 1165390 - Make the detailed statistics formatting methods have consistent names; r=sfink (55c5db543) - Bug 1165410 - Reimplement GC statistics JSON output formatter; r=sfink (04c13c874) - Bug 1166789 - Cleanup javascript.options.mem.log formatting; r=sfink, r=mccr8 (f23b455b4) - Bug 1171451 - Use the correct type for the argv argument to NS_CreateJSArgv and the nsJSArgArray constructor; r=jst (edfa21a59) - Bug 886459, part 1 - Remove unused includes of nsIJSRuntimeService.h. r=bholley (bbc277ac1) - Bug 886459, part 2 - Remove context callbacks from XPCJSRuntime. r=bholley (2c3c8515a) - Bug 886459, part 3 - Remove simple uses of nsIJSRuntimeService to get the JSRuntime. r=bholley (ff5bfe304) - pointer style (2ea264afd) - Bug 1169457 - Add null check in OnWrapperDestroy. r=jimm (741739513) - Bug 886459, part 4 - Remove nsIJSRuntimeService. r=bholley,aklotz (61563f53b) - Bug 1176642 - Use absolute_import in mach_commands.py files; r=glandium (a9fcb3b3f) - Bug 1176642 - Defer import of autotry and pprint; r=chmanchester (de40855cb) - Bug 1178772 - Add check_macroassembler_style.py: Verify that each MacroAssembler declaration maps to all its definitions. r=h4writer (fd406593a) - Bug 1152556 - Add moz.build bugzilla metadata in dom/media. r=kinetik (fa2ffa121) - Bug 1152556 - Add moz.build bugzilla metadata in dom/media webrtc. r=abr (d208b839a) - re-enable peerconnection (42e8c412b) - Bug 1152538 - Enable WebRTC identity, r=jesup (13a47adcb) - Bug 1231123 - Simplify LaunchApp on BSDs by dropping fork/exec version. r=jld (c35e6e36f) - bug 1171120 - Fix mtransport+signalling to build on iOS. r=ekr (7034b20ab) - Bug 1150609 Patch 1 WebRTC SDP - add tmmbr to offer. r=jesup (52ca72d09) - Bug 1150609 Patch 2 - WebRTC enable tmmbr r=jesup (d59c6adb9) - Bug 1150609 Patch 3 - WebRTC enable tmmbr unittest changes. r=jesup (eeffed826) - Bug 1087161 - Upgrading B2G toolchain to gcc-4.9 (851194ca0)
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIJSRuntimeService.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@@ -150,8 +149,6 @@ static const uint32_t kMaxICCDuration = 2000; // ms
|
||||
// Trigger a CC if the purple buffer exceeds this size when we check it.
|
||||
#define NS_CC_PURPLE_LIMIT 200
|
||||
|
||||
#define JAVASCRIPT nsIProgrammingLanguage::JAVASCRIPT
|
||||
|
||||
// Large value used to specify that a script should run essentially forever
|
||||
#define NS_UNLIMITED_SCRIPT_RUNTIME (0x40000000LL << 32)
|
||||
|
||||
@@ -203,11 +200,6 @@ static bool sDidPaintAfterPreviousICCSlice = false;
|
||||
|
||||
static nsScriptNameSpaceManager *gNameSpaceManager;
|
||||
|
||||
static nsIJSRuntimeService *sRuntimeService;
|
||||
|
||||
static const char kJSRuntimeServiceContractID[] =
|
||||
"@mozilla.org/js/xpc/RuntimeService;1";
|
||||
|
||||
static PRTime sFirstCollectionTime;
|
||||
|
||||
static JSRuntime *sRuntime;
|
||||
@@ -657,10 +649,8 @@ nsJSContext::~nsJSContext()
|
||||
|
||||
if (!sContextCount && sDidShutdown) {
|
||||
// The last context is being deleted, and we're already in the
|
||||
// process of shutting down, release the JS runtime service, and
|
||||
// the security manager.
|
||||
// process of shutting down, release the security manager.
|
||||
|
||||
NS_IF_RELEASE(sRuntimeService);
|
||||
NS_IF_RELEASE(sSecurityManager);
|
||||
}
|
||||
}
|
||||
@@ -2234,7 +2224,7 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
|
||||
if (sPostGCEventsToConsole) {
|
||||
NS_NAMED_LITERAL_STRING(kFmt, "GC(T+%.1f) ");
|
||||
nsString prefix, gcstats;
|
||||
gcstats.Adopt(aDesc.formatMessage(aRt));
|
||||
gcstats.Adopt(aDesc.formatSummaryMessage(aRt));
|
||||
prefix.Adopt(nsTextFormatter::smprintf(kFmt.get(),
|
||||
double(delta) / PR_USEC_PER_SEC));
|
||||
nsString msg = prefix + gcstats;
|
||||
@@ -2310,6 +2300,15 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
|
||||
nsCycleCollector_dispatchDeferredDeletion();
|
||||
}
|
||||
|
||||
if (sPostGCEventsToConsole) {
|
||||
nsString gcstats;
|
||||
gcstats.Adopt(aDesc.formatSliceMessage(aRt));
|
||||
nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
||||
if (cs) {
|
||||
cs->LogStringMessage(gcstats.get());
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -2369,7 +2368,6 @@ mozilla::dom::StartupJSEnvironment()
|
||||
sNeedsFullCC = false;
|
||||
sNeedsGCAfterCC = false;
|
||||
gNameSpaceManager = nullptr;
|
||||
sRuntimeService = nullptr;
|
||||
sRuntime = nullptr;
|
||||
sIsInitialized = false;
|
||||
sDidShutdown = false;
|
||||
@@ -2704,13 +2702,8 @@ nsJSContext::EnsureStatics()
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
rv = CallGetService(kJSRuntimeServiceContractID, &sRuntimeService);
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
rv = sRuntimeService->GetRuntime(&sRuntime);
|
||||
if (NS_FAILED(rv)) {
|
||||
sRuntime = xpc::GetJSRuntime();
|
||||
if (!sRuntime) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
@@ -2884,9 +2877,7 @@ mozilla::dom::ShutdownJSEnvironment()
|
||||
|
||||
if (!sContextCount) {
|
||||
// We're being shutdown, and there are no more contexts
|
||||
// alive, release the JS runtime service and the security manager.
|
||||
|
||||
NS_IF_RELEASE(sRuntimeService);
|
||||
// alive, release the security manager.
|
||||
NS_IF_RELEASE(sSecurityManager);
|
||||
}
|
||||
|
||||
@@ -2902,7 +2893,7 @@ mozilla::dom::ShutdownJSEnvironment()
|
||||
// on-the-fly.
|
||||
class nsJSArgArray final : public nsIJSArgArray {
|
||||
public:
|
||||
nsJSArgArray(JSContext *aContext, uint32_t argc, JS::Value *argv,
|
||||
nsJSArgArray(JSContext *aContext, uint32_t argc, const JS::Value* argv,
|
||||
nsresult *prv);
|
||||
|
||||
// nsISupports
|
||||
@@ -2925,11 +2916,11 @@ protected:
|
||||
uint32_t mArgc;
|
||||
};
|
||||
|
||||
nsJSArgArray::nsJSArgArray(JSContext *aContext, uint32_t argc, JS::Value *argv,
|
||||
nsresult *prv) :
|
||||
mContext(aContext),
|
||||
mArgv(nullptr),
|
||||
mArgc(argc)
|
||||
nsJSArgArray::nsJSArgArray(JSContext *aContext, uint32_t argc,
|
||||
const JS::Value* argv, nsresult *prv)
|
||||
: mContext(aContext)
|
||||
, mArgv(nullptr)
|
||||
, mArgc(argc)
|
||||
{
|
||||
// copy the array - we don't know its lifetime, and ours is tied to xpcom
|
||||
// refcounting.
|
||||
@@ -3044,12 +3035,11 @@ NS_IMETHODIMP nsJSArgArray::Enumerate(nsISimpleEnumerator **_retval)
|
||||
}
|
||||
|
||||
// The factory function
|
||||
nsresult NS_CreateJSArgv(JSContext *aContext, uint32_t argc, void *argv,
|
||||
nsIJSArgArray **aArray)
|
||||
nsresult NS_CreateJSArgv(JSContext *aContext, uint32_t argc,
|
||||
const JS::Value* argv, nsIJSArgArray **aArray)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIJSArgArray> ret = new nsJSArgArray(aContext, argc,
|
||||
static_cast<JS::Value *>(argv), &rv);
|
||||
nsCOMPtr<nsIJSArgArray> ret = new nsJSArgArray(aContext, argc, argv, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user