Skip to content

Commit

Permalink
merge autoland to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Dec 22, 2016
2 parents baed6cf + 232388e commit fb752ee
Show file tree
Hide file tree
Showing 393 changed files with 12,745 additions and 5,369 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
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 fb752ee

Please sign in to comment.