Skip to content

Commit

Permalink
Merge mozilla-central to mozilla-inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Dec 22, 2016
2 parents 3a93b8f + fb752ee commit 041b5d9
Show file tree
Hide file tree
Showing 397 changed files with 25,865 additions and 18,494 deletions.
2 changes: 1 addition & 1 deletion accessible/base/nsAccessibilityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ class PluginTimerCallBack final : public nsITimerCallback
~PluginTimerCallBack() {}

public:
PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}
explicit PluginTimerCallBack(nsIContent* aContent) : mContent(aContent) {}

NS_DECL_ISUPPORTS

Expand Down
6 changes: 3 additions & 3 deletions accessible/windows/ProxyWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace a11y {
class ProxyAccessibleWrap : public AccessibleWrap
{
public:
ProxyAccessibleWrap(ProxyAccessible* aProxy) :
explicit ProxyAccessibleWrap(ProxyAccessible* aProxy) :
AccessibleWrap(nullptr, nullptr)
{
mType = eProxyType;
Expand All @@ -38,7 +38,7 @@ class ProxyAccessibleWrap : public AccessibleWrap
class HyperTextProxyAccessibleWrap : public HyperTextAccessibleWrap
{
public:
HyperTextProxyAccessibleWrap(ProxyAccessible* aProxy) :
explicit HyperTextProxyAccessibleWrap(ProxyAccessible* aProxy) :
HyperTextAccessibleWrap(nullptr, nullptr)
{
mType = eProxyType;
Expand All @@ -60,7 +60,7 @@ class HyperTextProxyAccessibleWrap : public HyperTextAccessibleWrap
class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap
{
public:
DocProxyAccessibleWrap(ProxyAccessible* aProxy) :
explicit DocProxyAccessibleWrap(ProxyAccessible* aProxy) :
HyperTextProxyAccessibleWrap(aProxy)
{ mGenericTypes |= eDocument; }

Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ AccessibleWrap::get_accFocus(
class AccessibleEnumerator final : public IEnumVARIANT
{
public:
AccessibleEnumerator(const nsTArray<Accessible*>& aArray) :
explicit AccessibleEnumerator(const nsTArray<Accessible*>& aArray) :
mArray(aArray), mCurIndex(0) { }
AccessibleEnumerator(const AccessibleEnumerator& toCopy) :
mArray(toCopy.mArray), mCurIndex(toCopy.mCurIndex) { }
Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/msaa/EnumVariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace a11y {
class ChildrenEnumVariant final : public IEnumVARIANT
{
public:
ChildrenEnumVariant(AccessibleWrap* aAnchor) : mAnchorAcc(aAnchor),
explicit ChildrenEnumVariant(AccessibleWrap* aAnchor) : mAnchorAcc(aAnchor),
mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0) { }

// IUnknown
Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/msaa/ServiceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace a11y {
class ServiceProvider final : public IServiceProvider
{
public:
ServiceProvider(AccessibleWrap* aAcc) : mAccessible(aAcc) {}
explicit ServiceProvider(AccessibleWrap* aAcc) : mAccessible(aAcc) {}
~ServiceProvider() {}

DECL_IUNKNOWN
Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/sdn/sdnAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace a11y {
class sdnAccessible final : public ISimpleDOMNode
{
public:
sdnAccessible(nsINode* aNode) :
explicit sdnAccessible(nsINode* aNode) :
mNode(aNode)
{
if (!mNode)
Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/sdn/sdnDocAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace a11y {
class sdnDocAccessible final : public ISimpleDOMDocument
{
public:
sdnDocAccessible(DocAccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
explicit sdnDocAccessible(DocAccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
~sdnDocAccessible() { };

DECL_IUNKNOWN
Expand Down
4 changes: 2 additions & 2 deletions accessible/windows/sdn/sdnTextAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ struct nsPoint;

namespace mozilla {
namespace a11y {

class sdnTextAccessible final : public ISimpleDOMText
{
public:
sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
explicit sdnTextAccessible(AccessibleWrap* aAccessible) : mAccessible(aAccessible) {};
~sdnTextAccessible() {}

DECL_IUNKNOWN
Expand Down
4 changes: 2 additions & 2 deletions accessible/windows/uia/uiaRawElmProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ uiaRawElmProvider::GetIAccessiblePair(__RPC__deref_out_opt IAccessible** aAcc,
return CO_E_OBJNOTCONNECTED;

*aIdChild = CHILDID_SELF;
*aAcc = mAcc;
mAcc->AddRef();
RefPtr<AccessibleWrap> copy(mAcc);
copy.forget(aAcc);

return S_OK;

Expand Down
2 changes: 1 addition & 1 deletion accessible/windows/uia/uiaRawElmProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class uiaRawElmProvider final : public IAccessibleEx,
public IRawElementProviderSimple
{
public:
uiaRawElmProvider(AccessibleWrap* aAcc) : mAcc(aAcc) { }
explicit uiaRawElmProvider(AccessibleWrap* aAcc) : mAcc(aAcc) { }

// IUnknown
DECL_IUNKNOWN
Expand Down
38 changes: 25 additions & 13 deletions browser/app/blocklist.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1480349195955" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1480349215711" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
<prefs/>
Expand Down Expand Up @@ -810,18 +810,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i872" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i966" id="{5C655500-E712-41e7-9349-CE462F844B19}">
<prefs/>
<versionRange minVersion="0" maxVersion="1.0.1-signed" severity="1"/>
</emItem>
<emItem blockID="i90" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
<emItem blockID="i306" id="{ADFA33FD-16F5-4355-8504-DF4D664CFE10}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
Expand Down Expand Up @@ -1352,6 +1340,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1425" id="/^([email protected]|jid0-EYTXLS0GyfQME5irGbnD4HksnbQ@jetpack|jid1-ZjJ7t75BAcbGCX@jetpack)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i674" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
Expand Down Expand Up @@ -1524,6 +1516,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i1423" id="/^(@pluginscribens_firefox|[email protected]|[email protected]|[email protected]|[email protected]|[email protected]|jid0-bigoD0uivzAMmt07zrf3OHqa418@jetpack|jid0-iXbAR01tjT2BsbApyS6XWnjDhy8@jetpack)$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i68" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
Expand Down Expand Up @@ -1675,6 +1671,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i1424" id="/^(jid0-S9kkzfTvEmC985BVmf8ZOzA5nLM@jetpack|jid0-xGZYdxpAkROWMUMfWKINyrXigBA@jetpack|jid1-qps14pkDB6UDvA@jetpack|jid1-Tsr09YnAqIWL0Q@jetpack|[email protected]|voipgrid@jetpack|{38a64ef0-7181-11e3-981f-0800200c9a66}|[email protected])$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i519" id="703db0db-5fe9-44b6-9f53-c6a91a0ad5bd@7314bc82-969e-4d2a-921b-e5edd0b02cf1.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
Expand Down Expand Up @@ -1991,6 +1991,18 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i872" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="1"/>
</emItem>
<emItem blockID="i966" id="{5C655500-E712-41e7-9349-CE462F844B19}">
<prefs/>
<versionRange minVersion="0" maxVersion="1.0.1-signed" severity="1"/>
</emItem>
<emItem blockID="i90" id="[email protected]">
<prefs/>
<versionRange minVersion="0" maxVersion="*"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p416">
Expand Down
148 changes: 84 additions & 64 deletions browser/base/content/sanitize.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,79 +278,16 @@ Sanitizer.prototype = {
}

// Clear plugin data.
// As evidenced in bug 1253204, clearing plugin data can sometimes be
// very, very long, for mysterious reasons. Unfortunately, this is not
// something actionable by Mozilla, so crashing here serves no purpose.
//
// For this reason, instead of waiting for sanitization to always
// complete, we introduce a soft timeout. Once this timeout has
// elapsed, we proceed with the shutdown of Firefox.
let promiseClearPluginCookies;
try {
// We don't want to wait for this operation to complete...
promiseClearPluginCookies = this.promiseClearPluginCookies(range);

// ... at least, not for more than 10 seconds.
yield Promise.race([
promiseClearPluginCookies,
new Promise(resolve => setTimeout(resolve, 10000 /* 10 seconds */))
]);
yield Sanitizer.clearPluginData(range);
} catch (ex) {
seenException = ex;
}

// Detach waiting for plugin cookies to be cleared.
promiseClearPluginCookies.catch(() => {
// If this exception is raised before the soft timeout, it
// will appear in `seenException`. Otherwise, it's too late
// to do anything about it.
});

if (seenException) {
throw seenException;
}
}),

promiseClearPluginCookies: Task.async(function* (range) {
const FLAG_CLEAR_ALL = Ci.nsIPluginHost.FLAG_CLEAR_ALL;
let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);

// Determine age range in seconds. (-1 means clear all.) We don't know
// that range[1] is actually now, so we compute age range based
// on the lower bound. If range results in a negative age, do nothing.
let age = range ? (Date.now() / 1000 - range[0] / 1000000) : -1;
if (!range || age >= 0) {
let tags = ph.getPluginTags();
for (let tag of tags) {
let refObj = {};
let probe = "";
if (/\bFlash\b/.test(tag.name)) {
probe = tag.loaded ? "FX_SANITIZE_LOADED_FLASH"
: "FX_SANITIZE_UNLOADED_FLASH";
TelemetryStopwatch.start(probe, refObj);
}
try {
let rv = yield new Promise(resolve =>
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, age, resolve)
);
// If the plugin doesn't support clearing by age, clear everything.
if (rv == Components.results.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED) {
yield new Promise(resolve =>
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, -1, resolve)
);
}
if (probe) {
TelemetryStopwatch.finish(probe, refObj);
}
} catch (ex) {
// Ignore errors from plug-ins
if (probe) {
TelemetryStopwatch.cancel(probe, refObj);
}
}
}
}
})
},

offlineApps: {
Expand Down Expand Up @@ -705,6 +642,12 @@ Sanitizer.prototype = {
yield promiseReady;
})
},

pluginData: {
clear: Task.async(function* (range) {
yield Sanitizer.clearPluginData(range);
}),
},
}
};

Expand Down Expand Up @@ -774,6 +717,83 @@ Sanitizer.getClearRange = function(ts) {
return [startDate, endDate];
};

Sanitizer.clearPluginData = Task.async(function* (range) {
// Clear plugin data.
// As evidenced in bug 1253204, clearing plugin data can sometimes be
// very, very long, for mysterious reasons. Unfortunately, this is not
// something actionable by Mozilla, so crashing here serves no purpose.
//
// For this reason, instead of waiting for sanitization to always
// complete, we introduce a soft timeout. Once this timeout has
// elapsed, we proceed with the shutdown of Firefox.
let seenException;

let promiseClearPluginData = Task.async(function* () {
const FLAG_CLEAR_ALL = Ci.nsIPluginHost.FLAG_CLEAR_ALL;
let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);

// Determine age range in seconds. (-1 means clear all.) We don't know
// that range[1] is actually now, so we compute age range based
// on the lower bound. If range results in a negative age, do nothing.
let age = range ? (Date.now() / 1000 - range[0] / 1000000) : -1;
if (!range || age >= 0) {
let tags = ph.getPluginTags();
for (let tag of tags) {
let refObj = {};
let probe = "";
if (/\bFlash\b/.test(tag.name)) {
probe = tag.loaded ? "FX_SANITIZE_LOADED_FLASH"
: "FX_SANITIZE_UNLOADED_FLASH";
TelemetryStopwatch.start(probe, refObj);
}
try {
let rv = yield new Promise(resolve =>
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, age, resolve)
);
// If the plugin doesn't support clearing by age, clear everything.
if (rv == Components.results.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED) {
yield new Promise(resolve =>
ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, -1, resolve)
);
}
if (probe) {
TelemetryStopwatch.finish(probe, refObj);
}
} catch (ex) {
// Ignore errors from plug-ins
if (probe) {
TelemetryStopwatch.cancel(probe, refObj);
}
}
}
}
});

try {
// We don't want to wait for this operation to complete...
promiseClearPluginData = promiseClearPluginData(range);

// ... at least, not for more than 10 seconds.
yield Promise.race([
promiseClearPluginData,
new Promise(resolve => setTimeout(resolve, 10000 /* 10 seconds */))
]);
} catch (ex) {
seenException = ex;
}

// Detach waiting for plugin data to be cleared.
promiseClearPluginData.catch(() => {
// If this exception is raised before the soft timeout, it
// will appear in `seenException`. Otherwise, it's too late
// to do anything about it.
});

if (seenException) {
throw seenException;
}
});

Sanitizer._prefs = null;
Sanitizer.__defineGetter__("prefs", function()
{
Expand Down
Loading

0 comments on commit 041b5d9

Please sign in to comment.