Files
palemoon27/dom/base/ProcessGlobal.cpp
T
roytam1 c106e1d83f import change from rmottola/Arctic-Fox:
- Bug 1136322 - Optimize anon scopes from CC graph, r=mccr8 (30dc41e43)
- Bug 1073379, part 1 - Add an AnimationUtils::DoubleToTimeDuration helper. r=birtles (aa1ad8263)
- Bug 1073379, part 2 - Implement web-animations proceedure to 'update the player start time' and make AnimationPlayer.startTime writeable. r=birtles, r=smaug (1fb9e6846)
- Bug 1073379, part 3 - Make AnimationPlayer::SetStartTime() notify its animation manager (via its player collection) of changes so that computed style is updated correctly. r=dholbert (e2c9fd732)
- Bug 1073379, part 4 - Rework the CSS animations event dispatch code to handle startTime shifting the animations back in time. r=dholbert (eb8fce72f)
- Bug 1073379, part 5 - Add assert_between_exclusive and assert_between_inclusive methods to impltests testharness.js. r=Ms2ger (3bf02b920)
- Bug 1073379, part 6 - Tests for the effect of setting CSS animation's AnimationPlayer.startTime. r=dholbert (e16af3e3c)
- Bug 1073379, part 6b - Re-enable the player.playState check in checkStateAtActiveIntervalEndTime, but disable the first checkStateAtActiveIntervalEndTime call in the 'Skipping backwards through animation' tests. r=orange (caa6c6829)
- Bug 1129650 - Touching navigator.mozId causes an error NS_ERROR_FACTORY_NOT_REGISTERED. r=baku (3e60c1ac4)
- Bug 237623 - introduce soft checks for HTTP framing errors (slightly adapted, since some code was already existing) (99af51054)
- Bug 1135560 - Number.{parseInt, parseFloat} should be the same functions as global ones. r=till (447e062f8)
- Bug 931903 - Add mochitest for forwarding a stream from one PC to another. r=jesup,drno (3f59c4983)
- Bug 853162 - Remove XMLHttpRequest.sendAsBinary() interface. r=smaug (6743e5f77)
- Bug 1135677 - Deal with overflowing rects. r=bas (a4fd64e58)
- Bug 1136389 - Fix qcms num in/out channels mismatch. r=jrmuizel (8b2f43315)
- Bug 1136378 - Use a browser's outerWindowId property rather than a CPOW to identify marionette's content listeners.;r=mconley (0c7174cc0)
- bug 1071880 - Notify user of addons that are slowing their browser down significantly r=mossop (f5cd276a6)
- Bug 897031 - NS_ERROR_XPC_GS_RETURNED_FAILURE at nsBlocklistService.js:70 followed by ReferenceError: gApp is not defined, on green Windows debug mochitest runs. r=dtownsend (ca53e537d)
- Bug 826741 - Use the backtracking register allocator by default (b93762a32)
- Bug 1135654 - part 1 - move backtrace conversion scripts to FINAL_TARGET_FILES; r=mshal (85aabdfd3)
- Bug 1135654 - part 2 - move FINAL_TARGET's .gdbinit to FINAL_TARGET_FILES; r=mshal (92a13af32)
- Bug 1135654 - part 3 - move installation of MOZ_CLANG_RT_ASAN_LIB_PATH to moz.build; r=mshal (8f4916099)
- Bug 1135654 - part 4 - remove libs:: rule for installing Valgrind suppressions in favor of INSTALL_TARGETS; r=mshal (2ac68a277)
- Bug 1073352, part 1 - Make the DOMWINDOW and DOCSHELL leak detector work with e10s. r=jmaher (957be3db1)
- Bug 1087646 - fast-path null principal'd documents. r=mcmanus (df0140396)
- Bug 1087646 - Add a test. r=smaug (18315fc00)
2019-08-23 09:54:34 +08:00

104 lines
3.2 KiB
C++

/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8; -*- */
/* vim: set sw=4 ts=8 et 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 "ProcessGlobal.h"
#include "nsContentCID.h"
using namespace mozilla;
using namespace mozilla::dom;
ProcessGlobal::ProcessGlobal(nsFrameMessageManager* aMessageManager)
: mInitialized(false),
mMessageManager(aMessageManager)
{
SetIsNotDOMBinding();
mozilla::HoldJSObjects(this);
}
ProcessGlobal::~ProcessGlobal()
{
mAnonymousGlobalScopes.Clear();
mozilla::DropJSObjects(this);
}
ProcessGlobal*
ProcessGlobal::Get()
{
nsCOMPtr<nsISyncMessageSender> service = do_GetService(NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID);
if (!service) {
return nullptr;
}
return static_cast<ProcessGlobal*>(service.get());
}
/* [notxpcom] boolean markForCC (); */
// This method isn't automatically forwarded safely because it's notxpcom, so
// the IDL binding doesn't know what value to return.
NS_IMETHODIMP_(bool)
ProcessGlobal::MarkForCC()
{
MarkScopesForCC();
return mMessageManager ? mMessageManager->MarkForCC() : false;
}
NS_IMPL_CYCLE_COLLECTION_CLASS(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
for (uint32_t i = 0; i < tmp->mAnonymousGlobalScopes.Length(); ++i) {
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mAnonymousGlobalScopes[i])
}
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAnonymousGlobalScopes)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ProcessGlobal)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentProcessMessageManager)
NS_INTERFACE_MAP_ENTRY(nsIMessageListenerManager)
NS_INTERFACE_MAP_ENTRY(nsIMessageSender)
NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender)
NS_INTERFACE_MAP_ENTRY(nsIContentProcessMessageManager)
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ContentProcessMessageManager)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTING_RELEASE(ProcessGlobal)
bool
ProcessGlobal::Init()
{
if (mInitialized) {
return true;
}
mInitialized = true;
nsISupports* scopeSupports = NS_ISUPPORTS_CAST(nsIContentProcessMessageManager*, this);
return InitChildGlobalInternal(scopeSupports, NS_LITERAL_CSTRING("processChildGlobal"));
}
void
ProcessGlobal::LoadScript(const nsAString& aURL)
{
Init();
LoadScriptInternal(aURL, false);
}