This commit is contained in:
Ryan VanderMeulen 2013-11-11 16:03:46 -05:00
Родитель 4343609ebb ac6b377e78
Коммит 92244f5510
126 изменённых файлов: 1384 добавлений и 708 удалений

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

@ -19,3 +19,5 @@
#
Bug 921718 presumably needed a clobber due to bug 928195.
and
Bug 853423 - New code (inc. new function IsIPAddrLocal) is not being included in incremental builds.

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

@ -10,7 +10,6 @@ chrome.jar:
content/arrow.svg (content/arrow.svg)
* content/dbg-browser-actors.js (content/dbg-browser-actors.js)
content/forms.js (content/forms.js)
* content/settings.js (content/settings.js)
* content/shell.html (content/shell.html)
* content/shell.js (content/shell.js)

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

@ -1,4 +1,4 @@
{
"revision": "4a3f02dbc339012f5f595b8180f54adf5cb08713",
"revision": "8aa52bb04742d118e84f830e72a5799b81c98e3a",
"repo_path": "/integration/gaia-central"
}

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

@ -2001,6 +2001,7 @@ GK_ATOM(DisplayPort, "_displayport")
GK_ATOM(CriticalDisplayPort, "_critical_displayport")
// Names for system metrics
GK_ATOM(color_picker_available, "color-picker-available")
GK_ATOM(scrollbar_start_backward, "scrollbar-start-backward")
GK_ATOM(scrollbar_start_forward, "scrollbar-start-forward")
GK_ATOM(scrollbar_end_backward, "scrollbar-end-backward")
@ -2038,6 +2039,7 @@ GK_ATOM(windows_version_win7, "windows-version-win7")
GK_ATOM(windows_version_win8, "windows-version-win8")
// And the same again, as media query keywords.
GK_ATOM(_moz_color_picker_available, "-moz-color-picker-available")
GK_ATOM(_moz_scrollbar_start_backward, "-moz-scrollbar-start-backward")
GK_ATOM(_moz_scrollbar_start_forward, "-moz-scrollbar-start-forward")
GK_ATOM(_moz_scrollbar_end_backward, "-moz-scrollbar-end-backward")

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

@ -42,7 +42,7 @@ public:
* If the meta data isn't well format, this function will return NS_ERROR_FAILURE to caller,
* else save the pointer to mMetadata and return NS_OK.
*/
virtual nsresult SetMetadata(nsRefPtr<TrackMetadataBase> aMetadata) = 0;
virtual nsresult SetMetadata(TrackMetadataBase* aMetadata) = 0;
enum {
FLUSH_NEEDED = 1 << 0,
@ -61,7 +61,6 @@ public:
uint32_t aFlags = 0) = 0;
protected:
nsRefPtr<TrackMetadataBase> mMetadata;
bool mInitialized;
};
}

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

@ -26,19 +26,20 @@ public:
mEncodedFrames.AppendElement(aEncodedFrame);
}
// Retrieve all of the encoded frames
const nsTArray<nsAutoPtr<EncodedFrame> >& GetEncodedFrames() const
const nsTArray<nsRefPtr<EncodedFrame> >& GetEncodedFrames() const
{
return mEncodedFrames;
}
private:
// This container is used to store the video or audio encoded packets.
// Muxer should check mFrameType and get the encoded data type from mEncodedFrames.
nsTArray<nsAutoPtr<EncodedFrame> > mEncodedFrames;
nsTArray<nsRefPtr<EncodedFrame> > mEncodedFrames;
};
// Represent one encoded frame
class EncodedFrame
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(EncodedFrame)
public:
EncodedFrame() :
mTimeStamp(0),

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

@ -186,7 +186,7 @@ OpusTrackEncoder::GetPacketDuration()
return GetOutputSampleRate() * kFrameDurationMs / 1000;
}
nsRefPtr<TrackMetadataBase>
already_AddRefed<TrackMetadataBase>
OpusTrackEncoder::GetMetadata()
{
{
@ -201,7 +201,7 @@ OpusTrackEncoder::GetMetadata()
return nullptr;
}
OpusMetadata* meta = new OpusMetadata();
nsRefPtr<OpusMetadata> meta = new OpusMetadata();
mLookahead = 0;
int error = opus_encoder_ctl(mEncoder, OPUS_GET_LOOKAHEAD(&mLookahead));
@ -222,7 +222,7 @@ OpusTrackEncoder::GetMetadata()
SerializeOpusCommentHeader(vendor, comments,
&meta->mCommentHeader);
return meta;
return meta.forget();
}
nsresult
@ -281,7 +281,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData)
iter.Next();
}
EncodedFrame* audiodata = new EncodedFrame();
nsRefPtr<EncodedFrame> audiodata = new EncodedFrame();
audiodata->SetFrameType(EncodedFrame::AUDIO_FRAME);
if (mResampler) {
nsAutoTArray<AudioDataValue, 9600> resamplingDest;

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

@ -32,7 +32,7 @@ public:
OpusTrackEncoder();
virtual ~OpusTrackEncoder();
nsRefPtr<TrackMetadataBase> GetMetadata() MOZ_OVERRIDE;
already_AddRefed<TrackMetadataBase> GetMetadata() MOZ_OVERRIDE;
nsresult GetEncodedTrack(EncodedFrameContainer& aData) MOZ_OVERRIDE;

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

@ -52,7 +52,7 @@ public:
/**
* Creates and sets up meta data for a specific codec
*/
virtual nsRefPtr<TrackMetadataBase> GetMetadata() = 0;
virtual already_AddRefed<TrackMetadataBase> GetMetadata() = 0;
/**
* Encodes raw segments. Result data is returned in aData.

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

@ -4,7 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "OggWriter.h"
#include "prtime.h"
#include "OpusTrackEncoder.h"
#undef LOG
#ifdef MOZ_WIDGET_GONK
@ -168,24 +167,23 @@ OggWriter::GetContainerData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
}
nsresult
OggWriter::SetMetadata(nsRefPtr<TrackMetadataBase> aMetadata)
OggWriter::SetMetadata(TrackMetadataBase* aMetadata)
{
if (aMetadata->GetKind() != TrackMetadataBase::METADATA_OPUS) {
LOG("wrong meta data type!");
return NS_ERROR_FAILURE;
}
// Validate each field of METADATA
OpusMetadata* meta = static_cast<OpusMetadata*>(aMetadata.get());
if (meta->mIdHeader.Length() == 0) {
mMetadata = static_cast<OpusMetadata*>(aMetadata);
if (mMetadata->mIdHeader.Length() == 0) {
LOG("miss mIdHeader!");
return NS_ERROR_FAILURE;
}
if (meta->mCommentHeader.Length() == 0) {
if (mMetadata->mCommentHeader.Length() == 0) {
LOG("miss mCommentHeader!");
return NS_ERROR_FAILURE;
}
mMetadata = aMetadata;
return NS_OK;
}

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

@ -7,6 +7,7 @@
#define OggWriter_h_
#include "ContainerWriter.h"
#include "OpusTrackEncoder.h"
#include <ogg/ogg.h>
namespace mozilla {
@ -29,7 +30,7 @@ public:
uint32_t aFlags = 0) MOZ_OVERRIDE;
// Check metadata type integrity and reject unacceptable track encoder.
nsresult SetMetadata(nsRefPtr<TrackMetadataBase> aMetadata) MOZ_OVERRIDE;
nsresult SetMetadata(TrackMetadataBase* aMetadata) MOZ_OVERRIDE;
private:
nsresult Init();
@ -38,6 +39,8 @@ private:
uint32_t aFlags = 0);
void ProduceOggPage(nsTArray<nsTArray<uint8_t> >* aOutputBufs);
// Store the Medatata from track encoder
nsRefPtr<OpusMetadata> mMetadata;
ogg_stream_state mOggStreamState;
ogg_page mOggPage;

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

@ -63,8 +63,9 @@ ShouldExposeChildWindow(nsString& aNameBeingResolved, nsIDOMWindow *aChild)
// computed independently by the parent.
nsCOMPtr<nsPIDOMWindow> piWin = do_QueryInterface(aChild);
NS_ENSURE_TRUE(piWin, false);
return piWin->GetFrameElementInternal()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
aNameBeingResolved, eCaseMatters);
Element* e = piWin->GetFrameElementInternal();
return e && e->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
aNameBeingResolved, eCaseMatters);
}
bool

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

@ -415,7 +415,7 @@ BluetoothHfpManager::Init()
#ifdef MOZ_B2G_RIL
mListener = new BluetoothRilListener();
if (!mListener->Listen(true)) {
if (!mListener->StartListening()) {
BT_WARNING("Failed to start listening RIL");
return false;
}
@ -447,7 +447,7 @@ BluetoothHfpManager::Init()
BluetoothHfpManager::~BluetoothHfpManager()
{
#ifdef MOZ_B2G_RIL
if (!mListener->Listen(false)) {
if (!mListener->StopListening()) {
BT_WARNING("Failed to stop listening RIL");
}
mListener = nullptr;
@ -586,14 +586,15 @@ BluetoothHfpManager::HandleVolumeChanged(const nsAString& aData)
#ifdef MOZ_B2G_RIL
void
BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
BluetoothHfpManager::HandleVoiceConnectionChanged()
{
nsCOMPtr<nsIMobileConnectionProvider> connection =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(connection);
nsCOMPtr<nsIDOMMozMobileConnectionInfo> voiceInfo;
connection->GetVoiceConnectionInfo(aClientId, getter_AddRefs(voiceInfo));
// TODO: Bug 921991 - B2G BT: support multiple sim cards
connection->GetVoiceConnectionInfo(0, getter_AddRefs(voiceInfo));
NS_ENSURE_TRUE_VOID(voiceInfo);
nsString type;
@ -604,12 +605,11 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
voiceInfo->GetRoaming(&roaming);
UpdateCIND(CINDType::ROAM, roaming);
bool service = false;
nsString regState;
voiceInfo->GetState(regState);
bool service = regState.EqualsLiteral("registered");
if (service != sCINDItems[CINDType::SERVICE].value) {
// Notify BluetoothRilListener of service change
mListener->ServiceChanged(aClientId, service);
if (regState.EqualsLiteral("registered")) {
service = true;
}
UpdateCIND(CINDType::SERVICE, service);
@ -630,7 +630,8 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
* - manual: set mNetworkSelectionMode to 1 (manual)
*/
nsString mode;
connection->GetNetworkSelectionMode(aClientId, mode);
// TODO: Bug 921991 - B2G BT: support multiple sim cards
connection->GetNetworkSelectionMode(0, mode);
if (mode.EqualsLiteral("manual")) {
mNetworkSelectionMode = 1;
} else {
@ -657,14 +658,15 @@ BluetoothHfpManager::HandleVoiceConnectionChanged(uint32_t aClientId)
}
void
BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
BluetoothHfpManager::HandleIccInfoChanged()
{
nsCOMPtr<nsIIccProvider> icc =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(icc);
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
// TODO: Bug 921991 - B2G BT: support multiple sim cards
icc->GetIccInfo(0, getter_AddRefs(iccInfo));
NS_ENSURE_TRUE_VOID(iccInfo);
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);

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

@ -121,8 +121,8 @@ public:
void HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState,
const nsAString& aError, const nsAString& aNumber,
const bool aIsOutgoing, bool aSend);
void HandleIccInfoChanged(uint32_t aClientId);
void HandleVoiceConnectionChanged(uint32_t aClientId);
void HandleIccInfoChanged();
void HandleVoiceConnectionChanged();
#endif
bool IsConnected();

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

@ -7,24 +7,36 @@
#include "BluetoothRilListener.h"
#include "BluetoothHfpManager.h"
#include "nsIDOMMobileConnection.h"
#include "nsIRadioInterfaceLayer.h"
#include "nsIIccProvider.h"
#include "nsIMobileConnectionProvider.h"
#include "nsITelephonyProvider.h"
#include "nsRadioInterfaceLayer.h"
#include "nsServiceManagerUtils.h"
#include "nsString.h"
USING_BLUETOOTH_NAMESPACE
namespace {
/**
* IccListener
*/
class IccListener : public nsIIccListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIICCLISTENER
IccListener() { }
};
NS_IMPL_ISUPPORTS1(IccListener, nsIIccListener)
NS_IMETHODIMP
IccListener::NotifyIccInfoChanged()
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
hfp->HandleIccInfoChanged(mOwner->mClientId);
hfp->HandleIccInfoChanged();
return NS_OK;
}
@ -47,39 +59,25 @@ IccListener::NotifyCardStateChanged()
return NS_OK;
}
bool
IccListener::Listen(bool aStart)
{
nsCOMPtr<nsIIccProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsresult rv;
if (aStart) {
rv = provider->RegisterIccMsg(mOwner->mClientId, this);
} else {
rv = provider->UnregisterIccMsg(mOwner->mClientId, this);
}
return NS_SUCCEEDED(rv);
}
void
IccListener::SetOwner(BluetoothRilListener *aOwner)
{
mOwner = aOwner;
}
/**
* MobileConnectionListener
*/
class MobileConnectionListener : public nsIMobileConnectionListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMOBILECONNECTIONLISTENER
MobileConnectionListener() { }
};
NS_IMPL_ISUPPORTS1(MobileConnectionListener, nsIMobileConnectionListener)
NS_IMETHODIMP
MobileConnectionListener::NotifyVoiceChanged()
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
hfp->HandleVoiceConnectionChanged(mClientId);
hfp->HandleVoiceConnectionChanged();
return NS_OK;
}
@ -133,26 +131,20 @@ MobileConnectionListener::NotifyIccChanged()
return NS_OK;
}
bool
MobileConnectionListener::Listen(bool aStart)
{
nsCOMPtr<nsIMobileConnectionProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsresult rv;
if (aStart) {
rv = provider->RegisterMobileConnectionMsg(mClientId, this);
} else {
rv = provider->UnregisterMobileConnectionMsg(mClientId, this);
}
return NS_SUCCEEDED(rv);
}
/**
* TelephonyListener Implementation
*
* TODO: Bug 921991 - B2G BT: support multiple sim cards
*/
class TelephonyListener : public nsITelephonyListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSITELEPHONYLISTENER
TelephonyListener() { }
};
NS_IMPL_ISUPPORTS1(TelephonyListener, nsITelephonyListener)
NS_IMETHODIMP
@ -251,109 +243,36 @@ TelephonyListener::NotifyCdmaCallWaiting(uint32_t aServiceId,
return NS_OK;
}
bool
TelephonyListener::Listen(bool aStart)
{
nsCOMPtr<nsITelephonyProvider> provider =
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsresult rv;
if (aStart) {
rv = provider->RegisterListener(this);
} else {
rv = provider->UnregisterListener(this);
}
return NS_SUCCEEDED(rv);
}
} // anonymous namespace
/**
* BluetoothRilListener
*/
BluetoothRilListener::BluetoothRilListener()
{
// Query number of total clients (sim slots)
uint32_t numOfClients;
nsCOMPtr<nsIRadioInterfaceLayer> radioInterfaceLayer =
do_GetService(NS_RADIOINTERFACELAYER_CONTRACTID);
NS_ENSURE_TRUE_VOID(radioInterfaceLayer);
radioInterfaceLayer->GetNumRadioInterfaces(&numOfClients);
// Init MobileConnectionListener array and IccInfoListener
for (uint32_t i = 0; i < numOfClients; i++) {
MobileConnectionListener listener(i);
mMobileConnListeners.AppendElement(listener);
}
mIccListener.SetOwner(this);
// Probe for available client
SelectClient();
mIccListener = new IccListener();
mMobileConnectionListener = new MobileConnectionListener();
mTelephonyListener = new TelephonyListener();
}
bool
BluetoothRilListener::Listen(bool aStart)
BluetoothRilListener::StartListening()
{
NS_ENSURE_TRUE(ListenMobileConnAndIccInfo(aStart), false);
NS_ENSURE_TRUE(mTelephonyListener.Listen(aStart), false);
NS_ENSURE_TRUE(StartIccListening(), false);
NS_ENSURE_TRUE(StartMobileConnectionListening(), false);
NS_ENSURE_TRUE(StartTelephonyListening(), false);
return true;
}
void
BluetoothRilListener::SelectClient()
bool
BluetoothRilListener::StopListening()
{
// Reset mClientId
mClientId = mMobileConnListeners.Length();
NS_ENSURE_TRUE(StopIccListening(), false);
NS_ENSURE_TRUE(StopMobileConnectionListening(), false);
NS_ENSURE_TRUE(StopTelephonyListening(), false);
nsCOMPtr<nsIMobileConnectionProvider> connection =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE_VOID(connection);
uint32_t i;
for (i = 0; i < mMobileConnListeners.Length(); i++) {
nsCOMPtr<nsIDOMMozMobileConnectionInfo> voiceInfo;
connection->GetVoiceConnectionInfo(i, getter_AddRefs(voiceInfo));
if (!voiceInfo) {
BT_WARNING("%s: Failed to get voice connection info", __FUNCTION__);
continue;
}
nsString regState;
voiceInfo->GetState(regState);
if (regState.EqualsLiteral("registered")) {
// Found available client
mClientId = i;
return;
}
}
}
void
BluetoothRilListener::ServiceChanged(uint32_t aClientId, bool aRegistered)
{
// Stop listening
ListenMobileConnAndIccInfo(false);
/**
* aRegistered:
* - TRUE: service becomes registered. We were listening to all clients
* and one of them becomes available. Select it to listen.
* - FALSE: service becomes un-registered. The client we were listening
* becomes unavailable. Select another registered one to listen.
*/
if (aRegistered) {
mClientId = aClientId;
} else {
SelectClient();
}
// Restart listening
ListenMobileConnAndIccInfo(true);
BT_LOGR("%s: %d client %d. new mClientId %d", __FUNCTION__, aRegistered, aClientId,
(mClientId < mMobileConnListeners.Length()) ? mClientId : -1);
return true;
}
void
@ -363,32 +282,78 @@ BluetoothRilListener::EnumerateCalls()
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
NS_ENSURE_TRUE_VOID(provider);
nsCOMPtr<nsITelephonyListener> listener(
do_QueryInterface(&mTelephonyListener));
provider->EnumerateCalls(mTelephonyListener);
}
provider->EnumerateCalls(listener);
// private
bool
BluetoothRilListener::StartIccListening()
{
nsCOMPtr<nsIIccProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
// TODO: Bug 921991 - B2G BT: support multiple sim cards
nsresult rv = provider->RegisterIccMsg(0, mIccListener);
return NS_SUCCEEDED(rv);
}
bool
BluetoothRilListener::ListenMobileConnAndIccInfo(bool aStart)
BluetoothRilListener::StopIccListening()
{
/**
* mClientId < number of total clients:
* The client with mClientId is available. Start/Stop listening
* mobile connection and icc info of this client only.
*
* mClientId >= number of total clients:
* All clients are unavailable. Start/Stop listening mobile
* connections of all clients.
*/
if (mClientId < mMobileConnListeners.Length()) {
NS_ENSURE_TRUE(mMobileConnListeners[mClientId].Listen(aStart), false);
NS_ENSURE_TRUE(mIccListener.Listen(aStart), false);
} else {
for (uint32_t i = 0; i < mMobileConnListeners.Length(); i++) {
NS_ENSURE_TRUE(mMobileConnListeners[i].Listen(aStart), false);
}
}
nsCOMPtr<nsIIccProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
return true;
// TODO: Bug 921991 - B2G BT: support multiple sim cards
nsresult rv = provider->UnregisterIccMsg(0, mIccListener);
return NS_SUCCEEDED(rv);
}
bool
BluetoothRilListener::StartMobileConnectionListening()
{
nsCOMPtr<nsIMobileConnectionProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
// TODO: Bug 921991 - B2G BT: support multiple sim cards
nsresult rv = provider->
RegisterMobileConnectionMsg(0, mMobileConnectionListener);
return NS_SUCCEEDED(rv);
}
bool
BluetoothRilListener::StopMobileConnectionListening()
{
nsCOMPtr<nsIMobileConnectionProvider> provider =
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
// TODO: Bug 921991 - B2G BT: support multiple sim cards
nsresult rv = provider->
UnregisterMobileConnectionMsg(0, mMobileConnectionListener);
return NS_SUCCEEDED(rv);
}
bool
BluetoothRilListener::StartTelephonyListening()
{
nsCOMPtr<nsITelephonyProvider> provider =
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsresult rv = provider->RegisterListener(mTelephonyListener);
return NS_SUCCEEDED(rv);
}
bool
BluetoothRilListener::StopTelephonyListening()
{
nsCOMPtr<nsITelephonyProvider> provider =
do_GetService(TELEPHONY_PROVIDER_CONTRACTID);
NS_ENSURE_TRUE(provider, false);
nsresult rv = provider->UnregisterListener(mTelephonyListener);
return NS_SUCCEEDED(rv);
}

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

@ -9,114 +9,37 @@
#include "BluetoothCommon.h"
#include "nsIIccProvider.h"
#include "nsIMobileConnectionProvider.h"
#include "nsITelephonyProvider.h"
#include "nsCOMPtr.h"
class nsIIccListener;
class nsIMobileConnectionListener;
class nsITelephonyListener;
BEGIN_BLUETOOTH_NAMESPACE
class BluetoothRilListener;
class IccListener : public nsIIccListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIICCLISTENER
IccListener() { }
bool Listen(bool aStart);
void SetOwner(BluetoothRilListener *aOwner);
private:
BluetoothRilListener* mOwner;
};
class MobileConnectionListener : public nsIMobileConnectionListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMOBILECONNECTIONLISTENER
MobileConnectionListener(uint32_t aClientId)
: mClientId(aClientId) { }
bool Listen(bool aStart);
private:
uint32_t mClientId;
};
class TelephonyListener : public nsITelephonyListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSITELEPHONYLISTENER
TelephonyListener() { }
bool Listen(bool aStart);
};
class BluetoothRilListener
{
public:
BluetoothRilListener();
/**
* Start/Stop listening.
*
* @param aStart [in] whether to start/stop listening
*/
bool Listen(bool aStart);
bool StartListening();
bool StopListening();
/**
* Be informed that certain client's service has changed.
*
* @param aClientId [in] the client id with service change
* @param aRegistered [in] whether changed service is registered
*/
void ServiceChanged(uint32_t aClientId, bool aRegistered);
/**
* Enumerate current calls.
*/
void EnumerateCalls();
/**
* The id of client that mobile connection and icc info listeners
* are listening to.
*
* mClientId equals to number of total clients (array length of
* mobile connection listeners) if there is no available client to listen.
*/
uint32_t mClientId;
private:
/**
* Start/Stop listening of mobile connection and icc info.
*
* @param aStart [in] whether to start/stop listening
*/
bool ListenMobileConnAndIccInfo(bool aStart);
bool StartIccListening();
bool StopIccListening();
/**
* Select available client to listen and assign mClientId.
*
* mClientId is assigned to number of total clients (array length of
* mobile connection listeners) if there is no available client to listen.
*/
void SelectClient();
bool StartMobileConnectionListening();
bool StopMobileConnectionListening();
/**
* Array of mobile connection listeners.
*
* The length equals to number of total clients.
*/
nsTArray<MobileConnectionListener> mMobileConnListeners;
bool StartTelephonyListening();
bool StopTelephonyListening();
IccListener mIccListener;
TelephonyListener mTelephonyListener;
nsCOMPtr<nsIIccListener> mIccListener;
nsCOMPtr<nsIMobileConnectionListener> mMobileConnectionListener;
nsCOMPtr<nsITelephonyListener> mTelephonyListener;
};
END_BLUETOOTH_NAMESPACE

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

@ -24,9 +24,14 @@ docShell.setFullscreenAllowed(infos.fullscreenAllowed);
if (!('BrowserElementIsPreloaded' in this)) {
try {
if (Services.prefs.getBoolPref("dom.mozInputMethod.enabled")) {
Services.scriptloader.loadSubScript("chrome://global/content/forms.js");
}
} catch (e) {
}
// Those are produc-specific files that's sometimes unavailable.
try {
Services.scriptloader.loadSubScript("chrome://browser/content/forms.js");
Services.scriptloader.loadSubScript("chrome://browser/content/ErrorPage.js");
} catch (e) {
}

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

@ -9,7 +9,7 @@ this.EXPORTED_SYMBOLS = ['Keyboard'];
const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
const kFormsFrameScript = 'chrome://browser/content/forms.js';
const kFormsFrameScript = 'chrome://global/content/forms.js';
Cu.import('resource://gre/modules/Services.jsm');
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@ -64,27 +64,31 @@ this.Keyboard = {
ppmm.broadcastAsyncMessage('Keyboard:FocusChange', { 'type': 'blur' });
}
} else {
mm.addMessageListener('Forms:Input', this);
mm.addMessageListener('Forms:SelectionChange', this);
mm.addMessageListener('Forms:GetText:Result:OK', this);
mm.addMessageListener('Forms:GetText:Result:Error', this);
mm.addMessageListener('Forms:SetSelectionRange:Result:OK', this);
mm.addMessageListener('Forms:ReplaceSurroundingText:Result:OK', this);
mm.addMessageListener('Forms:SendKey:Result:OK', this);
mm.addMessageListener('Forms:SequenceError', this);
mm.addMessageListener('Forms:GetContext:Result:OK', this);
mm.addMessageListener('Forms:SetComposition:Result:OK', this);
mm.addMessageListener('Forms:EndComposition:Result:OK', this);
this.initFormsFrameScript(mm);
}
},
// When not running apps OOP, we need to load forms.js here since this
// won't happen from dom/ipc/preload.js
try {
if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) {
mm.loadFrameScript(kFormsFrameScript, true);
}
} catch (e) {
dump('Error loading ' + kFormsFrameScript + ' as frame script: ' + e + '\n');
initFormsFrameScript: function(mm) {
mm.addMessageListener('Forms:Input', this);
mm.addMessageListener('Forms:SelectionChange', this);
mm.addMessageListener('Forms:GetText:Result:OK', this);
mm.addMessageListener('Forms:GetText:Result:Error', this);
mm.addMessageListener('Forms:SetSelectionRange:Result:OK', this);
mm.addMessageListener('Forms:ReplaceSurroundingText:Result:OK', this);
mm.addMessageListener('Forms:SendKey:Result:OK', this);
mm.addMessageListener('Forms:SequenceError', this);
mm.addMessageListener('Forms:GetContext:Result:OK', this);
mm.addMessageListener('Forms:SetComposition:Result:OK', this);
mm.addMessageListener('Forms:EndComposition:Result:OK', this);
// When not running apps OOP, we need to load forms.js here since this
// won't happen from dom/ipc/preload.js
try {
if (Services.prefs.getBoolPref("dom.ipc.tabs.disabled") === true) {
mm.loadFrameScript(kFormsFrameScript, true);
}
} catch (e) {
dump('Error loading ' + kFormsFrameScript + ' as frame script: ' + e + '\n');
}
},

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

6
dom/inputmethod/jar.mn Normal file
Просмотреть файл

@ -0,0 +1,6 @@
# 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/.
toolkit.jar:
content/global/forms.js (forms.js)

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

@ -87,9 +87,15 @@ const BrowserElementIsPreloaded = true;
} catch(e) {
}
try {
if (Services.prefs.getBoolPref("dom.mozInputMethod.enabled")) {
Services.scriptloader.loadSubScript("chrome://global/content/forms.js", global);
}
} catch (e) {
}
// Those are produc-specific files that's sometimes unavailable.
try {
Services.scriptloader.loadSubScript("chrome://browser/content/forms.js", global);
Services.scriptloader.loadSubScript("chrome://browser/content/ErrorPage.js", global);
} catch (e) {
}

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

@ -11,6 +11,4 @@
#define NS_RILCONTENTHELPER_CID \
{ 0x472816e1, 0x1fd6, 0x4405, \
{ 0x99, 0x6c, 0x80, 0x6f, 0x9e, 0xa6, 0x81, 0x74 } }
#define NS_RADIOINTERFACELAYER_CONTRACTID "@mozilla.org/ril;1"
#define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"

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

@ -195,12 +195,14 @@ var WifiManager = (function() {
// On properly written drivers, bringing the interface
// down powers down the interface.
callback(0);
notify("supplicantlost", { success: true });
return;
}
wifiCommand.unloadDriver(function(status) {
driverLoaded = (status < 0);
callback(status);
notify("supplicantlost", { success: true });
});
}
@ -413,6 +415,12 @@ var WifiManager = (function() {
}
function notifyStateChange(fields) {
// Don't handle any state change when and after disabling.
if (manager.state === "DISABLING" ||
manager.state === "UNINITIALIZED") {
return false;
}
// If we're already in the COMPLETED state, we might receive events from
// the supplicant that tell us that we're re-authenticating or reminding
// us that we're associated to a network. In those cases, we don't need to
@ -676,22 +684,22 @@ var WifiManager = (function() {
return true;
}
if (eventData.indexOf("CTRL-EVENT-TERMINATING") === 0) {
// If the monitor socket is closed, we have already stopped the
// supplicant and we can stop waiting for more events and
// simply exit here (we don't have to notify about having lost
// the connection).
if (eventData.indexOf("connection closed") !== -1) {
notify("supplicantlost", { success: true });
return false;
}
// As long we haven't seen too many recv errors yet, we
// will keep going for a bit longer.
if (eventData.indexOf("recv error") !== -1 && ++recvErrors < 10)
// As long the monitor socket is not closed and we haven't seen too many
// recv errors yet, we will keep going for a bit longer.
if (eventData.indexOf("connection closed") === -1 &&
eventData.indexOf("recv error") !== -1 && ++recvErrors < 10)
return true;
notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 });
notify("supplicantlost", { success: true });
// If the supplicant is terminated as commanded, the supplicant lost
// notification will be sent after driver unloaded. In such case, the
// manager state will be "DISABLING" or "UNINITIALIZED".
// So if supplicant terminated with incorrect manager state, implying
// unexpected condition, we should notify supplicant lost here.
if (manager.state !== "DISABLING" && manager.state !== "UNINITIALIZED") {
notify("supplicantlost", { success: true });
}
return false;
}
if (eventData.indexOf("CTRL-EVENT-DISCONNECTED") === 0) {
@ -897,6 +905,7 @@ var WifiManager = (function() {
// Note these following calls ignore errors. If we fail to kill the
// supplicant gracefully, then we need to continue telling it to die
// until it does.
manager.state = "DISABLING";
wifiCommand.terminateSupplicant(function (ok) {
manager.connectionDropped(function () {
wifiCommand.stopSupplicant(function (status) {

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

@ -3,7 +3,7 @@
* 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 <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
#include <stdint.h>
#include "nsDebug.h"
#include "nscore.h"
@ -13,33 +13,29 @@ NS_GetComplexLineBreaks(const PRUnichar* aText, uint32_t aLength,
uint8_t* aBreakBefore)
{
NS_ASSERTION(aText, "aText shouldn't be null");
TextBreakLocatorRef breakLocator;
memset(aBreakBefore, false, aLength * sizeof(uint8_t));
memset(aBreakBefore, 0, aLength * sizeof(uint8_t));
OSStatus status = UCCreateTextBreakLocator(nullptr,
0,
kUCTextBreakLineMask,
&breakLocator);
if (status != noErr)
CFStringRef str = ::CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, reinterpret_cast<const UniChar*>(aText), aLength, kCFAllocatorNull);
if (!str) {
return;
for (UniCharArrayOffset position = 0; position < aLength;) {
UniCharArrayOffset offset;
status = UCFindTextBreak(breakLocator,
kUCTextBreakLineMask,
position == 0 ? kUCTextBreakLeadingEdgeMask :
(kUCTextBreakLeadingEdgeMask |
kUCTextBreakIterateMask),
reinterpret_cast<const UniChar*>(aText),
aLength,
position,
&offset);
if (status != noErr || offset >= aLength)
break;
aBreakBefore[offset] = true;
position = offset;
}
UCDisposeTextBreakLocator(&breakLocator);
CFStringTokenizerRef st = ::CFStringTokenizerCreate(kCFAllocatorDefault, str, ::CFRangeMake(0, aLength), kCFStringTokenizerUnitLineBreak, NULL);
if (!st) {
::CFRelease(str);
return;
}
CFStringTokenizerTokenType tt = ::CFStringTokenizerAdvanceToNextToken(st);
while (tt != kCFStringTokenizerTokenNone) {
CFRange r = ::CFStringTokenizerGetCurrentTokenRange(st);
if (r.location != 0) { // Ignore leading edge
aBreakBefore[r.location] = true;
}
tt = CFStringTokenizerAdvanceToNextToken(st);
}
::CFRelease(st);
::CFRelease(str);
}

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

@ -33,6 +33,7 @@
#include "nsHZToUnicode.h"
#include "gbku.h"
#include "mozilla/Telemetry.h"
//----------------------------------------------------------------------
// Class nsHZToUnicode [implementation]
@ -49,11 +50,14 @@
#define HZ_ODD_BYTE_STATE (mHZState & (HZ_STATE_ODD_BYTE_FLAG))
#define HZ_ENCODING_STATE (mHZState & ~(HZ_STATE_ODD_BYTE_FLAG))
using namespace mozilla;
nsHZToUnicode::nsHZToUnicode() : nsBufferDecoderSupport(1)
{
mHZState = HZ_STATE_ASCII; // per HZ spec, default to ASCII state
mRunLength = 0;
mOddByte = 0;
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_HZ, true);
}
//Overwriting the ConvertNoBuff() in nsUCvCnSupport.cpp.

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

@ -6,6 +6,7 @@
#define nsISO2022CNToUnicode_h__
#include "nsCOMPtr.h"
#include "nsUCSupport.h"
#include "mozilla/Telemetry.h"
#define MBYTE 0x8e
#undef PMASK
@ -17,13 +18,18 @@
#define SS2 0x4e
#define SS3 0x4f
using namespace mozilla;
class nsISO2022CNToUnicode : public nsBasicDecoderSupport
{
public:
nsISO2022CNToUnicode() :
mState(eState_ASCII),
mPlaneID(0),
mRunLength(0) { }
mRunLength(0)
{
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ISO2022CN, true);
}
virtual ~nsISO2022CNToUnicode() {}

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

@ -19,6 +19,9 @@
#include "nsUCConstructors.h"
#include "nsCP850ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -34,6 +37,7 @@ nsCP850ToUnicodeConstructor(nsISupports* aOuter, REFNSIID aIID,
#include "cp850.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM850, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -19,6 +19,9 @@
#include "nsUCConstructors.h"
#include "nsCP852ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -31,6 +34,7 @@ nsCP852ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "cp852.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM852, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -19,6 +19,9 @@
#include "nsUCConstructors.h"
#include "nsCP855ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -31,6 +34,7 @@ nsCP855ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "cp855.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM855, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -19,6 +19,9 @@
#include "nsUCConstructors.h"
#include "nsCP857ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -31,6 +34,7 @@ nsCP857ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "cp857.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM857, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -19,6 +19,9 @@
#include "nsUCConstructors.h"
#include "nsCP862ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -31,6 +34,7 @@ nsCP862ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "cp862.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_IBM862, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,7 +5,9 @@
#ifndef nsShiftJISToUnicode_h__
#define nsShiftJISToUnicode_h__
#include "nsUCSupport.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
class nsShiftJISToUnicode : public nsBasicDecoderSupport
{
@ -83,6 +85,7 @@ public:
mGB2312Decoder = nullptr;
mEUCKRDecoder = nullptr;
mISO88597Decoder = nullptr;
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ISO2022JP, true);
}
virtual ~nsISO2022JPToUnicodeV2()
{

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

@ -5,8 +5,9 @@
#ifndef nsISO2022KRToUnicode_h__
#define nsISO2022KRToUnicode_h__
#include "nsUCSupport.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
class nsISO2022KRToUnicode : public nsBasicDecoderSupport
{
@ -18,6 +19,7 @@ public:
mData = 0;
mEUCKRDecoder = nullptr;
mRunLength = 0;
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ISO2022KR, true);
}
virtual ~nsISO2022KRToUnicode()

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

@ -6,6 +6,9 @@
#include "nsJohabToUnicode.h"
#include "nsUCvKODll.h"
#include "nsUCConstructors.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -46,6 +49,7 @@ nsresult
nsJohabToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_JOHAB, true);
return CreateMultiTableDecoder(sizeof(g_JOHABRanges) / sizeof(g_JOHABRanges[0]),
(const uRange*) &g_JOHABRanges,
(uScanClassID*) &g_JOHABScanClassIDs,

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsARMSCII8ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsARMSCII8ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "armscii.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ARMSCII8, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsISOIR111ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsISOIR111ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "iso-ir-111.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_ISOIR111, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacArabicToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacArabicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macarabic.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACARABIC, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacCEToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacCEToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macce.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACCE, true);
return CreateOneByteDecoder((uMappingTable*) &g_MacCEMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacCroatianToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacCroatianToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "maccroat.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACCROATIAN, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacDevanagariToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacDevanagariToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macdevanaga.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACDEVANAGARI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacFarsiToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacFarsiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macfarsi.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACFARSI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacGreekToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacGreekToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macgreek.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACGREEK, true);
return CreateOneByteDecoder((uMappingTable*) &g_MacGreekMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacGurmukhiToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacGurmukhiToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macgurmukhi.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACGURMUKHI, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacHebrewToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacHebrewToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "machebrew.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACHEBREW, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacIcelandicToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacIcelandicToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macicela.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACICELANDIC, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacRomanianToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacRomanianToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macro.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACROMANIAN, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsMacTurkishToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsMacTurkishToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "macturki.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_MACTURKISH, true);
return CreateOneByteDecoder((uMappingTable*) &g_MacTurkishMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsT61ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -24,6 +27,7 @@ nsT61ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
ShiftInCell(u2BytesChar, 2, 0xC0, 0xCF)
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_T61, true);
return CreateTableDecoder(uMultibytesCharset,
(uShiftInTable*) &g_T61ShiftInTable,
(uMappingTable*) &g_T61MappingTable, 1,

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

@ -5,6 +5,9 @@
#include "nsUCConstructors.h"
#include "nsTCVN5712ToUnicode.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsTCVN5712ToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "tcvn5712.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_VIETTCVN5712, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsVISCIIToUnicode.h"
#include "nsUCConstructors.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsVISCIIToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "viscii.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_VISCII, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -5,6 +5,9 @@
#include "nsVPSToUnicode.h"
#include "nsUCConstructors.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
//----------------------------------------------------------------------
// Global functions and data [declaration]
@ -17,6 +20,7 @@ nsVPSToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID,
#include "vps.ut"
};
Telemetry::Accumulate(Telemetry::DECODER_INSTANTIATED_VIETVPS, true);
return CreateOneByteDecoder((uMappingTable*) &g_utMappingTable,
aOuter, aIID, aResult);
}

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

@ -2916,7 +2916,7 @@ if test "$_USE_SYSTEM_NSPR" || (test "$NSPR_CFLAGS" -o "$NSPR_LIBS"); then
fi
case "$target" in
*linux*|*darwin*)
*linux*|*darwin*|*dragonfly*|*freebsd*|*netbsd*|*openbsd*)
if test -z "$_HAS_NSPR"; then JS_POSIX_NSPR_DEFAULT=1; fi
;;
esac

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

@ -26,9 +26,10 @@ BufferGrayRoots(GCMarker *gcmarker);
class AutoCopyFreeListToArenas
{
JSRuntime *runtime;
ZoneSelector selector;
public:
AutoCopyFreeListToArenas(JSRuntime *rt);
AutoCopyFreeListToArenas(JSRuntime *rt, ZoneSelector selector);
~AutoCopyFreeListToArenas();
};
@ -64,7 +65,7 @@ struct AutoPrepareForTracing
AutoTraceSession session;
AutoCopyFreeListToArenas copy;
AutoPrepareForTracing(JSRuntime *rt);
AutoPrepareForTracing(JSRuntime *rt, ZoneSelector selector);
};
class IncrementalSafety

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

@ -11,6 +11,7 @@
#include "js/HashTable.h"
#include "vm/Runtime.h"
#include "jscntxtinlines.h"
#include "jsgcinlines.h"
using namespace js;
@ -21,7 +22,8 @@ js::TraceRuntime(JSTracer *trc)
{
JS_ASSERT(!IS_GC_MARKING_TRACER(trc));
AutoPrepareForTracing prep(trc->runtime);
AutoLockForExclusiveAccess lock(trc->runtime);
AutoPrepareForTracing prep(trc->runtime, WithAtoms);
MarkRuntime(trc);
}
@ -54,9 +56,10 @@ js::IterateZonesCompartmentsArenasCells(JSRuntime *rt, void *data,
IterateArenaCallback arenaCallback,
IterateCellCallback cellCallback)
{
AutoPrepareForTracing prop(rt);
AutoLockForExclusiveAccess lock(rt);
AutoPrepareForTracing prop(rt, WithAtoms);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
(*zoneCallback)(rt, data, zone);
IterateCompartmentsArenasCells(rt, zone, data,
compartmentCallback, arenaCallback, cellCallback);
@ -70,7 +73,8 @@ js::IterateZoneCompartmentsArenasCells(JSRuntime *rt, Zone *zone, void *data,
IterateArenaCallback arenaCallback,
IterateCellCallback cellCallback)
{
AutoPrepareForTracing prop(rt);
AutoLockForExclusiveAccess lock(rt);
AutoPrepareForTracing prop(rt, WithAtoms);
(*zoneCallback)(rt, data, zone);
IterateCompartmentsArenasCells(rt, zone, data,
@ -80,7 +84,7 @@ js::IterateZoneCompartmentsArenasCells(JSRuntime *rt, Zone *zone, void *data,
void
js::IterateChunks(JSRuntime *rt, void *data, IterateChunkCallback chunkCallback)
{
AutoPrepareForTracing prep(rt);
AutoPrepareForTracing prep(rt, SkipAtoms);
for (js::GCChunkSet::Range r = rt->gcChunkSet.all(); !r.empty(); r.popFront())
chunkCallback(rt, data, r.front());
@ -90,7 +94,7 @@ void
js::IterateScripts(JSRuntime *rt, JSCompartment *compartment,
void *data, IterateScriptCallback scriptCallback)
{
AutoPrepareForTracing prep(rt);
AutoPrepareForTracing prep(rt, SkipAtoms);
if (compartment) {
for (CellIterUnderGC i(compartment->zone(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
@ -99,7 +103,7 @@ js::IterateScripts(JSRuntime *rt, JSCompartment *compartment,
scriptCallback(rt, data, script);
}
} else {
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
for (CellIterUnderGC i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next())
scriptCallback(rt, data, i.get<JSScript>());
}
@ -109,7 +113,7 @@ js::IterateScripts(JSRuntime *rt, JSCompartment *compartment,
void
js::IterateGrayObjects(Zone *zone, GCThingCallback cellCallback, void *data)
{
AutoPrepareForTracing prep(zone->runtimeFromMainThread());
AutoPrepareForTracing prep(zone->runtimeFromMainThread(), SkipAtoms);
for (size_t finalizeKind = 0; finalizeKind <= FINALIZE_OBJECT_LAST; finalizeKind++) {
for (CellIterUnderGC i(zone, AllocKind(finalizeKind)); !i.done(); i.next()) {
@ -126,9 +130,10 @@ JS_IterateCompartments(JSRuntime *rt, void *data,
{
JS_ASSERT(!rt->isHeapBusy());
AutoLockForExclusiveAccess lock(rt);
AutoPauseWorkersForTracing pause(rt);
AutoTraceSession session(rt);
for (CompartmentsIter c(rt); !c.done(); c.next())
for (CompartmentsIter c(rt, WithAtoms); !c.done(); c.next())
(*compartmentCallback)(rt, data, c);
}

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

@ -602,7 +602,7 @@ js::Nursery::collect(JSRuntime *rt, JS::gcreason::Reason reason)
rt->gcStoreBuffer.mark(&trc); // This must happen first.
MarkRuntime(&trc);
Debugger::markAll(&trc);
for (CompartmentsIter comp(rt); !comp.done(); comp.next()) {
for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next()) {
comp->markAllCrossCompartmentWrappers(&trc);
comp->markAllInitialShapeTableEntries(&trc);
}

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

@ -664,7 +664,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
JS_ASSERT(!rt->mainThread.suppressGC);
if (IS_GC_MARKING_TRACER(trc)) {
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
if (!c->zone()->isCollecting())
c->markCrossCompartmentWrappers(trc);
}
@ -721,7 +721,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
for (ContextIter acx(rt); !acx.done(); acx.next())
acx->mark(trc);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
if (IS_GC_MARKING_TRACER(trc) && !zone->isCollecting())
continue;
@ -743,7 +743,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
}
/* We can't use GCCompartmentsIter if we're called from TraceRuntime. */
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
if (trc->runtime->isHeapMinorCollecting())
c->globalWriteBarriered = false;
@ -773,7 +773,7 @@ js::gc::MarkRuntime(JSTracer *trc, bool useSavedRoots)
* which have been entered. Globals aren't nursery allocated so there's
* no need to do this for minor GCs.
*/
for (CompartmentsIter c(rt); !c.done(); c.next())
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next())
c->mark(trc);
/*

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

@ -16,6 +16,7 @@
#include "gc/Zone.h"
#include "js/HashTable.h"
#include "jscntxtinlines.h"
#include "jsgcinlines.h"
using namespace js;
@ -235,13 +236,13 @@ JS::CheckStackRoots(JSContext *cx)
// Can switch to the atoms compartment during analysis.
if (IsAtomsCompartment(cx->compartment())) {
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
if (c.get()->activeAnalysis)
return;
}
}
AutoCopyFreeListToArenas copy(rt);
AutoCopyFreeListToArenas copy(rt, WithAtoms);
ConservativeGCData *cgcd = &rt->conservativeGC;
cgcd->recordStackTop();
@ -447,7 +448,8 @@ gc::StartVerifyPreBarriers(JSRuntime *rt)
MinorGC(rt, JS::gcreason::API);
AutoPrepareForTracing prep(rt);
AutoLockForExclusiveAccess lock(rt);
AutoPrepareForTracing prep(rt, WithAtoms);
if (!IsIncrementalGCSafe(rt))
return;
@ -510,7 +512,7 @@ gc::StartVerifyPreBarriers(JSRuntime *rt)
rt->gcMarker.start();
rt->setNeedsBarrier(true);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
PurgeJITCaches(zone);
zone->setNeedsBarrier(true, Zone::UpdateIon);
zone->allocator.arenas.purge();
@ -575,7 +577,7 @@ AssertMarkedOrAllocated(const EdgeValue &edge)
void
gc::EndVerifyPreBarriers(JSRuntime *rt)
{
AutoPrepareForTracing prep(rt);
AutoPrepareForTracing prep(rt, SkipAtoms);
VerifyPreTracer *trc = (VerifyPreTracer *)rt->gcVerifyPreData;
@ -585,7 +587,7 @@ gc::EndVerifyPreBarriers(JSRuntime *rt)
bool compartmentCreated = false;
/* We need to disable barriers before tracing, which may invoke barriers. */
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (!zone->needsBarrier())
compartmentCreated = true;
@ -740,7 +742,7 @@ js::gc::EndVerifyPostBarriers(JSRuntime *rt)
{
#ifdef JSGC_GENERATIONAL
VerifyPostTracer::EdgeSet edges;
AutoPrepareForTracing prep(rt);
AutoPrepareForTracing prep(rt, SkipAtoms);
VerifyPostTracer *trc = (VerifyPostTracer *)rt->gcVerifyPostData;

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

@ -319,21 +319,39 @@ struct Zone : public JS::shadow::Zone,
namespace js {
/*
* Using the atoms zone without holding the exclusive access lock is dangerous
* because worker threads may be using it simultaneously. Therefore, it's
* better to skip the atoms zone when iterating over zones. If you need to
* iterate over the atoms zone, consider taking the exclusive access lock first.
*/
enum ZoneSelector {
WithAtoms,
SkipAtoms
};
class ZonesIter {
private:
JS::Zone **it, **end;
public:
ZonesIter(JSRuntime *rt) {
ZonesIter(JSRuntime *rt, ZoneSelector selector) {
it = rt->zones.begin();
end = rt->zones.end();
if (selector == SkipAtoms) {
JS_ASSERT(rt->isAtomsZone(*it));
it++;
}
}
bool done() const { return it == end; }
void next() {
JS_ASSERT(!done());
it++;
do {
it++;
} while (!done() && (*it)->usedByExclusiveThread);
}
JS::Zone *get() const {
@ -383,8 +401,15 @@ class CompartmentsIterT
CompartmentsIterT(JSRuntime *rt)
: zone(rt)
{
JS_ASSERT(!zone.done());
comp.construct(zone);
if (!zone.done())
comp.construct(zone);
}
CompartmentsIterT(JSRuntime *rt, ZoneSelector selector)
: zone(rt, selector)
{
if (!zone.done())
comp.construct(zone);
}
bool done() const { return zone.done(); }

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

@ -0,0 +1,5 @@
// |jit-test| error: ReferenceError
for (var c in foo)
try {
throw new Error();
} catch (e) {}

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

@ -0,0 +1,11 @@
// |jit-test| error: is undefined
load(libdir + "iteration.js");
function iterable() {
var iterable = {};
iterable[std_iterator] = () => ({next: () => void 0});
return iterable;
}
(function*(){yield*iterable()}()).next();

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

@ -795,30 +795,31 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
BaselineScript *baselineScript = script->baselineScript();
#ifdef DEBUG
uint32_t expectedDepth = js_ReconstructStackDepth(cx, script,
resumeAfter ? GetNextPc(pc) : pc);
if (op != JSOP_FUNAPPLY || !iter.moreFrames() || resumeAfter) {
if (op == JSOP_FUNCALL) {
// For fun.call(this, ...); the reconstructStackDepth will
// include the this. When inlining that is not included.
// So the exprStackSlots will be one less.
JS_ASSERT(expectedDepth - exprStackSlots <= 1);
} else if (iter.moreFrames() && (IsGetPropPC(pc) || IsSetPropPC(pc))) {
// Accessors coming out of ion are inlined via a complete
// lie perpetrated by the compiler internally. Ion just rearranges
// the stack, and pretends that it looked like a call all along.
// This means that the depth is actually one *more* than expected
// by the interpreter, as there is now a JSFunction, |this| and [arg],
// rather than the expected |this| and [arg]
// Note that none of that was pushed, but it's still reflected
// in exprStackSlots.
JS_ASSERT(exprStackSlots - expectedDepth == 1);
} else {
// For fun.apply({}, arguments) the reconstructStackDepth will
// have stackdepth 4, but it could be that we inlined the
// funapply. In that case exprStackSlots, will have the real
// arguments in the slots and not be 4.
JS_ASSERT(exprStackSlots == expectedDepth);
uint32_t expectedDepth;
if (ReconstructStackDepth(cx, script, resumeAfter ? GetNextPc(pc) : pc, &expectedDepth)) {
if (op != JSOP_FUNAPPLY || !iter.moreFrames() || resumeAfter) {
if (op == JSOP_FUNCALL) {
// For fun.call(this, ...); the reconstructStackDepth will
// include the this. When inlining that is not included.
// So the exprStackSlots will be one less.
JS_ASSERT(expectedDepth - exprStackSlots <= 1);
} else if (iter.moreFrames() && (IsGetPropPC(pc) || IsSetPropPC(pc))) {
// Accessors coming out of ion are inlined via a complete
// lie perpetrated by the compiler internally. Ion just rearranges
// the stack, and pretends that it looked like a call all along.
// This means that the depth is actually one *more* than expected
// by the interpreter, as there is now a JSFunction, |this| and [arg],
// rather than the expected |this| and [arg]
// Note that none of that was pushed, but it's still reflected
// in exprStackSlots.
JS_ASSERT(exprStackSlots - expectedDepth == 1);
} else {
// For fun.apply({}, arguments) the reconstructStackDepth will
// have stackdepth 4, but it could be that we inlined the
// funapply. In that case exprStackSlots, will have the real
// arguments in the slots and not be 4.
JS_ASSERT(exprStackSlots == expectedDepth);
}
}
}

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

@ -904,7 +904,7 @@ jit::AddSizeOfBaselineData(JSScript *script, mozilla::MallocSizeOf mallocSizeOf,
void
jit::ToggleBaselineSPS(JSRuntime *runtime, bool enable)
{
for (ZonesIter zone(runtime); !zone.done(); zone.next()) {
for (ZonesIter zone(runtime, SkipAtoms); !zone.done(); zone.next()) {
for (gc::CellIter i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
JSScript *script = i.get<JSScript>();
if (!script->hasBaselineScript())

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

@ -1303,12 +1303,17 @@ class Assembler
void initWithAllocator() {
m_buffer.initWithAllocator();
// Note that the sizes for the double pools are set to 1020 rather than 1024 to
// work around a rare edge case that would otherwise bail out - which is not
// possible for Asm.js code and causes a compilation failure. See the comment at
// the fail_bail call within IonAssemberBufferWithConstantPools.h: finishPool().
// Set up the backwards double region
new (&pools_[2]) Pool (1024, 8, 4, 8, 8, m_buffer.LifoAlloc_, true);
new (&pools_[2]) Pool (1020, 8, 4, 8, 8, m_buffer.LifoAlloc_, true);
// Set up the backwards 32 bit region
new (&pools_[3]) Pool (4096, 4, 4, 8, 4, m_buffer.LifoAlloc_, true, true);
// Set up the forwards double region
new (doublePool) Pool (1024, 8, 4, 8, 8, m_buffer.LifoAlloc_, false, false, &pools_[2]);
new (doublePool) Pool (1020, 8, 4, 8, 8, m_buffer.LifoAlloc_, false, false, &pools_[2]);
// Set up the forwards 32 bit region
new (int32Pool) Pool (4096, 4, 4, 8, 4, m_buffer.LifoAlloc_, false, true, &pools_[3]);
for (int i = 0; i < 4; i++) {

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

@ -279,25 +279,28 @@ CodeGeneratorShared::encode(LSnapshot *snapshot)
#ifdef DEBUG
if (GetIonContext()->cx) {
uint32_t stackDepth = js_ReconstructStackDepth(GetIonContext()->cx, script, bailPC);
if (JSOp(*bailPC) == JSOP_FUNCALL) {
// For fun.call(this, ...); the reconstructStackDepth will
// include the this. When inlining that is not included.
// So the exprStackSlots will be one less.
JS_ASSERT(stackDepth - exprStack <= 1);
} else if (JSOp(*bailPC) != JSOP_FUNAPPLY &&
!IsGetPropPC(bailPC) && !IsSetPropPC(bailPC))
{
// For fun.apply({}, arguments) the reconstructStackDepth will
// have stackdepth 4, but it could be that we inlined the
// funapply. In that case exprStackSlots, will have the real
// arguments in the slots and not be 4.
uint32_t stackDepth;
if (ReconstructStackDepth(GetIonContext()->cx, script, bailPC, &stackDepth)) {
if (JSOp(*bailPC) == JSOP_FUNCALL) {
// For fun.call(this, ...); the reconstructStackDepth will
// include the this. When inlining that is not included.
// So the exprStackSlots will be one less.
JS_ASSERT(stackDepth - exprStack <= 1);
} else if (JSOp(*bailPC) != JSOP_FUNAPPLY &&
!IsGetPropPC(bailPC) && !IsSetPropPC(bailPC))
{
// For fun.apply({}, arguments) the reconstructStackDepth will
// have stackdepth 4, but it could be that we inlined the
// funapply. In that case exprStackSlots, will have the real
// arguments in the slots and not be 4.
// With accessors, we have different stack depths depending on whether or not we
// inlined the accessor, as the inlined stack contains a callee function that should
// never have been there and we might just be capturing an uneventful property site,
// in which case there won't have been any violence.
JS_ASSERT(exprStack == stackDepth);
// With accessors, we have different stack depths depending on
// whether or not we inlined the accessor, as the inlined stack
// contains a callee function that should never have been there
// and we might just be capturing an uneventful property site, in
// which case there won't have been any violence.
JS_ASSERT(exprStack == stackDepth);
}
}
}
#endif

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

@ -260,7 +260,7 @@ js::DestroyContext(JSContext *cx, DestroyContextMode mode)
* Dump remaining type inference results while we still have a context.
* This printing depends on atoms still existing.
*/
for (CompartmentsIter c(rt); !c.done(); c.next())
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next())
c->types.print(cx, false);
}
if (mode == DCM_FORCE_GC) {

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

@ -155,7 +155,7 @@ JS::PrepareZoneForGC(Zone *zone)
JS_FRIEND_API(void)
JS::PrepareForFullGC(JSRuntime *rt)
{
for (ZonesIter zone(rt); !zone.done(); zone.next())
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next())
zone->scheduleGC();
}
@ -165,7 +165,7 @@ JS::PrepareForIncrementalGC(JSRuntime *rt)
if (!JS::IsIncrementalGCInProgress(rt))
return;
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (zone->wasGCStarted())
PrepareZoneForGC(zone);
}
@ -174,7 +174,7 @@ JS::PrepareForIncrementalGC(JSRuntime *rt)
JS_FRIEND_API(bool)
JS::IsGCScheduled(JSRuntime *rt)
{
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (zone->isGCScheduled())
return true;
}

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

@ -1010,7 +1010,7 @@ js_FinishGC(JSRuntime *rt)
#endif
/* Delete all remaining zones. */
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next())
js_delete(comp.get());
js_delete(zone.get());
@ -1908,7 +1908,7 @@ size_t
GCMarker::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
{
size_t size = stack.sizeOfExcludingThis(mallocSizeOf);
for (ZonesIter zone(runtime); !zone.done(); zone.next())
for (ZonesIter zone(runtime, WithAtoms); !zone.done(); zone.next())
size += zone->gcGrayRoots.sizeOfExcludingThis(mallocSizeOf);
return size;
}
@ -2208,7 +2208,7 @@ static void
AssertBackgroundSweepingFinished(JSRuntime *rt)
{
JS_ASSERT(!rt->gcSweepingZones);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
for (unsigned i = 0; i < FINALIZE_LIMIT; ++i) {
JS_ASSERT(!zone->allocator.arenas.arenaListsToSweep[i]);
JS_ASSERT(zone->allocator.arenas.doneBackgroundFinalize(AllocKind(i)));
@ -2771,7 +2771,7 @@ CheckForCompartmentMismatches(JSRuntime *rt)
CompartmentCheckTracer trc;
JS_TracerInit(&trc, rt, CheckCompartmentCallback);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
trc.zone = zone;
for (size_t thingKind = 0; thingKind < FINALIZE_LAST; thingKind++) {
for (CellIterUnderGC i(zone, AllocKind(thingKind)); !i.done(); i.next()) {
@ -2798,7 +2798,7 @@ BeginMarkPhase(JSRuntime *rt)
rt->gcIsFull = true;
bool any = false;
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
/* Assert that zone state is as we expect */
JS_ASSERT(!zone->isCollecting());
JS_ASSERT(!zone->compartments.empty());
@ -2820,7 +2820,7 @@ BeginMarkPhase(JSRuntime *rt)
zone->setPreservingCode(false);
}
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, WithAtoms); !c.done(); c.next()) {
JS_ASSERT(!c->gcLiveArrayBuffers);
c->marked = false;
if (ShouldPreserveJITCode(c, currentTime))
@ -2953,7 +2953,7 @@ BeginMarkPhase(JSRuntime *rt)
*/
/* Set the maybeAlive flag based on cross-compartment edges. */
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
for (JSCompartment::WrapperEnum e(c); !e.empty(); e.popFront()) {
Cell *dst = e.front().key.wrapped;
dst->tenuredZone()->maybeAlive = true;
@ -3293,7 +3293,7 @@ AssertNeedsBarrierFlagsConsistent(JSRuntime *rt)
{
#ifdef DEBUG
bool anyNeedsBarrier = false;
for (ZonesIter zone(rt); !zone.done(); zone.next())
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next())
anyNeedsBarrier |= zone->needsBarrier();
JS_ASSERT(rt->needsBarrier() == anyNeedsBarrier);
#endif
@ -3307,7 +3307,7 @@ DropStringWrappers(JSRuntime *rt)
* us to sweep the wrappers in all compartments every time we sweep a
* compartment group.
*/
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
for (JSCompartment::WrapperEnum e(c); !e.empty(); e.popFront()) {
if (e.front().key.kind == CrossCompartmentKey::StringWrapper)
e.removeFront();
@ -3856,7 +3856,7 @@ BeginSweepPhase(JSRuntime *rt, bool lastGC)
#endif
#ifdef DEBUG
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
JS_ASSERT(!c->gcIncomingGrayPointers);
for (JSCompartment::WrapperEnum e(c); !e.empty(); e.popFront()) {
if (e.front().key.kind != CrossCompartmentKey::StringWrapper)
@ -3966,7 +3966,7 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocationKind gckind, bool lastGC)
* newly created zones. Can only change from full to not full.
*/
if (rt->gcIsFull) {
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (!zone->isCollecting()) {
rt->gcIsFull = false;
break;
@ -3981,7 +3981,7 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocationKind gckind, bool lastGC)
* prevent the cycle collector from collecting some dead objects.
*/
if (rt->gcFoundBlackGrayEdges) {
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (!zone->isCollecting())
zone->allocator.arenas.unmarkAll();
}
@ -4057,7 +4057,7 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocationKind gckind, bool lastGC)
SweepZones(&fop, lastGC);
}
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
zone->setGCLastBytes(zone->gcBytes, gckind);
if (zone->isCollecting()) {
JS_ASSERT(zone->isGCFinished());
@ -4077,7 +4077,7 @@ EndSweepPhase(JSRuntime *rt, JSGCInvocationKind gckind, bool lastGC)
}
#ifdef DEBUG
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
JS_ASSERT(!c->gcIncomingGrayPointers);
JS_ASSERT(!c->gcLiveArrayBuffers);
@ -4165,7 +4165,7 @@ AutoGCSession::~AutoGCSession()
#endif
/* Clear gcMallocBytes for all compartments */
for (ZonesIter zone(runtime); !zone.done(); zone.next()) {
for (ZonesIter zone(runtime, WithAtoms); !zone.done(); zone.next()) {
zone->resetGCMallocBytes();
zone->unscheduleGC();
}
@ -4173,19 +4173,39 @@ AutoGCSession::~AutoGCSession()
runtime->resetGCMallocBytes();
}
AutoCopyFreeListToArenas::AutoCopyFreeListToArenas(JSRuntime *rt)
: runtime(rt)
AutoCopyFreeListToArenas::AutoCopyFreeListToArenas(JSRuntime *rt, ZoneSelector selector)
: runtime(rt),
selector(selector)
{
for (ZonesIter zone(rt); !zone.done(); zone.next())
for (ZonesIter zone(rt, selector); !zone.done(); zone.next())
zone->allocator.arenas.copyFreeListsToArenas();
}
AutoCopyFreeListToArenas::~AutoCopyFreeListToArenas()
{
for (ZonesIter zone(runtime); !zone.done(); zone.next())
for (ZonesIter zone(runtime, selector); !zone.done(); zone.next())
zone->allocator.arenas.clearFreeListsInArenas();
}
class AutoCopyFreeListToArenasForGC
{
JSRuntime *runtime;
public:
AutoCopyFreeListToArenasForGC(JSRuntime *rt) : runtime(rt) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
//if (zone->canCollect())
zone->allocator.arenas.copyFreeListsToArenas();
}
}
~AutoCopyFreeListToArenasForGC() {
for (ZonesIter zone(runtime, WithAtoms); !zone.done(); zone.next()) {
//if (zone->canCollect())
zone->allocator.arenas.clearFreeListsInArenas();
}
}
};
static void
IncrementalCollectSlice(JSRuntime *rt,
int64_t budget,
@ -4201,7 +4221,7 @@ ResetIncrementalGC(JSRuntime *rt, const char *reason)
case MARK: {
/* Cancel any ongoing marking. */
AutoCopyFreeListToArenas copy(rt);
AutoCopyFreeListToArenasForGC copy(rt);
rt->gcMarker.reset();
rt->gcMarker.stop();
@ -4229,7 +4249,7 @@ ResetIncrementalGC(JSRuntime *rt, const char *reason)
case SWEEP:
rt->gcMarker.reset();
for (ZonesIter zone(rt); !zone.done(); zone.next())
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next())
zone->scheduledForDestruction = false;
/* Finish sweeping the current zone group, then abort. */
@ -4249,10 +4269,10 @@ ResetIncrementalGC(JSRuntime *rt, const char *reason)
rt->gcStats.reset(reason);
#ifdef DEBUG
for (CompartmentsIter c(rt); !c.done(); c.next())
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next())
JS_ASSERT(!c->gcLiveArrayBuffers);
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
JS_ASSERT(!zone->needsBarrier());
for (unsigned i = 0; i < FINALIZE_LIMIT; ++i)
JS_ASSERT(!zone->allocator.arenas.arenaListsToSweep[i]);
@ -4307,7 +4327,7 @@ AutoGCSlice::~AutoGCSlice()
{
/* We can't use GCZonesIter if this is the end of the last slice. */
bool haveBarriers = false;
for (ZonesIter zone(runtime); !zone.done(); zone.next()) {
for (ZonesIter zone(runtime, WithAtoms); !zone.done(); zone.next()) {
if (zone->isGCMarking()) {
zone->setNeedsBarrier(true, Zone::UpdateIon);
zone->allocator.arenas.prepareForIncrementalGC(runtime);
@ -4339,7 +4359,7 @@ IncrementalCollectSlice(JSRuntime *rt,
JS::gcreason::Reason reason,
JSGCInvocationKind gckind)
{
AutoCopyFreeListToArenas copy(rt);
AutoCopyFreeListToArenasForGC copy(rt);
AutoGCSlice slice(rt);
bool lastGC = (reason == JS::gcreason::DESTROY_RUNTIME);
@ -4504,7 +4524,7 @@ BudgetIncrementalGC(JSRuntime *rt, int64_t *budget)
}
bool reset = false;
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (zone->gcBytes >= zone->gcTriggerBytes) {
*budget = SliceBudget::Unlimited;
rt->gcStats.nonincremental("allocation trigger");
@ -4682,7 +4702,7 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget,
int zoneCount = 0;
int compartmentCount = 0;
int collectedCount = 0;
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (rt->gcMode == JSGC_MODE_GLOBAL)
zone->scheduleGC();
@ -4695,7 +4715,7 @@ Collect(JSRuntime *rt, bool incremental, int64_t budget,
collectedCount++;
}
for (CompartmentsIter c(rt); !c.done(); c.next())
for (CompartmentsIter c(rt, WithAtoms); !c.done(); c.next())
compartmentCount++;
rt->gcShouldCleanUpEverything = ShouldCleanUpEverything(rt, reason, gckind);
@ -4767,7 +4787,7 @@ js::GCFinalSlice(JSRuntime *rt, JSGCInvocationKind gckind, JS::gcreason::Reason
static bool
ZonesSelected(JSRuntime *rt)
{
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
if (zone->isGCScheduled())
return true;
}
@ -4836,11 +4856,11 @@ AutoFinishGC::AutoFinishGC(JSRuntime *rt)
gc::FinishBackgroundFinalize(rt);
}
AutoPrepareForTracing::AutoPrepareForTracing(JSRuntime *rt)
AutoPrepareForTracing::AutoPrepareForTracing(JSRuntime *rt, ZoneSelector selector)
: finish(rt),
pause(rt),
session(rt),
copy(rt)
copy(rt, selector)
{
RecordNativeStackTopForGC(rt);
}
@ -4896,7 +4916,7 @@ void
gc::MergeCompartments(JSCompartment *source, JSCompartment *target)
{
JSRuntime *rt = source->runtimeFromMainThread();
AutoPrepareForTracing prepare(rt);
AutoPrepareForTracing prepare(rt, SkipAtoms);
// Cleanup tables and other state in the source compartment that will be
// meaningless after merging into the target compartment.
@ -5031,7 +5051,7 @@ void
js::ReleaseAllJITCode(FreeOp *fop)
{
#ifdef JS_ION
for (ZonesIter zone(fop->runtime()); !zone.done(); zone.next()) {
for (ZonesIter zone(fop->runtime(), SkipAtoms); !zone.done(); zone.next()) {
# ifdef DEBUG
/* Assert no baseline scripts are marked as active. */
@ -5059,7 +5079,7 @@ js::ReleaseAllJITCode(FreeOp *fop)
}
/* Sweep now invalidated compiler outputs from each compartment. */
for (CompartmentsIter comp(fop->runtime()); !comp.done(); comp.next())
for (CompartmentsIter comp(fop->runtime(), SkipAtoms); !comp.done(); comp.next())
comp->types.clearCompilerOutputs(fop);
#endif
}
@ -5134,7 +5154,7 @@ js::StopPCCountProfiling(JSContext *cx)
if (!vec)
return;
for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (ZonesIter zone(rt, SkipAtoms); !zone.done(); zone.next()) {
for (CellIter i(zone, FINALIZE_SCRIPT); !i.done(); i.next()) {
JSScript *script = i.get<JSScript>();
if (script->hasScriptCounts && script->types) {

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

@ -306,7 +306,7 @@ class GCZonesIter
ZonesIter zone;
public:
GCZonesIter(JSRuntime *rt) : zone(rt) {
GCZonesIter(JSRuntime *rt) : zone(rt, WithAtoms) {
if (!zone->isCollecting())
next();
}

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

@ -402,12 +402,16 @@ class BytecodeParser
bool parse();
#ifdef DEBUG
bool isReachable(uint32_t offset) { return maybeCode(offset); }
bool isReachable(const jsbytecode *pc) { return maybeCode(pc); }
#endif
uint32_t stackDepthAtPC(uint32_t offset) {
// Sometimes the code generator in debug mode asks about the stack depth
// of unreachable code (bug 932180 comment 22). Assume that unreachable
// code has no operands on the stack.
Bytecode *code = maybeCode(offset);
return code ? code->stackDepth : 0;
return getCode(offset).stackDepth;
}
uint32_t stackDepthAtPC(const jsbytecode *pc) { return stackDepthAtPC(pc - script_->code); }
@ -697,6 +701,21 @@ BytecodeParser::parse()
#ifdef DEBUG
bool
js::ReconstructStackDepth(JSContext *cx, JSScript *script, jsbytecode *pc, uint32_t *depth)
{
BytecodeParser parser(cx, script);
if (!parser.parse())
return false;
if (!parser.isReachable(pc))
return false;
*depth = parser.stackDepthAtPC(pc);
return true;
}
/*
* If pc != nullptr, include a prefix indicating whether the PC is at the
* current line. If showAll is true, include the source note type and the
@ -707,10 +726,14 @@ js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, bool lines,
jsbytecode *pc, bool showAll, Sprinter *sp)
{
RootedScript script(cx, scriptArg);
BytecodeParser parser(cx, script);
jsbytecode *next, *end;
unsigned len;
if (showAll && !parser.parse())
return false;
if (showAll)
Sprint(sp, "%s:%u\n", script->filename(), script->lineno);
@ -757,10 +780,10 @@ js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, bool lines,
}
else
sp->put(" ");
if (script->hasAnalysis() && script->analysis()->maybeCode(next))
Sprint(sp, "%05u ", script->analysis()->getCode(next).stackDepth);
if (parser.isReachable(next))
Sprint(sp, "%05u ", parser.stackDepthAtPC(next));
else
sp->put(" ");
Sprint(sp, " ", parser.stackDepthAtPC(next));
}
len = js_Disassemble1(cx, script, next, next - script->code, lines, sp);
if (!len)
@ -1985,16 +2008,6 @@ js::DecompileArgument(JSContext *cx, int formalIndex, HandleValue v)
return LossyTwoByteCharsToNewLatin1CharsZ(cx, linear->range()).c_str();
}
unsigned
js_ReconstructStackDepth(JSContext *cx, JSScript *script, jsbytecode *pc)
{
BytecodeParser parser(cx, script);
if (!parser.parse())
return 0;
return parser.stackDepthAtPC(pc);
}
bool
js::CallResultEscapes(jsbytecode *pc)
{

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

@ -351,14 +351,17 @@ StackUses(JSScript *script, jsbytecode *pc);
extern unsigned
StackDefs(JSScript *script, jsbytecode *pc);
} /* namespace js */
#ifdef DEBUG
/*
* Given bytecode address pc in script's main program code, return the operand
* stack depth just before (JSOp) *pc executes.
* Given bytecode address pc in script's main program code, compute the operand
* stack depth just before (JSOp) *pc executes. If *pc is not reachable, return
* false.
*/
extern unsigned
js_ReconstructStackDepth(JSContext *cx, JSScript *script, jsbytecode *pc);
extern bool
ReconstructStackDepth(JSContext *cx, JSScript *script, jsbytecode *pc, uint32_t *depth);
#endif
} /* namespace js */
#ifdef _MSC_VER
#pragma warning(pop)

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

@ -229,7 +229,7 @@ void
WatchpointMap::traceAll(WeakMapTracer *trc)
{
JSRuntime *rt = trc->runtime;
for (CompartmentsIter comp(rt); !comp.done(); comp.next()) {
for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next()) {
if (WatchpointMap *wpmap = comp->watchpointMap)
wpmap->trace(trc);
}

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

@ -56,7 +56,7 @@ void
WeakMapBase::traceAllMappings(WeakMapTracer *tracer)
{
JSRuntime *rt = tracer->runtime;
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
for (WeakMapBase *m = c->gcWeakMapList; m; m = m->next)
m->traceMappings(tracer);
}
@ -440,3 +440,4 @@ js_InitWeakMapClass(JSContext *cx, HandleObject obj)
return nullptr;
return weakMapProto;
}

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

@ -885,7 +885,7 @@ js::NukeCrossCompartmentWrappers(JSContext* cx,
// Iterate through scopes looking for system cross compartment wrappers
// that point to an object that shares a global with obj.
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
if (!sourceFilter.match(c))
continue;
@ -992,7 +992,7 @@ js::RemapAllWrappersForObject(JSContext *cx, JSObject *oldTargetArg,
if (!toTransplant.reserve(cx->runtime()->numCompartments))
return false;
for (CompartmentsIter c(cx->runtime()); !c.done(); c.next()) {
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
if (WrapperMap::Ptr wp = c->lookupWrapper(origv)) {
// We found a wrapper. Remember and root it.
toTransplant.infallibleAppend(WrapperValue(wp));
@ -1017,7 +1017,7 @@ js::RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,
AutoWrapperVector toRecompute(cx);
for (CompartmentsIter c(cx->runtime()); !c.done(); c.next()) {
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
// Filter by source compartment.
if (!sourceFilter.match(c))
continue;

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

@ -1448,7 +1448,7 @@ Debugger::markAllIteratively(GCMarker *trc)
* convoluted since the easiest way to find them is via their debuggees.
*/
JSRuntime *rt = trc->runtime;
for (CompartmentsIter c(rt); !c.done(); c.next()) {
for (CompartmentsIter c(rt, SkipAtoms); !c.done(); c.next()) {
GlobalObjectSet &debuggees = c->getDebuggees();
for (GlobalObjectSet::Enum e(debuggees); !e.empty(); e.popFront()) {
GlobalObject *global = e.front();
@ -1950,7 +1950,7 @@ Debugger::addAllGlobalsAsDebuggees(JSContext *cx, unsigned argc, Value *vp)
{
THIS_DEBUGGER(cx, argc, vp, "addAllGlobalsAsDebuggees", args, dbg);
AutoDebugModeGC dmgc(cx->runtime());
for (CompartmentsIter c(cx->runtime()); !c.done(); c.next()) {
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
if (c == dbg->object->compartment() || c->options().invisibleToDebugger)
continue;
c->zone()->scheduledForDestruction = false;
@ -2629,7 +2629,7 @@ Debugger::findAllGlobals(JSContext *cx, unsigned argc, Value *vp)
if (!result)
return false;
for (CompartmentsIter c(cx->runtime()); !c.done(); c.next()) {
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
c->zone()->scheduledForDestruction = false;
GlobalObject *global = c->maybeGlobal();

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

@ -487,7 +487,7 @@ JS::CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisit
JS_ASSERT(totalArenaSize % gc::ArenaSize == 0);
#endif
for (CompartmentsIter comp(rt); !comp.done(); comp.next())
for (CompartmentsIter comp(rt, WithAtoms); !comp.done(); comp.next())
comp->compartmentStats = nullptr;
size_t numDirtyChunks =
@ -512,7 +512,7 @@ JS_PUBLIC_API(size_t)
JS::SystemCompartmentCount(JSRuntime *rt)
{
size_t n = 0;
for (CompartmentsIter comp(rt); !comp.done(); comp.next()) {
for (CompartmentsIter comp(rt, WithAtoms); !comp.done(); comp.next()) {
if (comp->isSystem)
++n;
}
@ -523,7 +523,7 @@ JS_PUBLIC_API(size_t)
JS::UserCompartmentCount(JSRuntime *rt)
{
size_t n = 0;
for (CompartmentsIter comp(rt); !comp.done(); comp.next()) {
for (CompartmentsIter comp(rt, WithAtoms); !comp.done(); comp.next()) {
if (!comp->isSystem)
++n;
}

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

@ -172,7 +172,7 @@ JS_SetDebugModeForAllCompartments(JSContext *cx, bool debug)
{
AutoDebugModeGC dmgc(cx->runtime());
for (CompartmentsIter c(cx->runtime()); !c.done(); c.next()) {
for (CompartmentsIter c(cx->runtime(), SkipAtoms); !c.done(); c.next()) {
// Ignore special compartments (atoms, JSD compartments)
if (c->principals) {
if (!c->setDebugModeFromC(cx, !!debug, dmgc))

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

@ -14,6 +14,10 @@
#include <sys/time.h>
#include <time.h>
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <pthread_np.h>
#endif
class nspr::Thread
{
pthread_t pthread_;
@ -146,6 +150,11 @@ PR_SetCurrentThreadName(const char *name)
int result;
#ifdef XP_MACOSX
result = pthread_setname_np(name);
#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
pthread_set_name_np(pthread_self(), name);
result = 0;
#elif defined(__NetBSD__)
result = pthread_setname_np(pthread_self(), "%s", (void *)name);
#else
result = pthread_setname_np(pthread_self(), name);
#endif

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

@ -408,7 +408,7 @@ JSRuntime::~JSRuntime()
sourceHook = nullptr;
/* Off thread compilation and parsing depend on atoms still existing. */
for (CompartmentsIter comp(this); !comp.done(); comp.next())
for (CompartmentsIter comp(this, SkipAtoms); !comp.done(); comp.next())
CancelOffThreadIonCompile(comp, nullptr);
WaitForOffThreadParsingToFinish(this);
@ -421,7 +421,7 @@ JSRuntime::~JSRuntime()
FinishCommonNames(this);
/* Clear debugging state to remove GC roots. */
for (CompartmentsIter comp(this); !comp.done(); comp.next()) {
for (CompartmentsIter comp(this, SkipAtoms); !comp.done(); comp.next()) {
comp->clearTraps(defaultFreeOp());
if (WatchpointMap *wpmap = comp->watchpointMap)
wpmap->clear();
@ -713,7 +713,7 @@ JSRuntime::setGCMaxMallocBytes(size_t value)
*/
gcMaxMallocBytes = (ptrdiff_t(value) >= 0) ? value : size_t(-1) >> 1;
resetGCMallocBytes();
for (ZonesIter zone(this); !zone.done(); zone.next())
for (ZonesIter zone(this, WithAtoms); !zone.done(); zone.next())
zone->setGCMaxMallocBytes(value);
}

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

@ -110,8 +110,8 @@ const CharacterInfo unicode::js_charinfo[] = {
{65334, 0, 2},
{65333, 0, 2},
{65329, 0, 2},
{42893, 613, 10},
{42922, 614, 10},
{42280, 0, 2},
{42308, 0, 2},
{65327, 0, 2},
{65325, 0, 2},
{10743, 0, 2},
@ -152,7 +152,7 @@ const CharacterInfo unicode::js_charinfo[] = {
{0, 48, 2},
{65488, 0, 2},
{0, 7264, 2},
{42877, 7545, 10},
{35332, 0, 2},
{3814, 0, 2},
{65477, 0, 2},
{0, 57921, 2},
@ -193,6 +193,9 @@ const CharacterInfo unicode::js_charinfo[] = {
{0, 54754, 2},
{0, 54721, 2},
{58272, 0, 2},
{0, 30204, 2},
{0, 23256, 2},
{0, 23228, 2},
};
const uint8_t unicode::index1[] = {
@ -687,10 +690,10 @@ const uint8_t unicode::index2[] = {
0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 8, 9, 8, 9, 8, 9,
8, 9, 8, 9, 8, 9, 8, 9, 5, 5, 8, 9, 8, 9, 8, 9, 8, 9,
8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9,
8, 9, 8, 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 9, 8, 9, 98,
8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 5, 0, 0, 8, 9, 56, 5, 0,
8, 9, 8, 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 9, 8, 9, 139,
8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 5, 0, 0, 8, 9, 140, 5, 0,
8, 9, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 9,
8, 9, 8, 9, 8, 9, 8, 9, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8, 9, 8, 9, 8, 9, 8, 9, 141, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 5, 5, 5, 2, 5, 5, 5,

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

@ -54,8 +54,6 @@ namespace unicode {
* if GetFlag(char) & (FLAG_IDENTIFIER_PART | FLAG_LETTER):
* return True
*
* NO_DELTA
* See comment in CharacterInfo
*/
struct CharFlag {
@ -63,7 +61,6 @@ struct CharFlag {
SPACE = 1 << 0,
LETTER = 1 << 1,
IDENTIFIER_PART = 1 << 2,
NO_DELTA = 1 << 3
};
};
@ -82,10 +79,6 @@ class CharacterInfo {
* For upper case alpha, we would store 0 in upperCase and 32 in
* lowerCase (65 + 32 = 97).
*
* If the delta between the chars wouldn't fit in a T, the flag
* FLAG_NO_DELTA is set, and you can just use upperCase and lowerCase
* without adding them the base char. See CharInfo.toUpperCase().
*
* We use deltas to reuse information for multiple characters. For
* example the whole lower case latin alphabet fits into one entry,
* because it's always a UnicodeLetter and upperCase contains
@ -200,13 +193,6 @@ ToUpperCase(jschar ch)
{
const CharacterInfo &info = CharInfo(ch);
/*
* The delta didn't fit into T, so we had to store the
* actual char code.
*/
if (info.flags & CharFlag::NO_DELTA)
return info.upperCase;
return uint16_t(ch) + info.upperCase;
}
@ -215,9 +201,6 @@ ToLowerCase(jschar ch)
{
const CharacterInfo &info = CharInfo(ch);
if (info.flags & CharFlag::NO_DELTA)
return info.lowerCase;
return uint16_t(ch) + info.lowerCase;
}

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

@ -48,7 +48,6 @@ ZWJ = ord(u'\N{ZERO WIDTH JOINER}')
FLAG_SPACE = 1 << 0
FLAG_LETTER = 1 << 1
FLAG_IDENTIFIER_PART = 1 << 2
FLAG_NO_DELTA = 1 << 3
MAX = 0xffff
@ -129,11 +128,11 @@ def generate_unicode_stuff(unicode_data, data_file, test_mapping, test_space):
up_d = upper - code
low_d = lower - code
if -32768 <= up_d <= 32767 and -32768 <= low_d <= 32767:
upper = up_d & 0xffff
lower = low_d & 0xffff
else:
flags |= FLAG_NO_DELTA
assert up_d > -65535 and up_d < 65535
assert low_d > -65535 and low_d < 65535
upper = up_d & 0xffff
lower = low_d & 0xffff
item = (upper, lower, flags)
@ -248,7 +247,7 @@ if (typeof reportCompare === "function")
"""
data_file.write('/* Generated by make_unicode.py DO NOT MODIFY */\n')
data_file.write(public_domain)
data_file.write('#include "Unicode.h"\n\n')
data_file.write('#include "vm/Unicode.h"\n\n')
data_file.write('using namespace js;\n')
data_file.write('using namespace js::unicode;\n')
data_file.write(comment)

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

@ -3874,9 +3874,8 @@ nsDisplayTransform::GetFrameBoundsForTransform(const nsIFrame* aFrame)
NS_PRECONDITION(aFrame, "Can't get the bounds of a nonexistent frame!");
if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
gfxRect bbox = nsSVGUtils::GetBBox(const_cast<nsIFrame*>(aFrame));
return nsLayoutUtils::RoundGfxRectToAppRect(bbox,
aFrame->PresContext()->AppUnitsPerCSSPixel()) - aFrame->GetPosition();
// TODO: SVG needs to define what percentage translations resolve against.
return nsRect();
}
return nsRect(nsPoint(0, 0), aFrame->GetSize());
@ -3892,9 +3891,8 @@ nsDisplayTransform::GetFrameBoundsForTransform(const nsIFrame* aFrame)
nsRect result;
if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
gfxRect bbox = nsSVGUtils::GetBBox(const_cast<nsIFrame*>(aFrame));
return nsLayoutUtils::RoundGfxRectToAppRect(bbox,
aFrame->PresContext()->AppUnitsPerCSSPixel()) - aFrame->GetPosition();
// TODO: SVG needs to define what percentage translations resolve against.
return result;
}
/* Iterate through the continuation list, unioning together all the
@ -3964,56 +3962,51 @@ nsDisplayTransform::GetDeltaToTransformOrigin(const nsIFrame* aFrame,
* a distance, it's already computed for us!
*/
const nsStyleDisplay* display = aFrame->StyleDisplay();
nsRect boundingRect;
if (aBoundsOverride) {
boundingRect = *aBoundsOverride;
} else if (display->mTransformOrigin[0].GetUnit() != eStyleUnit_Coord ||
display->mTransformOrigin[1].GetUnit() != eStyleUnit_Coord) {
// GetFrameBoundsForTransform is expensive for SVG frames and we don't need
// it if the origin is coords (which it is by default for SVG).
boundingRect = nsDisplayTransform::GetFrameBoundsForTransform(aFrame);
}
nsRect boundingRect = (aBoundsOverride ? *aBoundsOverride :
nsDisplayTransform::GetFrameBoundsForTransform(aFrame));
/* Allows us to access named variables by index. */
float coords[2];
nscoord boundingOffsets[2] = {boundingRect.x, boundingRect.y};
nscoord boundingDimensions[2] = {boundingRect.width, boundingRect.height};
nscoord frameOffsets[2] = {aFrame->GetPosition().x, aFrame->GetPosition().y};
float coords[3];
const nscoord* dimensions[2] =
{&boundingRect.width, &boundingRect.height};
for (uint8_t index = 0; index < 2; ++index) {
/* If the -moz-transform-origin specifies a percentage, take the percentage
* of the size of the box.
*/
const nsStyleCoord &coord = display->mTransformOrigin[index];
if (coord.GetUnit() == eStyleUnit_Percent) {
if (coord.GetUnit() == eStyleUnit_Calc) {
const nsStyleCoord::Calc *calc = coord.GetCalcValue();
coords[index] =
NSAppUnitsToFloatPixels(boundingDimensions[index], aAppUnitsPerPixel) *
coord.GetPercentValue() +
NSAppUnitsToFloatPixels(boundingOffsets[index], aAppUnitsPerPixel);
NSAppUnitsToFloatPixels(*dimensions[index], aAppUnitsPerPixel) *
calc->mPercent +
NSAppUnitsToFloatPixels(calc->mLength, aAppUnitsPerPixel);
} else if (coord.GetUnit() == eStyleUnit_Percent) {
coords[index] =
NSAppUnitsToFloatPixels(*dimensions[index], aAppUnitsPerPixel) *
coord.GetPercentValue();
} else {
if (coord.GetUnit() == eStyleUnit_Calc) {
const nsStyleCoord::Calc *calc = coord.GetCalcValue();
coords[index] =
NSAppUnitsToFloatPixels(boundingDimensions[index], aAppUnitsPerPixel) *
calc->mPercent +
NSAppUnitsToFloatPixels(calc->mLength, aAppUnitsPerPixel);
} else {
NS_ABORT_IF_FALSE(coord.GetUnit() == eStyleUnit_Coord, "unexpected unit");
coords[index] =
NSAppUnitsToFloatPixels(coord.GetCoordValue(), aAppUnitsPerPixel);
}
if (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
// <length> values represent offsets from the origin of the SVG element's
// user space, not the top left of its border-box, so we must
// convert them to be relative to the border-box.
coords[index] -= NSAppUnitsToFloatPixels(frameOffsets[index], aAppUnitsPerPixel);
}
NS_ABORT_IF_FALSE(coord.GetUnit() == eStyleUnit_Coord, "unexpected unit");
coords[index] =
NSAppUnitsToFloatPixels(coord.GetCoordValue(), aAppUnitsPerPixel);
}
if ((aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
coord.GetUnit() != eStyleUnit_Percent) {
// <length> values represent offsets from the origin of the SVG element's
// user space, not the top left of its bounds, so we must adjust for that:
nscoord offset =
(index == 0) ? aFrame->GetPosition().x : aFrame->GetPosition().y;
coords[index] -= NSAppUnitsToFloatPixels(offset, aAppUnitsPerPixel);
}
}
return gfxPoint3D(coords[0], coords[1],
NSAppUnitsToFloatPixels(display->mTransformOrigin[2].GetCoordValue(),
aAppUnitsPerPixel));
coords[2] = NSAppUnitsToFloatPixels(display->mTransformOrigin[2].GetCoordValue(),
aAppUnitsPerPixel);
/* Adjust based on the origin of the rectangle. */
coords[0] += NSAppUnitsToFloatPixels(boundingRect.x, aAppUnitsPerPixel);
coords[1] += NSAppUnitsToFloatPixels(boundingRect.y, aAppUnitsPerPixel);
return gfxPoint3D(coords[0], coords[1], coords[2]);
}
/* Returns the delta specified by the -moz-perspective-origin property.
@ -4087,6 +4080,7 @@ nsDisplayTransform::FrameTransformProperties::FrameTransformProperties(const nsI
: mFrame(aFrame)
, mTransformList(aFrame->StyleDisplay()->mSpecifiedTransform)
, mToTransformOrigin(GetDeltaToTransformOrigin(aFrame, aAppUnitsPerPixel, aBoundsOverride))
, mToPerspectiveOrigin(GetDeltaToPerspectiveOrigin(aFrame, aAppUnitsPerPixel))
, mChildPerspective(0)
{
const nsStyleDisplay* parentDisp = nullptr;
@ -4096,9 +4090,6 @@ nsDisplayTransform::FrameTransformProperties::FrameTransformProperties(const nsI
}
if (parentDisp && parentDisp->mChildPerspective.GetUnit() == eStyleUnit_Coord) {
mChildPerspective = parentDisp->mChildPerspective.GetCoordValue();
if (mChildPerspective > 0.0) {
mToPerspectiveOrigin = GetDeltaToPerspectiveOrigin(aFrame, aAppUnitsPerPixel);
}
}
}
@ -4198,7 +4189,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
/* At the point when perspective is applied, we have been translated to the transform origin.
* The translation to the perspective origin is the difference between these values.
*/
result = result * nsLayoutUtils::ChangeMatrixBasis(aProperties.GetToPerspectiveOrigin() - aProperties.mToTransformOrigin, perspective);
result = result * nsLayoutUtils::ChangeMatrixBasis(aProperties.mToPerspectiveOrigin - aProperties.mToTransformOrigin, perspective);
}
gfxPoint3D rounded(hasSVGTransforms ? newOrigin.x : NS_round(newOrigin.x),

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

@ -3061,24 +3061,15 @@ public:
: mFrame(nullptr)
, mTransformList(aTransformList)
, mToTransformOrigin(aToTransformOrigin)
, mChildPerspective(aChildPerspective)
, mToPerspectiveOrigin(aToPerspectiveOrigin)
, mChildPerspective(aChildPerspective)
{}
const nsIFrame* mFrame;
const nsCSSValueList* mTransformList;
const gfxPoint3D mToTransformOrigin;
const gfxPoint3D mToPerspectiveOrigin;
nscoord mChildPerspective;
const gfxPoint3D& GetToPerspectiveOrigin() const
{
NS_ASSERTION(mChildPerspective > 0, "Only valid with mChildPerspective > 0");
return mToPerspectiveOrigin;
}
private:
// mToPerspectiveOrigin is only valid if mChildPerspective > 0.
gfxPoint3D mToPerspectiveOrigin;
};
/**

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

@ -1643,7 +1643,7 @@ fuzzy-if(Android&&AndroidVersion>=15,8,300) == 625409-1.html 625409-1-ref.html
== 630835-1.html about:blank
== 631352-1.html 631352-1-ref.html
skip-if(B2G) fails-if(Android) == 632423-1.html 632423-1-ref.html
skip-if(Android||B2G) random-if(winWidget&&!d2d) == 632781-verybig.html 632781-ref.html
skip-if(Android||B2G) random-if(winWidget) == 632781-verybig.html 632781-ref.html
== 632781-normalsize.html 632781-ref.html
fails-if(Android) == 633344-1.html 633344-1-ref.html
== 634232-1.html 634232-1-ref.html

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

@ -124,7 +124,3 @@ skip-if(B2G) == stresstest-1.html stresstest-1-ref.html # bug 773482
== table-2b.html table-2-ref.html
# Bug 722463
== inline-1a.html inline-1-ref.html
== transform-origin-svg-1a.svg transform-origin-svg-1-ref.svg
== transform-origin-svg-1b.svg transform-origin-svg-1-ref.svg
== transform-origin-svg-2a.svg transform-origin-svg-2-ref.svg
== transform-origin-svg-2b.svg transform-origin-svg-2-ref.svg

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

@ -1,3 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<rect x='40' y='140' width='100' height='100' fill='lime'/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 108 B

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

@ -1,6 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<g transform="translate(30,30)">
<rect x='10' y='10' width='100' height='100' fill='lime'
style="transform:rotate(90deg); transform-origin:left bottom;"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 218 B

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

@ -1,7 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<g transform="translate(30,30)">
<rect x='10' y='10' width='100' height='100' fill='lime'
style="transform:rotate(90deg); transform-origin:10px 110px;
-webkit-transform:rotate(90deg); -webkit-transform-origin:10px 110px;"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 302 B

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

@ -1,3 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<rect x='40' y='140' width='100' height='100' fill='lime' stroke-width='20' stroke='blue'/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 140 B

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

@ -1,6 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<g transform="translate(30,30)">
<rect x='10' y='10' width='100' height='100' fill='lime' stroke-width='20' stroke='blue'
style="transform:rotate(90deg); transform-origin:left bottom;"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 250 B

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

@ -1,7 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg'>
<g transform="translate(30,30)">
<rect x='10' y='10' width='100' height='100' fill='lime' stroke-width='20' stroke='blue'
style="transform:rotate(90deg); transform-origin:10px 110px;
-webkit-transform:rotate(90deg); -webkit-transform-origin:10px 110px;"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 334 B

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

@ -1168,6 +1168,11 @@ InitSystemMetrics()
sSystemMetrics->AppendElement(nsGkAtoms::windows_glass);
}
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_ColorPickerAvailable, &metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(nsGkAtoms::color_picker_available);
}
rv = LookAndFeel::GetInt(LookAndFeel::eIntID_WindowsClassic, &metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(nsGkAtoms::windows_classic);

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

@ -495,6 +495,13 @@ nsMediaFeatures::features[] = {
{ nullptr },
GetIsResourceDocument
},
{
&nsGkAtoms::_moz_color_picker_available,
nsMediaFeature::eMinMaxNotAllowed,
nsMediaFeature::eBoolInteger,
{ &nsGkAtoms::color_picker_available },
GetSystemMetric
},
{
&nsGkAtoms::_moz_scrollbar_start_backward,
nsMediaFeature::eMinMaxNotAllowed,

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

@ -3765,16 +3765,14 @@ nsSVGTextFrame2::ReflowSVG()
nsSVGEffects::UpdateEffects(this);
}
// Now unset the various reflow bits. Do this before calling
// FinishAndStoreOverflow since FinishAndStoreOverflow can require glyph
// positions (to resolve transform-origin).
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
nsRect overflow = nsRect(nsPoint(0,0), mRect.Size());
nsOverflowAreas overflowAreas(overflow, overflow);
FinishAndStoreOverflow(overflowAreas, mRect.Size());
// Now unset the various reflow bits:
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
// XXX nsSVGContainerFrame::ReflowSVG only looks at its nsISVGChildFrame
// children, and calls ConsiderChildOverflow on them. Does it matter
// that ConsiderChildOverflow won't be called on our children?
@ -3809,21 +3807,9 @@ nsSVGTextFrame2::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
{
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
SVGBBox bbox;
if (NS_SUBTREE_DIRTY(this)) {
// Return an empty bbox if this frame's subtree is dirty. This may be called
// in that situation, e.g. when we're building a display list after an
// interrupted reflow. This can also be called during reflow before we've
// been reflowed, e.g. if an earlier sibling is calling FinishAndStoreOverflow and
// needs our parent's perspective matrix, which depends on the SVG bbox
// contribution of this frame. In the latter situation, when all siblings have
// been reflowed, the parent will compute its perspective and rerun
// FinishAndStoreOverflow for all its children.
return bbox;
}
UpdateGlyphPositioning();
SVGBBox bbox;
nsPresContext* presContext = PresContext();
TextRenderedRunIterator it(this);

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

@ -51,7 +51,7 @@ foreignObject {
text-indent: 0;
}
/* Set |transform-origin:0 0;| for all SVG elements except outer-<svg>,
/* Set |transform-origin:0% 0%;| for all SVG elements except outer-<svg>,
noting that 'svg' as a child of 'foreignObject' counts as outer-<svg>.
*/
*:not(svg),

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

@ -12,7 +12,7 @@ EXPORTS += [
'pngconf.h',
]
SOURCES += [
UNIFIED_SOURCES += [
'png.c',
'pngerror.c',
'pngget.c',

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

@ -1294,6 +1294,7 @@ abstract public class GeckoApp
});
GeckoAppShell.setNotificationClient(makeNotificationClient());
NotificationHelper.init(getApplicationContext());
}
protected void initializeChrome() {

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

@ -98,7 +98,6 @@ public class GeckoApplication extends Application {
public void onCreate() {
HardwareUtils.init(getApplicationContext());
Clipboard.init(getApplicationContext());
NotificationHelper.init(getApplicationContext());
GeckoLoader.loadMozGlue();
super.onCreate();
}

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

@ -30,7 +30,7 @@ public final class NotificationHelper implements GeckoEventListener {
public static final String NOTIFICATION_ID = "NotificationHelper_ID";
private static final String LOGTAG = "GeckoNotificationManager";
private static final String HELPER_NOTIFICATION = "helperNotif";
private static final String HELPER_BROADCAST_ACTION = "helperBroadcastAction";
private static final String HELPER_BROADCAST_ACTION = AppConstants.ANDROID_PACKAGE_NAME + ".helperBroadcastAction";
// Attributes mandatory to be used while sending a notification from js.
private static final String TITLE_ATTR = "title";
@ -71,6 +71,7 @@ public final class NotificationHelper implements GeckoEventListener {
public static void init(Context context) {
if (mInstance != null) {
Log.w(LOGTAG, "NotificationHelper.init() called twice!");
return;
}
mInstance = new NotificationHelper();
mContext = context;

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

@ -1,65 +1,70 @@
# [test_bug720538] # disabled on fig - bug 897072
[testAboutPage]
[testAddonManager]
# disabled on x86 only; bug 936216
skip-if = processor == "x86"
[testAddSearchEngine]
[testAwesomebar]
# [testAwesomebarSwipes] # disabled on fig - bug 880060
[testBookmark]
[testAxisLocking]
# disabled on x86 only; bug 927476
skip-if = processor == "x86"
# [testBookmark] # see bug 915350
[testBookmarksPage]
[testBookmarkFolders]
# [testBookmarklets] # see bug 915350
# [testBookmarkKeyword] # see bug 915350
[testBrowserProvider]
[testBrowserSearchVisibility]
[testJNI]
[testLoad]
[testNewTab]
[testOrderedBroadcast]
[testPrefsObserver]
[testPanCorrectness]
# disabled on x86 only; bug 927476
skip-if = processor == "x86"
# [test_bug720538] # disabled on fig - bug 897072
[testClearPrivateData]
[testDeviceSearchEngine]
[testDistribution]
[testDoorHanger]
[testFindInPage]
[testFlingCorrectness]
# disabled on x86 only; bug 927476
skip-if = processor == "x86"
[testOverscroll]
[testAxisLocking]
# disabled on x86 only; bug 927476
skip-if = processor == "x86"
[testAboutPage]
[testLinkContextMenu]
[testMailToContextMenu]
[testPictureLinkContextMenu]
[testPasswordProvider]
[testPromptGridInput]
# [testPasswordEncrypt] # see bug 824067
[testFormHistory]
[testBrowserProvider]
[testSearchSuggestions]
[testSharedPreferences]
# [testThumbnails] # see bug 813107
[testAddonManager]
[testGetUserMedia]
# [testHistory] # see bug 915350
# [testVkbOverlap] # see bug 907274
[testDoorHanger]
# [testTabHistory] # see bug 915350
[testShareLink]
[testClearPrivateData]
[testSettingsMenuItems]
[testSystemPages]
# disabled on x86 only; bug 907383
skip-if = processor == "x86"
# [testPermissions] # see bug 757475
[testJarReader]
[testDistribution]
[testFindInPage]
[testInputUrlBar]
[testAddSearchEngine]
[testHomeBanner]
[testImportFromAndroid]
# disabled on x86 only; bug 900664
skip-if = processor == "x86"
[testInputUrlBar]
[testJarReader]
[testJNI]
[testLinkContextMenu]
[testLoad]
[testMailToContextMenu]
[testMasterPassword]
[testDeviceSearchEngine]
[testNewTab]
[testOrderedBroadcast]
[testOverscroll]
[testPanCorrectness]
# disabled on x86 only; bug 927476
skip-if = processor == "x86"
# [testPasswordEncrypt] # see bug 824067
[testPasswordProvider]
# [testPermissions] # see bug 757475
[testPictureLinkContextMenu]
[testPrefsObserver]
[testPrivateBrowsing]
[testReaderMode]
[testGetUserMedia]
[testHomeBanner]
[testPromptGridInput]
# [testReaderMode] # see bug 913254
# disabled on x86 only; bug 936224
# skip-if = processor == "x86"
[testSearchSuggestions]
[testSettingsMenuItems]
[testSharedPreferences]
# [testShareLink] # see bug 915897
[testSystemPages]
# disabled on x86 only; bug 907383
skip-if = processor == "x86"
# [testTabHistory] # see bug 915350
# [testThumbnails] # see bug 813107
# [testVkbOverlap] # see bug 907274
# Used for Talos, please don't use in mochitest
#[testPan]

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше