Skip to content

Commit

Permalink
Merge m-c to autoland, a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
KWierso committed Nov 17, 2016
2 parents 6c48ba9 + f9e9d69 commit 609b992
Show file tree
Hide file tree
Showing 1,648 changed files with 31,832 additions and 36,539 deletions.
1 change: 1 addition & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ handle SIGPIPE noprint nostop pass
# sandboxing code on older kernels.
handle SIG38 noprint nostop pass
handle SIG64 noprint nostop pass
handle SIGSYS noprint nostop pass

# Show the concrete types behind nsIFoo
set print object on
Expand Down
6 changes: 1 addition & 5 deletions accessible/base/AccEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class AccEvent
// node, only the umbrella event on the ancestor will be emitted.
eCoalesceReorder,

// eCoalesceMutationTextChange : coalesce text change events caused by
// tree mutations of the same tree level.
eCoalesceMutationTextChange,

// eCoalesceOfSameType : For events of the same type, only the newest event
// will be processed.
eCoalesceOfSameType,
Expand Down Expand Up @@ -214,7 +210,7 @@ class AccMutationEvent: public AccEvent
{
public:
AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceMutationTextChange)
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
{
// Don't coalesce these since they are coalesced by reorder event. Coalesce
// contained text change events.
Expand Down
10 changes: 7 additions & 3 deletions accessible/base/EventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ EventQueue::CoalesceEvents()

switch(tailEvent->mEventRule) {
case AccEvent::eCoalesceReorder:
MOZ_ASSERT(tailEvent->mAccessible->IsApplication() ||
tailEvent->mAccessible->IsOuterDoc() ||
tailEvent->mAccessible->IsXULTree(),
{
DebugOnly<Accessible*> target = tailEvent->mAccessible.get();
MOZ_ASSERT(target->IsApplication() ||
target->IsOuterDoc() ||
target->IsXULTree(),
"Only app or outerdoc accessible reorder events are in the queue");
MOZ_ASSERT(tailEvent->GetEventType() == nsIAccessibleEvent::EVENT_REORDER, "only reorder events should be queued");
break; // case eCoalesceReorder
}

case AccEvent::eCoalesceOfSameType:
{
Expand Down
11 changes: 9 additions & 2 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2273,8 +2273,15 @@ DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
RemoveDependentIDsFor(aRoot);

uint32_t count = aRoot->ContentChildCount();
for (uint32_t idx = 0; idx < count; idx++)
UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
for (uint32_t idx = 0; idx < count; idx++) {
Accessible* child = aRoot->ContentChildAt(idx);

// Removing this accessible from the document doesn't mean anything about
// accessibles for subdocuments, so skip removing those from the tree.
if (!child->IsDoc()) {
UncacheChildrenInSubtree(child);
}
}

if (aRoot->IsNodeMapEntry() &&
mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
Expand Down
17 changes: 13 additions & 4 deletions accessible/html/HTMLFormControlAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@ HTMLTextFieldAccessible::Value(nsString& aValue)
}

HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
if (input)
input->GetValue(aValue);
if (input) {
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
// file input here.
input->GetValue(aValue, CallerType::NonSystem);
}
}

void
Expand Down Expand Up @@ -552,7 +555,10 @@ HTMLSpinnerAccessible::Value(nsString& aValue)
if (!aValue.IsEmpty())
return;

HTMLInputElement::FromContent(mContent)->GetValue(aValue);
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
// file input here.
HTMLInputElement::FromContent(mContent)->GetValue(aValue,
CallerType::NonSystem);
}

double
Expand Down Expand Up @@ -628,7 +634,10 @@ HTMLRangeAccessible::Value(nsString& aValue)
if (!aValue.IsEmpty())
return;

HTMLInputElement::FromContent(mContent)->GetValue(aValue);
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
// file input here.
HTMLInputElement::FromContent(mContent)->GetValue(aValue,
CallerType::NonSystem);
}

double
Expand Down
4 changes: 2 additions & 2 deletions accessible/jsat/AccessFu.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ this.AccessFu = { // jshint ignore:line
case 'remote-browser-shown':
case 'inprocess-browser-shown':
{
// Ignore notifications that aren't from a BrowserOrApp
// Ignore notifications that aren't from a Browser
let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
if (!frameLoader.ownerIsMozBrowserFrame) {
return;
}
this._handleMessageManager(frameLoader.messageManager);
Expand Down
31 changes: 30 additions & 1 deletion accessible/tests/mochitest/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,16 @@ function eventQueue(aEventType)
}

// Check if handled event matches any expected async events.
var haveUnmatchedAsync = false;
for (idx = 0; idx < eventSeq.length; idx++) {
if (eventSeq[idx] instanceof orderChecker && haveUnmatchedAsync) {
break;
}

if (!eventSeq[idx].wasCaught) {
haveUnmatchedAsync = true;
}

if (!eventSeq[idx].unexpected && eventSeq[idx].async) {
if (eventQueue.compareEvents(eventSeq[idx], aEvent)) {
this.processMatchedChecker(aEvent, eventSeq[idx], scnIdx, idx);
Expand All @@ -553,6 +562,16 @@ function eventQueue(aEventType)
invoker.check(aEvent);
}

for (idx = 0; idx < eventSeq.length; idx++) {
if (!eventSeq[idx].wasCaught) {
if (eventSeq[idx] instanceof orderChecker) {
eventSeq[idx].wasCaught++;
} else {
break;
}
}
}

// If we don't have more events to wait then schedule next invoker.
if (this.hasMatchedScenario()) {
if (this.mNextInvokerStatus == kInvokerNotScheduled) {
Expand Down Expand Up @@ -596,6 +615,7 @@ function eventQueue(aEventType)
(aEventSeq[aEventSeq.idx].unexpected ||
aEventSeq[aEventSeq.idx].todo ||
aEventSeq[aEventSeq.idx].async ||
aEventSeq[aEventSeq.idx] instanceof orderChecker ||
aEventSeq[aEventSeq.idx].wasCaught > 0)) {
aEventSeq.idx++;
}
Expand All @@ -612,7 +632,7 @@ function eventQueue(aEventType)
// sync expcected events yet.
for (var idx = 0; idx < aEventSeq.length; idx++) {
if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
!aEventSeq[idx].wasCaught)
!aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
return true;
}

Expand Down Expand Up @@ -1679,6 +1699,15 @@ function invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg, aIsAsync)
this.mTargetFuncArg = aTargetFuncArg;
}

/**
* event checker that forces preceeding async events to happen before this
* checker.
*/
function orderChecker()
{
this.__proto__ = new invokerChecker(null, null, null, false);
}

/**
* Generic invoker checker for todo events.
*/
Expand Down
9 changes: 0 additions & 9 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,6 @@ pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
pref("hal.processPriorityManager.gonk.MASTER.cgroup", "");

pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
pref("hal.processPriorityManager.gonk.PREALLOC.cgroup", "apps/bg_non_interactive");

pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.cgroup", "apps/critical");
Expand Down Expand Up @@ -693,12 +690,6 @@ pref("gonk.notifySoftLowMemUnderKB", 43008);
// blocked on a poll(), and this pref has no effect.)
pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);

// Enable pre-launching content processes for improved startup time
// (hiding latency).
pref("dom.ipc.processPrelaunch.enabled", true);
// Wait this long before pre-launching a new subprocess.
pref("dom.ipc.processPrelaunch.delayMs", 5000);

pref("dom.ipc.reuse_parent_app", false);

// When a process receives a system message, we hold a CPU wake lock on its
Expand Down
63 changes: 0 additions & 63 deletions b2g/chrome/content/devtools/hud.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() {
return devtools.require('devtools/server/actors/memory').MemoryFront;
});

Cu.import('resource://gre/modules/Frames.jsm');

var _telemetryDebug = false;

function telemetryDebug(...args) {
Expand All @@ -54,7 +52,6 @@ function telemetryDebug(...args) {
*/
var developerHUD = {

_targets: new Map(),
_histograms: new Set(),
_customHistograms: new Set(),
_client: null,
Expand Down Expand Up @@ -99,13 +96,6 @@ var developerHUD = {
}
}

Frames.addObserver(this);

let appFrames = Frames.list().filter(frame => frame.getAttribute('mozapp'));
for (let frame of appFrames) {
this.trackFrame(frame);
}

SettingsListener.observe('hud.logging', this._logging, enabled => {
this._logging = enabled;
});
Expand All @@ -124,63 +114,10 @@ var developerHUD = {
return;
}

for (let frame of this._targets.keys()) {
this.untrackFrame(frame);
}

Frames.removeObserver(this);

this._client.close();
delete this._client;
},

/**
* This method will ask all registered watchers to track and update metrics
* on an app frame.
*/
trackFrame(frame) {
if (this._targets.has(frame)) {
return;
}

DebuggerServer.connectToChild(this._conn, frame).then(actor => {
let target = new Target(frame, actor);
this._targets.set(frame, target);

for (let w of this._watchers) {
w.trackTarget(target);
}
});
},

untrackFrame(frame) {
let target = this._targets.get(frame);
if (target) {
for (let w of this._watchers) {
w.untrackTarget(target);
}

target.destroy();
this._targets.delete(frame);
}
},

onFrameCreated(frame, isFirstAppFrame) {
let mozapp = frame.getAttribute('mozapp');
if (!mozapp) {
return;
}
this.trackFrame(frame);
},

onFrameDestroyed(frame, isLastAppFrame) {
let mozapp = frame.getAttribute('mozapp');
if (!mozapp) {
return;
}
this.untrackFrame(frame);
},

log(message) {
if (this._logging) {
dump(DEVELOPER_HUD_LOG_PREFIX + ': ' + message + '\n');
Expand Down
1 change: 0 additions & 1 deletion b2g/chrome/content/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ var shell = {
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');
systemAppFrame.setAttribute('id', 'systemapp');
systemAppFrame.setAttribute('mozbrowser', 'true');
systemAppFrame.setAttribute('mozapp', manifestURL);
systemAppFrame.setAttribute('allowfullscreen', 'true');
systemAppFrame.setAttribute('src', 'blank.html');
let container = document.getElementById('container');
Expand Down
1 change: 0 additions & 1 deletion b2g/chrome/content/shell_remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ var remoteShell = {
document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
systemAppFrame.setAttribute("id", this.id);
systemAppFrame.setAttribute("mozbrowser", "true");
systemAppFrame.setAttribute("mozapp", manifestURL);
systemAppFrame.setAttribute("allowfullscreen", "true");
systemAppFrame.setAttribute("src", "blank.html");

Expand Down
9 changes: 0 additions & 9 deletions b2g/components/AlertsHelper.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ function debug(str) {

const kNotificationIconSize = 128;

const kDesktopNotificationPerm = "desktop-notification";

const kNotificationSystemMessageName = "notification";

const kDesktopNotification = "desktop-notification";
Expand Down Expand Up @@ -256,13 +254,6 @@ var AlertsHelper = {
},

receiveMessage: function(aMessage) {
if (!aMessage.target.assertAppHasPermission(kDesktopNotificationPerm)) {
Cu.reportError("Desktop-notification message " + aMessage.name +
" from a content process with no " + kDesktopNotificationPerm +
" privileges.");
return;
}

switch(aMessage.name) {
case kMessageAlertNotificationSend:
this.showAlertNotification(aMessage);
Expand Down
15 changes: 1 addition & 14 deletions b2g/components/DebuggerActors.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ function B2GTabList(connection) {
B2GTabList.prototype = Object.create(BrowserTabList.prototype);

B2GTabList.prototype._getBrowsers = function() {
return Frames.list().filter(frame => {
// Ignore app frames
return !frame.getAttribute("mozapp");
});
return Frames.list();
};

B2GTabList.prototype._getSelectedBrowser = function() {
Expand All @@ -59,21 +56,11 @@ B2GTabList.prototype._listenForEventsIf = function(shouldListen) {
};

B2GTabList.prototype.onFrameCreated = function(frame) {
let mozapp = frame.getAttribute("mozapp");
if (mozapp) {
// Ignore app frames
return;
}
this._notifyListChanged();
this._checkListening();
};

B2GTabList.prototype.onFrameDestroyed = function(frame) {
let mozapp = frame.getAttribute("mozapp");
if (mozapp) {
// Ignore app frames
return;
}
let actor = this._actorByBrowser.get(frame);
if (actor) {
this._handleActorClose(actor, frame);
Expand Down
4 changes: 2 additions & 2 deletions b2g/components/ErrorPage.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ var ErrorPage = {

observe: function errorPageObserve(aSubject, aTopic, aData) {
let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
// Ignore notifications that aren't from a BrowserOrApp
if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
// Ignore notifications that aren't from a Browser
if (!frameLoader.ownerIsMozBrowserFrame) {
return;
}
this._listenError(frameLoader);
Expand Down
Loading

0 comments on commit 609b992

Please sign in to comment.