зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to fx-team a=merge
This commit is contained in:
Коммит
6a1716e012
|
@ -12,6 +12,7 @@
|
||||||
#include "nsAccUtils.h"
|
#include "nsAccUtils.h"
|
||||||
#include "nsIAccessibleRelation.h"
|
#include "nsIAccessibleRelation.h"
|
||||||
#include "nsIAccessibleTable.h"
|
#include "nsIAccessibleTable.h"
|
||||||
|
#include "ProxyAccessible.h"
|
||||||
#include "RootAccessible.h"
|
#include "RootAccessible.h"
|
||||||
#include "nsIAccessibleValue.h"
|
#include "nsIAccessibleValue.h"
|
||||||
#include "nsMai.h"
|
#include "nsMai.h"
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "nsStateMap.h"
|
#include "nsStateMap.h"
|
||||||
|
#include "mozilla/a11y/Platform.h"
|
||||||
#include "Relation.h"
|
#include "Relation.h"
|
||||||
#include "RootAccessible.h"
|
#include "RootAccessible.h"
|
||||||
#include "States.h"
|
#include "States.h"
|
||||||
|
@ -133,9 +135,13 @@ struct MaiAtkObject
|
||||||
* The AccessibleWrap whose properties and features are exported
|
* The AccessibleWrap whose properties and features are exported
|
||||||
* via this object instance.
|
* via this object instance.
|
||||||
*/
|
*/
|
||||||
AccessibleWrap* accWrap;
|
uintptr_t accWrap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
|
||||||
|
// proxy.
|
||||||
|
static const uintptr_t IS_PROXY = 1;
|
||||||
|
|
||||||
struct MaiAtkObjectClass
|
struct MaiAtkObjectClass
|
||||||
{
|
{
|
||||||
AtkObjectClass parent_class;
|
AtkObjectClass parent_class;
|
||||||
|
@ -248,7 +254,7 @@ AccessibleWrap::ShutdownAtkObject()
|
||||||
{
|
{
|
||||||
if (mAtkObject) {
|
if (mAtkObject) {
|
||||||
if (IS_MAI_OBJECT(mAtkObject)) {
|
if (IS_MAI_OBJECT(mAtkObject)) {
|
||||||
MAI_ATK_OBJECT(mAtkObject)->accWrap = nullptr;
|
MAI_ATK_OBJECT(mAtkObject)->accWrap = 0;
|
||||||
}
|
}
|
||||||
SetMaiHyperlink(nullptr);
|
SetMaiHyperlink(nullptr);
|
||||||
g_object_unref(mAtkObject);
|
g_object_unref(mAtkObject);
|
||||||
|
@ -582,8 +588,7 @@ initializeCB(AtkObject *aAtkObj, gpointer aData)
|
||||||
ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
|
ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
|
||||||
|
|
||||||
/* initialize object */
|
/* initialize object */
|
||||||
MAI_ATK_OBJECT(aAtkObj)->accWrap =
|
MAI_ATK_OBJECT(aAtkObj)->accWrap = reinterpret_cast<uintptr_t>(aData);
|
||||||
static_cast<AccessibleWrap*>(aData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -591,7 +596,7 @@ finalizeCB(GObject *aObj)
|
||||||
{
|
{
|
||||||
if (!IS_MAI_OBJECT(aObj))
|
if (!IS_MAI_OBJECT(aObj))
|
||||||
return;
|
return;
|
||||||
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == nullptr, "AccWrap NOT null");
|
NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap == 0, "AccWrap NOT null");
|
||||||
|
|
||||||
// call parent finalize function
|
// call parent finalize function
|
||||||
// finalize of GObjectClass will unref the accessible parent if has
|
// finalize of GObjectClass will unref the accessible parent if has
|
||||||
|
@ -663,25 +668,33 @@ getDescriptionCB(AtkObject *aAtkObj)
|
||||||
AtkRole
|
AtkRole
|
||||||
getRoleCB(AtkObject *aAtkObj)
|
getRoleCB(AtkObject *aAtkObj)
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
|
||||||
if (!accWrap)
|
|
||||||
return ATK_ROLE_INVALID;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
|
|
||||||
"Does not support nsIAccessibleText when it should");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (aAtkObj->role != ATK_ROLE_INVALID)
|
if (aAtkObj->role != ATK_ROLE_INVALID)
|
||||||
return aAtkObj->role;
|
return aAtkObj->role;
|
||||||
|
|
||||||
|
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||||
|
a11y::role role;
|
||||||
|
if (!accWrap) {
|
||||||
|
ProxyAccessible* proxy = GetProxy(aAtkObj);
|
||||||
|
if (!proxy)
|
||||||
|
return ATK_ROLE_INVALID;
|
||||||
|
|
||||||
|
role = proxy->Role();
|
||||||
|
} else {
|
||||||
|
#ifdef DEBUG
|
||||||
|
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
|
||||||
|
"Does not support nsIAccessibleText when it should");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
role = accWrap->Role();
|
||||||
|
}
|
||||||
|
|
||||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, \
|
#define ROLE(geckoRole, stringRole, atkRole, macRole, \
|
||||||
msaaRole, ia2Role, nameRule) \
|
msaaRole, ia2Role, nameRule) \
|
||||||
case roles::geckoRole: \
|
case roles::geckoRole: \
|
||||||
aAtkObj->role = atkRole; \
|
aAtkObj->role = atkRole; \
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (accWrap->Role()) {
|
switch (role) {
|
||||||
#include "RoleMap.h"
|
#include "RoleMap.h"
|
||||||
default:
|
default:
|
||||||
MOZ_CRASH("Unknown role.");
|
MOZ_CRASH("Unknown role.");
|
||||||
|
@ -879,19 +892,18 @@ TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
|
||||||
AtkStateSet *
|
AtkStateSet *
|
||||||
refStateSetCB(AtkObject *aAtkObj)
|
refStateSetCB(AtkObject *aAtkObj)
|
||||||
{
|
{
|
||||||
AtkStateSet *state_set = nullptr;
|
AtkStateSet *state_set = nullptr;
|
||||||
state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
|
state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
|
||||||
|
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||||
if (!accWrap) {
|
if (accWrap)
|
||||||
TranslateStates(states::DEFUNCT, state_set);
|
|
||||||
return state_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Map states
|
|
||||||
TranslateStates(accWrap->State(), state_set);
|
TranslateStates(accWrap->State(), state_set);
|
||||||
|
else if (ProxyAccessible* proxy = GetProxy(aAtkObj))
|
||||||
|
TranslateStates(proxy->State(), state_set);
|
||||||
|
else
|
||||||
|
TranslateStates(states::DEFUNCT, state_set);
|
||||||
|
|
||||||
return state_set;
|
return state_set;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -946,7 +958,13 @@ AccessibleWrap*
|
||||||
GetAccessibleWrap(AtkObject* aAtkObj)
|
GetAccessibleWrap(AtkObject* aAtkObj)
|
||||||
{
|
{
|
||||||
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr);
|
NS_ENSURE_TRUE(IS_MAI_OBJECT(aAtkObj), nullptr);
|
||||||
AccessibleWrap* accWrap = MAI_ATK_OBJECT(aAtkObj)->accWrap;
|
|
||||||
|
// Make sure its native is an AccessibleWrap not a proxy.
|
||||||
|
if (MAI_ATK_OBJECT(aAtkObj)->accWrap & IS_PROXY)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
AccessibleWrap* accWrap =
|
||||||
|
reinterpret_cast<AccessibleWrap*>(MAI_ATK_OBJECT(aAtkObj)->accWrap);
|
||||||
|
|
||||||
// Check if the accessible was deconstructed.
|
// Check if the accessible was deconstructed.
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
|
@ -961,6 +979,50 @@ GetAccessibleWrap(AtkObject* aAtkObj)
|
||||||
return accWrap;
|
return accWrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProxyAccessible*
|
||||||
|
GetProxy(AtkObject* aObj)
|
||||||
|
{
|
||||||
|
if (!aObj || !(MAI_ATK_OBJECT(aObj)->accWrap & IS_PROXY))
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return reinterpret_cast<ProxyAccessible*>(MAI_ATK_OBJECT(aObj)->accWrap
|
||||||
|
& ~IS_PROXY);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t
|
||||||
|
GetInterfacesForProxy(ProxyAccessible* aProxy)
|
||||||
|
{
|
||||||
|
return MAI_INTERFACE_COMPONENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyCreated(ProxyAccessible* aProxy)
|
||||||
|
{
|
||||||
|
GType type = GetMaiAtkType(GetInterfacesForProxy(aProxy));
|
||||||
|
NS_ASSERTION(type, "why don't we have a type!");
|
||||||
|
|
||||||
|
AtkObject* obj =
|
||||||
|
reinterpret_cast<AtkObject *>
|
||||||
|
(g_object_new(type, nullptr));
|
||||||
|
if (!obj)
|
||||||
|
return;
|
||||||
|
|
||||||
|
uintptr_t inner = reinterpret_cast<uintptr_t>(aProxy) | IS_PROXY;
|
||||||
|
atk_object_initialize(obj, reinterpret_cast<gpointer>(inner));
|
||||||
|
obj->role = ATK_ROLE_INVALID;
|
||||||
|
obj->layer = ATK_LAYER_INVALID;
|
||||||
|
aProxy->SetWrapper(reinterpret_cast<uintptr_t>(obj) | IS_PROXY);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyDestroyed(ProxyAccessible* aProxy)
|
||||||
|
{
|
||||||
|
auto obj = reinterpret_cast<MaiAtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
|
||||||
|
obj->accWrap = 0;
|
||||||
|
g_object_unref(obj);
|
||||||
|
aProxy->SetWrapper(0);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,7 +97,7 @@ private:
|
||||||
|
|
||||||
static EAvailableAtkSignals gAvailableAtkSignals;
|
static EAvailableAtkSignals gAvailableAtkSignals;
|
||||||
|
|
||||||
uint16_t CreateMaiInterfaces(void);
|
uint16_t CreateMaiInterfaces();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
|
|
|
@ -35,6 +35,7 @@ LOCAL_INCLUDES += [
|
||||||
'/accessible/base',
|
'/accessible/base',
|
||||||
'/accessible/generic',
|
'/accessible/generic',
|
||||||
'/accessible/html',
|
'/accessible/html',
|
||||||
|
'/accessible/ipc',
|
||||||
'/accessible/xpcom',
|
'/accessible/xpcom',
|
||||||
'/accessible/xul',
|
'/accessible/xul',
|
||||||
'/other-licenses/atk-1.0',
|
'/other-licenses/atk-1.0',
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
|
|
||||||
#include "AccessibleWrap.h"
|
#include "AccessibleWrap.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
class ProxyAccessible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#define MAI_TYPE_ATK_OBJECT (mai_atk_object_get_type ())
|
#define MAI_TYPE_ATK_OBJECT (mai_atk_object_get_type ())
|
||||||
#define MAI_ATK_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
#define MAI_ATK_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||||
MAI_TYPE_ATK_OBJECT, MaiAtkObject))
|
MAI_TYPE_ATK_OBJECT, MaiAtkObject))
|
||||||
|
@ -29,6 +35,7 @@
|
||||||
GType mai_atk_object_get_type(void);
|
GType mai_atk_object_get_type(void);
|
||||||
GType mai_util_get_type();
|
GType mai_util_get_type();
|
||||||
mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
|
mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
|
||||||
|
mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj);
|
||||||
|
|
||||||
extern int atkMajorVersion, atkMinorVersion;
|
extern int atkMajorVersion, atkMinorVersion;
|
||||||
|
|
||||||
|
|
|
@ -232,6 +232,8 @@ public:
|
||||||
bool IsShow() const { return mEventType == nsIAccessibleEvent::EVENT_SHOW; }
|
bool IsShow() const { return mEventType == nsIAccessibleEvent::EVENT_SHOW; }
|
||||||
bool IsHide() const { return mEventType == nsIAccessibleEvent::EVENT_HIDE; }
|
bool IsHide() const { return mEventType == nsIAccessibleEvent::EVENT_HIDE; }
|
||||||
|
|
||||||
|
Accessible* Parent() const { return mParent; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsCOMPtr<nsINode> mNode;
|
nsCOMPtr<nsINode> mNode;
|
||||||
nsRefPtr<Accessible> mParent;
|
nsRefPtr<Accessible> mParent;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "ApplicationAccessible.h"
|
#include "ApplicationAccessible.h"
|
||||||
#include "ARIAMap.h"
|
#include "ARIAMap.h"
|
||||||
#include "DocAccessible-inl.h"
|
#include "DocAccessible-inl.h"
|
||||||
|
#include "DocAccessibleChild.h"
|
||||||
#include "nsAccessibilityService.h"
|
#include "nsAccessibilityService.h"
|
||||||
#include "RootAccessibleWrap.h"
|
#include "RootAccessibleWrap.h"
|
||||||
|
|
||||||
|
@ -27,6 +28,8 @@
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsIWebProgress.h"
|
#include "nsIWebProgress.h"
|
||||||
#include "nsCoreUtils.h"
|
#include "nsCoreUtils.h"
|
||||||
|
#include "nsXULAppAPI.h"
|
||||||
|
#include "mozilla/dom/ContentChild.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::a11y;
|
using namespace mozilla::a11y;
|
||||||
|
@ -418,6 +421,12 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
|
||||||
docAcc->FireDelayedEvent(nsIAccessibleEvent::EVENT_REORDER,
|
docAcc->FireDelayedEvent(nsIAccessibleEvent::EVENT_REORDER,
|
||||||
ApplicationAcc());
|
ApplicationAcc());
|
||||||
|
|
||||||
|
if (IPCAccessibilityActive()) {
|
||||||
|
DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
|
||||||
|
docAcc->SetIPCDoc(ipcDoc);
|
||||||
|
auto contentChild = dom::ContentChild::GetSingleton();
|
||||||
|
contentChild->SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
parentDocAcc->BindChildDocument(docAcc);
|
parentDocAcc->BindChildDocument(docAcc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace a11y {
|
||||||
|
|
||||||
class Accessible;
|
class Accessible;
|
||||||
class DocAccessible;
|
class DocAccessible;
|
||||||
|
class DocAccessibleParent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage the document accessible life cycle.
|
* Manage the document accessible life cycle.
|
||||||
|
@ -65,6 +66,25 @@ public:
|
||||||
RemoveListeners(aDocument);
|
RemoveListeners(aDocument);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notification that a top level document in a content process has gone away.
|
||||||
|
*/
|
||||||
|
void RemoteDocShutdown(DocAccessibleParent* aDoc)
|
||||||
|
{
|
||||||
|
DebugOnly<bool> result = mRemoteDocuments.RemoveElement(aDoc);
|
||||||
|
MOZ_ASSERT(result, "Why didn't we find the document!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notify of a new top level document in a content process.
|
||||||
|
*/
|
||||||
|
void RemoteDocAdded(DocAccessibleParent* aDoc)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(!mRemoteDocuments.Contains(aDoc),
|
||||||
|
"How did we already have the doc!");
|
||||||
|
mRemoteDocuments.AppendElement(aDoc);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
bool IsProcessingRefreshDriverNotification() const;
|
bool IsProcessingRefreshDriverNotification() const;
|
||||||
#endif
|
#endif
|
||||||
|
@ -144,6 +164,11 @@ private:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DocAccessibleHashtable mDocAccessibleCache;
|
DocAccessibleHashtable mDocAccessibleCache;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The list of remote top level documents.
|
||||||
|
*/
|
||||||
|
nsTArray<DocAccessibleParent*> mRemoteDocuments;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Accessible-inl.h"
|
#include "Accessible-inl.h"
|
||||||
#include "nsEventShell.h"
|
#include "nsEventShell.h"
|
||||||
#include "DocAccessible.h"
|
#include "DocAccessible.h"
|
||||||
|
#include "DocAccessibleChild.h"
|
||||||
#include "nsAccessibilityService.h"
|
#include "nsAccessibilityService.h"
|
||||||
#include "nsTextEquivUtils.h"
|
#include "nsTextEquivUtils.h"
|
||||||
#ifdef A11Y_LOG
|
#ifdef A11Y_LOG
|
||||||
|
@ -555,5 +556,15 @@ EventQueue::ProcessEventQueue()
|
||||||
|
|
||||||
if (!mDocument)
|
if (!mDocument)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (IPCAccessibilityActive()) {
|
||||||
|
DocAccessibleChild* ipcDoc = mDocument->IPCDoc();
|
||||||
|
if (event->mEventType == nsIAccessibleEvent::EVENT_SHOW)
|
||||||
|
ipcDoc->ShowEvent(downcast_accEvent(event));
|
||||||
|
else if (event->mEventType == nsIAccessibleEvent::EVENT_HIDE)
|
||||||
|
ipcDoc->SendHideEvent(reinterpret_cast<uintptr_t>(event->GetAccessible()));
|
||||||
|
else
|
||||||
|
ipcDoc->SendEvent(event->GetEventType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,11 @@
|
||||||
#include "NotificationController.h"
|
#include "NotificationController.h"
|
||||||
|
|
||||||
#include "DocAccessible-inl.h"
|
#include "DocAccessible-inl.h"
|
||||||
|
#include "DocAccessibleChild.h"
|
||||||
#include "TextLeafAccessible.h"
|
#include "TextLeafAccessible.h"
|
||||||
#include "TextUpdater.h"
|
#include "TextUpdater.h"
|
||||||
|
|
||||||
|
#include "mozilla/dom/ContentChild.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
|
@ -217,8 +219,19 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
||||||
if (ownerContent) {
|
if (ownerContent) {
|
||||||
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
|
Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
|
||||||
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {
|
if (outerDocAcc && outerDocAcc->AppendChild(childDoc)) {
|
||||||
if (mDocument->AppendChildDocument(childDoc))
|
if (mDocument->AppendChildDocument(childDoc)) {
|
||||||
|
if (IPCAccessibilityActive()) {
|
||||||
|
DocAccessibleChild* ipcDoc = new DocAccessibleChild(childDoc);
|
||||||
|
childDoc->SetIPCDoc(ipcDoc);
|
||||||
|
auto contentChild = dom::ContentChild::GetSingleton();
|
||||||
|
DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc();
|
||||||
|
uint64_t id = reinterpret_cast<uintptr_t>(outerDocAcc->UniqueID());
|
||||||
|
contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc,
|
||||||
|
id);
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
outerDocAcc->RemoveChild(childDoc);
|
outerDocAcc->RemoveChild(childDoc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace a11y {
|
namespace a11y {
|
||||||
|
|
||||||
|
class ProxyAccessible;
|
||||||
|
|
||||||
enum EPlatformDisabledState {
|
enum EPlatformDisabledState {
|
||||||
ePlatformIsForceEnabled = -1,
|
ePlatformIsForceEnabled = -1,
|
||||||
ePlatformIsEnabled = 0,
|
ePlatformIsEnabled = 0,
|
||||||
|
@ -47,6 +49,17 @@ void PlatformInit();
|
||||||
*/
|
*/
|
||||||
void PlatformShutdown();
|
void PlatformShutdown();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called when a new ProxyAccessible is created, so the platform may setup a
|
||||||
|
* wrapper for it, or take other action.
|
||||||
|
*/
|
||||||
|
void ProxyCreated(ProxyAccessible*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called just before a ProxyAccessible is destroyed so its wrapper can be
|
||||||
|
* disposed of and other action taken.
|
||||||
|
*/
|
||||||
|
void ProxyDestroyed(ProxyAccessible*);
|
||||||
} // namespace a11y
|
} // namespace a11y
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
@ -783,7 +783,9 @@ enum Role {
|
||||||
/**
|
/**
|
||||||
* Represent a keyboard or keypad key (ARIA role "key").
|
* Represent a keyboard or keypad key (ARIA role "key").
|
||||||
*/
|
*/
|
||||||
KEY = 129
|
KEY = 129,
|
||||||
|
|
||||||
|
LAST_ROLE = KEY
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace role
|
} // namespace role
|
||||||
|
|
|
@ -60,6 +60,7 @@ if CONFIG['A11Y_LOG']:
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
'/accessible/generic',
|
'/accessible/generic',
|
||||||
'/accessible/html',
|
'/accessible/html',
|
||||||
|
'/accessible/ipc',
|
||||||
'/accessible/xpcom',
|
'/accessible/xpcom',
|
||||||
'/accessible/xul',
|
'/accessible/xul',
|
||||||
'/dom/xbl',
|
'/dom/xbl',
|
||||||
|
@ -93,3 +94,5 @@ FINAL_LIBRARY = 'xul'
|
||||||
|
|
||||||
if CONFIG['MOZ_ENABLE_GTK']:
|
if CONFIG['MOZ_ENABLE_GTK']:
|
||||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
||||||
|
|
||||||
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
|
@ -238,6 +238,19 @@ GetAccService()
|
||||||
return nsAccessibilityService::gAccessibilityService;
|
return nsAccessibilityService::gAccessibilityService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if we're in a content process and not B2G.
|
||||||
|
*/
|
||||||
|
inline bool
|
||||||
|
IPCAccessibilityActive()
|
||||||
|
{
|
||||||
|
#ifdef MOZ_B2G
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
|
return XRE_GetProcessType() != GeckoProcessType_Default;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map nsIAccessibleEvents constants to strings. Used by
|
* Map nsIAccessibleEvents constants to strings. Used by
|
||||||
* nsIAccessibleRetrieval::getStringEventType() method.
|
* nsIAccessibleRetrieval::getStringEventType() method.
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "Accessible-inl.h"
|
#include "Accessible-inl.h"
|
||||||
#include "AccIterator.h"
|
#include "AccIterator.h"
|
||||||
#include "DocAccessible-inl.h"
|
#include "DocAccessible-inl.h"
|
||||||
|
#include "DocAccessibleChild.h"
|
||||||
#include "HTMLImageMapAccessible.h"
|
#include "HTMLImageMapAccessible.h"
|
||||||
#include "nsAccCache.h"
|
#include "nsAccCache.h"
|
||||||
#include "nsAccessiblePivot.h"
|
#include "nsAccessiblePivot.h"
|
||||||
|
@ -83,7 +84,7 @@ DocAccessible::
|
||||||
mScrollPositionChangedTicks(0),
|
mScrollPositionChangedTicks(0),
|
||||||
mLoadState(eTreeConstructionPending), mDocFlags(0), mLoadEventType(0),
|
mLoadState(eTreeConstructionPending), mDocFlags(0), mLoadEventType(0),
|
||||||
mVirtualCursor(nullptr),
|
mVirtualCursor(nullptr),
|
||||||
mPresShell(aPresShell)
|
mPresShell(aPresShell), mIPCDoc(nullptr)
|
||||||
{
|
{
|
||||||
mGenericTypes |= eDocument;
|
mGenericTypes |= eDocument;
|
||||||
mStateFlags |= eNotNodeMapEntry;
|
mStateFlags |= eNotNodeMapEntry;
|
||||||
|
@ -473,6 +474,12 @@ DocAccessible::Shutdown()
|
||||||
|
|
||||||
mChildDocuments.Clear();
|
mChildDocuments.Clear();
|
||||||
|
|
||||||
|
// XXX thinking about ordering?
|
||||||
|
if (IPCAccessibilityActive()) {
|
||||||
|
DocAccessibleChild::Send__delete__(mIPCDoc);
|
||||||
|
MOZ_ASSERT(!mIPCDoc);
|
||||||
|
}
|
||||||
|
|
||||||
if (mVirtualCursor) {
|
if (mVirtualCursor) {
|
||||||
mVirtualCursor->RemoveObserver(this);
|
mVirtualCursor->RemoveObserver(this);
|
||||||
mVirtualCursor = nullptr;
|
mVirtualCursor = nullptr;
|
||||||
|
@ -1446,6 +1453,13 @@ DocAccessible::DoInitialUpdate()
|
||||||
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent());
|
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent());
|
||||||
ParentDocument()->FireDelayedEvent(reorderEvent);
|
ParentDocument()->FireDelayedEvent(reorderEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t childCount = ChildCount();
|
||||||
|
for (uint32_t i = 0; i < childCount; i++) {
|
||||||
|
Accessible* child = GetChildAt(i);
|
||||||
|
nsRefPtr<AccShowEvent> event = new AccShowEvent(child, child->GetContent());
|
||||||
|
FireDelayedEvent(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -33,6 +33,7 @@ namespace a11y {
|
||||||
|
|
||||||
class DocManager;
|
class DocManager;
|
||||||
class NotificationController;
|
class NotificationController;
|
||||||
|
class DocAccessibleChild;
|
||||||
class RelatedAccIterator;
|
class RelatedAccIterator;
|
||||||
template<class Class, class Arg>
|
template<class Class, class Arg>
|
||||||
class TNotification;
|
class TNotification;
|
||||||
|
@ -519,6 +520,20 @@ protected:
|
||||||
*/
|
*/
|
||||||
bool IsLoadEventTarget() const;
|
bool IsLoadEventTarget() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this document is in a content process return the object responsible for
|
||||||
|
* communicating with the main process for it.
|
||||||
|
*/
|
||||||
|
DocAccessibleChild* IPCDoc() const { return mIPCDoc; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the object responsible for communicating with the main process on
|
||||||
|
* behalf of this document.
|
||||||
|
*/
|
||||||
|
void SetIPCDoc(DocAccessibleChild* aIPCDoc) { mIPCDoc = aIPCDoc; }
|
||||||
|
|
||||||
|
friend class DocAccessibleChild;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to fire scrolling end event after page scroll.
|
* Used to fire scrolling end event after page scroll.
|
||||||
*
|
*
|
||||||
|
@ -642,6 +657,9 @@ protected:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
nsIPresShell* mPresShell;
|
nsIPresShell* mPresShell;
|
||||||
|
|
||||||
|
// Exclusively owned by IPDL so don't manually delete it!
|
||||||
|
DocAccessibleChild* mIPCDoc;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline DocAccessible*
|
inline DocAccessible*
|
||||||
|
|
|
@ -28,6 +28,7 @@ UNIFIED_SOURCES += [
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
'/accessible/base',
|
'/accessible/base',
|
||||||
'/accessible/html',
|
'/accessible/html',
|
||||||
|
'/accessible/ipc',
|
||||||
'/accessible/xpcom',
|
'/accessible/xpcom',
|
||||||
'/accessible/xul',
|
'/accessible/xul',
|
||||||
'/content/base/src',
|
'/content/base/src',
|
||||||
|
@ -54,3 +55,5 @@ else:
|
||||||
]
|
]
|
||||||
|
|
||||||
FINAL_LIBRARY = 'xul'
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|
||||||
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "DocAccessibleChild.h"
|
||||||
|
|
||||||
|
#include "Accessible-inl.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
void
|
||||||
|
SerializeTree(Accessible* aRoot, nsTArray<AccessibleData>& aTree)
|
||||||
|
{
|
||||||
|
uint64_t id = reinterpret_cast<uint64_t>(aRoot->UniqueID());
|
||||||
|
uint32_t role = aRoot->Role();
|
||||||
|
uint32_t childCount = aRoot->ChildCount();
|
||||||
|
|
||||||
|
nsString name;
|
||||||
|
aRoot->Name(name);
|
||||||
|
aTree.AppendElement(AccessibleData(id, role, childCount, name));
|
||||||
|
for (uint32_t i = 0; i < childCount; i++)
|
||||||
|
SerializeTree(aRoot->GetChildAt(i), aTree);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DocAccessibleChild::ShowEvent(AccShowEvent* aShowEvent)
|
||||||
|
{
|
||||||
|
Accessible* parent = aShowEvent->Parent();
|
||||||
|
uint64_t parentID = parent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(parent->UniqueID());
|
||||||
|
uint32_t idxInParent = aShowEvent->GetAccessible()->IndexInParent();
|
||||||
|
nsTArray<AccessibleData> shownTree;
|
||||||
|
ShowEventData data(parentID, idxInParent, shownTree);
|
||||||
|
SerializeTree(aShowEvent->GetAccessible(), data.NewTree());
|
||||||
|
SendShowEvent(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DocAccessibleChild::RecvState(const uint64_t& aID, uint64_t* aState)
|
||||||
|
{
|
||||||
|
Accessible* acc = mDoc->GetAccessibleByUniqueID((void*)aID);
|
||||||
|
if (!acc) {
|
||||||
|
*aState = states::DEFUNCT;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
*aState = acc->State();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#ifndef mozilla_a11y_DocAccessibleChild_h
|
||||||
|
#define mozilla_a11y_DocAccessibleChild_h
|
||||||
|
|
||||||
|
#include "mozilla/a11y/DocAccessible.h"
|
||||||
|
#include "mozilla/a11y/PDocAccessibleChild.h"
|
||||||
|
#include "nsISupportsImpl.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
class AccShowEvent;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These objects handle content side communication for an accessible document,
|
||||||
|
* and their lifetime is the same as the document they represent.
|
||||||
|
*/
|
||||||
|
class DocAccessibleChild : public PDocAccessibleChild
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DocAccessibleChild(DocAccessible* aDoc) :
|
||||||
|
mDoc(aDoc)
|
||||||
|
{ MOZ_COUNT_CTOR(DocAccessibleChild); }
|
||||||
|
~DocAccessibleChild()
|
||||||
|
{
|
||||||
|
mDoc->SetIPCDoc(nullptr);
|
||||||
|
MOZ_COUNT_DTOR(DocAccessibleChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowEvent(AccShowEvent* aShowEvent);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the state for the accessible with given ID.
|
||||||
|
*/
|
||||||
|
virtual bool RecvState(const uint64_t& aID, uint64_t* aState) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DocAccessible* mDoc;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,114 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "DocAccessibleParent.h"
|
||||||
|
#include "nsAutoPtr.h"
|
||||||
|
#include "mozilla/a11y/Platform.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
bool
|
||||||
|
DocAccessibleParent::RecvShowEvent(const ShowEventData& aData)
|
||||||
|
{
|
||||||
|
if (aData.NewTree().IsEmpty()) {
|
||||||
|
NS_ERROR("no children being added");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProxyAccessible* parent = nullptr;
|
||||||
|
if (aData.ID()) {
|
||||||
|
ProxyEntry* e = mAccessibles.GetEntry(aData.ID());
|
||||||
|
if (e)
|
||||||
|
parent = e->mProxy;
|
||||||
|
} else {
|
||||||
|
parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// XXX This should really never happen, but sometimes we fail to fire the
|
||||||
|
// required show events.
|
||||||
|
if (!parent) {
|
||||||
|
NS_ERROR("adding child to unknown accessible");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t newChildIdx = aData.Idx();
|
||||||
|
if (newChildIdx > parent->ChildrenCount()) {
|
||||||
|
NS_ERROR("invalid index to add child at");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t consumed = AddSubtree(parent, aData.NewTree(), 0, newChildIdx);
|
||||||
|
MOZ_ASSERT(consumed == aData.NewTree().Length());
|
||||||
|
for (uint32_t i = 0; i < consumed; i++) {
|
||||||
|
uint64_t id = aData.NewTree()[i].ID();
|
||||||
|
MOZ_ASSERT(mAccessibles.GetEntry(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
return consumed;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
DocAccessibleParent::AddSubtree(ProxyAccessible* aParent,
|
||||||
|
const nsTArray<a11y::AccessibleData>& aNewTree,
|
||||||
|
uint32_t aIdx, uint32_t aIdxInParent)
|
||||||
|
{
|
||||||
|
if (aNewTree.Length() <= aIdx) {
|
||||||
|
NS_ERROR("bad index in serialized tree!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AccessibleData& newChild = aNewTree[aIdx];
|
||||||
|
if (newChild.Role() > roles::LAST_ROLE) {
|
||||||
|
NS_ERROR("invalid role");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto role = static_cast<a11y::role>(newChild.Role());
|
||||||
|
ProxyAccessible* newProxy =
|
||||||
|
new ProxyAccessible(newChild.ID(), aParent, this, role, newChild.Name());
|
||||||
|
aParent->AddChildAt(aIdxInParent, newProxy);
|
||||||
|
mAccessibles.PutEntry(newChild.ID())->mProxy = newProxy;
|
||||||
|
ProxyCreated(newProxy);
|
||||||
|
|
||||||
|
uint32_t accessibles = 1;
|
||||||
|
uint32_t kids = newChild.ChildrenCount();
|
||||||
|
for (uint32_t i = 0; i < kids; i++) {
|
||||||
|
uint32_t consumed = AddSubtree(newProxy, aNewTree, aIdx + accessibles, i);
|
||||||
|
if (!consumed)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
accessibles += consumed;
|
||||||
|
}
|
||||||
|
|
||||||
|
MOZ_ASSERT(newProxy->ChildrenCount() == kids);
|
||||||
|
|
||||||
|
return accessibles;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID)
|
||||||
|
{
|
||||||
|
ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID);
|
||||||
|
if (!rootEntry) {
|
||||||
|
NS_ERROR("invalid root being removed!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProxyAccessible* root = rootEntry->mProxy;
|
||||||
|
if (!root) {
|
||||||
|
NS_ERROR("invalid root being removed!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProxyAccessible* parent = root->Parent();
|
||||||
|
parent->RemoveChild(root);
|
||||||
|
root->Shutdown();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,141 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#ifndef mozilla_a11y_DocAccessibleParent_h
|
||||||
|
#define mozilla_a11y_DocAccessibleParent_h
|
||||||
|
|
||||||
|
#include "nsAccessibilityService.h"
|
||||||
|
#include "ProxyAccessible.h"
|
||||||
|
#include "mozilla/a11y/PDocAccessibleParent.h"
|
||||||
|
#include "nsClassHashtable.h"
|
||||||
|
#include "nsHashKeys.h"
|
||||||
|
#include "nsISupportsImpl.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These objects live in the main process and comunicate with and represent
|
||||||
|
* an accessible document in a content process.
|
||||||
|
*/
|
||||||
|
class DocAccessibleParent : public ProxyAccessible,
|
||||||
|
public PDocAccessibleParent
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DocAccessibleParent() :
|
||||||
|
mParentDoc(nullptr)
|
||||||
|
{ MOZ_COUNT_CTOR_INHERITED(DocAccessibleParent, ProxyAccessible); }
|
||||||
|
~DocAccessibleParent()
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR_INHERITED(DocAccessibleParent, ProxyAccessible);
|
||||||
|
MOZ_ASSERT(mChildDocs.Length() == 0);
|
||||||
|
MOZ_ASSERT(!mParentDoc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called when a message from a document in a child process notifies the main
|
||||||
|
* process it is firing an event.
|
||||||
|
*/
|
||||||
|
virtual bool RecvEvent(const uint32_t& aType) MOZ_OVERRIDE
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool RecvShowEvent(const ShowEventData& aData) MOZ_OVERRIDE;
|
||||||
|
virtual bool RecvHideEvent(const uint64_t& aRootID) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(mChildDocs.IsEmpty(),
|
||||||
|
"why wheren't the child docs destroyed already?");
|
||||||
|
mParentDoc ? mParentDoc->RemoveChildDoc(this)
|
||||||
|
: GetAccService()->RemoteDocShutdown(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the main processes representation of the parent document (if any)
|
||||||
|
* of the document this object represents.
|
||||||
|
*/
|
||||||
|
DocAccessibleParent* Parent() const { return mParentDoc; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called when a document in a content process notifies the main process of a
|
||||||
|
* new child document.
|
||||||
|
*/
|
||||||
|
bool AddChildDoc(DocAccessibleParent* aChildDoc, uint64_t aParentID)
|
||||||
|
{
|
||||||
|
ProxyAccessible* outerDoc = mAccessibles.GetEntry(aParentID)->mProxy;
|
||||||
|
if (!outerDoc)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
aChildDoc->mParent = outerDoc;
|
||||||
|
outerDoc->SetChildDoc(aChildDoc);
|
||||||
|
mChildDocs.AppendElement(aChildDoc);
|
||||||
|
aChildDoc->mParentDoc = this;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called when the document in the content process this object represents
|
||||||
|
* notifies the main process a child document has been removed.
|
||||||
|
*/
|
||||||
|
void RemoveChildDoc(DocAccessibleParent* aChildDoc)
|
||||||
|
{
|
||||||
|
aChildDoc->mParent->SetChildDoc(nullptr);
|
||||||
|
mChildDocs.RemoveElement(aChildDoc);
|
||||||
|
aChildDoc->mParentDoc = nullptr;
|
||||||
|
MOZ_ASSERT(aChildDoc->mChildDocs.Length() == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveAccessible(ProxyAccessible* aAccessible)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(mAccessibles.GetEntry(aAccessible->ID()));
|
||||||
|
mAccessibles.RemoveEntry(aAccessible->ID());
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
class ProxyEntry : public PLDHashEntryHdr
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProxyEntry(const void*) : mProxy(nullptr) {}
|
||||||
|
ProxyEntry(ProxyEntry&& aOther) :
|
||||||
|
mProxy(aOther.mProxy) { aOther.mProxy = nullptr; }
|
||||||
|
~ProxyEntry() { delete mProxy; }
|
||||||
|
|
||||||
|
typedef uint64_t KeyType;
|
||||||
|
typedef const void* KeyTypePointer;
|
||||||
|
|
||||||
|
bool KeyEquals(const void* aKey) const
|
||||||
|
{ return mProxy->ID() == (uint64_t)aKey; }
|
||||||
|
|
||||||
|
static const void* KeyToPointer(uint64_t aKey) { return (void*)aKey; }
|
||||||
|
|
||||||
|
static PLDHashNumber HashKey(const void* aKey) { return (uint64_t)aKey; }
|
||||||
|
|
||||||
|
enum { ALLOW_MEMMOVE = true };
|
||||||
|
|
||||||
|
ProxyAccessible* mProxy;
|
||||||
|
};
|
||||||
|
|
||||||
|
uint32_t AddSubtree(ProxyAccessible* aParent,
|
||||||
|
const nsTArray<AccessibleData>& aNewTree, uint32_t aIdx,
|
||||||
|
uint32_t aIdxInParent);
|
||||||
|
|
||||||
|
nsTArray<DocAccessibleParent*> mChildDocs;
|
||||||
|
DocAccessibleParent* mParentDoc;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Conceptually this is a map from IDs to proxies, but we store the ID in the
|
||||||
|
* proxy object so we can't use a real map.
|
||||||
|
*/
|
||||||
|
nsTHashtable<ProxyEntry> mAccessibles;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,47 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
include protocol PContent;
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
struct AccessibleData
|
||||||
|
{
|
||||||
|
uint64_t ID;
|
||||||
|
uint32_t Role;
|
||||||
|
uint32_t ChildrenCount;
|
||||||
|
nsString Name;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ShowEventData
|
||||||
|
{
|
||||||
|
uint64_t ID;
|
||||||
|
uint32_t Idx;
|
||||||
|
AccessibleData[] NewTree;
|
||||||
|
};
|
||||||
|
|
||||||
|
prio(normal upto high) sync protocol PDocAccessible
|
||||||
|
{
|
||||||
|
manager PContent;
|
||||||
|
|
||||||
|
parent:
|
||||||
|
__delete__();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notify the parent process the document in the child process is firing an
|
||||||
|
* event.
|
||||||
|
*/
|
||||||
|
Event(uint32_t type);
|
||||||
|
ShowEvent(ShowEventData data);
|
||||||
|
HideEvent(uint64_t aRootID);
|
||||||
|
|
||||||
|
child:
|
||||||
|
prio(high) sync State(uint64_t aID) returns(uint64_t states);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "ProxyAccessible.h"
|
||||||
|
#include "DocAccessibleParent.h"
|
||||||
|
#include "mozilla/unused.h"
|
||||||
|
#include "mozilla/a11y/Platform.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
void
|
||||||
|
ProxyAccessible::Shutdown()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(!mOuterDoc);
|
||||||
|
|
||||||
|
uint32_t childCount = mChildren.Length();
|
||||||
|
for (uint32_t idx = 0; idx < childCount; idx++)
|
||||||
|
mChildren[idx]->Shutdown();
|
||||||
|
|
||||||
|
mChildren.Clear();
|
||||||
|
ProxyDestroyed(this);
|
||||||
|
mDoc->RemoveAccessible(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProxyAccessible::SetChildDoc(DocAccessibleParent* aParent)
|
||||||
|
{
|
||||||
|
if (aParent) {
|
||||||
|
MOZ_ASSERT(mChildren.IsEmpty());
|
||||||
|
mChildren.AppendElement(aParent);
|
||||||
|
mOuterDoc = true;
|
||||||
|
} else {
|
||||||
|
MOZ_ASSERT(mChildren.Length() == 1);
|
||||||
|
mChildren.Clear();
|
||||||
|
mOuterDoc = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t
|
||||||
|
ProxyAccessible::State() const
|
||||||
|
{
|
||||||
|
uint64_t state = 0;
|
||||||
|
unused << mDoc->SendState(mID, &state);
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||||
|
/* vim: set ts=2 et sw=2 tw=80: */
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#ifndef mozilla_a11y_ProxyAccessible_h
|
||||||
|
#define mozilla_a11y_ProxyAccessible_h
|
||||||
|
|
||||||
|
#include "mozilla/a11y/Role.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsTArray.h"
|
||||||
|
|
||||||
|
namespace mozilla {
|
||||||
|
namespace a11y {
|
||||||
|
|
||||||
|
class DocAccessibleParent;
|
||||||
|
|
||||||
|
class ProxyAccessible
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
ProxyAccessible(uint64_t aID, ProxyAccessible* aParent,
|
||||||
|
DocAccessibleParent* aDoc, role aRole,
|
||||||
|
const nsString& aName) :
|
||||||
|
mParent(aParent), mDoc(aDoc), mID(aID), mRole(aRole), mOuterDoc(false), mName(aName)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(ProxyAccessible);
|
||||||
|
}
|
||||||
|
~ProxyAccessible() { MOZ_COUNT_DTOR(ProxyAccessible); }
|
||||||
|
|
||||||
|
void AddChildAt(uint32_t aIdx, ProxyAccessible* aChild)
|
||||||
|
{ mChildren.InsertElementAt(aIdx, aChild); }
|
||||||
|
|
||||||
|
uint32_t ChildrenCount() const { return mChildren.Length(); }
|
||||||
|
|
||||||
|
void Shutdown();
|
||||||
|
|
||||||
|
void SetChildDoc(DocAccessibleParent*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove The given child.
|
||||||
|
*/
|
||||||
|
void RemoveChild(ProxyAccessible* aChild)
|
||||||
|
{ mChildren.RemoveElement(aChild); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the proxy for the parent of the wrapped accessible.
|
||||||
|
*/
|
||||||
|
ProxyAccessible* Parent() const { return mParent; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the role of the accessible we're proxying.
|
||||||
|
*/
|
||||||
|
role Role() const { return mRole; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the states for the proxied accessible.
|
||||||
|
*/
|
||||||
|
uint64_t State() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow the platform to store a pointers worth of data on us.
|
||||||
|
*/
|
||||||
|
uintptr_t GetWrapper() const { return mWrapper; }
|
||||||
|
void SetWrapper(uintptr_t aWrapper) { mWrapper = aWrapper; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the ID of the accessible being proxied.
|
||||||
|
*/
|
||||||
|
uint64_t ID() const { return mID; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ProxyAccessible() :
|
||||||
|
mParent(nullptr), mDoc(nullptr), mWrapper(0), mID(0)
|
||||||
|
{ MOZ_COUNT_CTOR(ProxyAccessible); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ProxyAccessible* mParent;
|
||||||
|
|
||||||
|
private:
|
||||||
|
nsTArray<ProxyAccessible*> mChildren;
|
||||||
|
DocAccessibleParent* mDoc;
|
||||||
|
uintptr_t mWrapper;
|
||||||
|
uint64_t mID;
|
||||||
|
role mRole : 31;
|
||||||
|
bool mOuterDoc : 1;
|
||||||
|
nsString mName;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,31 @@
|
||||||
|
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||||
|
# vim: set filetype=python:
|
||||||
|
# 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/.
|
||||||
|
|
||||||
|
IPDL_SOURCES += ['PDocAccessible.ipdl']
|
||||||
|
|
||||||
|
# with --disable-accessibility we need to compile PDocAccessible.ipdl, but not
|
||||||
|
# the C++.
|
||||||
|
if CONFIG['ACCESSIBILITY']:
|
||||||
|
EXPORTS.mozilla.a11y += [
|
||||||
|
'DocAccessibleChild.h',
|
||||||
|
'DocAccessibleParent.h',
|
||||||
|
'ProxyAccessible.h'
|
||||||
|
]
|
||||||
|
|
||||||
|
SOURCES += [
|
||||||
|
'DocAccessibleChild.cpp',
|
||||||
|
'DocAccessibleParent.cpp',
|
||||||
|
'ProxyAccessible.cpp'
|
||||||
|
]
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += [
|
||||||
|
'../base',
|
||||||
|
'../generic',
|
||||||
|
]
|
||||||
|
|
||||||
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|
||||||
|
include('/ipc/chromium/chromium-config.mozbuild')
|
|
@ -33,6 +33,15 @@ PlatformShutdown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProxyCreated(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ProxyDestroyed(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ elif toolkit == 'cocoa':
|
||||||
else:
|
else:
|
||||||
DIRS += ['other']
|
DIRS += ['other']
|
||||||
|
|
||||||
DIRS += ['base', 'generic', 'html', 'interfaces', 'jsat', 'xpcom']
|
DIRS += ['base', 'generic', 'html', 'interfaces', 'ipc', 'jsat', 'xpcom']
|
||||||
|
|
||||||
if CONFIG['MOZ_XUL']:
|
if CONFIG['MOZ_XUL']:
|
||||||
DIRS += ['xul']
|
DIRS += ['xul']
|
||||||
|
|
|
@ -18,3 +18,13 @@ void
|
||||||
a11y::PlatformShutdown()
|
a11y::PlatformShutdown()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyCreated(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyDestroyed(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -34,3 +34,12 @@ a11y::PlatformShutdown()
|
||||||
nsWinUtils::ShutdownWindowEmulation();
|
nsWinUtils::ShutdownWindowEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyCreated(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
a11y::ProxyDestroyed(ProxyAccessible*)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -851,7 +851,6 @@ pref("memory.system_memory_reporter", true);
|
||||||
// Don't dump memory reports on OOM, by default.
|
// Don't dump memory reports on OOM, by default.
|
||||||
pref("memory.dump_reports_on_oom", false);
|
pref("memory.dump_reports_on_oom", false);
|
||||||
|
|
||||||
pref("layout.imagevisibility.enabled", true);
|
|
||||||
pref("layout.imagevisibility.numscrollportwidths", 1);
|
pref("layout.imagevisibility.numscrollportwidths", 1);
|
||||||
pref("layout.imagevisibility.numscrollportheights", 1);
|
pref("layout.imagevisibility.numscrollportheights", 1);
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,15 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
|
||||||
|
|
|
@ -15,17 +15,17 @@
|
||||||
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
||||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||||
<!-- Gonk specific things and forks -->
|
<!-- Gonk specific things and forks -->
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="84923f1940625c47ff4c1fdf01b10fde3b7d909e">
|
<project name="platform_build" path="build" remote="b2g" revision="70eb0cb0977d6295e7da8896f9efb9f3ca1c13ea">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
</project>
|
</project>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
|
|
|
@ -15,15 +15,15 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
|
||||||
|
|
|
@ -15,17 +15,17 @@
|
||||||
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
||||||
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
|
||||||
<!-- Gonk specific things and forks -->
|
<!-- Gonk specific things and forks -->
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="84923f1940625c47ff4c1fdf01b10fde3b7d909e">
|
<project name="platform_build" path="build" remote="b2g" revision="70eb0cb0977d6295e7da8896f9efb9f3ca1c13ea">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c058843242068d0df7c107e09da31b53d2e08fa6"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||||
|
|
|
@ -15,15 +15,15 @@
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
|
||||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
|
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
</project>
|
</project>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
"remote": "",
|
"remote": "",
|
||||||
"branch": ""
|
"branch": ""
|
||||||
},
|
},
|
||||||
"revision": "2bf3274b9e149c6a0ffc13be4c7d3a2f7236e311",
|
"revision": "d3b2bb39fd5873ff8d537a3267d21d20491c3d1d",
|
||||||
"repo_path": "/integration/gaia-central"
|
"repo_path": "/integration/gaia-central"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,16 +13,16 @@
|
||||||
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
||||||
<default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
|
<default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
|
||||||
<!-- Gonk specific things and forks -->
|
<!-- Gonk specific things and forks -->
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="84923f1940625c47ff4c1fdf01b10fde3b7d909e">
|
<project name="platform_build" path="build" remote="b2g" revision="70eb0cb0977d6295e7da8896f9efb9f3ca1c13ea">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||||
<default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
|
<default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
|
||||||
<!-- Gonk specific things and forks -->
|
<!-- Gonk specific things and forks -->
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="84923f1940625c47ff4c1fdf01b10fde3b7d909e">
|
<project name="platform_build" path="build" remote="b2g" revision="70eb0cb0977d6295e7da8896f9efb9f3ca1c13ea">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
</project>
|
</project>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
|
|
|
@ -13,16 +13,16 @@
|
||||||
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
<remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
|
||||||
<default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
|
<default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
|
||||||
<!-- Gonk specific things and forks -->
|
<!-- Gonk specific things and forks -->
|
||||||
<project name="platform_build" path="build" remote="b2g" revision="84923f1940625c47ff4c1fdf01b10fde3b7d909e">
|
<project name="platform_build" path="build" remote="b2g" revision="70eb0cb0977d6295e7da8896f9efb9f3ca1c13ea">
|
||||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||||
</project>
|
</project>
|
||||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="82174cee5ede9f23aedad8a39f8b8cdc1ae710c4"/>
|
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4d7f051cede6544f4c83580253c743c22b0cb279"/>
|
||||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="73d68c9c91bc568ce7c888ac057b3f44bd1b2e79"/>
|
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
|
||||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9f6b7471c881ee689183d681658cf2ba3dfc5610"/>
|
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a7631963e5f702a0c6027f5575e5e0deeededea6"/>
|
||||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||||
<!-- Stock Android things -->
|
<!-- Stock Android things -->
|
||||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||||
|
|
|
@ -86,7 +86,7 @@ addEventListener("blur", function(event) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||||
addEventListener("contextmenu", function (event) {
|
let handleContentContextMenu = function (event) {
|
||||||
let defaultPrevented = event.defaultPrevented;
|
let defaultPrevented = event.defaultPrevented;
|
||||||
if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
|
if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
|
||||||
let plugin = null;
|
let plugin = null;
|
||||||
|
@ -112,7 +112,12 @@ if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||||
|
|
||||||
sendSyncMessage("contextmenu", { editFlags, spellInfo }, { event });
|
sendSyncMessage("contextmenu", { editFlags, spellInfo }, { event });
|
||||||
}
|
}
|
||||||
}, false);
|
}
|
||||||
|
|
||||||
|
Cc["@mozilla.org/eventlistenerservice;1"]
|
||||||
|
.getService(Ci.nsIEventListenerService)
|
||||||
|
.addSystemEventListener(global, "contextmenu", handleContentContextMenu, true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
addEventListener("mozUITour", function(event) {
|
addEventListener("mozUITour", function(event) {
|
||||||
if (!Services.prefs.getBoolPref("browser.uitour.enabled"))
|
if (!Services.prefs.getBoolPref("browser.uitour.enabled"))
|
||||||
|
|
|
@ -120,6 +120,9 @@ BINPATH = bin
|
||||||
endif
|
endif
|
||||||
DEFINES += -DBINPATH=$(BINPATH)
|
DEFINES += -DBINPATH=$(BINPATH)
|
||||||
|
|
||||||
|
AB = $(firstword $(subst -, ,$(AB_CD)))
|
||||||
|
DEFINES += -DAB=$(AB)
|
||||||
|
|
||||||
DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION)
|
DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION)
|
||||||
ifdef MOZ_NATIVE_ICU
|
ifdef MOZ_NATIVE_ICU
|
||||||
DEFINES += -DMOZ_NATIVE_ICU
|
DEFINES += -DMOZ_NATIVE_ICU
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
@APPNAME@/Contents/PkgInfo
|
@APPNAME@/Contents/PkgInfo
|
||||||
@APPNAME@/Contents/Resources/firefox.icns
|
@APPNAME@/Contents/Resources/firefox.icns
|
||||||
@APPNAME@/Contents/Resources/document.icns
|
@APPNAME@/Contents/Resources/document.icns
|
||||||
@APPNAME@/Contents/Resources/en.lproj/*
|
@APPNAME@/Contents/Resources/@AB@.lproj/*
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[@AB_CD@]
|
[@AB_CD@]
|
||||||
|
|
|
@ -671,7 +671,6 @@ pref("full-screen-api.ignore-widgets", true);
|
||||||
// image visibility prefs.
|
// image visibility prefs.
|
||||||
// image visibility tries to only keep images near the viewport decoded instead
|
// image visibility tries to only keep images near the viewport decoded instead
|
||||||
// of keeping all images decoded.
|
// of keeping all images decoded.
|
||||||
pref("layout.imagevisibility.enabled", true);
|
|
||||||
pref("layout.imagevisibility.numscrollportwidths", 1);
|
pref("layout.imagevisibility.numscrollportwidths", 1);
|
||||||
pref("layout.imagevisibility.numscrollportheights", 1);
|
pref("layout.imagevisibility.numscrollportheights", 1);
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
|
||||||
CASE_RETURN( TYPE_CSP_REPORT );
|
CASE_RETURN( TYPE_CSP_REPORT );
|
||||||
CASE_RETURN( TYPE_XSLT );
|
CASE_RETURN( TYPE_XSLT );
|
||||||
CASE_RETURN( TYPE_BEACON );
|
CASE_RETURN( TYPE_BEACON );
|
||||||
|
CASE_RETURN( TYPE_FETCH );
|
||||||
default:
|
default:
|
||||||
return "<Unknown Type>";
|
return "<Unknown Type>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ typedef unsigned long nsContentPolicyType;
|
||||||
* by launching a dialog to prompt the user for something).
|
* by launching a dialog to prompt the user for something).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[scriptable,uuid(b6a71698-c117-441d-86b9-480cf06e3952)]
|
[scriptable,uuid(8afe3e5c-f916-48fd-8075-9579d3502e1d)]
|
||||||
interface nsIContentPolicy : nsISupports
|
interface nsIContentPolicy : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -150,6 +150,12 @@ interface nsIContentPolicy : nsISupports
|
||||||
*/
|
*/
|
||||||
const nsContentPolicyType TYPE_BEACON = 19;
|
const nsContentPolicyType TYPE_BEACON = 19;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates a load initiated by the fetch() function from the Fetch
|
||||||
|
* specification.
|
||||||
|
*/
|
||||||
|
const nsContentPolicyType TYPE_FETCH = 20;
|
||||||
|
|
||||||
/* When adding new content types, please update nsContentBlocker,
|
/* When adding new content types, please update nsContentBlocker,
|
||||||
* NS_CP_ContentTypeName, nsCSPContext, all nsIContentPolicy
|
* NS_CP_ContentTypeName, nsCSPContext, all nsIContentPolicy
|
||||||
* implementations, and other things that are not listed here that are
|
* implementations, and other things that are not listed here that are
|
||||||
|
|
|
@ -709,6 +709,7 @@ CSP_ContentTypeToDirective(nsContentPolicyType aType)
|
||||||
case nsIContentPolicy::TYPE_WEBSOCKET:
|
case nsIContentPolicy::TYPE_WEBSOCKET:
|
||||||
case nsIContentPolicy::TYPE_XMLHTTPREQUEST:
|
case nsIContentPolicy::TYPE_XMLHTTPREQUEST:
|
||||||
case nsIContentPolicy::TYPE_BEACON:
|
case nsIContentPolicy::TYPE_BEACON:
|
||||||
|
case nsIContentPolicy::TYPE_FETCH:
|
||||||
return CSP_CONNECT_SRC;
|
return CSP_CONNECT_SRC;
|
||||||
|
|
||||||
case nsIContentPolicy::TYPE_OBJECT:
|
case nsIContentPolicy::TYPE_OBJECT:
|
||||||
|
|
|
@ -117,7 +117,7 @@ nsDOMFileReader::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||||
|
|
||||||
nsCOMPtr<nsPIDOMWindow> owner = do_QueryInterface(aGlobal.GetAsSupports());
|
nsCOMPtr<nsPIDOMWindow> owner = do_QueryInterface(aGlobal.GetAsSupports());
|
||||||
if (!owner) {
|
if (!owner) {
|
||||||
NS_WARNING("Unexpected nsIJSNativeInitializer owner");
|
NS_WARNING("Unexpected owner");
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "nsIInterfaceRequestor.h"
|
#include "nsIInterfaceRequestor.h"
|
||||||
#include "nsJSUtils.h"
|
#include "nsJSUtils.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
#include "nsIJSNativeInitializer.h"
|
|
||||||
#include "prtime.h"
|
#include "prtime.h"
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsIAsyncInputStream.h"
|
#include "nsIAsyncInputStream.h"
|
||||||
|
|
|
@ -120,7 +120,8 @@ nsDataDocumentContentPolicy::ShouldLoad(uint32_t aContentType,
|
||||||
aContentType == nsIContentPolicy::TYPE_DOCUMENT ||
|
aContentType == nsIContentPolicy::TYPE_DOCUMENT ||
|
||||||
aContentType == nsIContentPolicy::TYPE_SUBDOCUMENT ||
|
aContentType == nsIContentPolicy::TYPE_SUBDOCUMENT ||
|
||||||
aContentType == nsIContentPolicy::TYPE_SCRIPT ||
|
aContentType == nsIContentPolicy::TYPE_SCRIPT ||
|
||||||
aContentType == nsIContentPolicy::TYPE_XSLT) {
|
aContentType == nsIContentPolicy::TYPE_XSLT ||
|
||||||
|
aContentType == nsIContentPolicy::TYPE_FETCH) {
|
||||||
*aDecision = nsIContentPolicy::REJECT_TYPE;
|
*aDecision = nsIContentPolicy::REJECT_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -383,6 +383,7 @@ nsMixedContentBlocker::ShouldLoad(uint32_t aContentType,
|
||||||
// purposes and to avoid the assertion and warning for the default case.
|
// purposes and to avoid the assertion and warning for the default case.
|
||||||
case TYPE_CSP_REPORT:
|
case TYPE_CSP_REPORT:
|
||||||
case TYPE_DTD:
|
case TYPE_DTD:
|
||||||
|
case TYPE_FETCH:
|
||||||
case TYPE_FONT:
|
case TYPE_FONT:
|
||||||
case TYPE_OBJECT:
|
case TYPE_OBJECT:
|
||||||
case TYPE_SCRIPT:
|
case TYPE_SCRIPT:
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
#include "nsIDOMHTMLOptionElement.h"
|
#include "nsIDOMHTMLOptionElement.h"
|
||||||
#include "nsIJSNativeInitializer.h"
|
|
||||||
#include "mozilla/dom/HTMLFormElement.h"
|
#include "mozilla/dom/HTMLFormElement.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
|
@ -174,6 +174,49 @@ GMPParent::LoadProcess()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AbortWaitingForGMPAsyncShutdown(nsITimer* aTimer, void* aClosure)
|
||||||
|
{
|
||||||
|
NS_WARNING("Timed out waiting for GMP async shutdown!");
|
||||||
|
GMPParent* parent = reinterpret_cast<GMPParent*>(aClosure);
|
||||||
|
nsRefPtr<GeckoMediaPluginService> service =
|
||||||
|
GeckoMediaPluginService::GetGeckoMediaPluginService();
|
||||||
|
if (service) {
|
||||||
|
service->AsyncShutdownComplete(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
GMPParent::EnsureAsyncShutdownTimeoutSet()
|
||||||
|
{
|
||||||
|
if (mAsyncShutdownTimeout) {
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsresult rv;
|
||||||
|
mAsyncShutdownTimeout = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
|
||||||
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set timer to abort waiting for plugin to shutdown if it takes
|
||||||
|
// too long.
|
||||||
|
rv = mAsyncShutdownTimeout->SetTarget(mGMPThread);
|
||||||
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t timeout = GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT;
|
||||||
|
nsRefPtr<GeckoMediaPluginService> service =
|
||||||
|
GeckoMediaPluginService::GetGeckoMediaPluginService();
|
||||||
|
if (service) {
|
||||||
|
timeout = service->AsyncShutdownTimeoutMs();
|
||||||
|
}
|
||||||
|
return mAsyncShutdownTimeout->InitWithFuncCallback(
|
||||||
|
&AbortWaitingForGMPAsyncShutdown, this, timeout,
|
||||||
|
nsITimer::TYPE_ONE_SHOT);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GMPParent::CloseIfUnused()
|
GMPParent::CloseIfUnused()
|
||||||
{
|
{
|
||||||
|
@ -199,7 +242,8 @@ GMPParent::CloseIfUnused()
|
||||||
LOGD(("%s::%s: %p sending async shutdown notification", __CLASS__,
|
LOGD(("%s::%s: %p sending async shutdown notification", __CLASS__,
|
||||||
__FUNCTION__, this));
|
__FUNCTION__, this));
|
||||||
mAsyncShutdownInProgress = true;
|
mAsyncShutdownInProgress = true;
|
||||||
if (!SendBeginAsyncShutdown()) {
|
if (!SendBeginAsyncShutdown() ||
|
||||||
|
NS_FAILED(EnsureAsyncShutdownTimeoutSet())) {
|
||||||
AbortAsyncShutdown();
|
AbortAsyncShutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,6 +263,11 @@ GMPParent::AbortAsyncShutdown()
|
||||||
MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
|
MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
|
||||||
LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
|
LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
|
||||||
|
|
||||||
|
if (mAsyncShutdownTimeout) {
|
||||||
|
mAsyncShutdownTimeout->Cancel();
|
||||||
|
mAsyncShutdownTimeout = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mAsyncShutdownRequired || !mAsyncShutdownInProgress) {
|
if (!mAsyncShutdownRequired || !mAsyncShutdownInProgress) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -289,6 +338,8 @@ GMPParent::Shutdown()
|
||||||
LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
|
LOGD(("%s::%s: %p", __CLASS__, __FUNCTION__, this));
|
||||||
MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
|
MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
|
||||||
|
|
||||||
|
MOZ_ASSERT(!mAsyncShutdownTimeout, "Should have canceled shutdown timeout");
|
||||||
|
|
||||||
if (mAbnormalShutdownInProgress) {
|
if (mAbnormalShutdownInProgress) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,8 @@ private:
|
||||||
virtual bool RecvAsyncShutdownComplete() MOZ_OVERRIDE;
|
virtual bool RecvAsyncShutdownComplete() MOZ_OVERRIDE;
|
||||||
virtual bool RecvAsyncShutdownRequired() MOZ_OVERRIDE;
|
virtual bool RecvAsyncShutdownRequired() MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
nsresult EnsureAsyncShutdownTimeoutSet();
|
||||||
|
|
||||||
GMPState mState;
|
GMPState mState;
|
||||||
nsCOMPtr<nsIFile> mDirectory; // plugin directory on disk
|
nsCOMPtr<nsIFile> mDirectory; // plugin directory on disk
|
||||||
nsString mName; // base name of plugin on disk, UTF-16 because used for paths
|
nsString mName; // base name of plugin on disk, UTF-16 because used for paths
|
||||||
|
@ -188,6 +190,7 @@ private:
|
||||||
nsTArray<nsRefPtr<GMPTimerParent>> mTimers;
|
nsTArray<nsRefPtr<GMPTimerParent>> mTimers;
|
||||||
nsTArray<nsRefPtr<GMPStorageParent>> mStorage;
|
nsTArray<nsRefPtr<GMPStorageParent>> mStorage;
|
||||||
nsCOMPtr<nsIThread> mGMPThread;
|
nsCOMPtr<nsIThread> mGMPThread;
|
||||||
|
nsCOMPtr<nsITimer> mAsyncShutdownTimeout; // GMP Thread only.
|
||||||
// NodeId the plugin is assigned to, or empty if the the plugin is not
|
// NodeId the plugin is assigned to, or empty if the the plugin is not
|
||||||
// assigned to a NodeId.
|
// assigned to a NodeId.
|
||||||
nsAutoCString mNodeId;
|
nsAutoCString mNodeId;
|
||||||
|
|
|
@ -136,8 +136,8 @@ GeckoMediaPluginService::GetGeckoMediaPluginService()
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(GeckoMediaPluginService, mozIGeckoMediaPluginService, nsIObserver)
|
NS_IMPL_ISUPPORTS(GeckoMediaPluginService, mozIGeckoMediaPluginService, nsIObserver)
|
||||||
|
|
||||||
#define GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT 3000
|
|
||||||
static int32_t sMaxAsyncShutdownWaitMs = 0;
|
static int32_t sMaxAsyncShutdownWaitMs = 0;
|
||||||
|
static bool sHaveSetTimeoutPrefCache = false;
|
||||||
|
|
||||||
GeckoMediaPluginService::GeckoMediaPluginService()
|
GeckoMediaPluginService::GeckoMediaPluginService()
|
||||||
: mMutex("GeckoMediaPluginService::mMutex")
|
: mMutex("GeckoMediaPluginService::mMutex")
|
||||||
|
@ -147,9 +147,8 @@ GeckoMediaPluginService::GeckoMediaPluginService()
|
||||||
, mWaitingForPluginsAsyncShutdown(false)
|
, mWaitingForPluginsAsyncShutdown(false)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
static bool setTimeoutPrefCache = false;
|
if (!sHaveSetTimeoutPrefCache) {
|
||||||
if (!setTimeoutPrefCache) {
|
sHaveSetTimeoutPrefCache = true;
|
||||||
setTimeoutPrefCache = true;
|
|
||||||
Preferences::AddIntVarCache(&sMaxAsyncShutdownWaitMs,
|
Preferences::AddIntVarCache(&sMaxAsyncShutdownWaitMs,
|
||||||
"media.gmp.async-shutdown-timeout",
|
"media.gmp.async-shutdown-timeout",
|
||||||
GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT);
|
GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT);
|
||||||
|
@ -162,6 +161,13 @@ GeckoMediaPluginService::~GeckoMediaPluginService()
|
||||||
MOZ_ASSERT(mAsyncShutdownPlugins.IsEmpty());
|
MOZ_ASSERT(mAsyncShutdownPlugins.IsEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t
|
||||||
|
GeckoMediaPluginService::AsyncShutdownTimeoutMs()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(sHaveSetTimeoutPrefCache);
|
||||||
|
return sMaxAsyncShutdownWaitMs;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
GeckoMediaPluginService::Init()
|
GeckoMediaPluginService::Init()
|
||||||
{
|
{
|
||||||
|
@ -205,16 +211,6 @@ GeckoMediaPluginService::Init()
|
||||||
return GetThread(getter_AddRefs(thread));
|
return GetThread(getter_AddRefs(thread));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
AbortWaitingForGMPAsyncShutdown(nsITimer* aTimer, void* aClosure)
|
|
||||||
{
|
|
||||||
NS_WARNING("Timed out waiting for GMP async shutdown!");
|
|
||||||
nsRefPtr<GeckoMediaPluginService> service = sSingletonService.get();
|
|
||||||
if (service) {
|
|
||||||
service->AbortAsyncShutdown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
GeckoMediaPluginService::Observe(nsISupports* aSubject,
|
GeckoMediaPluginService::Observe(nsISupports* aSubject,
|
||||||
const char* aTopic,
|
const char* aTopic,
|
||||||
|
@ -533,9 +529,11 @@ GeckoMediaPluginService::AsyncShutdownComplete(GMPParent* aParent)
|
||||||
|
|
||||||
mAsyncShutdownPlugins.RemoveElement(aParent);
|
mAsyncShutdownPlugins.RemoveElement(aParent);
|
||||||
if (mAsyncShutdownPlugins.IsEmpty() && mShuttingDownOnGMPThread) {
|
if (mAsyncShutdownPlugins.IsEmpty() && mShuttingDownOnGMPThread) {
|
||||||
// The main thread is waiting for async shutdown of plugins,
|
// The main thread may be waiting for async shutdown of plugins,
|
||||||
// which has completed. Break the main thread out of its waiting loop.
|
// which has completed. Break the main thread out of its waiting loop.
|
||||||
AbortAsyncShutdown();
|
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
||||||
|
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
||||||
|
NS_DispatchToMainThread(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,47 +544,6 @@ GeckoMediaPluginService::SetAsyncShutdownComplete()
|
||||||
mWaitingForPluginsAsyncShutdown = false;
|
mWaitingForPluginsAsyncShutdown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
GeckoMediaPluginService::AbortAsyncShutdown()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
|
|
||||||
for (size_t i = 0; i < mAsyncShutdownPlugins.Length(); i++) {
|
|
||||||
mAsyncShutdownPlugins[i]->AbortAsyncShutdown();
|
|
||||||
}
|
|
||||||
mAsyncShutdownPlugins.Clear();
|
|
||||||
if (mAsyncShutdownTimeout) {
|
|
||||||
mAsyncShutdownTimeout->Cancel();
|
|
||||||
mAsyncShutdownTimeout = nullptr;
|
|
||||||
}
|
|
||||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
|
||||||
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
|
||||||
NS_DispatchToMainThread(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
GeckoMediaPluginService::SetAsyncShutdownTimeout()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(!mAsyncShutdownTimeout);
|
|
||||||
|
|
||||||
nsresult rv;
|
|
||||||
mAsyncShutdownTimeout = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
NS_WARNING("Failed to create timer for async GMP shutdown");
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set timer to abort waiting for plugins to shutdown if they take
|
|
||||||
// too long.
|
|
||||||
rv = mAsyncShutdownTimeout->SetTarget(mGMPThread);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mAsyncShutdownTimeout->InitWithFuncCallback(
|
|
||||||
&AbortWaitingForGMPAsyncShutdown, nullptr, sMaxAsyncShutdownWaitMs,
|
|
||||||
nsITimer::TYPE_ONE_SHOT);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GeckoMediaPluginService::UnloadPlugins()
|
GeckoMediaPluginService::UnloadPlugins()
|
||||||
{
|
{
|
||||||
|
@ -607,16 +564,7 @@ GeckoMediaPluginService::UnloadPlugins()
|
||||||
mPlugins.Clear();
|
mPlugins.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mAsyncShutdownPlugins.IsEmpty()) {
|
|
||||||
// We have plugins that require async shutdown. Set a timer to abort
|
|
||||||
// waiting if they take too long to shutdown.
|
|
||||||
if (NS_FAILED(SetAsyncShutdownTimeout())) {
|
|
||||||
mAsyncShutdownPlugins.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mAsyncShutdownPlugins.IsEmpty()) {
|
if (mAsyncShutdownPlugins.IsEmpty()) {
|
||||||
mAsyncShutdownPlugins.Clear();
|
|
||||||
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
nsRefPtr<nsIRunnable> task(NS_NewRunnableMethod(
|
||||||
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
this, &GeckoMediaPluginService::SetAsyncShutdownComplete));
|
||||||
NS_DispatchToMainThread(task);
|
NS_DispatchToMainThread(task);
|
||||||
|
|
|
@ -28,6 +28,8 @@ namespace gmp {
|
||||||
|
|
||||||
class GMPParent;
|
class GMPParent;
|
||||||
|
|
||||||
|
#define GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT 3000
|
||||||
|
|
||||||
class GeckoMediaPluginService MOZ_FINAL : public mozIGeckoMediaPluginService
|
class GeckoMediaPluginService MOZ_FINAL : public mozIGeckoMediaPluginService
|
||||||
, public nsIObserver
|
, public nsIObserver
|
||||||
{
|
{
|
||||||
|
@ -45,6 +47,8 @@ public:
|
||||||
void AsyncShutdownComplete(GMPParent* aParent);
|
void AsyncShutdownComplete(GMPParent* aParent);
|
||||||
void AbortAsyncShutdown();
|
void AbortAsyncShutdown();
|
||||||
|
|
||||||
|
int32_t AsyncShutdownTimeoutMs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~GeckoMediaPluginService();
|
~GeckoMediaPluginService();
|
||||||
|
|
||||||
|
@ -122,7 +126,6 @@ private:
|
||||||
MainThreadOnly<bool> mWaitingForPluginsAsyncShutdown;
|
MainThreadOnly<bool> mWaitingForPluginsAsyncShutdown;
|
||||||
|
|
||||||
nsTArray<nsRefPtr<GMPParent>> mAsyncShutdownPlugins; // GMP Thread only.
|
nsTArray<nsRefPtr<GMPParent>> mAsyncShutdownPlugins; // GMP Thread only.
|
||||||
nsCOMPtr<nsITimer> mAsyncShutdownTimeout; // GMP Thread only.
|
|
||||||
|
|
||||||
#ifndef MOZ_WIDGET_GONK
|
#ifndef MOZ_WIDGET_GONK
|
||||||
nsCOMPtr<nsIFile> mStorageBaseDir;
|
nsCOMPtr<nsIFile> mStorageBaseDir;
|
||||||
|
|
|
@ -29,7 +29,6 @@ EXPORTS += [
|
||||||
'nsIDOMClassInfo.h',
|
'nsIDOMClassInfo.h',
|
||||||
'nsIDOMScriptObjectFactory.h',
|
'nsIDOMScriptObjectFactory.h',
|
||||||
'nsIGlobalObject.h',
|
'nsIGlobalObject.h',
|
||||||
'nsIJSNativeInitializer.h',
|
|
||||||
'nsIScriptContext.h',
|
'nsIScriptContext.h',
|
||||||
'nsIScriptGlobalObject.h',
|
'nsIScriptGlobalObject.h',
|
||||||
'nsIScriptNameSpaceManager.h',
|
'nsIScriptNameSpaceManager.h',
|
||||||
|
|
|
@ -50,7 +50,6 @@
|
||||||
|
|
||||||
// Window scriptable helper includes
|
// Window scriptable helper includes
|
||||||
#include "nsScriptNameSpaceManager.h"
|
#include "nsScriptNameSpaceManager.h"
|
||||||
#include "nsIJSNativeInitializer.h"
|
|
||||||
|
|
||||||
// DOM base includes
|
// DOM base includes
|
||||||
#include "nsIDOMWindow.h"
|
#include "nsIDOMWindow.h"
|
||||||
|
@ -1397,9 +1396,8 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIJSNativeInitializer> initializer(do_QueryInterface(native));
|
|
||||||
nsCOMPtr<nsIDOMGlobalObjectConstructor> constructor(do_QueryInterface(native));
|
nsCOMPtr<nsIDOMGlobalObjectConstructor> constructor(do_QueryInterface(native));
|
||||||
if (initializer || constructor) {
|
if (constructor) {
|
||||||
// Initialize object using the current inner window, but only if
|
// Initialize object using the current inner window, but only if
|
||||||
// the caller can access it.
|
// the caller can access it.
|
||||||
nsCOMPtr<nsPIDOMWindow> owner = do_QueryReferent(aWeakOwner);
|
nsCOMPtr<nsPIDOMWindow> owner = do_QueryReferent(aWeakOwner);
|
||||||
|
@ -1412,54 +1410,47 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
|
||||||
return NS_ERROR_DOM_SECURITY_ERR;
|
return NS_ERROR_DOM_SECURITY_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initializer) {
|
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS = do_QueryInterface(native);
|
||||||
rv = initializer->Initialize(currentInner, cx, obj, args);
|
|
||||||
if (NS_FAILED(rv)) {
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS = do_QueryInterface(native);
|
|
||||||
|
|
||||||
JS::Rooted<JSObject*> thisObject(cx, wrappedJS->GetJSObject());
|
JS::Rooted<JSObject*> thisObject(cx, wrappedJS->GetJSObject());
|
||||||
if (!thisObject) {
|
if (!thisObject) {
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSAutoCompartment ac(cx, thisObject);
|
||||||
|
|
||||||
|
JS::Rooted<JS::Value> funval(cx);
|
||||||
|
if (!JS_GetProperty(cx, thisObject, "constructor", &funval) ||
|
||||||
|
!funval.isObject()) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the object is even callable.
|
||||||
|
NS_ENSURE_STATE(JS::IsCallable(&funval.toObject()));
|
||||||
|
{
|
||||||
|
// wrap parameters in the target compartment
|
||||||
|
// we also pass in the calling window as the first argument
|
||||||
|
unsigned argc = args.length() + 1;
|
||||||
|
JS::AutoValueVector argv(cx);
|
||||||
|
if (!argv.resize(argc)) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSAutoCompartment ac(cx, thisObject);
|
nsCOMPtr<nsIDOMWindow> currentWin(do_GetInterface(currentInner));
|
||||||
|
rv = WrapNative(cx, currentWin, &NS_GET_IID(nsIDOMWindow),
|
||||||
|
true, argv[0]);
|
||||||
|
|
||||||
JS::Rooted<JS::Value> funval(cx);
|
for (size_t i = 1; i < argc; ++i) {
|
||||||
if (!JS_GetProperty(cx, thisObject, "constructor", &funval) ||
|
argv[i].set(args[i - 1]);
|
||||||
!funval.isObject()) {
|
if (!JS_WrapValue(cx, argv[i]))
|
||||||
return NS_ERROR_UNEXPECTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the object is even callable.
|
|
||||||
NS_ENSURE_STATE(JS::IsCallable(&funval.toObject()));
|
|
||||||
{
|
|
||||||
// wrap parameters in the target compartment
|
|
||||||
// we also pass in the calling window as the first argument
|
|
||||||
unsigned argc = args.length() + 1;
|
|
||||||
JS::AutoValueVector argv(cx);
|
|
||||||
if (!argv.resize(argc)) {
|
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMWindow> currentWin(do_GetInterface(currentInner));
|
|
||||||
rv = WrapNative(cx, currentWin, &NS_GET_IID(nsIDOMWindow),
|
|
||||||
true, argv[0]);
|
|
||||||
|
|
||||||
for (size_t i = 1; i < argc; ++i) {
|
|
||||||
argv[i].set(args[i - 1]);
|
|
||||||
if (!JS_WrapValue(cx, argv[i]))
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
JS::Rooted<JS::Value> frval(cx);
|
|
||||||
bool ret = JS_CallFunctionValue(cx, thisObject, funval, argv, &frval);
|
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JS::Rooted<JS::Value> frval(cx);
|
||||||
|
bool ret = JS_CallFunctionValue(cx, thisObject, funval, argv, &frval);
|
||||||
|
|
||||||
|
if (!ret) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef nsIJSNativeInitializer_h__
|
|
||||||
#define nsIJSNativeInitializer_h__
|
|
||||||
|
|
||||||
#include "nsISupports.h"
|
|
||||||
|
|
||||||
#define NS_IJSNATIVEINITIALIZER_IID \
|
|
||||||
{ 0xdb48eee5, 0x89a4, 0x4f18, \
|
|
||||||
{ 0x86, 0xd0, 0x4c, 0x4e, 0x9d, 0x4b, 0xf8, 0x7e } }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A JavaScript specific interface used to initialize new
|
|
||||||
* native objects, created as a result of calling a
|
|
||||||
* JavaScript constructor. The arguments are passed in
|
|
||||||
* their raw form as JS::Value's.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class nsIJSNativeInitializer : public nsISupports {
|
|
||||||
public:
|
|
||||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSNATIVEINITIALIZER_IID)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize a newly created native instance using the owner of the
|
|
||||||
* constructor and the parameters passed into the JavaScript constructor.
|
|
||||||
*/
|
|
||||||
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext *cx, JSObject *obj,
|
|
||||||
const JS::CallArgs& args) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSNativeInitializer,
|
|
||||||
NS_IJSNATIVEINITIALIZER_IID)
|
|
||||||
|
|
||||||
#endif // nsIJSNativeInitializer_h__
|
|
|
@ -45,10 +45,9 @@ InternalRequest::GetRequestConstructorCopy(nsIGlobalObject* aGlobal, ErrorResult
|
||||||
copy->mOrigin = NS_ConvertUTF16toUTF8(location.mOrigin);
|
copy->mOrigin = NS_ConvertUTF16toUTF8(location.mOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copy->mContext = nsIContentPolicy::TYPE_FETCH;
|
||||||
copy->mMode = mMode;
|
copy->mMode = mMode;
|
||||||
copy->mCredentialsMode = mCredentialsMode;
|
copy->mCredentialsMode = mCredentialsMode;
|
||||||
// FIXME(nsm): Add ContentType fetch to nsIContentPolicy and friends.
|
|
||||||
// Then set copy's mContext to that.
|
|
||||||
return copy.forget();
|
return copy.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
#include "TabChild.h"
|
#include "TabChild.h"
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
#include "mozilla/a11y/DocAccessibleChild.h"
|
||||||
|
#endif
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/dom/ContentBridgeChild.h"
|
#include "mozilla/dom/ContentBridgeChild.h"
|
||||||
#include "mozilla/dom/ContentBridgeParent.h"
|
#include "mozilla/dom/ContentBridgeParent.h"
|
||||||
|
@ -731,6 +734,22 @@ ContentChild::InitXPCOM()
|
||||||
InitOnContentProcessCreated();
|
InitOnContentProcessCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a11y::PDocAccessibleChild*
|
||||||
|
ContentChild::AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(false, "should never call this!");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ContentChild::DeallocPDocAccessibleChild(a11y::PDocAccessibleChild* aChild)
|
||||||
|
{
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
delete static_cast<mozilla::a11y::DocAccessibleChild*>(aChild);
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
PMemoryReportRequestChild*
|
PMemoryReportRequestChild*
|
||||||
ContentChild::AllocPMemoryReportRequestChild(const uint32_t& aGeneration,
|
ContentChild::AllocPMemoryReportRequestChild(const uint32_t& aGeneration,
|
||||||
const bool &aAnonymize,
|
const bool &aAnonymize,
|
||||||
|
|
|
@ -382,6 +382,8 @@ public:
|
||||||
const uint64_t& aID,
|
const uint64_t& aID,
|
||||||
const bool& aIsForApp,
|
const bool& aIsForApp,
|
||||||
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
const bool& aIsForBrowser) MOZ_OVERRIDE;
|
||||||
|
virtual PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) MOZ_OVERRIDE;
|
||||||
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) MOZ_OVERRIDE;
|
||||||
|
|
||||||
void GetAvailableDictionaries(InfallibleTArray<nsString>& aDictionaries);
|
void GetAvailableDictionaries(InfallibleTArray<nsString>& aDictionaries);
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,10 @@
|
||||||
#include "CrashReporterParent.h"
|
#include "CrashReporterParent.h"
|
||||||
#include "IHistory.h"
|
#include "IHistory.h"
|
||||||
#include "mozIApplication.h"
|
#include "mozIApplication.h"
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
#include "mozilla/a11y/DocAccessibleParent.h"
|
||||||
|
#include "nsAccessibilityService.h"
|
||||||
|
#endif
|
||||||
#include "mozilla/ClearOnShutdown.h"
|
#include "mozilla/ClearOnShutdown.h"
|
||||||
#include "mozilla/dom/DataStoreService.h"
|
#include "mozilla/dom/DataStoreService.h"
|
||||||
#include "mozilla/dom/DOMStorageIPC.h"
|
#include "mozilla/dom/DOMStorageIPC.h"
|
||||||
|
@ -2706,6 +2710,42 @@ ContentParent::Observe(nsISupports* aSubject,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a11y::PDocAccessibleParent*
|
||||||
|
ContentParent::AllocPDocAccessibleParent(PDocAccessibleParent* aParent, const uint64_t&)
|
||||||
|
{
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
return new a11y::DocAccessibleParent();
|
||||||
|
#else
|
||||||
|
return nullptr;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ContentParent::DeallocPDocAccessibleParent(PDocAccessibleParent* aParent)
|
||||||
|
{
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
delete static_cast<a11y::DocAccessibleParent*>(aParent);
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ContentParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc, PDocAccessibleParent* aParentDoc, const uint64_t& aParentID)
|
||||||
|
{
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
auto doc = static_cast<a11y::DocAccessibleParent*>(aDoc);
|
||||||
|
if (aParentDoc) {
|
||||||
|
MOZ_ASSERT(aParentID);
|
||||||
|
auto parentDoc = static_cast<a11y::DocAccessibleParent*>(aParentDoc);
|
||||||
|
return parentDoc->AddChildDoc(doc, aParentID);
|
||||||
|
} else {
|
||||||
|
MOZ_ASSERT(!aParentID);
|
||||||
|
GetAccService()->RemoteDocAdded(doc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
PCompositorParent*
|
PCompositorParent*
|
||||||
ContentParent::AllocPCompositorParent(mozilla::ipc::Transport* aTransport,
|
ContentParent::AllocPCompositorParent(mozilla::ipc::Transport* aTransport,
|
||||||
base::ProcessId aOtherProcess)
|
base::ProcessId aOtherProcess)
|
||||||
|
|
|
@ -679,6 +679,11 @@ private:
|
||||||
int32_t* aSliceRefCnt,
|
int32_t* aSliceRefCnt,
|
||||||
bool* aResult) MOZ_OVERRIDE;
|
bool* aResult) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual PDocAccessibleParent* AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&) MOZ_OVERRIDE;
|
||||||
|
virtual bool DeallocPDocAccessibleParent(PDocAccessibleParent*) MOZ_OVERRIDE;
|
||||||
|
virtual bool RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
|
||||||
|
PDocAccessibleParent* aParentDoc, const uint64_t& aParentID) MOZ_OVERRIDE;
|
||||||
|
|
||||||
// If you add strong pointers to cycle collected objects here, be sure to
|
// If you add strong pointers to cycle collected objects here, be sure to
|
||||||
// release these objects in ShutDownProcess. See the comment there for more
|
// release these objects in ShutDownProcess. See the comment there for more
|
||||||
// details.
|
// details.
|
||||||
|
|
|
@ -14,6 +14,7 @@ include protocol PCompositor;
|
||||||
include protocol PContentBridge;
|
include protocol PContentBridge;
|
||||||
include protocol PCycleCollectWithLogs;
|
include protocol PCycleCollectWithLogs;
|
||||||
include protocol PCrashReporter;
|
include protocol PCrashReporter;
|
||||||
|
include protocol PDocAccessible;
|
||||||
include protocol PExternalHelperApp;
|
include protocol PExternalHelperApp;
|
||||||
include protocol PDeviceStorageRequest;
|
include protocol PDeviceStorageRequest;
|
||||||
include protocol PFileDescriptorSet;
|
include protocol PFileDescriptorSet;
|
||||||
|
@ -333,6 +334,7 @@ prio(normal upto high) intr protocol PContent
|
||||||
manages PCellBroadcast;
|
manages PCellBroadcast;
|
||||||
manages PCrashReporter;
|
manages PCrashReporter;
|
||||||
manages PCycleCollectWithLogs;
|
manages PCycleCollectWithLogs;
|
||||||
|
manages PDocAccessible;
|
||||||
manages PDeviceStorageRequest;
|
manages PDeviceStorageRequest;
|
||||||
manages PFileSystemRequest;
|
manages PFileSystemRequest;
|
||||||
manages PExternalHelperApp;
|
manages PExternalHelperApp;
|
||||||
|
@ -491,6 +493,14 @@ child:
|
||||||
OnAppThemeChanged();
|
OnAppThemeChanged();
|
||||||
|
|
||||||
parent:
|
parent:
|
||||||
|
/**
|
||||||
|
* Tell the parent process a new accessible document has been created.
|
||||||
|
* aParentDoc is the accessible document it was created in if any, and
|
||||||
|
* aParentAcc is the id of the accessible in that document the new document
|
||||||
|
* is a child of.
|
||||||
|
*/
|
||||||
|
PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell the content process some attributes of itself. This is
|
* Tell the content process some attributes of itself. This is
|
||||||
* among the first information queried by content processes after
|
* among the first information queried by content processes after
|
||||||
|
|
|
@ -356,6 +356,7 @@ PluginHangUIParent::RecvUserResponse(const unsigned int& aResponse)
|
||||||
mModule->TerminateChildProcess(mMainThreadMessageLoop);
|
mModule->TerminateChildProcess(mMainThreadMessageLoop);
|
||||||
responseCode = 1;
|
responseCode = 1;
|
||||||
} else if(aResponse & HANGUI_USER_RESPONSE_CONTINUE) {
|
} else if(aResponse & HANGUI_USER_RESPONSE_CONTINUE) {
|
||||||
|
mModule->OnHangUIContinue();
|
||||||
// User clicked Continue
|
// User clicked Continue
|
||||||
responseCode = 2;
|
responseCode = 2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -133,6 +133,7 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
||||||
, mNPNIface(nullptr)
|
, mNPNIface(nullptr)
|
||||||
, mPlugin(nullptr)
|
, mPlugin(nullptr)
|
||||||
, mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
|
, mTaskFactory(MOZ_THIS_IN_INITIALIZER_LIST())
|
||||||
|
, mHangAnnotationFlags(0)
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
, mPluginCpuUsageOnHang()
|
, mPluginCpuUsageOnHang()
|
||||||
, mHangUIParent(nullptr)
|
, mHangUIParent(nullptr)
|
||||||
|
@ -160,6 +161,8 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
||||||
#ifdef MOZ_ENABLE_PROFILER_SPS
|
#ifdef MOZ_ENABLE_PROFILER_SPS
|
||||||
InitPluginProfiling();
|
InitPluginProfiling();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mozilla::HangMonitor::RegisterAnnotator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginModuleParent::~PluginModuleParent()
|
PluginModuleParent::~PluginModuleParent()
|
||||||
|
@ -203,6 +206,8 @@ PluginModuleParent::~PluginModuleParent()
|
||||||
mHangUIParent = nullptr;
|
mHangUIParent = nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mozilla::HangMonitor::UnregisterAnnotator(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
@ -224,20 +229,8 @@ PluginModuleParent::WriteExtraDataForMinidump(AnnotationTable& notes)
|
||||||
filePos++;
|
filePos++;
|
||||||
notes.Put(NS_LITERAL_CSTRING("PluginFilename"), CS(pluginFile.substr(filePos).c_str()));
|
notes.Put(NS_LITERAL_CSTRING("PluginFilename"), CS(pluginFile.substr(filePos).c_str()));
|
||||||
|
|
||||||
nsCString pluginName;
|
notes.Put(NS_LITERAL_CSTRING("PluginName"), mPluginName);
|
||||||
nsCString pluginVersion;
|
notes.Put(NS_LITERAL_CSTRING("PluginVersion"), mPluginVersion);
|
||||||
|
|
||||||
nsRefPtr<nsPluginHost> ph = nsPluginHost::GetInst();
|
|
||||||
if (ph) {
|
|
||||||
nsPluginTag* tag = ph->TagForPlugin(mPlugin);
|
|
||||||
if (tag) {
|
|
||||||
pluginName = tag->mName;
|
|
||||||
pluginVersion = tag->mVersion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
notes.Put(NS_LITERAL_CSTRING("PluginName"), pluginName);
|
|
||||||
notes.Put(NS_LITERAL_CSTRING("PluginVersion"), pluginVersion);
|
|
||||||
|
|
||||||
CrashReporterParent* crashReporter = CrashReporter();
|
CrashReporterParent* crashReporter = CrashReporter();
|
||||||
if (crashReporter) {
|
if (crashReporter) {
|
||||||
|
@ -389,13 +382,52 @@ GetProcessCpuUsage(const InfallibleTArray<base::ProcessHandle>& processHandles,
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
|
#endif // #ifdef XP_WIN
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginModuleParent::EnteredCxxStack()
|
||||||
|
{
|
||||||
|
mHangAnnotationFlags |= kInPluginCall;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginModuleParent::ExitedCxxStack()
|
PluginModuleParent::ExitedCxxStack()
|
||||||
{
|
{
|
||||||
|
mHangAnnotationFlags = 0;
|
||||||
|
#ifdef XP_WIN
|
||||||
FinishHangUI();
|
FinishHangUI();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #ifdef XP_WIN
|
/**
|
||||||
|
* This function is always called by the HangMonitor thread.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
PluginModuleParent::AnnotateHang(mozilla::HangMonitor::HangAnnotations& aAnnotations)
|
||||||
|
{
|
||||||
|
uint32_t flags = mHangAnnotationFlags;
|
||||||
|
if (flags) {
|
||||||
|
/* We don't actually annotate anything specifically for kInPluginCall;
|
||||||
|
we use it to determine whether to annotate other things. It will
|
||||||
|
be pretty obvious from the ChromeHang stack that we're in a plugin
|
||||||
|
call when the hang occurred. */
|
||||||
|
if (flags & kHangUIShown) {
|
||||||
|
aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIShown"),
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
if (flags & kHangUIContinued) {
|
||||||
|
aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIContinued"),
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
if (flags & kHangUIDontShow) {
|
||||||
|
aAnnotations.AddAnnotation(NS_LITERAL_STRING("HangUIDontShow"),
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
aAnnotations.AddAnnotation(NS_LITERAL_STRING("pluginName"), mPluginName);
|
||||||
|
aAnnotations.AddAnnotation(NS_LITERAL_STRING("pluginVersion"),
|
||||||
|
mPluginVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||||
static bool
|
static bool
|
||||||
|
@ -531,6 +563,23 @@ PluginModuleParent::TerminateChildProcess(MessageLoop* aMsgLoop)
|
||||||
NS_WARNING("failed to kill subprocess!");
|
NS_WARNING("failed to kill subprocess!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
PluginModuleParent::GetPluginDetails(nsACString& aPluginName,
|
||||||
|
nsACString& aPluginVersion)
|
||||||
|
{
|
||||||
|
nsRefPtr<nsPluginHost> host = nsPluginHost::GetInst();
|
||||||
|
if (!host) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
nsPluginTag* pluginTag = host->TagForPlugin(mPlugin);
|
||||||
|
if (!pluginTag) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
aPluginName = pluginTag->mName;
|
||||||
|
aPluginVersion = pluginTag->mVersion;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
void
|
void
|
||||||
PluginModuleParent::EvaluateHangUIState(const bool aReset)
|
PluginModuleParent::EvaluateHangUIState(const bool aReset)
|
||||||
|
@ -566,21 +615,6 @@ PluginModuleParent::EvaluateHangUIState(const bool aReset)
|
||||||
SetChildTimeout(autoStopSecs);
|
SetChildTimeout(autoStopSecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
PluginModuleParent::GetPluginName(nsAString& aPluginName)
|
|
||||||
{
|
|
||||||
nsRefPtr<nsPluginHost> host = nsPluginHost::GetInst();
|
|
||||||
if (!host) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
nsPluginTag* pluginTag = host->TagForPlugin(mPlugin);
|
|
||||||
if (!pluginTag) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
CopyUTF8toUTF16(pluginTag->mName, aPluginName);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PluginModuleParent::LaunchHangUI()
|
PluginModuleParent::LaunchHangUI()
|
||||||
{
|
{
|
||||||
|
@ -593,7 +627,12 @@ PluginModuleParent::LaunchHangUI()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (mHangUIParent->DontShowAgain()) {
|
if (mHangUIParent->DontShowAgain()) {
|
||||||
return !mHangUIParent->WasLastHangStopped();
|
mHangAnnotationFlags |= kHangUIDontShow;
|
||||||
|
bool wasLastHangStopped = mHangUIParent->WasLastHangStopped();
|
||||||
|
if (!wasLastHangStopped) {
|
||||||
|
mHangAnnotationFlags |= kHangUIContinued;
|
||||||
|
}
|
||||||
|
return !wasLastHangStopped;
|
||||||
}
|
}
|
||||||
delete mHangUIParent;
|
delete mHangUIParent;
|
||||||
mHangUIParent = nullptr;
|
mHangUIParent = nullptr;
|
||||||
|
@ -601,12 +640,9 @@ PluginModuleParent::LaunchHangUI()
|
||||||
mHangUIParent = new PluginHangUIParent(this,
|
mHangUIParent = new PluginHangUIParent(this,
|
||||||
Preferences::GetInt(kHangUITimeoutPref, 0),
|
Preferences::GetInt(kHangUITimeoutPref, 0),
|
||||||
Preferences::GetInt(kChildTimeoutPref, 0));
|
Preferences::GetInt(kChildTimeoutPref, 0));
|
||||||
nsAutoString pluginName;
|
bool retval = mHangUIParent->Init(NS_ConvertUTF8toUTF16(mPluginName));
|
||||||
if (!GetPluginName(pluginName)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
bool retval = mHangUIParent->Init(pluginName);
|
|
||||||
if (retval) {
|
if (retval) {
|
||||||
|
mHangAnnotationFlags |= kHangUIShown;
|
||||||
/* Once the UI is shown we switch the timeout over to use
|
/* Once the UI is shown we switch the timeout over to use
|
||||||
kChildTimeoutPref, allowing us to terminate a hung plugin
|
kChildTimeoutPref, allowing us to terminate a hung plugin
|
||||||
after kChildTimeoutPref seconds if the user doesn't respond to
|
after kChildTimeoutPref seconds if the user doesn't respond to
|
||||||
|
@ -636,6 +672,12 @@ PluginModuleParent::FinishHangUI()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginModuleParent::OnHangUIContinue()
|
||||||
|
{
|
||||||
|
mHangAnnotationFlags |= kHangUIContinued;
|
||||||
|
}
|
||||||
#endif // XP_WIN
|
#endif // XP_WIN
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
|
@ -1263,6 +1305,10 @@ PluginModuleParent::NPP_New(NPMIMEType pluginType, NPP instance,
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mPluginName.IsEmpty()) {
|
||||||
|
GetPluginDetails(mPluginName, mPluginVersion);
|
||||||
|
}
|
||||||
|
|
||||||
// create the instance on the other side
|
// create the instance on the other side
|
||||||
InfallibleTArray<nsCString> names;
|
InfallibleTArray<nsCString> names;
|
||||||
InfallibleTArray<nsCString> values;
|
InfallibleTArray<nsCString> values;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include "base/process.h"
|
#include "base/process.h"
|
||||||
#include "mozilla/FileUtils.h"
|
#include "mozilla/FileUtils.h"
|
||||||
|
#include "mozilla/HangMonitor.h"
|
||||||
#include "mozilla/PluginLibrary.h"
|
#include "mozilla/PluginLibrary.h"
|
||||||
#include "mozilla/plugins/ScopedMethodFactory.h"
|
#include "mozilla/plugins/ScopedMethodFactory.h"
|
||||||
#include "mozilla/plugins/PluginProcessParent.h"
|
#include "mozilla/plugins/PluginProcessParent.h"
|
||||||
|
@ -59,6 +60,7 @@ class PluginModuleParent
|
||||||
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
#ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||||
, public CrashReporter::InjectorCrashCallback
|
, public CrashReporter::InjectorCrashCallback
|
||||||
#endif
|
#endif
|
||||||
|
, public mozilla::HangMonitor::Annotator
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef mozilla::PluginLibrary PluginLibrary;
|
typedef mozilla::PluginLibrary PluginLibrary;
|
||||||
|
@ -112,9 +114,22 @@ public:
|
||||||
|
|
||||||
void TerminateChildProcess(MessageLoop* aMsgLoop);
|
void TerminateChildProcess(MessageLoop* aMsgLoop);
|
||||||
|
|
||||||
#ifdef XP_WIN
|
virtual void
|
||||||
void
|
EnteredCxxStack() MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void
|
||||||
ExitedCxxStack() MOZ_OVERRIDE;
|
ExitedCxxStack() MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void
|
||||||
|
AnnotateHang(mozilla::HangMonitor::HangAnnotations& aAnnotations) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
#ifdef XP_WIN
|
||||||
|
/**
|
||||||
|
* Called by Plugin Hang UI to notify that the user has clicked continue.
|
||||||
|
* Used for chrome hang annotations.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
OnHangUIContinue();
|
||||||
#endif // XP_WIN
|
#endif // XP_WIN
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -287,6 +302,16 @@ private:
|
||||||
nsString mBrowserDumpID;
|
nsString mBrowserDumpID;
|
||||||
nsString mHangID;
|
nsString mHangID;
|
||||||
nsRefPtr<nsIObserver> mProfilerObserver;
|
nsRefPtr<nsIObserver> mProfilerObserver;
|
||||||
|
enum HangAnnotationFlags
|
||||||
|
{
|
||||||
|
kInPluginCall = (1u << 0),
|
||||||
|
kHangUIShown = (1u << 1),
|
||||||
|
kHangUIContinued = (1u << 2),
|
||||||
|
kHangUIDontShow = (1u << 3)
|
||||||
|
};
|
||||||
|
Atomic<uint32_t> mHangAnnotationFlags;
|
||||||
|
nsCString mPluginName;
|
||||||
|
nsCString mPluginVersion;
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
InfallibleTArray<float> mPluginCpuUsageOnHang;
|
InfallibleTArray<float> mPluginCpuUsageOnHang;
|
||||||
PluginHangUIParent *mHangUIParent;
|
PluginHangUIParent *mHangUIParent;
|
||||||
|
@ -307,9 +332,6 @@ private:
|
||||||
void
|
void
|
||||||
EvaluateHangUIState(const bool aReset);
|
EvaluateHangUIState(const bool aReset);
|
||||||
|
|
||||||
bool
|
|
||||||
GetPluginName(nsAString& aPluginName);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launches the Plugin Hang UI.
|
* Launches the Plugin Hang UI.
|
||||||
*
|
*
|
||||||
|
@ -327,6 +349,9 @@ private:
|
||||||
FinishHangUI();
|
FinishHangUI();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool
|
||||||
|
GetPluginDetails(nsACString& aPluginName, nsACString& aPluginVersion);
|
||||||
|
|
||||||
#ifdef MOZ_X11
|
#ifdef MOZ_X11
|
||||||
// Dup of plugin's X socket, used to scope its resources to this
|
// Dup of plugin's X socket, used to scope its resources to this
|
||||||
// object instead of the plugin process's lifetime
|
// object instead of the plugin process's lifetime
|
||||||
|
|
|
@ -10,7 +10,7 @@ const Cc = Components.classes;
|
||||||
const Ci = Components.interfaces;
|
const Ci = Components.interfaces;
|
||||||
const Cu = Components.utils;
|
const Cu = Components.utils;
|
||||||
|
|
||||||
this.EXPORTED_SYMBOLS = ["SettingsRequestManager"];
|
this.EXPORTED_SYMBOLS = [];
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/SettingsDB.jsm");
|
Cu.import("resource://gre/modules/SettingsDB.jsm");
|
||||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
|
@ -159,7 +159,7 @@ static bool SignMask(JSContext *cx, unsigned argc, Value *vp)
|
||||||
|
|
||||||
#define SIGN_MASK(type) \
|
#define SIGN_MASK(type) \
|
||||||
static bool type##SignMask(JSContext *cx, unsigned argc, Value *vp) { \
|
static bool type##SignMask(JSContext *cx, unsigned argc, Value *vp) { \
|
||||||
return SignMask<Int32x4>(cx, argc, vp); \
|
return SignMask<type>(cx, argc, vp); \
|
||||||
}
|
}
|
||||||
SIGN_MASK(Float32x4);
|
SIGN_MASK(Float32x4);
|
||||||
SIGN_MASK(Int32x4);
|
SIGN_MASK(Int32x4);
|
||||||
|
@ -785,6 +785,25 @@ Int32x4BinaryScalar(JSContext *cx, unsigned argc, Value *vp)
|
||||||
return StoreResult<Int32x4>(cx, args, result);
|
return StoreResult<Int32x4>(cx, args, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename In, template<typename C> class Op>
|
||||||
|
static bool
|
||||||
|
CompareFunc(JSContext *cx, unsigned argc, Value *vp)
|
||||||
|
{
|
||||||
|
typedef typename In::Elem InElem;
|
||||||
|
|
||||||
|
CallArgs args = CallArgsFromVp(argc, vp);
|
||||||
|
if (args.length() != 2 || !IsVectorObject<In>(args[0]) || !IsVectorObject<In>(args[1]))
|
||||||
|
return ErrorBadArgs(cx);
|
||||||
|
|
||||||
|
int32_t result[Int32x4::lanes];
|
||||||
|
InElem *left = TypedObjectMemory<InElem *>(args[0]);
|
||||||
|
InElem *right = TypedObjectMemory<InElem *>(args[1]);
|
||||||
|
for (unsigned i = 0; i < Int32x4::lanes; i++)
|
||||||
|
result[i] = Op<InElem>::apply(left[i], right[i]);
|
||||||
|
|
||||||
|
return StoreResult<Int32x4>(cx, args, result);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename V, typename Vret>
|
template<typename V, typename Vret>
|
||||||
static bool
|
static bool
|
||||||
FuncConvert(JSContext *cx, unsigned argc, Value *vp)
|
FuncConvert(JSContext *cx, unsigned argc, Value *vp)
|
||||||
|
|
|
@ -36,15 +36,15 @@
|
||||||
V(add, (BinaryFunc<Float32x4, Add, Float32x4>), 2, 0) \
|
V(add, (BinaryFunc<Float32x4, Add, Float32x4>), 2, 0) \
|
||||||
V(and, (CoercedBinaryFunc<Float32x4, Int32x4, And, Float32x4>), 2, 0) \
|
V(and, (CoercedBinaryFunc<Float32x4, Int32x4, And, Float32x4>), 2, 0) \
|
||||||
V(div, (BinaryFunc<Float32x4, Div, Float32x4>), 2, 0) \
|
V(div, (BinaryFunc<Float32x4, Div, Float32x4>), 2, 0) \
|
||||||
V(equal, (BinaryFunc<Float32x4, Equal, Int32x4>), 2, 0) \
|
V(equal, (CompareFunc<Float32x4, Equal>), 2, 0) \
|
||||||
V(greaterThan, (BinaryFunc<Float32x4, GreaterThan, Int32x4>), 2, 0) \
|
V(greaterThan, (CompareFunc<Float32x4, GreaterThan>), 2, 0) \
|
||||||
V(greaterThanOrEqual, (BinaryFunc<Float32x4, GreaterThanOrEqual, Int32x4>), 2, 0) \
|
V(greaterThanOrEqual, (CompareFunc<Float32x4, GreaterThanOrEqual>), 2, 0) \
|
||||||
V(lessThan, (BinaryFunc<Float32x4, LessThan, Int32x4>), 2, 0) \
|
V(lessThan, (CompareFunc<Float32x4, LessThan>), 2, 0) \
|
||||||
V(lessThanOrEqual, (BinaryFunc<Float32x4, LessThanOrEqual, Int32x4>), 2, 0) \
|
V(lessThanOrEqual, (CompareFunc<Float32x4, LessThanOrEqual>), 2, 0) \
|
||||||
V(max, (BinaryFunc<Float32x4, Maximum, Float32x4>), 2, 0) \
|
V(max, (BinaryFunc<Float32x4, Maximum, Float32x4>), 2, 0) \
|
||||||
V(min, (BinaryFunc<Float32x4, Minimum, Float32x4>), 2, 0) \
|
V(min, (BinaryFunc<Float32x4, Minimum, Float32x4>), 2, 0) \
|
||||||
V(mul, (BinaryFunc<Float32x4, Mul, Float32x4>), 2, 0) \
|
V(mul, (BinaryFunc<Float32x4, Mul, Float32x4>), 2, 0) \
|
||||||
V(notEqual, (BinaryFunc<Float32x4, NotEqual, Int32x4>), 2, 0) \
|
V(notEqual, (CompareFunc<Float32x4, NotEqual>), 2, 0) \
|
||||||
V(or, (CoercedBinaryFunc<Float32x4, Int32x4, Or, Float32x4>), 2, 0) \
|
V(or, (CoercedBinaryFunc<Float32x4, Int32x4, Or, Float32x4>), 2, 0) \
|
||||||
V(scale, (FuncWith<Float32x4, Scale>), 2, 0) \
|
V(scale, (FuncWith<Float32x4, Scale>), 2, 0) \
|
||||||
V(sub, (BinaryFunc<Float32x4, Sub, Float32x4>), 2, 0) \
|
V(sub, (BinaryFunc<Float32x4, Sub, Float32x4>), 2, 0) \
|
||||||
|
@ -82,9 +82,9 @@
|
||||||
#define INT32X4_BINARY_FUNCTION_LIST(V) \
|
#define INT32X4_BINARY_FUNCTION_LIST(V) \
|
||||||
V(add, (BinaryFunc<Int32x4, Add, Int32x4>), 2, 0) \
|
V(add, (BinaryFunc<Int32x4, Add, Int32x4>), 2, 0) \
|
||||||
V(and, (BinaryFunc<Int32x4, And, Int32x4>), 2, 0) \
|
V(and, (BinaryFunc<Int32x4, And, Int32x4>), 2, 0) \
|
||||||
V(equal, (BinaryFunc<Int32x4, Equal, Int32x4>), 2, 0) \
|
V(equal, (CompareFunc<Int32x4, Equal>), 2, 0) \
|
||||||
V(greaterThan, (BinaryFunc<Int32x4, GreaterThan, Int32x4>), 2, 0) \
|
V(greaterThan, (CompareFunc<Int32x4, GreaterThan>), 2, 0) \
|
||||||
V(lessThan, (BinaryFunc<Int32x4, LessThan, Int32x4>), 2, 0) \
|
V(lessThan, (CompareFunc<Int32x4, LessThan>), 2, 0) \
|
||||||
V(mul, (BinaryFunc<Int32x4, Mul, Int32x4>), 2, 0) \
|
V(mul, (BinaryFunc<Int32x4, Mul, Int32x4>), 2, 0) \
|
||||||
V(or, (BinaryFunc<Int32x4, Or, Int32x4>), 2, 0) \
|
V(or, (BinaryFunc<Int32x4, Or, Int32x4>), 2, 0) \
|
||||||
V(sub, (BinaryFunc<Int32x4, Sub, Int32x4>), 2, 0) \
|
V(sub, (BinaryFunc<Int32x4, Sub, Int32x4>), 2, 0) \
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsIXPConnect.h"
|
#include "nsIXPConnect.h"
|
||||||
#include "nsIJSNativeInitializer.h"
|
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
|
|
|
@ -724,7 +724,6 @@ pref("app.orientation.default", "");
|
||||||
// back to the system.
|
// back to the system.
|
||||||
pref("memory.free_dirty_pages", true);
|
pref("memory.free_dirty_pages", true);
|
||||||
|
|
||||||
pref("layout.imagevisibility.enabled", true);
|
|
||||||
pref("layout.imagevisibility.numscrollportwidths", 1);
|
pref("layout.imagevisibility.numscrollportwidths", 1);
|
||||||
pref("layout.imagevisibility.numscrollportheights", 1);
|
pref("layout.imagevisibility.numscrollportheights", 1);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
PACKAGE_NAME = 'mozdevice'
|
PACKAGE_NAME = 'mozdevice'
|
||||||
PACKAGE_VERSION = '0.42'
|
PACKAGE_VERSION = '0.43'
|
||||||
|
|
||||||
deps = ['mozfile >= 1.0',
|
deps = ['mozfile >= 1.0',
|
||||||
'mozlog >= 2.1',
|
'mozlog >= 2.1',
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
#include "mozilla/PoisonIOInterposer.h"
|
#include "mozilla/PoisonIOInterposer.h"
|
||||||
#include "mozilla/StartupTimeline.h"
|
#include "mozilla/StartupTimeline.h"
|
||||||
#if defined(MOZ_ENABLE_PROFILER_SPS)
|
#if defined(MOZ_ENABLE_PROFILER_SPS)
|
||||||
|
#include "mozilla/HangMonitor.h"
|
||||||
#include "shared-libraries.h"
|
#include "shared-libraries.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ namespace {
|
||||||
|
|
||||||
using namespace base;
|
using namespace base;
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
using namespace mozilla::HangMonitor;
|
||||||
|
|
||||||
template<class EntryType>
|
template<class EntryType>
|
||||||
class AutoHashtable : public nsTHashtable<EntryType>
|
class AutoHashtable : public nsTHashtable<EntryType>
|
||||||
|
@ -208,14 +210,38 @@ CombinedStacks::SizeOfExcludingThis() const {
|
||||||
|
|
||||||
class HangReports {
|
class HangReports {
|
||||||
public:
|
public:
|
||||||
size_t SizeOfExcludingThis() const;
|
/**
|
||||||
|
* This struct encapsulates information for an individual ChromeHang annotation.
|
||||||
|
* mHangIndex is the index of the corresponding ChromeHang.
|
||||||
|
*/
|
||||||
|
struct AnnotationInfo {
|
||||||
|
AnnotationInfo(uint32_t aHangIndex,
|
||||||
|
HangAnnotations* aAnnotations)
|
||||||
|
: mHangIndex(aHangIndex)
|
||||||
|
, mAnnotations(aAnnotations)
|
||||||
|
{}
|
||||||
|
AnnotationInfo(const AnnotationInfo& aOther)
|
||||||
|
: mHangIndex(aOther.mHangIndex)
|
||||||
|
, mAnnotations(aOther.mAnnotations)
|
||||||
|
{}
|
||||||
|
~AnnotationInfo() {}
|
||||||
|
uint32_t mHangIndex;
|
||||||
|
mutable nsAutoPtr<HangAnnotations> mAnnotations;
|
||||||
|
};
|
||||||
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||||
void AddHang(const Telemetry::ProcessedStack& aStack, uint32_t aDuration,
|
void AddHang(const Telemetry::ProcessedStack& aStack, uint32_t aDuration,
|
||||||
int32_t aSystemUptime, int32_t aFirefoxUptime);
|
int32_t aSystemUptime, int32_t aFirefoxUptime,
|
||||||
|
HangAnnotations* aAnnotations);
|
||||||
uint32_t GetDuration(unsigned aIndex) const;
|
uint32_t GetDuration(unsigned aIndex) const;
|
||||||
int32_t GetSystemUptime(unsigned aIndex) const;
|
int32_t GetSystemUptime(unsigned aIndex) const;
|
||||||
int32_t GetFirefoxUptime(unsigned aIndex) const;
|
int32_t GetFirefoxUptime(unsigned aIndex) const;
|
||||||
|
const std::vector<AnnotationInfo>& GetAnnotationInfo() const;
|
||||||
const CombinedStacks& GetStacks() const;
|
const CombinedStacks& GetStacks() const;
|
||||||
private:
|
private:
|
||||||
|
/**
|
||||||
|
* This struct encapsulates the data for an individual ChromeHang, excluding
|
||||||
|
* annotations.
|
||||||
|
*/
|
||||||
struct HangInfo {
|
struct HangInfo {
|
||||||
// Hang duration (in seconds)
|
// Hang duration (in seconds)
|
||||||
uint32_t mDuration;
|
uint32_t mDuration;
|
||||||
|
@ -225,6 +251,7 @@ private:
|
||||||
int32_t mFirefoxUptime;
|
int32_t mFirefoxUptime;
|
||||||
};
|
};
|
||||||
std::vector<HangInfo> mHangInfo;
|
std::vector<HangInfo> mHangInfo;
|
||||||
|
std::vector<AnnotationInfo> mAnnotationInfo;
|
||||||
CombinedStacks mStacks;
|
CombinedStacks mStacks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -232,19 +259,30 @@ void
|
||||||
HangReports::AddHang(const Telemetry::ProcessedStack& aStack,
|
HangReports::AddHang(const Telemetry::ProcessedStack& aStack,
|
||||||
uint32_t aDuration,
|
uint32_t aDuration,
|
||||||
int32_t aSystemUptime,
|
int32_t aSystemUptime,
|
||||||
int32_t aFirefoxUptime) {
|
int32_t aFirefoxUptime,
|
||||||
|
HangAnnotations* aAnnotations) {
|
||||||
HangInfo info = { aDuration, aSystemUptime, aFirefoxUptime };
|
HangInfo info = { aDuration, aSystemUptime, aFirefoxUptime };
|
||||||
mHangInfo.push_back(info);
|
mHangInfo.push_back(info);
|
||||||
|
if (aAnnotations) {
|
||||||
|
AnnotationInfo ainfo(static_cast<uint32_t>(mHangInfo.size() - 1),
|
||||||
|
aAnnotations);
|
||||||
|
mAnnotationInfo.push_back(ainfo);
|
||||||
|
}
|
||||||
mStacks.AddStack(aStack);
|
mStacks.AddStack(aStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
HangReports::SizeOfExcludingThis() const {
|
HangReports::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
n += mStacks.SizeOfExcludingThis();
|
n += mStacks.SizeOfExcludingThis();
|
||||||
// This is a crude approximation. See comment on
|
// This is a crude approximation. See comment on
|
||||||
// CombinedStacks::SizeOfExcludingThis.
|
// CombinedStacks::SizeOfExcludingThis.
|
||||||
n += mHangInfo.capacity() * sizeof(HangInfo);
|
n += mHangInfo.capacity() * sizeof(HangInfo);
|
||||||
|
n += mAnnotationInfo.capacity() * sizeof(AnnotationInfo);
|
||||||
|
for (std::vector<AnnotationInfo>::const_iterator i = mAnnotationInfo.begin(),
|
||||||
|
e = mAnnotationInfo.end(); i != e; ++i) {
|
||||||
|
n += i->mAnnotations->SizeOfIncludingThis(aMallocSizeOf);
|
||||||
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,6 +306,11 @@ HangReports::GetFirefoxUptime(unsigned aIndex) const {
|
||||||
return mHangInfo[aIndex].mFirefoxUptime;
|
return mHangInfo[aIndex].mFirefoxUptime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::vector<HangReports::AnnotationInfo>&
|
||||||
|
HangReports::GetAnnotationInfo() const {
|
||||||
|
return mAnnotationInfo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IOInterposeObserver recording statistics of main-thread I/O during execution,
|
* IOInterposeObserver recording statistics of main-thread I/O during execution,
|
||||||
* aimed at consumption by TelemetryImpl
|
* aimed at consumption by TelemetryImpl
|
||||||
|
@ -575,7 +618,8 @@ public:
|
||||||
static void RecordChromeHang(uint32_t aDuration,
|
static void RecordChromeHang(uint32_t aDuration,
|
||||||
Telemetry::ProcessedStack &aStack,
|
Telemetry::ProcessedStack &aStack,
|
||||||
int32_t aSystemUptime,
|
int32_t aSystemUptime,
|
||||||
int32_t aFirefoxUptime);
|
int32_t aFirefoxUptime,
|
||||||
|
HangAnnotations* aAnnotations);
|
||||||
#endif
|
#endif
|
||||||
static void RecordThreadHangStats(Telemetry::ThreadHangStats& aStats);
|
static void RecordThreadHangStats(Telemetry::ThreadHangStats& aStats);
|
||||||
static nsresult GetHistogramEnumId(const char *name, Telemetry::ID *id);
|
static nsresult GetHistogramEnumId(const char *name, Telemetry::ID *id);
|
||||||
|
@ -1798,7 +1842,9 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, JS::MutableHandle<JS::Value> ret)
|
||||||
JS::Rooted<JSObject*> durationArray(cx, JS_NewArrayObject(cx, 0));
|
JS::Rooted<JSObject*> durationArray(cx, JS_NewArrayObject(cx, 0));
|
||||||
JS::Rooted<JSObject*> systemUptimeArray(cx, JS_NewArrayObject(cx, 0));
|
JS::Rooted<JSObject*> systemUptimeArray(cx, JS_NewArrayObject(cx, 0));
|
||||||
JS::Rooted<JSObject*> firefoxUptimeArray(cx, JS_NewArrayObject(cx, 0));
|
JS::Rooted<JSObject*> firefoxUptimeArray(cx, JS_NewArrayObject(cx, 0));
|
||||||
if (!durationArray || !systemUptimeArray || !firefoxUptimeArray) {
|
JS::Rooted<JSObject*> annotationsArray(cx, JS_NewArrayObject(cx, 0));
|
||||||
|
if (!durationArray || !systemUptimeArray || !firefoxUptimeArray ||
|
||||||
|
!annotationsArray) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1820,6 +1866,13 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, JS::MutableHandle<JS::Value> ret)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ok = JS_DefineProperty(cx, fullReportObj, "annotations", annotationsArray,
|
||||||
|
JSPROP_ENUMERATE);
|
||||||
|
if (!ok) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const size_t length = stacks.GetStackCount();
|
const size_t length = stacks.GetStackCount();
|
||||||
for (size_t i = 0; i < length; ++i) {
|
for (size_t i = 0; i < length; ++i) {
|
||||||
if (!JS_SetElement(cx, durationArray, i, mHangReports.GetDuration(i))) {
|
if (!JS_SetElement(cx, durationArray, i, mHangReports.GetDuration(i))) {
|
||||||
|
@ -1831,6 +1884,49 @@ TelemetryImpl::GetChromeHangs(JSContext *cx, JS::MutableHandle<JS::Value> ret)
|
||||||
if (!JS_SetElement(cx, firefoxUptimeArray, i, mHangReports.GetFirefoxUptime(i))) {
|
if (!JS_SetElement(cx, firefoxUptimeArray, i, mHangReports.GetFirefoxUptime(i))) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
const std::vector<HangReports::AnnotationInfo>& annotationInfo =
|
||||||
|
mHangReports.GetAnnotationInfo();
|
||||||
|
uint32_t annotationsArrayIndex = 0;
|
||||||
|
for (std::vector<HangReports::AnnotationInfo>::const_iterator
|
||||||
|
ai = annotationInfo.begin(), e = annotationInfo.end(); ai != e;
|
||||||
|
++ai, ++annotationsArrayIndex) {
|
||||||
|
JS::Rooted<JSObject*> keyValueArray(cx, JS_NewArrayObject(cx, 0));
|
||||||
|
if (!keyValueArray) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
JS::RootedValue indexValue(cx);
|
||||||
|
indexValue.setNumber(ai->mHangIndex);
|
||||||
|
if (!JS_SetElement(cx, keyValueArray, 0, indexValue)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
JS::Rooted<JSObject*> jsAnnotation(cx, JS_NewObject(cx, nullptr,
|
||||||
|
JS::NullPtr(),
|
||||||
|
JS::NullPtr()));
|
||||||
|
if (!jsAnnotation) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
nsAutoPtr<HangAnnotations::Enumerator> annotationsEnum;
|
||||||
|
if (!ai->mAnnotations->GetEnumerator(annotationsEnum.StartAssignment())) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
nsAutoString key;
|
||||||
|
nsAutoString value;
|
||||||
|
while (annotationsEnum->Next(key, value)) {
|
||||||
|
JS::RootedValue jsValue(cx);
|
||||||
|
jsValue.setString(JS_NewUCStringCopyN(cx, value.get(), value.Length()));
|
||||||
|
if (!JS_DefineUCProperty(cx, jsAnnotation, key.get(), key.Length(),
|
||||||
|
jsValue, JSPROP_ENUMERATE)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!JS_SetElement(cx, keyValueArray, 1, jsAnnotation)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
if (!JS_SetElement(cx, annotationsArray, annotationsArrayIndex,
|
||||||
|
keyValueArray)) {
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -2543,7 +2639,8 @@ void
|
||||||
TelemetryImpl::RecordChromeHang(uint32_t aDuration,
|
TelemetryImpl::RecordChromeHang(uint32_t aDuration,
|
||||||
Telemetry::ProcessedStack &aStack,
|
Telemetry::ProcessedStack &aStack,
|
||||||
int32_t aSystemUptime,
|
int32_t aSystemUptime,
|
||||||
int32_t aFirefoxUptime)
|
int32_t aFirefoxUptime,
|
||||||
|
HangAnnotations* aAnnotations)
|
||||||
{
|
{
|
||||||
if (!sTelemetry || !sTelemetry->mCanRecord)
|
if (!sTelemetry || !sTelemetry->mCanRecord)
|
||||||
return;
|
return;
|
||||||
|
@ -2551,7 +2648,8 @@ TelemetryImpl::RecordChromeHang(uint32_t aDuration,
|
||||||
MutexAutoLock hangReportMutex(sTelemetry->mHangReportsMutex);
|
MutexAutoLock hangReportMutex(sTelemetry->mHangReportsMutex);
|
||||||
|
|
||||||
sTelemetry->mHangReports.AddHang(aStack, aDuration,
|
sTelemetry->mHangReports.AddHang(aStack, aDuration,
|
||||||
aSystemUptime, aFirefoxUptime);
|
aSystemUptime, aFirefoxUptime,
|
||||||
|
aAnnotations);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2641,7 +2739,7 @@ TelemetryImpl::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||||
n += mTrackedDBs.SizeOfExcludingThis(aMallocSizeOf);
|
n += mTrackedDBs.SizeOfExcludingThis(aMallocSizeOf);
|
||||||
{ // Scope for mHangReportsMutex lock
|
{ // Scope for mHangReportsMutex lock
|
||||||
MutexAutoLock lock(mHangReportsMutex);
|
MutexAutoLock lock(mHangReportsMutex);
|
||||||
n += mHangReports.SizeOfExcludingThis();
|
n += mHangReports.SizeOfExcludingThis(aMallocSizeOf);
|
||||||
}
|
}
|
||||||
{ // Scope for mThreadHangStatsMutex lock
|
{ // Scope for mThreadHangStatsMutex lock
|
||||||
MutexAutoLock lock(mThreadHangStatsMutex);
|
MutexAutoLock lock(mThreadHangStatsMutex);
|
||||||
|
@ -2797,10 +2895,11 @@ void Init()
|
||||||
void RecordChromeHang(uint32_t duration,
|
void RecordChromeHang(uint32_t duration,
|
||||||
ProcessedStack &aStack,
|
ProcessedStack &aStack,
|
||||||
int32_t aSystemUptime,
|
int32_t aSystemUptime,
|
||||||
int32_t aFirefoxUptime)
|
int32_t aFirefoxUptime,
|
||||||
|
HangAnnotations* aAnnotations)
|
||||||
{
|
{
|
||||||
TelemetryImpl::RecordChromeHang(duration, aStack,
|
TelemetryImpl::RecordChromeHang(duration, aStack,
|
||||||
aSystemUptime, aFirefoxUptime);
|
aSystemUptime, aFirefoxUptime, aAnnotations);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@ namespace base {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
namespace HangMonitor {
|
||||||
|
class HangAnnotations;
|
||||||
|
}
|
||||||
namespace Telemetry {
|
namespace Telemetry {
|
||||||
|
|
||||||
#include "TelemetryHistogramEnums.h"
|
#include "TelemetryHistogramEnums.h"
|
||||||
|
@ -195,12 +198,14 @@ class ProcessedStack;
|
||||||
* @param aStack - Array of PCs from the hung call stack
|
* @param aStack - Array of PCs from the hung call stack
|
||||||
* @param aSystemUptime - System uptime at the time of the hang, in minutes
|
* @param aSystemUptime - System uptime at the time of the hang, in minutes
|
||||||
* @param aFirefoxUptime - Firefox uptime at the time of the hang, in minutes
|
* @param aFirefoxUptime - Firefox uptime at the time of the hang, in minutes
|
||||||
|
* @param aAnnotations - Any annotations to be added to the report
|
||||||
*/
|
*/
|
||||||
#if defined(MOZ_ENABLE_PROFILER_SPS)
|
#if defined(MOZ_ENABLE_PROFILER_SPS)
|
||||||
void RecordChromeHang(uint32_t aDuration,
|
void RecordChromeHang(uint32_t aDuration,
|
||||||
ProcessedStack &aStack,
|
ProcessedStack &aStack,
|
||||||
int32_t aSystemUptime,
|
int32_t aSystemUptime,
|
||||||
int32_t aFirefoxUptime);
|
int32_t aFirefoxUptime,
|
||||||
|
mozilla::HangMonitor::HangAnnotations* aAnnotations = nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class ThreadHangStats;
|
class ThreadHangStats;
|
||||||
|
|
|
@ -95,6 +95,35 @@ CopySections(const unsigned char *data, PIMAGE_NT_HEADERS old_headers, PMEMORYMO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
CopyRegion(HANDLE hRemoteProcess, void* remoteAddress, void* localAddress, DWORD size, DWORD protect)
|
||||||
|
{
|
||||||
|
if (size > 0) {
|
||||||
|
// Copy the data from local->remote and set the memory protection
|
||||||
|
if (!VirtualAllocEx(hRemoteProcess, remoteAddress, size, MEM_COMMIT, PAGE_READWRITE))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!WriteProcessMemory(hRemoteProcess,
|
||||||
|
remoteAddress,
|
||||||
|
localAddress,
|
||||||
|
size,
|
||||||
|
nullptr)) {
|
||||||
|
#ifdef DEBUG_OUTPUT
|
||||||
|
OutputLastError("Error writing remote memory.\n");
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD oldProtect;
|
||||||
|
if (VirtualProtectEx(hRemoteProcess, remoteAddress, size, protect, &oldProtect) == 0) {
|
||||||
|
#ifdef DEBUG_OUTPUT
|
||||||
|
OutputLastError("Error protecting memory page");
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// Protection flags for memory pages (Executable, Readable, Writeable)
|
// Protection flags for memory pages (Executable, Readable, Writeable)
|
||||||
static int ProtectionFlags[2][2][2] = {
|
static int ProtectionFlags[2][2][2] = {
|
||||||
{
|
{
|
||||||
|
@ -117,11 +146,20 @@ FinalizeSections(PMEMORYMODULE module, HANDLE hRemoteProcess)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
int numSections = module->headers->FileHeader.NumberOfSections;
|
||||||
|
|
||||||
|
if (numSections < 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers);
|
PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers);
|
||||||
|
|
||||||
|
// Copy any data before the first section (i.e. the image header)
|
||||||
|
if (!CopyRegion(hRemoteProcess, module->remoteCodeBase, module->localCodeBase, section->VirtualAddress, PAGE_READONLY))
|
||||||
|
return false;
|
||||||
|
|
||||||
// loop through all sections and change access flags
|
// loop through all sections and change access flags
|
||||||
for (i=0; i<module->headers->FileHeader.NumberOfSections; i++, section++) {
|
for (i=0; i<numSections; i++, section++) {
|
||||||
DWORD protect, oldProtect, size;
|
DWORD protect, size;
|
||||||
int executable = (section->Characteristics & IMAGE_SCN_MEM_EXECUTE) != 0;
|
int executable = (section->Characteristics & IMAGE_SCN_MEM_EXECUTE) != 0;
|
||||||
int readable = (section->Characteristics & IMAGE_SCN_MEM_READ) != 0;
|
int readable = (section->Characteristics & IMAGE_SCN_MEM_READ) != 0;
|
||||||
int writeable = (section->Characteristics & IMAGE_SCN_MEM_WRITE) != 0;
|
int writeable = (section->Characteristics & IMAGE_SCN_MEM_WRITE) != 0;
|
||||||
|
@ -132,39 +170,17 @@ FinalizeSections(PMEMORYMODULE module, HANDLE hRemoteProcess)
|
||||||
protect |= PAGE_NOCACHE;
|
protect |= PAGE_NOCACHE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* remoteAddress = module->remoteCodeBase + section->VirtualAddress;
|
||||||
|
void* localAddress = module->localCodeBase + section->VirtualAddress;
|
||||||
|
|
||||||
// determine size of region
|
// determine size of region
|
||||||
size = section->Misc.VirtualSize;
|
size = section->Misc.VirtualSize;
|
||||||
if (size > 0) {
|
|
||||||
void* remoteAddress = module->remoteCodeBase + section->VirtualAddress;
|
|
||||||
void* localAddress = module->localCodeBase + section->VirtualAddress;
|
|
||||||
|
|
||||||
#ifdef DEBUG_OUTPUT
|
#ifdef DEBUG_OUTPUT
|
||||||
fprintf(stderr, "Copying section %s to %p, size %x, executable %i readable %i writeable %i\n",
|
fprintf(stderr, "Copying section %s to %p, size %x, executable %i readable %i writeable %i\n",
|
||||||
section->Name, remoteAddress, size, executable, readable, writeable);
|
section->Name, remoteAddress, size, executable, readable, writeable);
|
||||||
#endif
|
#endif
|
||||||
|
if (!CopyRegion(hRemoteProcess, remoteAddress, localAddress, size, protect))
|
||||||
// Copy the data from local->remote and set the memory protection
|
return false;
|
||||||
if (!VirtualAllocEx(hRemoteProcess, remoteAddress, size, MEM_COMMIT, PAGE_READWRITE))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!WriteProcessMemory(hRemoteProcess,
|
|
||||||
remoteAddress,
|
|
||||||
localAddress,
|
|
||||||
size,
|
|
||||||
nullptr)) {
|
|
||||||
#ifdef DEBUG_OUTPUT
|
|
||||||
OutputLastError("Error writing remote memory.\n");
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VirtualProtectEx(hRemoteProcess, remoteAddress, size, protect, &oldProtect) == 0) {
|
|
||||||
#ifdef DEBUG_OUTPUT
|
|
||||||
OutputLastError("Error protecting memory page");
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ function TouchEventHandler (window) {
|
||||||
|
|
||||||
let TouchEventHandler = {
|
let TouchEventHandler = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
events: ['mousedown', 'mousemove', 'mouseup'],
|
events: ['mousedown', 'mousemove', 'mouseup', 'touchstart', 'touchend'],
|
||||||
start: function teh_start() {
|
start: function teh_start() {
|
||||||
if (this.enabled)
|
if (this.enabled)
|
||||||
return false;
|
return false;
|
||||||
|
@ -61,18 +61,43 @@ function TouchEventHandler (window) {
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
},
|
},
|
||||||
handleEvent: function teh_handleEvent(evt) {
|
handleEvent: function teh_handleEvent(evt) {
|
||||||
// Ignore all but real mouse event coming from physical mouse
|
|
||||||
// (especially ignore mouse event being dispatched from a touch event)
|
|
||||||
if (evt.button || evt.mozInputSource != Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE || evt.isSynthesized) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The gaia system window use an hybrid system even on the device which is
|
// The gaia system window use an hybrid system even on the device which is
|
||||||
// a mix of mouse/touch events. So let's not cancel *all* mouse events
|
// a mix of mouse/touch events. So let's not cancel *all* mouse events
|
||||||
// if it is the current target.
|
// if it is the current target.
|
||||||
let content = this.getContent(evt.target);
|
let content = this.getContent(evt.target);
|
||||||
let isSystemWindow = content.location.toString().indexOf("system.gaiamobile.org") != -1;
|
let isSystemWindow = content.location.toString().indexOf("system.gaiamobile.org") != -1;
|
||||||
|
|
||||||
|
// App touchstart & touchend should also be dispatched on the system app
|
||||||
|
// to match on-device behavior.
|
||||||
|
if (evt.type.startsWith('touch') && !isSystemWindow) {
|
||||||
|
let sysFrame = content.realFrameElement;
|
||||||
|
let sysDocument = sysFrame.ownerDocument;
|
||||||
|
let sysWindow = sysDocument.defaultView;
|
||||||
|
|
||||||
|
let touchEvent = sysDocument.createEvent('touchevent');
|
||||||
|
let touch = evt.touches[0] || evt.changedTouches[0];
|
||||||
|
let point = sysDocument.createTouch(sysWindow, sysFrame, 0,
|
||||||
|
touch.pageX, touch.pageY,
|
||||||
|
touch.screenX, touch.screenY,
|
||||||
|
touch.clientX, touch.clientY,
|
||||||
|
1, 1, 0, 0);
|
||||||
|
|
||||||
|
let touches = sysDocument.createTouchList(point);
|
||||||
|
let targetTouches = touches;
|
||||||
|
let changedTouches = touches;
|
||||||
|
touchEvent.initTouchEvent(evt.type, true, true, sysWindow, 0,
|
||||||
|
false, false, false, false,
|
||||||
|
touches, targetTouches, changedTouches);
|
||||||
|
sysFrame.dispatchEvent(touchEvent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore all but real mouse event coming from physical mouse
|
||||||
|
// (especially ignore mouse event being dispatched from a touch event)
|
||||||
|
if (evt.button || evt.mozInputSource != Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE || evt.isSynthesized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let eventTarget = this.target;
|
let eventTarget = this.target;
|
||||||
let type = '';
|
let type = '';
|
||||||
switch (evt.type) {
|
switch (evt.type) {
|
||||||
|
|
|
@ -118,6 +118,8 @@ if CONFIG['MOZ_UNIVERSALCHARDET']:
|
||||||
|
|
||||||
if CONFIG['ACCESSIBILITY']:
|
if CONFIG['ACCESSIBILITY']:
|
||||||
DIRS += ['/accessible']
|
DIRS += ['/accessible']
|
||||||
|
else:
|
||||||
|
DIRS += ['/accessible/ipc']
|
||||||
|
|
||||||
# toolkit
|
# toolkit
|
||||||
|
|
||||||
|
|
|
@ -3132,20 +3132,12 @@ NS_METHOD nsWindow::EnableDragDrop(bool aEnable)
|
||||||
|
|
||||||
NS_METHOD nsWindow::CaptureMouse(bool aCapture)
|
NS_METHOD nsWindow::CaptureMouse(bool aCapture)
|
||||||
{
|
{
|
||||||
TRACKMOUSEEVENT mTrack;
|
|
||||||
mTrack.cbSize = sizeof(TRACKMOUSEEVENT);
|
|
||||||
mTrack.dwFlags = TME_LEAVE;
|
|
||||||
mTrack.dwHoverTime = 0;
|
|
||||||
if (aCapture) {
|
if (aCapture) {
|
||||||
mTrack.hwndTrack = mWnd;
|
|
||||||
::SetCapture(mWnd);
|
::SetCapture(mWnd);
|
||||||
} else {
|
} else {
|
||||||
mTrack.hwndTrack = nullptr;
|
|
||||||
::ReleaseCapture();
|
::ReleaseCapture();
|
||||||
}
|
}
|
||||||
sIsInMouseCapture = aCapture;
|
sIsInMouseCapture = aCapture;
|
||||||
// Requests WM_MOUSELEAVE events for this window.
|
|
||||||
TrackMouseEvent(&mTrack);
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4865,6 +4857,15 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
||||||
|
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
{
|
{
|
||||||
|
if (!mMousePresent) {
|
||||||
|
TRACKMOUSEEVENT tme;
|
||||||
|
tme.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||||
|
tme.dwFlags = TME_LEAVE;
|
||||||
|
tme.hwndTrack = mWnd;
|
||||||
|
// Request WM_MOUSELEAVE events for this window.
|
||||||
|
TrackMouseEvent(&tme);
|
||||||
|
}
|
||||||
|
|
||||||
mMousePresent = true;
|
mMousePresent = true;
|
||||||
|
|
||||||
// Suppress dispatch of pending events
|
// Suppress dispatch of pending events
|
||||||
|
@ -4932,6 +4933,12 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_NCMOUSELEAVE:
|
||||||
|
// If upon mouse leave event, only WM_NCMOUSELEAVE message is sent, sending WM_MOUSELEAVE message
|
||||||
|
// makes the event being properly handled.
|
||||||
|
SendMessage(mWnd, WM_MOUSELEAVE, 0, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_CONTEXTMENU:
|
case WM_CONTEXTMENU:
|
||||||
{
|
{
|
||||||
// if the context menu is brought up from the keyboard, |lParam|
|
// if the context menu is brought up from the keyboard, |lParam|
|
||||||
|
|
|
@ -5,15 +5,21 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/HangMonitor.h"
|
#include "mozilla/HangMonitor.h"
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
|
||||||
#include "mozilla/BackgroundHangMonitor.h"
|
#include "mozilla/BackgroundHangMonitor.h"
|
||||||
#include "mozilla/Monitor.h"
|
#include "mozilla/Monitor.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/ProcessedStack.h"
|
#include "mozilla/ProcessedStack.h"
|
||||||
#include "mozilla/Atomics.h"
|
#include "mozilla/Atomics.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "mozilla/StaticPtr.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsAutoPtr.h"
|
||||||
|
#include "nsReadableUtils.h"
|
||||||
#include "nsStackWalk.h"
|
#include "nsStackWalk.h"
|
||||||
|
#include "nsThreadUtils.h"
|
||||||
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
#include "nsExceptionHandler.h"
|
#include "nsExceptionHandler.h"
|
||||||
|
@ -68,6 +74,9 @@ static const int32_t DEFAULT_CHROME_HANG_INTERVAL = 5;
|
||||||
|
|
||||||
// Maximum number of PCs to gather from the stack
|
// Maximum number of PCs to gather from the stack
|
||||||
static const int32_t MAX_CALL_STACK_PCS = 400;
|
static const int32_t MAX_CALL_STACK_PCS = 400;
|
||||||
|
|
||||||
|
// Chrome hang annotators
|
||||||
|
static StaticAutoPtr<std::set<Annotator*>> gAnnotators;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PrefChangedFunc
|
// PrefChangedFunc
|
||||||
|
@ -113,6 +122,162 @@ Crash()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REPORT_CHROME_HANGS
|
#ifdef REPORT_CHROME_HANGS
|
||||||
|
class ChromeHangAnnotations : public HangAnnotations
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ChromeHangAnnotations();
|
||||||
|
~ChromeHangAnnotations();
|
||||||
|
|
||||||
|
void AddAnnotation(const nsAString& aName, const int32_t aData) MOZ_OVERRIDE;
|
||||||
|
void AddAnnotation(const nsAString& aName, const double aData) MOZ_OVERRIDE;
|
||||||
|
void AddAnnotation(const nsAString& aName, const nsAString& aData) MOZ_OVERRIDE;
|
||||||
|
void AddAnnotation(const nsAString& aName, const nsACString& aData) MOZ_OVERRIDE;
|
||||||
|
void AddAnnotation(const nsAString& aName, const bool aData) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||||
|
bool IsEmpty() const MOZ_OVERRIDE;
|
||||||
|
bool GetEnumerator(Enumerator** aOutEnum) MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
typedef std::pair<nsString, nsString> AnnotationType;
|
||||||
|
typedef std::vector<AnnotationType> VectorType;
|
||||||
|
typedef VectorType::const_iterator IteratorType;
|
||||||
|
|
||||||
|
private:
|
||||||
|
VectorType mAnnotations;
|
||||||
|
};
|
||||||
|
|
||||||
|
ChromeHangAnnotations::ChromeHangAnnotations()
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(ChromeHangAnnotations);
|
||||||
|
}
|
||||||
|
|
||||||
|
ChromeHangAnnotations::~ChromeHangAnnotations()
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(ChromeHangAnnotations);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const int32_t aData)
|
||||||
|
{
|
||||||
|
nsString dataString;
|
||||||
|
dataString.AppendInt(aData);
|
||||||
|
AnnotationType annotation = std::make_pair(nsString(aName), dataString);
|
||||||
|
mAnnotations.push_back(annotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const double aData)
|
||||||
|
{
|
||||||
|
nsString dataString;
|
||||||
|
dataString.AppendFloat(aData);
|
||||||
|
AnnotationType annotation = std::make_pair(nsString(aName), dataString);
|
||||||
|
mAnnotations.push_back(annotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const nsAString& aData)
|
||||||
|
{
|
||||||
|
AnnotationType annotation = std::make_pair(nsString(aName), nsString(aData));
|
||||||
|
mAnnotations.push_back(annotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const nsACString& aData)
|
||||||
|
{
|
||||||
|
nsString dataString;
|
||||||
|
AppendUTF8toUTF16(aData, dataString);
|
||||||
|
AnnotationType annotation = std::make_pair(nsString(aName), dataString);
|
||||||
|
mAnnotations.push_back(annotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeHangAnnotations::AddAnnotation(const nsAString& aName, const bool aData)
|
||||||
|
{
|
||||||
|
nsString dataString;
|
||||||
|
dataString += aData ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false");
|
||||||
|
AnnotationType annotation = std::make_pair(nsString(aName), dataString);
|
||||||
|
mAnnotations.push_back(annotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class itself does not use synchronization but it (and its parent object)
|
||||||
|
* should be protected by mutual exclusion in some way. In Telemetry the chrome
|
||||||
|
* hang data is protected via TelemetryImpl::mHangReportsMutex.
|
||||||
|
*/
|
||||||
|
class ChromeHangAnnotationEnumerator : public HangAnnotations::Enumerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ChromeHangAnnotationEnumerator(const ChromeHangAnnotations::VectorType& aAnnotations);
|
||||||
|
~ChromeHangAnnotationEnumerator();
|
||||||
|
|
||||||
|
virtual bool Next(nsAString& aOutName, nsAString& aOutValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
ChromeHangAnnotations::IteratorType mIterator;
|
||||||
|
ChromeHangAnnotations::IteratorType mEnd;
|
||||||
|
};
|
||||||
|
|
||||||
|
ChromeHangAnnotationEnumerator::ChromeHangAnnotationEnumerator(
|
||||||
|
const ChromeHangAnnotations::VectorType& aAnnotations)
|
||||||
|
: mIterator(aAnnotations.begin())
|
||||||
|
, mEnd(aAnnotations.end())
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(ChromeHangAnnotationEnumerator);
|
||||||
|
}
|
||||||
|
|
||||||
|
ChromeHangAnnotationEnumerator::~ChromeHangAnnotationEnumerator()
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(ChromeHangAnnotationEnumerator);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ChromeHangAnnotationEnumerator::Next(nsAString& aOutName, nsAString& aOutValue)
|
||||||
|
{
|
||||||
|
aOutName.Truncate();
|
||||||
|
aOutValue.Truncate();
|
||||||
|
if (mIterator == mEnd) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
aOutName = mIterator->first;
|
||||||
|
aOutValue = mIterator->second;
|
||||||
|
++mIterator;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ChromeHangAnnotations::IsEmpty() const
|
||||||
|
{
|
||||||
|
return mAnnotations.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
ChromeHangAnnotations::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
|
||||||
|
{
|
||||||
|
size_t result = sizeof(mAnnotations) +
|
||||||
|
mAnnotations.capacity() * sizeof(AnnotationType);
|
||||||
|
for (IteratorType i = mAnnotations.begin(), e = mAnnotations.end(); i != e;
|
||||||
|
++i) {
|
||||||
|
result += i->first.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||||
|
result += i->second.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ChromeHangAnnotations::GetEnumerator(HangAnnotations::Enumerator** aOutEnum)
|
||||||
|
{
|
||||||
|
if (!aOutEnum) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*aOutEnum = nullptr;
|
||||||
|
if (mAnnotations.empty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*aOutEnum = new ChromeHangAnnotationEnumerator(mAnnotations);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ChromeStackWalker(uint32_t aFrameNumber, void* aPC, void* aSP, void* aClosure)
|
ChromeStackWalker(uint32_t aFrameNumber, void* aPC, void* aSP, void* aClosure)
|
||||||
{
|
{
|
||||||
|
@ -163,6 +328,22 @@ GetChromeHangReport(Telemetry::ProcessedStack& aStack,
|
||||||
aFirefoxUptime = -1;
|
aFirefoxUptime = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ChromeHangAnnotatorCallout(ChromeHangAnnotations& aAnnotations)
|
||||||
|
{
|
||||||
|
gMonitor->AssertCurrentThreadOwns();
|
||||||
|
MOZ_ASSERT(gAnnotators);
|
||||||
|
if (!gAnnotators) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (std::set<Annotator*>::iterator i = gAnnotators->begin(),
|
||||||
|
e = gAnnotators->end();
|
||||||
|
i != e; ++i) {
|
||||||
|
(*i)->AnnotateHang(aAnnotations);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -182,6 +363,7 @@ ThreadMain(void*)
|
||||||
Telemetry::ProcessedStack stack;
|
Telemetry::ProcessedStack stack;
|
||||||
int32_t systemUptime = -1;
|
int32_t systemUptime = -1;
|
||||||
int32_t firefoxUptime = -1;
|
int32_t firefoxUptime = -1;
|
||||||
|
nsAutoPtr<ChromeHangAnnotations> annotations = new ChromeHangAnnotations();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -209,6 +391,7 @@ ThreadMain(void*)
|
||||||
// the minimum hang duration has been reached (not when the hang ends)
|
// the minimum hang duration has been reached (not when the hang ends)
|
||||||
if (waitCount == 2) {
|
if (waitCount == 2) {
|
||||||
GetChromeHangReport(stack, systemUptime, firefoxUptime);
|
GetChromeHangReport(stack, systemUptime, firefoxUptime);
|
||||||
|
ChromeHangAnnotatorCallout(*annotations);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// This is the crash-on-hang feature.
|
// This is the crash-on-hang feature.
|
||||||
|
@ -226,9 +409,11 @@ ThreadMain(void*)
|
||||||
#ifdef REPORT_CHROME_HANGS
|
#ifdef REPORT_CHROME_HANGS
|
||||||
if (waitCount >= 2) {
|
if (waitCount >= 2) {
|
||||||
uint32_t hangDuration = PR_IntervalToSeconds(now - lastTimestamp);
|
uint32_t hangDuration = PR_IntervalToSeconds(now - lastTimestamp);
|
||||||
Telemetry::RecordChromeHang(hangDuration, stack,
|
Telemetry::RecordChromeHang(hangDuration, stack, systemUptime,
|
||||||
systemUptime, firefoxUptime);
|
firefoxUptime, annotations->IsEmpty() ?
|
||||||
|
nullptr : annotations.forget());
|
||||||
stack.Clear();
|
stack.Clear();
|
||||||
|
annotations = new ChromeHangAnnotations();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lastTimestamp = timestamp;
|
lastTimestamp = timestamp;
|
||||||
|
@ -268,6 +453,7 @@ Startup()
|
||||||
if (!winMainThreadHandle) {
|
if (!winMainThreadHandle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
gAnnotators = new std::set<Annotator*>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Don't actually start measuring hangs until we hit the main event loop.
|
// Don't actually start measuring hangs until we hit the main event loop.
|
||||||
|
@ -306,6 +492,11 @@ Shutdown()
|
||||||
|
|
||||||
delete gMonitor;
|
delete gMonitor;
|
||||||
gMonitor = nullptr;
|
gMonitor = nullptr;
|
||||||
|
|
||||||
|
#ifdef REPORT_CHROME_HANGS
|
||||||
|
// gAnnotators is a StaticAutoPtr, so we just need to null it out.
|
||||||
|
gAnnotators = nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -394,5 +585,25 @@ Suspend()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RegisterAnnotator(Annotator& aAnnotator)
|
||||||
|
{
|
||||||
|
#ifdef REPORT_CHROME_HANGS
|
||||||
|
MonitorAutoLock lock(*gMonitor);
|
||||||
|
MOZ_ASSERT(gAnnotators);
|
||||||
|
gAnnotators->insert(&aAnnotator);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
UnregisterAnnotator(Annotator& aAnnotator)
|
||||||
|
{
|
||||||
|
#ifdef REPORT_CHROME_HANGS
|
||||||
|
MonitorAutoLock lock(*gMonitor);
|
||||||
|
MOZ_ASSERT(gAnnotators);
|
||||||
|
gAnnotators->erase(&aAnnotator);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace HangMonitor
|
} // namespace HangMonitor
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
#ifndef mozilla_HangMonitor_h
|
#ifndef mozilla_HangMonitor_h
|
||||||
#define mozilla_HangMonitor_h
|
#define mozilla_HangMonitor_h
|
||||||
|
|
||||||
|
#include "mozilla/MemoryReporting.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace HangMonitor {
|
namespace HangMonitor {
|
||||||
|
|
||||||
|
@ -38,6 +41,57 @@ void Startup();
|
||||||
*/
|
*/
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class declares an abstraction for a data type that encapsulates all
|
||||||
|
* of the annotations being reported by a registered hang Annotator.
|
||||||
|
*/
|
||||||
|
class HangAnnotations
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~HangAnnotations() {}
|
||||||
|
|
||||||
|
virtual void AddAnnotation(const nsAString& aName, const int32_t aData) = 0;
|
||||||
|
virtual void AddAnnotation(const nsAString& aName, const double aData) = 0;
|
||||||
|
virtual void AddAnnotation(const nsAString& aName, const nsAString& aData) = 0;
|
||||||
|
virtual void AddAnnotation(const nsAString& aName, const nsACString& aData) = 0;
|
||||||
|
virtual void AddAnnotation(const nsAString& aName, const bool aData) = 0;
|
||||||
|
|
||||||
|
class Enumerator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~Enumerator() {}
|
||||||
|
virtual bool Next(nsAString& aOutName, nsAString& aOutValue) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
|
||||||
|
virtual bool IsEmpty() const = 0;
|
||||||
|
virtual bool GetEnumerator(Enumerator **aOutEnum) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Annotator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* NB: This function is always called by the HangMonitor thread.
|
||||||
|
* Plan accordingly.
|
||||||
|
*/
|
||||||
|
virtual void AnnotateHang(HangAnnotations& aAnnotations) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers an Annotator to be called when a hang is detected.
|
||||||
|
* @param aAnnotator Reference to an object that implements the
|
||||||
|
* HangMonitor::Annotator interface.
|
||||||
|
*/
|
||||||
|
void RegisterAnnotator(Annotator& aAnnotator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers an Annotator that was previously registered via RegisterAnnotator.
|
||||||
|
* @param aAnnotator Reference to an object that implements the
|
||||||
|
* HangMonitor::Annotator interface.
|
||||||
|
*/
|
||||||
|
void UnregisterAnnotator(Annotator& aAnnotator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the hang monitor of activity which will reset its internal timer.
|
* Notify the hang monitor of activity which will reset its internal timer.
|
||||||
*
|
*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче