зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central into mozilla-inbound
This commit is contained in:
Коммит
ddc6026b27
|
@ -928,6 +928,15 @@ window.addEventListener('ContentStart', function update_onContentStart() {
|
|||
}, "headphones-status-changed", false);
|
||||
})();
|
||||
|
||||
(function audioChannelChangedTracker() {
|
||||
Services.obs.addObserver(function(aSubject, aTopic, aData) {
|
||||
shell.sendChromeEvent({
|
||||
type: 'audio-channel-changed',
|
||||
channel: aData
|
||||
});
|
||||
}, "audio-channel-changed", false);
|
||||
})();
|
||||
|
||||
(function recordingStatusTracker() {
|
||||
let gRecordingActiveCount = 0;
|
||||
|
||||
|
|
|
@ -148,7 +148,6 @@ _BROWSER_FILES = \
|
|||
browser_tabview_group.js \
|
||||
browser_tabview_launch.js \
|
||||
browser_tabview_multiwindow_search.js \
|
||||
browser_tabview_privatebrowsing.js \
|
||||
browser_tabview_rtl.js \
|
||||
browser_tabview_search.js \
|
||||
browser_tabview_snapping.js \
|
||||
|
@ -175,6 +174,7 @@ _BROWSER_FILES += \
|
|||
browser_tabview_bug624265.js \
|
||||
browser_tabview_bug624727.js \
|
||||
browser_tabview_bug650280.js \
|
||||
browser_tabview_privatebrowsing.js \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ enum AudioChannelType {
|
|||
AUDIO_CHANNEL_NOTIFICATION,
|
||||
AUDIO_CHANNEL_ALARM,
|
||||
AUDIO_CHANNEL_TELEPHONY,
|
||||
AUDIO_CHANNEL_PUBLICNOTIFICATION
|
||||
AUDIO_CHANNEL_PUBLICNOTIFICATION,
|
||||
AUDIO_CHANNEL_LAST
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "AudioChannelService.h"
|
||||
#include "AudioChannelServiceChild.h"
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
|
@ -30,6 +31,10 @@ AudioChannelService::GetAudioChannelService()
|
|||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
||||
return AudioChannelServiceChild::GetAudioChannelService();
|
||||
}
|
||||
|
||||
// If we already exist, exit early
|
||||
if (gAudioChannelService) {
|
||||
return gAudioChannelService;
|
||||
|
@ -46,6 +51,10 @@ AudioChannelService::GetAudioChannelService()
|
|||
void
|
||||
AudioChannelService::Shutdown()
|
||||
{
|
||||
if (XRE_GetProcessType() != GeckoProcessType_Default) {
|
||||
return AudioChannelServiceChild::Shutdown();
|
||||
}
|
||||
|
||||
if (gAudioChannelService) {
|
||||
delete gAudioChannelService;
|
||||
gAudioChannelService = nullptr;
|
||||
|
@ -55,6 +64,7 @@ AudioChannelService::Shutdown()
|
|||
NS_IMPL_ISUPPORTS0(AudioChannelService)
|
||||
|
||||
AudioChannelService::AudioChannelService()
|
||||
: mCurrentHigherChannel(AUDIO_CHANNEL_NORMAL)
|
||||
{
|
||||
mChannelCounters = new int32_t[AUDIO_CHANNEL_PUBLICNOTIFICATION+1];
|
||||
|
||||
|
@ -78,6 +88,12 @@ AudioChannelService::RegisterMediaElement(nsHTMLMediaElement* aMediaElement,
|
|||
AudioChannelType aType)
|
||||
{
|
||||
mMediaElements.Put(aMediaElement, aType);
|
||||
RegisterType(aType);
|
||||
}
|
||||
|
||||
void
|
||||
AudioChannelService::RegisterType(AudioChannelType aType)
|
||||
{
|
||||
mChannelCounters[aType]++;
|
||||
|
||||
// In order to avoid race conditions, it's safer to notify any existing
|
||||
|
@ -94,9 +110,14 @@ AudioChannelService::UnregisterMediaElement(nsHTMLMediaElement* aMediaElement)
|
|||
}
|
||||
|
||||
mMediaElements.Remove(aMediaElement);
|
||||
UnregisterType(type);
|
||||
}
|
||||
|
||||
mChannelCounters[type]--;
|
||||
MOZ_ASSERT(mChannelCounters[type] >= 0);
|
||||
void
|
||||
AudioChannelService::UnregisterType(AudioChannelType aType)
|
||||
{
|
||||
mChannelCounters[aType]--;
|
||||
MOZ_ASSERT(mChannelCounters[aType] >= 0);
|
||||
|
||||
// In order to avoid race conditions, it's safer to notify any existing
|
||||
// media element any time a new one is registered.
|
||||
|
@ -124,28 +145,62 @@ AudioChannelService::GetMuted(AudioChannelType aType, bool aElementHidden)
|
|||
case AUDIO_CHANNEL_PUBLICNOTIFICATION:
|
||||
// Nothing to do
|
||||
break;
|
||||
|
||||
case AUDIO_CHANNEL_LAST:
|
||||
MOZ_NOT_REACHED();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool muted = false;
|
||||
|
||||
// Priorities:
|
||||
switch (aType) {
|
||||
case AUDIO_CHANNEL_NORMAL:
|
||||
case AUDIO_CHANNEL_CONTENT:
|
||||
return !!mChannelCounters[AUDIO_CHANNEL_NOTIFICATION] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_ALARM] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_TELEPHONY] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_PUBLICNOTIFICATION];
|
||||
muted = !!mChannelCounters[AUDIO_CHANNEL_NOTIFICATION] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_ALARM] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_TELEPHONY] ||
|
||||
!!mChannelCounters[AUDIO_CHANNEL_PUBLICNOTIFICATION];
|
||||
|
||||
case AUDIO_CHANNEL_NOTIFICATION:
|
||||
case AUDIO_CHANNEL_ALARM:
|
||||
case AUDIO_CHANNEL_TELEPHONY:
|
||||
return ChannelsActiveWithHigherPriorityThan(aType);
|
||||
muted = ChannelsActiveWithHigherPriorityThan(aType);
|
||||
|
||||
case AUDIO_CHANNEL_PUBLICNOTIFICATION:
|
||||
break;
|
||||
|
||||
case AUDIO_CHANNEL_LAST:
|
||||
MOZ_NOT_REACHED();
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
// Notification if needed.
|
||||
if (!muted) {
|
||||
|
||||
// Calculating the most important unmuted channel:
|
||||
AudioChannelType higher = AUDIO_CHANNEL_NORMAL;
|
||||
for (int32_t type = AUDIO_CHANNEL_NORMAL;
|
||||
type <= AUDIO_CHANNEL_PUBLICNOTIFICATION;
|
||||
++type) {
|
||||
if (mChannelCounters[type]) {
|
||||
higher = (AudioChannelType)type;
|
||||
}
|
||||
}
|
||||
|
||||
if (higher != mCurrentHigherChannel) {
|
||||
mCurrentHigherChannel = higher;
|
||||
|
||||
nsString channelName;
|
||||
channelName.AssignASCII(ChannelName(mCurrentHigherChannel));
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
obs->NotifyObservers(nullptr, "audio-channel-changed", channelName.get());
|
||||
}
|
||||
}
|
||||
|
||||
return muted;
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,6 +221,13 @@ AudioChannelService::Notify()
|
|||
|
||||
// Notify any media element for the main process.
|
||||
mMediaElements.EnumerateRead(NotifyEnumerator, nullptr);
|
||||
|
||||
// Notify for the child processes.
|
||||
nsTArray<ContentParent*> children;
|
||||
ContentParent::GetAll(children);
|
||||
for (uint32_t i = 0; i < children.Length(); i++) {
|
||||
unused << children[i]->SendAudioChannelNotify();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -184,3 +246,30 @@ AudioChannelService::ChannelsActiveWithHigherPriorityThan(AudioChannelType aType
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
const char*
|
||||
AudioChannelService::ChannelName(AudioChannelType aType)
|
||||
{
|
||||
static struct {
|
||||
int32_t type;
|
||||
const char* value;
|
||||
} ChannelNameTable[] = {
|
||||
{ AUDIO_CHANNEL_NORMAL, "normal" },
|
||||
{ AUDIO_CHANNEL_CONTENT, "normal" },
|
||||
{ AUDIO_CHANNEL_NOTIFICATION, "notification" },
|
||||
{ AUDIO_CHANNEL_ALARM, "alarm" },
|
||||
{ AUDIO_CHANNEL_TELEPHONY, "telephony" },
|
||||
{ AUDIO_CHANNEL_PUBLICNOTIFICATION, "publicnotification" },
|
||||
{ -1, "unknown" }
|
||||
};
|
||||
|
||||
for (int i = AUDIO_CHANNEL_NORMAL; ; ++i) {
|
||||
if (ChannelNameTable[i].type == aType ||
|
||||
ChannelNameTable[i].type == -1) {
|
||||
return ChannelNameTable[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
NS_NOTREACHED("Execution should not reach here!");
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -37,31 +37,44 @@ public:
|
|||
* Any MediaElement that starts playing should register itself to
|
||||
* this service, sharing the AudioChannelType.
|
||||
*/
|
||||
void RegisterMediaElement(nsHTMLMediaElement* aMediaElement,
|
||||
AudioChannelType aType);
|
||||
virtual void RegisterMediaElement(nsHTMLMediaElement* aMediaElement,
|
||||
AudioChannelType aType);
|
||||
|
||||
/**
|
||||
* Any MediaElement that stops playing should unregister itself to
|
||||
* this service.
|
||||
*/
|
||||
void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement);
|
||||
virtual void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement);
|
||||
|
||||
/**
|
||||
* Return true if this type should be muted.
|
||||
*/
|
||||
virtual bool GetMuted(AudioChannelType aType, bool aElementHidden);
|
||||
|
||||
protected:
|
||||
void Notify();
|
||||
|
||||
protected:
|
||||
/* Register/Unregister IPC types: */
|
||||
void RegisterType(AudioChannelType aType);
|
||||
void UnregisterType(AudioChannelType aType);
|
||||
|
||||
AudioChannelService();
|
||||
virtual ~AudioChannelService();
|
||||
|
||||
bool ChannelsActiveWithHigherPriorityThan(AudioChannelType aType);
|
||||
|
||||
const char* ChannelName(AudioChannelType aType);
|
||||
|
||||
nsDataHashtable< nsPtrHashKey<nsHTMLMediaElement>, AudioChannelType > mMediaElements;
|
||||
|
||||
int32_t* mChannelCounters;
|
||||
|
||||
AudioChannelType mCurrentHigherChannel;
|
||||
|
||||
// This is needed for IPC comunication between
|
||||
// AudioChannelServiceChild and this class.
|
||||
friend class ContentParent;
|
||||
friend class ContentChild;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
||||
/* 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 "AudioChannelServiceChild.h"
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozilla/Util.h"
|
||||
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
StaticRefPtr<AudioChannelServiceChild> gAudioChannelServiceChild;
|
||||
|
||||
// static
|
||||
AudioChannelService*
|
||||
AudioChannelServiceChild::GetAudioChannelService()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// If we already exist, exit early
|
||||
if (gAudioChannelServiceChild) {
|
||||
return gAudioChannelServiceChild;
|
||||
}
|
||||
|
||||
// Create new instance, register, return
|
||||
nsRefPtr<AudioChannelServiceChild> service = new AudioChannelServiceChild();
|
||||
NS_ENSURE_TRUE(service, nullptr);
|
||||
|
||||
gAudioChannelServiceChild = service;
|
||||
return gAudioChannelServiceChild;
|
||||
}
|
||||
|
||||
void
|
||||
AudioChannelServiceChild::Shutdown()
|
||||
{
|
||||
if (gAudioChannelServiceChild) {
|
||||
delete gAudioChannelServiceChild;
|
||||
gAudioChannelServiceChild = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
AudioChannelServiceChild::AudioChannelServiceChild()
|
||||
{
|
||||
}
|
||||
|
||||
AudioChannelServiceChild::~AudioChannelServiceChild()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
AudioChannelServiceChild::GetMuted(AudioChannelType aType, bool aMozHidden)
|
||||
{
|
||||
ContentChild *cc = ContentChild::GetSingleton();
|
||||
bool muted = false;
|
||||
|
||||
if (cc) {
|
||||
cc->SendAudioChannelGetMuted(aType, aMozHidden, &muted);
|
||||
}
|
||||
|
||||
return muted;
|
||||
}
|
||||
|
||||
void
|
||||
AudioChannelServiceChild::RegisterMediaElement(nsHTMLMediaElement* aMediaElement,
|
||||
AudioChannelType aType)
|
||||
{
|
||||
AudioChannelService::RegisterMediaElement(aMediaElement, aType);
|
||||
|
||||
ContentChild *cc = ContentChild::GetSingleton();
|
||||
if (cc) {
|
||||
cc->SendAudioChannelRegisterType(aType);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioChannelServiceChild::UnregisterMediaElement(nsHTMLMediaElement* aMediaElement)
|
||||
{
|
||||
AudioChannelType type;
|
||||
if (!mMediaElements.Get(aMediaElement, &type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AudioChannelService::UnregisterMediaElement(aMediaElement);
|
||||
|
||||
ContentChild *cc = ContentChild::GetSingleton();
|
||||
if (cc) {
|
||||
cc->SendAudioChannelUnregisterType(type);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
||||
/* 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 mozilla_dom_audiochannelservicechild_h__
|
||||
#define mozilla_dom_audiochannelservicechild_h__
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#include "AudioChannelService.h"
|
||||
#include "AudioChannelCommon.h"
|
||||
#include "nsHTMLMediaElement.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class AudioChannelServiceChild : public AudioChannelService
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Returns the AudioChannelServce singleton. Only to be called from main thread.
|
||||
* @return NS_OK on proper assignment, NS_ERROR_FAILURE otherwise.
|
||||
*/
|
||||
static AudioChannelService*
|
||||
GetAudioChannelService();
|
||||
|
||||
static void Shutdown();
|
||||
|
||||
virtual void RegisterMediaElement(nsHTMLMediaElement* aMediaElement,
|
||||
AudioChannelType aType);
|
||||
virtual void UnregisterMediaElement(nsHTMLMediaElement* aMediaElement);
|
||||
|
||||
/**
|
||||
* Return true if this type + this mozHidden should be muted.
|
||||
*/
|
||||
virtual bool GetMuted(AudioChannelType aType, bool aMozHidden);
|
||||
|
||||
protected:
|
||||
AudioChannelServiceChild();
|
||||
virtual ~AudioChannelServiceChild();
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif
|
||||
|
|
@ -32,10 +32,12 @@ EXPORTS_NAMESPACES = \
|
|||
$(NULL)
|
||||
|
||||
EXPORTS = AudioChannelService.h \
|
||||
AudioChannelServiceChild.h \
|
||||
AudioChannelCommon.h
|
||||
|
||||
CPPSRCS += \
|
||||
AudioChannelService.cpp \
|
||||
AudioChannelServiceChild.cpp \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsDeviceStorage.h"
|
||||
#include "AudioChannelService.h"
|
||||
|
||||
using namespace base;
|
||||
using namespace mozilla::docshell;
|
||||
|
@ -431,6 +432,17 @@ ContentChild::RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* chi
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvAudioChannelNotify()
|
||||
{
|
||||
nsRefPtr<AudioChannelService> service =
|
||||
AudioChannelService::GetAudioChannelService();
|
||||
if (service) {
|
||||
service->Notify();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::DeallocPMemoryReportRequest(PMemoryReportRequestChild* actor)
|
||||
{
|
||||
|
|
|
@ -111,6 +111,9 @@ public:
|
|||
virtual bool
|
||||
RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child);
|
||||
|
||||
virtual bool
|
||||
RecvAudioChannelNotify();
|
||||
|
||||
virtual bool
|
||||
RecvDumpMemoryReportsToFile(const nsString& aIdentifier,
|
||||
const bool& aMinimizeMemoryUsage,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "chrome/common/process_watcher.h"
|
||||
|
||||
#include "AppProcessPermissions.h"
|
||||
#include "AudioChannelService.h"
|
||||
#include "CrashReporterParent.h"
|
||||
#include "IHistory.h"
|
||||
#include "IDBFactory.h"
|
||||
|
@ -1011,6 +1012,42 @@ ContentParent::RecvFirstIdle()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvAudioChannelGetMuted(const AudioChannelType& aType,
|
||||
const bool& aMozHidden,
|
||||
bool* aValue)
|
||||
{
|
||||
nsRefPtr<AudioChannelService> service =
|
||||
AudioChannelService::GetAudioChannelService();
|
||||
*aValue = false;
|
||||
if (service) {
|
||||
*aValue = service->GetMuted(aType, aMozHidden);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvAudioChannelRegisterType(const AudioChannelType& aType)
|
||||
{
|
||||
nsRefPtr<AudioChannelService> service =
|
||||
AudioChannelService::GetAudioChannelService();
|
||||
if (service) {
|
||||
service->RegisterType(aType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvAudioChannelUnregisterType(const AudioChannelType& aType)
|
||||
{
|
||||
nsRefPtr<AudioChannelService> service =
|
||||
AudioChannelService::GetAudioChannelService();
|
||||
if (service) {
|
||||
service->UnregisterType(aType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS3(ContentParent,
|
||||
nsIObserver,
|
||||
nsIThreadObserver,
|
||||
|
|
|
@ -261,7 +261,7 @@ private:
|
|||
|
||||
virtual bool RecvSetURITitle(const URIParams& uri,
|
||||
const nsString& title);
|
||||
|
||||
|
||||
virtual bool RecvShowFilePicker(const int16_t& mode,
|
||||
const int16_t& selectedType,
|
||||
const bool& addToRecentDocs,
|
||||
|
@ -273,7 +273,7 @@ private:
|
|||
InfallibleTArray<nsString>* files,
|
||||
int16_t* retValue,
|
||||
nsresult* result);
|
||||
|
||||
|
||||
virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
|
||||
const nsString& aText, const bool& aTextClickable,
|
||||
const nsString& aCookie, const nsString& aName);
|
||||
|
@ -302,6 +302,13 @@ private:
|
|||
|
||||
virtual bool RecvFirstIdle();
|
||||
|
||||
virtual bool RecvAudioChannelGetMuted(const AudioChannelType& aType,
|
||||
const bool& aMozHidden,
|
||||
bool* aValue);
|
||||
|
||||
virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType);
|
||||
virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType);
|
||||
|
||||
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
|
||||
|
||||
GeckoChildProcessHost* mSubprocess;
|
||||
|
|
|
@ -38,6 +38,7 @@ using OverrideMapping;
|
|||
using IPC::Permission;
|
||||
using mozilla::null_t;
|
||||
using mozilla::void_t;
|
||||
using mozilla::dom::AudioChannelType;
|
||||
using mozilla::dom::NativeThreadId;
|
||||
using mozilla::layout::ScrollingBehavior;
|
||||
using gfxIntSize;
|
||||
|
@ -264,6 +265,11 @@ both:
|
|||
child:
|
||||
PMemoryReportRequest();
|
||||
|
||||
/**
|
||||
* Notify the AudioChannelService in the child processes.
|
||||
*/
|
||||
async AudioChannelNotify();
|
||||
|
||||
/**
|
||||
* Dump the contents of about:memory to a file in our temp directory.
|
||||
*
|
||||
|
@ -424,6 +430,13 @@ parent:
|
|||
// Tell the parent that the child has gone idle for the first time
|
||||
async FirstIdle();
|
||||
|
||||
// Get Muted from the main AudioChannelService.
|
||||
sync AudioChannelGetMuted(AudioChannelType aType, bool aMozHidden)
|
||||
returns (bool value);
|
||||
|
||||
async AudioChannelRegisterType(AudioChannelType aType);
|
||||
async AudioChannelUnregisterType(AudioChannelType aType);
|
||||
|
||||
both:
|
||||
AsyncMessage(nsString aMessage, ClonedMessageData aData);
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#ifndef TABMESSAGE_UTILS_H
|
||||
#define TABMESSAGE_UTILS_H
|
||||
|
||||
#include "AudioChannelCommon.h"
|
||||
#include "ipc/IPCMessageUtils.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -56,6 +57,13 @@ struct ParamTraits<mozilla::dom::RemoteDOMEvent>
|
|||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::dom::AudioChannelType>
|
||||
: public EnumSerializer<mozilla::dom::AudioChannelType,
|
||||
mozilla::dom::AUDIO_CHANNEL_NORMAL,
|
||||
mozilla::dom::AUDIO_CHANNEL_LAST>
|
||||
{ };
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -99,11 +99,16 @@ MOCHITEST_CHROME_FILES = \
|
|||
utils.js \
|
||||
test_clear_site_data.html \
|
||||
test_npruntime.xul \
|
||||
test_privatemode.xul \
|
||||
test_wmode.xul \
|
||||
test_bug479979.xul \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_CHROME_FILES += \
|
||||
test_privatemode.xul \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
MOCHITEST_FILES += \
|
||||
test_instance_re-parent-windowed.html \
|
||||
|
|
|
@ -17,12 +17,17 @@ MOCHITEST_BROWSER_FILES := \
|
|||
browser_ConsoleAPITests.js \
|
||||
test-console-api.html \
|
||||
browser_ConsoleStorageAPITests.js \
|
||||
browser_ConsoleStoragePBTest.js \
|
||||
browser_autofocus_preference.js \
|
||||
browser_bug396843.js \
|
||||
browser_xhr_sandbox.js \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_BROWSER_FILES += \
|
||||
browser_ConsoleStoragePBTest.js \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq (Linux,$(OS_ARCH))
|
||||
MOCHITEST_BROWSER_FILES += \
|
||||
browser_webapps_permissions.js \
|
||||
|
|
|
@ -39,7 +39,6 @@ MOCHITEST_FILES = \
|
|||
test_embededNulls.html \
|
||||
test_keySync.html \
|
||||
test_localStorageBase.html \
|
||||
test_localStorageBasePrivateBrowsing.html \
|
||||
test_localStorageBaseSessionOnly.html \
|
||||
test_localStorageCookieSettings.html \
|
||||
test_localStorageEnablePref.html \
|
||||
|
@ -50,13 +49,19 @@ MOCHITEST_FILES = \
|
|||
test_localStorageOriginsSchemaDiffs.html \
|
||||
test_localStorageReplace.html \
|
||||
test_localStorageQuota.html \
|
||||
test_localStorageQuotaPrivateBrowsing.html \
|
||||
test_localStorageQuotaSessionOnly.html \
|
||||
test_localStorageQuotaSessionOnly2.html \
|
||||
test_localStorageKeyOrder.html \
|
||||
test_storageConstructor.html \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_FILES += \
|
||||
test_localStorageBasePrivateBrowsing.html \
|
||||
test_localStorageQuotaPrivateBrowsing.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
test_localStorageFromChrome.xhtml \
|
||||
test_app_uninstall.html \
|
||||
|
|
|
@ -3,6 +3,7 @@ head = head_cookies.js
|
|||
tail =
|
||||
|
||||
[test_bug468700.js]
|
||||
skip-if = perwindowprivatebrowsing
|
||||
[test_bug526789.js]
|
||||
[test_bug650522.js]
|
||||
[test_bug667087.js]
|
||||
|
|
|
@ -47,10 +47,15 @@ MOCHITEST_FILES = test_bug231389.html \
|
|||
$(NULL)
|
||||
|
||||
MOCHITEST_CHROME_FILES = \
|
||||
test_bug536567.html \
|
||||
bug536567_subframe.html \
|
||||
test_bug665540.html \
|
||||
bug665540_window.xul \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_CHROME_FILES += \
|
||||
test_bug536567.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -19,7 +19,12 @@ MOCHITEST_FILES = \
|
|||
nosts_bootstrap.html^headers^ \
|
||||
verify.sjs \
|
||||
test_stricttransportsecurity.html \
|
||||
test_sts_privatebrowsing.html \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_FILES += \
|
||||
test_sts_privatebrowsing.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -13,5 +13,7 @@ skip-if = os == "android"
|
|||
# Bug 676972: test hangs consistently on Android
|
||||
skip-if = os == "android"
|
||||
[test_bug627234.js]
|
||||
skip-if = perwindowprivatebrowsing
|
||||
[test_sts_preloadlist.js]
|
||||
skip-if = perwindowprivatebrowsing
|
||||
[test_sts_preloadlist_selfdestruct.js]
|
||||
|
|
|
@ -53,7 +53,6 @@ MOCHITEST_FILES = \
|
|||
test_maxforms_3.html \
|
||||
test_notifications.html \
|
||||
test_notifications_popup.html \
|
||||
test_privbrowsing.html \
|
||||
test_prompt_async.html \
|
||||
test_xhr.html \
|
||||
test_xml_load.html \
|
||||
|
@ -83,11 +82,17 @@ MOCHITEST_FILES = \
|
|||
subtst_prompt_async.html \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_FILES += \
|
||||
test_privbrowsing.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_TARGET),Linux)
|
||||
MOCHITEST_FILES += \
|
||||
test_prompt.html \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
# This test doesn't pass because we can't ensure a cross-platform
|
||||
# event that occurs between DOMContentLoaded and Pageload
|
||||
|
|
|
@ -33,8 +33,13 @@ XPCSHELL_TESTS_COMMON = \
|
|||
# Simple MochiTests
|
||||
MOCHITEST_FILES = \
|
||||
mochitest/test_bug_411966.html \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_FILES += \
|
||||
mochitest/test_bug_461710.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
DIRS = \
|
||||
chrome \
|
||||
|
|
|
@ -22,7 +22,6 @@ MOCHITEST_BROWSER_FILES = \
|
|||
browser_redirect.js \
|
||||
browser_visituri.js \
|
||||
browser_visituri_nohistory.js \
|
||||
browser_visituri_privatebrowsing.js \
|
||||
browser_settitle.js \
|
||||
colorAnalyzer/category-discover.png \
|
||||
colorAnalyzer/dictionaryGeneric-16.png \
|
||||
|
@ -34,6 +33,10 @@ ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
|||
MOCHITEST_BROWSER_FILES += \
|
||||
browser_bug248970.js \
|
||||
$(NULL)
|
||||
else
|
||||
MOCHITEST_BROWSER_FILES += \
|
||||
browser_visituri_privatebrowsing.js \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# These are files that need to be loaded via the HTTP proxy server
|
||||
|
|
|
@ -16,6 +16,8 @@ fail-if = os == "android"
|
|||
[test_replaceFaviconData.js]
|
||||
[test_replaceFaviconDataFromDataURL.js]
|
||||
[test_setAndFetchFaviconForPage.js]
|
||||
skip-if = perwindowprivatebrowsing
|
||||
[test_setAndFetchFaviconForPage_failures.js]
|
||||
# Bug 676989: test fails consistently on Android
|
||||
fail-if = os == "android"
|
||||
skip-if = perwindowprivatebrowsing
|
||||
|
|
|
@ -25,11 +25,16 @@ MOCHITEST_FILES = \
|
|||
test_form_submission.html \
|
||||
test_form_submission_cap.html \
|
||||
test_form_submission_cap2.html \
|
||||
test_privbrowsing.html \
|
||||
satchel_common.js \
|
||||
subtst_form_submission_1.html \
|
||||
subtst_privbrowsing.html \
|
||||
$(NULL)
|
||||
|
||||
ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
MOCHITEST_FILES += \
|
||||
test_privbrowsing.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -27,5 +27,6 @@ run-if = os == 'win'
|
|||
[include:xpcshell_updater_xp_unix.ini]
|
||||
run-if = os == 'linux' || os == 'mac' || os == 'sunos'
|
||||
[test_bug497578.js]
|
||||
skip-if = perwindowprivatebrowsing
|
||||
[test_bug595059.js]
|
||||
[test_bug794211.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче