Merge mozilla-central into mozilla-inbound on a CLOSED TREE

This commit is contained in:
Ehsan Akhgari 2012-05-23 17:31:12 -04:00
Родитель ceaeecaca2 3cbb0c7a66
Коммит 3f00a625ae
19 изменённых файлов: 126 добавлений и 47 удалений

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

@ -147,7 +147,7 @@ pref("app.update.silent", false);
// If set to true, the Update Service will apply updates in the background
// when it finishes downloading them.
pref("app.update.stage.enabled", true);
pref("app.update.stage.enabled", false);
// Update service URL:
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");

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

@ -45,3 +45,4 @@ DEPRECATED_OPERATION(InputEncoding)
DEPRECATED_OPERATION(MozBeforePaint)
DEPRECATED_OPERATION(MozBlobBuilder)
DEPRECATED_OPERATION(DOMExceptionCode)
DEPRECATED_OPERATION(MutationEvent)

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

@ -92,8 +92,8 @@ class Element;
} // namespace mozilla
#define NS_IDOCUMENT_IID \
{ 0x88d887da, 0xd228, 0x41c2, \
{ 0xb8, 0x0a, 0x42, 0xec, 0xf0, 0xcb, 0xce, 0x37 } }
{ 0x8c6a1e62, 0xd5ad, 0x4297, \
{ 0xb9, 0x41, 0x64, 0x49, 0x22, 0x2e, 0xc4, 0xf0 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@ -674,6 +674,12 @@ public:
return mWindow ? mWindow->GetOuterWindow() : GetWindowInternal();
}
bool IsInBackgroundWindow() const
{
nsPIDOMWindow* outer = mWindow ? mWindow->GetOuterWindow() : nsnull;
return outer && outer->IsBackground();
}
/**
* Return the inner window used as the script compilation scope for
* this document. If you're not absolutely sure you need this, use

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

@ -1547,8 +1547,9 @@ nsContentSink::WillParseImpl(void)
vm->GetLastUserEventTime(lastEventTime);
bool newDynLower =
(currentTime - mBeginLoadTime) > PRUint32(sInitialPerfTime) &&
(currentTime - lastEventTime) < PRUint32(sInteractiveTime);
mDocument->IsInBackgroundWindow() ||
((currentTime - mBeginLoadTime) > PRUint32(sInitialPerfTime) &&
(currentTime - lastEventTime) < PRUint32(sInteractiveTime));
if (mDynamicLowerValue != newDynLower) {
FavorPerformanceHint(!newDynLower, 0);

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

@ -17,15 +17,15 @@
#include "nsServiceManagerUtils.h"
#include "DictionaryHelpers.h"
nsCOMArray<nsIDOMMozMutationObserver>*
nsCOMArray<nsIDOMMutationObserver>*
nsDOMMutationObserver::sScheduledMutationObservers = nsnull;
nsIDOMMozMutationObserver* nsDOMMutationObserver::sCurrentObserver = nsnull;
nsIDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nsnull;
PRUint32 nsDOMMutationObserver::sMutationLevel = 0;
PRUint64 nsDOMMutationObserver::sCount = 0;
nsAutoTArray<nsCOMArray<nsIDOMMozMutationObserver>, 4>*
nsAutoTArray<nsCOMArray<nsIDOMMutationObserver>, 4>*
nsDOMMutationObserver::sCurrentlyHandlingObservers = nsnull;
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMutationRecord)
@ -162,7 +162,7 @@ nsMutationReceiver::Disconnect(bool aRemoveFromObserver)
mParent = nsnull;
nsINode* target = mTarget;
mTarget = nsnull;
nsIDOMMozMutationObserver* observer = mObserver;
nsIDOMMutationObserver* observer = mObserver;
mObserver = nsnull;
RemoveClones();
@ -395,13 +395,13 @@ void nsMutationReceiver::NodeWillBeDestroyed(const nsINode *aNode)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMutationObserver)
DOMCI_DATA(MozMutationObserver, nsDOMMutationObserver)
DOMCI_DATA(MutationObserver, nsDOMMutationObserver)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMMutationObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMozMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozMutationObserver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsIDOMMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsIJSNativeInitializer)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozMutationObserver)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MutationObserver)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMMutationObserver)
@ -506,7 +506,7 @@ void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
sScheduledMutationObservers = new nsCOMArray<nsIDOMMozMutationObserver>;
sScheduledMutationObservers = new nsCOMArray<nsIDOMMutationObserver>;
}
bool didInsert = false;
@ -705,10 +705,10 @@ nsDOMMutationObserver::HandleMutationsInternal()
return;
}
nsCOMArray<nsIDOMMozMutationObserver>* suppressedObservers = nsnull;
nsCOMArray<nsIDOMMutationObserver>* suppressedObservers = nsnull;
while (sScheduledMutationObservers) {
nsCOMArray<nsIDOMMozMutationObserver>* observers = sScheduledMutationObservers;
nsCOMArray<nsIDOMMutationObserver>* observers = sScheduledMutationObservers;
sScheduledMutationObservers = nsnull;
for (PRInt32 i = 0; i < observers->Count(); ++i) {
sCurrentObserver = static_cast<nsDOMMutationObserver*>((*observers)[i]);
@ -716,7 +716,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
sCurrentObserver->HandleMutation();
} else {
if (!suppressedObservers) {
suppressedObservers = new nsCOMArray<nsIDOMMozMutationObserver>;
suppressedObservers = new nsCOMArray<nsIDOMMutationObserver>;
}
if (suppressedObservers->IndexOf(sCurrentObserver) < 0) {
suppressedObservers->AppendObject(sCurrentObserver);
@ -782,7 +782,7 @@ nsDOMMutationObserver::LeaveMutationHandling()
{
if (sCurrentlyHandlingObservers &&
sCurrentlyHandlingObservers->Length() == sMutationLevel) {
nsCOMArray<nsIDOMMozMutationObserver>& obs =
nsCOMArray<nsIDOMMutationObserver>& obs =
sCurrentlyHandlingObservers->ElementAt(sMutationLevel - 1);
for (PRInt32 i = 0; i < obs.Count(); ++i) {
nsDOMMutationObserver* o =
@ -804,7 +804,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse
if (!sCurrentlyHandlingObservers) {
sCurrentlyHandlingObservers =
new nsAutoTArray<nsCOMArray<nsIDOMMozMutationObserver>, 4>;
new nsAutoTArray<nsCOMArray<nsIDOMMutationObserver>, 4>;
}
while (sCurrentlyHandlingObservers->Length() < sMutationLevel) {

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

@ -141,7 +141,7 @@ public:
}
protected:
nsMutationReceiverBase(nsINode* aTarget, nsIDOMMozMutationObserver* aObserver)
nsMutationReceiverBase(nsINode* aTarget, nsIDOMMutationObserver* aObserver)
: mTarget(aTarget), mObserver(aObserver), mRegisterTarget(aTarget)
{
mRegisterTarget->AddMutationObserver(this);
@ -189,7 +189,7 @@ protected:
// The target for the MutationObserver.observe() method.
nsINode* mTarget;
nsIDOMMozMutationObserver* mObserver;
nsIDOMMutationObserver* mObserver;
nsRefPtr<nsMutationReceiverBase> mParent; // Cleared after microtask.
// The node to which Gecko-internal nsIMutationObserver was registered to.
// This is different than mTarget when dealing with transient observers.
@ -218,7 +218,7 @@ private:
class nsMutationReceiver : public nsMutationReceiverBase
{
public:
nsMutationReceiver(nsINode* aTarget, nsIDOMMozMutationObserver* aObserver)
nsMutationReceiver(nsINode* aTarget, nsIDOMMutationObserver* aObserver)
: nsMutationReceiverBase(aTarget, aObserver)
{
mTarget->BindObject(aObserver);
@ -278,7 +278,7 @@ public:
NS_DEFINE_STATIC_IID_ACCESSOR(nsMutationReceiver, NS_MUTATION_OBSERVER_IID)
class nsDOMMutationObserver : public nsIDOMMozMutationObserver,
class nsDOMMutationObserver : public nsIDOMMutationObserver,
public nsIJSNativeInitializer
{
public:
@ -289,8 +289,8 @@ public:
virtual ~nsDOMMutationObserver();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMMutationObserver,
nsIDOMMozMutationObserver)
NS_DECL_NSIDOMMOZMUTATIONOBSERVER
nsIDOMMutationObserver)
NS_DECL_NSIDOMMUTATIONOBSERVER
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* cx, JSObject* obj,
PRUint32 argc, jsval* argv);
@ -308,7 +308,7 @@ public:
static void EnterMutationHandling();
static void LeaveMutationHandling();
static nsIDOMMozMutationObserver* CurrentObserver()
static nsIDOMMutationObserver* CurrentObserver()
{
return sCurrentObserver;
}
@ -361,11 +361,11 @@ protected:
PRUint64 mId;
static PRUint64 sCount;
static nsCOMArray<nsIDOMMozMutationObserver>* sScheduledMutationObservers;
static nsIDOMMozMutationObserver* sCurrentObserver;
static nsCOMArray<nsIDOMMutationObserver>* sScheduledMutationObservers;
static nsIDOMMutationObserver* sCurrentObserver;
static PRUint32 sMutationLevel;
static nsAutoTArray<nsCOMArray<nsIDOMMozMutationObserver>, 4>*
static nsAutoTArray<nsCOMArray<nsIDOMMutationObserver>, 4>*
sCurrentlyHandlingObservers;
};

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

@ -299,7 +299,7 @@ function testChildList4() {
m.observe(div, { childList: true });
// Make sure transient observers aren't leaked.
var leakTest = new MozMutationObserver(function(){});
var leakTest = new M(function(){});
leakTest.observe(div, { characterData: true, subtree: true });
div.insertBefore(df, s2);

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

@ -250,6 +250,10 @@ nsEventListenerManager::AddEventListener(nsIDOMEventListener *aListener,
// Go from our target to the nearest enclosing DOM window.
nsPIDOMWindow* window = GetInnerWindowForTarget();
if (window) {
nsCOMPtr<nsIDocument> doc = do_QueryInterface(window->GetExtantDocument());
if (doc) {
doc->WarnOnceAbout(nsIDocument::eMutationEvent);
}
// If aType is NS_MUTATION_SUBTREEMODIFIED, we need to listen all
// mutations. nsContentUtils::HasMutationListeners relies on this.
window->SetMutationListeners((aType == NS_MUTATION_SUBTREEMODIFIED) ?

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

@ -1607,7 +1607,7 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CustomEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozMutationObserver, nsDOMGenericSH,
NS_DEFINE_CLASSINFO_DATA(MutationObserver, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MutationRecord, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -1657,7 +1657,7 @@ static const nsContractIDMapData kConstructorMap[] =
NS_DEFINE_CONSTRUCTOR_DATA(XSLTProcessor,
"@mozilla.org/document-transformer;1?type=xslt")
NS_DEFINE_CONSTRUCTOR_DATA(EventSource, NS_EVENTSOURCE_CONTRACTID)
NS_DEFINE_CONSTRUCTOR_DATA(MozMutationObserver, NS_DOMMUTATIONOBSERVER_CONTRACTID)
NS_DEFINE_CONSTRUCTOR_DATA(MutationObserver, NS_DOMMUTATIONOBSERVER_CONTRACTID)
};
#define NS_DEFINE_EVENT_CTOR(_class) \
@ -4405,8 +4405,8 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozMutationObserver, nsIDOMMozMutationObserver)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMutationObserver)
DOM_CLASSINFO_MAP_BEGIN(MutationObserver, nsIDOMMutationObserver)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMutationObserver)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MutationRecord, nsIDOMMutationRecord)

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

@ -508,7 +508,7 @@ DOMCI_CLASS(MozCSSKeyframesRule)
DOMCI_CLASS(MediaQueryList)
DOMCI_CLASS(CustomEvent)
DOMCI_CLASS(MozMutationObserver)
DOMCI_CLASS(MutationObserver)
DOMCI_CLASS(MutationRecord)
DOMCI_CLASS(MozSettingsEvent)

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

@ -56,8 +56,8 @@ dictionary MutationObserverInit
};
//[Constructor(in nsIMutationCallback aDoneCallback)]
[scriptable, builtinclass, uuid(156e2ce4-e44a-45f3-92c2-e6611f391dae)]
interface nsIDOMMozMutationObserver : nsISupports
[scriptable, builtinclass, uuid(573105b5-d64e-468f-959f-87eebf93913e)]
interface nsIDOMMutationObserver : nsISupports
{
[implicit_jscontext]
void observe(in nsIDOMNode aTarget, in jsval aOptions);
@ -65,8 +65,8 @@ interface nsIDOMMozMutationObserver : nsISupports
nsIVariant takeRecords();
};
[scriptable, function, uuid(fb539590-b088-4d07-96ff-2cefbc90a198)]
[scriptable, function, uuid(5b52ce60-2210-42f0-842b-7f9f03d62f85)]
interface nsIMutationObserverCallback : nsISupports
{
void handleMutations(in nsIVariant aRecords, in nsIDOMMozMutationObserver aObserver);
void handleMutations(in nsIVariant aRecords, in nsIDOMMutationObserver aObserver);
};

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

@ -120,3 +120,5 @@ MediaLoadDecodeError=Media resource %S could not be decoded.
MozBlobBuilderWarning=Use of MozBlobBuilder is deprecated. Use Blob constructor instead.
# LOCALIZATION NOTE: Do not translate "DOMException", "code" and "name"
DOMExceptionCodeWarning=Use of DOMException's code attribute is deprecated. Use name instead.
# LOCALIZATION NOTE: Do not translate "Mutation Event" and "MutationObserver"
MutationEventWarning=Use of Mutation Events is deprecated. Use MutationObserver instead.

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

@ -157,7 +157,9 @@ class nsHtml5ExecutorFlusher : public nsRunnable
{}
NS_IMETHODIMP Run()
{
mExecutor->RunFlushLoop();
if (!mExecutor->isInList()) {
mExecutor->RunFlushLoop();
}
return NS_OK;
}
};

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

@ -99,6 +99,9 @@ class nsHtml5ExecutorReflusher : public nsRunnable
}
};
static mozilla::LinkedList<nsHtml5TreeOpExecutor>* gBackgroundFlushList = nsnull;
static nsITimer* gFlushTimer = nsnull;
nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor(bool aRunsToCompletion)
{
mRunsToCompletion = aRunsToCompletion;
@ -109,6 +112,18 @@ nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor(bool aRunsToCompletion)
nsHtml5TreeOpExecutor::~nsHtml5TreeOpExecutor()
{
NS_ASSERTION(mOpQueue.IsEmpty(), "Somehow there's stuff in the op queue.");
if (gBackgroundFlushList && isInList()) {
remove();
if (gBackgroundFlushList->isEmpty()) {
delete gBackgroundFlushList;
gBackgroundFlushList = nsnull;
if (gFlushTimer) {
gFlushTimer->Cancel();
NS_RELEASE(gFlushTimer);
}
}
}
}
// nsIContentSink
@ -321,13 +336,46 @@ nsHtml5TreeOpExecutor::FlushTags()
return NS_OK;
}
void
FlushTimerCallback(nsITimer* aTimer, void* aClosure)
{
nsRefPtr<nsHtml5TreeOpExecutor> ex = gBackgroundFlushList->popFirst();
if (ex) {
ex->RunFlushLoop();
}
if (gBackgroundFlushList && gBackgroundFlushList->isEmpty()) {
delete gBackgroundFlushList;
gBackgroundFlushList = nsnull;
gFlushTimer->Cancel();
NS_RELEASE(gFlushTimer);
}
}
void
nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync()
{
nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
if (NS_FAILED(NS_DispatchToMainThread(flusher))) {
NS_WARNING("failed to dispatch executor flush event");
}
if (!mDocument || !mDocument->IsInBackgroundWindow()) {
nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
if (NS_FAILED(NS_DispatchToMainThread(flusher))) {
NS_WARNING("failed to dispatch executor flush event");
}
} else {
if (!gBackgroundFlushList) {
gBackgroundFlushList = new mozilla::LinkedList<nsHtml5TreeOpExecutor>();
}
if (!isInList()) {
gBackgroundFlushList->insertBack(this);
}
if (!gFlushTimer) {
nsCOMPtr<nsITimer> t = do_CreateInstance("@mozilla.org/timer;1");
t.swap(gFlushTimer);
// The timer value 50 should not hopefully slow down background pages too
// much, yet lets event loop to process enough between ticks.
// See bug 734015.
gFlushTimer->InitWithFuncCallback(FlushTimerCallback, nsnull,
50, nsITimer::TYPE_REPEATING_SLACK);
}
}
}
void

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

@ -58,6 +58,7 @@
#include "nsIURI.h"
#include "nsTHashtable.h"
#include "nsHashKeys.h"
#include "mozilla/LinkedList.h"
class nsHtml5Parser;
class nsHtml5TreeBuilder;
@ -75,7 +76,8 @@ enum eHtml5FlushState {
class nsHtml5TreeOpExecutor : public nsContentSink,
public nsIContentSink,
public nsAHtml5TreeOpSink
public nsAHtml5TreeOpSink,
public mozilla::LinkedListElement<nsHtml5TreeOpExecutor>
{
friend class nsHtml5FlushLoopGuard;

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

@ -233,6 +233,11 @@ SvcInstall(SvcInstallAction action)
QUERY_SERVICE_CONFIGW &serviceConfig =
*reinterpret_cast<QUERY_SERVICE_CONFIGW*>(serviceConfigBuffer.get());
// Ensure the service path is not quoted. We own this memory and know it to
// be large enough for the quoted path, so it is large enough for the
// unquoted path. This function cannot fail.
PathUnquoteSpacesW(serviceConfig.lpBinaryPathName);
// Obtain the existing maintenanceservice file's version number and
// the new file's version number. Versions are in the format of
// A.B.C.D.
@ -372,7 +377,7 @@ SvcInstall(SvcInstallAction action)
}
// Quote the path only if it contains spaces.
PathQuoteSpaces(newServiceBinaryPath);
PathQuoteSpacesW(newServiceBinaryPath);
// The service does not already exist so create the service as on demand
schService.own(CreateServiceW(schSCManager, SVC_NAME, SVC_DISPLAY_NAME,
SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,

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

@ -74,6 +74,8 @@ endif
include $(MOZILLA_DIR)/toolkit/mozapps/installer/signing.mk
include $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.mk
PACKAGE_BASE_DIR = $(_ABS_DIST)/l10n-stage
$(STAGEDIST): AB_CD:=en-US
$(STAGEDIST): UNPACKAGE=$(call ESCAPE_SPACE,$(ZIP_IN))
$(STAGEDIST): $(call ESCAPE_SPACE,$(ZIP_IN))

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

@ -46,6 +46,7 @@ STAGEPATH = universal/
endif
endif
PACKAGE_BASE_DIR = $(_ABS_DIST)
PACKAGE = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX)
# By default, the SDK uses the same packaging type as the main bundle,
@ -555,7 +556,7 @@ endif
ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
ifeq (Darwin, $(OS_ARCH))
MAKE_PACKAGE = $(PREPARE_PACKAGE) \
&& cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) && cd $(_ABS_DIST) \
&& cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) && cd $(PACKAGE_BASE_DIR) \
&& $(INNER_MAKE_PACKAGE)
else
MAKE_PACKAGE = $(PREPARE_PACKAGE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \

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

@ -1710,6 +1710,11 @@ static bool
GetInstallationDir(NS_tchar (&installDir)[N])
{
NS_tsnprintf(installDir, N, NS_T("%s"), gDestinationPath);
if (!sBackgroundUpdate && !sReplaceRequest) {
// no need to do any further processing
return true;
}
NS_tchar *slash = (NS_tchar *) NS_tstrrchr(installDir, NS_SLASH);
// Make sure we're not looking at a trailing slash
if (slash && slash[1] == NS_T('\0')) {