Merge inbound to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen 2017-05-30 16:09:14 -04:00
commit bd262b8cd1
13 changed files with 224 additions and 96 deletions

View File

@ -591,7 +591,6 @@ void
NotificationController::WillRefresh(mozilla::TimeStamp aTime)
{
PROFILER_LABEL_FUNC(js::ProfileEntry::Category::OTHER);
Telemetry::AutoTimer<Telemetry::A11Y_UPDATE_TIME> updateTimer;
// If the document accessible that notification collector was created for is
// now shut down, don't process notifications anymore.

View File

@ -1432,7 +1432,7 @@ var gBrowserInit = {
gBrowser.loadTabs(specs, {
inBackground: false,
replace: true,
// Bug 1365232, provide correct triggeringPrincipal
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
});
} catch (e) {}
} else if (uriToLoad instanceof XULElement) {
@ -1497,7 +1497,7 @@ var gBrowserInit = {
} else {
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
// Such callers expect that window.arguments[0] is handled as a single URI.
loadOneOrMoreURIs(uriToLoad);
loadOneOrMoreURIs(uriToLoad, Services.scriptSecurityManager.getSystemPrincipal());
}
}
@ -2165,7 +2165,7 @@ function BrowserGoHome(aEvent) {
// openUILinkIn in utilityOverlay.js doesn't handle loading multiple pages
switch (where) {
case "current":
loadOneOrMoreURIs(homePage);
loadOneOrMoreURIs(homePage, Services.scriptSecurityManager.getSystemPrincipal());
break;
case "tabshifted":
case "tab":
@ -2182,7 +2182,7 @@ function BrowserGoHome(aEvent) {
}
}
function loadOneOrMoreURIs(aURIString) {
function loadOneOrMoreURIs(aURIString, aTriggeringPrincipal) {
// we're not a browser window, pass the URI string to a new browser window
if (window.location.href != getBrowserURL()) {
window.openDialog(getBrowserURL(), "_blank", "all,dialog=no", aURIString);
@ -2195,7 +2195,7 @@ function loadOneOrMoreURIs(aURIString) {
gBrowser.loadTabs(aURIString.split("|"), {
inBackground: false,
replace: true,
// Bug 1365232, provide correct triggeringPrincipal
triggeringPrincipal: aTriggeringPrincipal,
});
} catch (e) {
}

View File

@ -154,17 +154,6 @@ public:
*/
virtual void Notify(const WakeLockInformation& aInfo) override;
/**
* Prevents processes from changing priority until unfrozen.
*/
void Freeze();
/**
* Allow process' priorities to change again. This will immediately adjust
* processes whose priority change did not happen because of the freeze.
*/
void Unfreeze();
/**
* Call ShutDown before destroying the ProcessPriorityManager because
* WakeLockObserver hols a strong reference to it.
@ -177,7 +166,6 @@ private:
static bool sTestMode;
static bool sPrefListenersRegistered;
static bool sInitialized;
static bool sFrozen;
static StaticRefPtr<ProcessPriorityManagerImpl> sSingleton;
static void PrefChangedCallback(const char* aPref, void* aClosure);
@ -193,7 +181,6 @@ private:
void ObserveContentParentCreated(nsISupports* aContentParent);
void ObserveContentParentDestroyed(nsISupports* aSubject);
void ObserveScreenStateChanged(const char16_t* aData);
nsDataHashtable<nsUint64HashKey, RefPtr<ParticularProcessPriorityManager> >
mParticularManagers;
@ -246,8 +233,7 @@ class ParticularProcessPriorityManager final
{
~ParticularProcessPriorityManager();
public:
explicit ParticularProcessPriorityManager(ContentParent* aContentParent,
bool aFrozen = false);
explicit ParticularProcessPriorityManager(ContentParent* aContentParent);
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
@ -291,8 +277,6 @@ public:
void ResetPriority();
void ResetPriorityNow();
void SetPriorityNow(ProcessPriority aPriority);
void Freeze();
void Unfreeze();
void ShutDown();
@ -314,7 +298,6 @@ private:
bool mHoldsCPUWakeLock;
bool mHoldsHighPriorityWakeLock;
bool mIsActivityOpener;
bool mFrozen;
/**
* Used to implement NameWithComma().
@ -329,7 +312,6 @@ private:
/* static */ bool ProcessPriorityManagerImpl::sRemoteTabsDisabled = true;
/* static */ bool ProcessPriorityManagerImpl::sTestMode = false;
/* static */ bool ProcessPriorityManagerImpl::sPrefListenersRegistered = false;
/* static */ bool ProcessPriorityManagerImpl::sFrozen = false;
/* static */ StaticRefPtr<ProcessPriorityManagerImpl>
ProcessPriorityManagerImpl::sSingleton;
/* static */ uint32_t ParticularProcessPriorityManager::sBackgroundPerceivableGracePeriodMS = 0;
@ -450,7 +432,6 @@ ProcessPriorityManagerImpl::Init()
if (os) {
os->AddObserver(this, "ipc:content-created", /* ownsWeak */ true);
os->AddObserver(this, "ipc:content-shutdown", /* ownsWeak */ true);
os->AddObserver(this, "screen-state-changed", /* ownsWeak */ true);
}
}
@ -465,8 +446,6 @@ ProcessPriorityManagerImpl::Observe(
ObserveContentParentCreated(aSubject);
} else if (topic.EqualsLiteral("ipc:content-shutdown")) {
ObserveContentParentDestroyed(aSubject);
} else if (topic.EqualsLiteral("screen-state-changed")) {
ObserveScreenStateChanged(aData);
} else {
MOZ_ASSERT(false);
}
@ -482,7 +461,7 @@ ProcessPriorityManagerImpl::GetParticularProcessPriorityManager(
uint64_t cpId = aContentParent->ChildID();
mParticularManagers.Get(cpId, &pppm);
if (!pppm) {
pppm = new ParticularProcessPriorityManager(aContentParent, sFrozen);
pppm = new ParticularProcessPriorityManager(aContentParent);
pppm->Init();
mParticularManagers.Put(cpId, pppm);
@ -537,22 +516,6 @@ ProcessPriorityManagerImpl::ObserveContentParentDestroyed(nsISupports* aSubject)
}
}
void
ProcessPriorityManagerImpl::ObserveScreenStateChanged(const char16_t* aData)
{
if (NS_LITERAL_STRING("on").Equals(aData)) {
sFrozen = false;
for (auto iter = mParticularManagers.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->Unfreeze();
}
} else {
sFrozen = true;
for (auto iter = mParticularManagers.Iter(); !iter.Done(); iter.Next()) {
iter.UserData()->Freeze();
}
}
}
bool
ProcessPriorityManagerImpl::ChildProcessHasHighPriority( void )
{
@ -599,14 +562,13 @@ NS_IMPL_ISUPPORTS(ParticularProcessPriorityManager,
nsISupportsWeakReference);
ParticularProcessPriorityManager::ParticularProcessPriorityManager(
ContentParent* aContentParent, bool aFrozen)
ContentParent* aContentParent)
: mContentParent(aContentParent)
, mChildID(aContentParent->ChildID())
, mPriority(PROCESS_PRIORITY_UNKNOWN)
, mHoldsCPUWakeLock(false)
, mHoldsHighPriorityWakeLock(false)
, mIsActivityOpener(false)
, mFrozen(aFrozen)
{
MOZ_ASSERT(XRE_IsParentProcess());
LOGP("Creating ParticularProcessPriorityManager.");
@ -799,10 +761,6 @@ ParticularProcessPriorityManager::OnFrameloaderVisibleChanged(nsISupports* aSubj
nsCOMPtr<nsIFrameLoader> fl = do_QueryInterface(aSubject);
NS_ENSURE_TRUE_VOID(fl);
if (mFrozen) {
return; // Ignore visibility changes when the screen is off
}
TabParent* tp = TabParent::GetFrom(fl);
if (!tp) {
return;
@ -974,7 +932,6 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority)
if (!ProcessPriorityManagerImpl::PrefsEnabled() ||
!mContentParent ||
mFrozen ||
mPriority == aPriority) {
return;
}
@ -1004,18 +961,6 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority)
ProcessPriorityToString(mPriority));
}
void
ParticularProcessPriorityManager::Freeze()
{
mFrozen = true;
}
void
ParticularProcessPriorityManager::Unfreeze()
{
mFrozen = false;
}
void
ParticularProcessPriorityManager::ShutDown()
{

View File

@ -2153,7 +2153,7 @@ PostToPluginThread(PluginThreadTaskData* aTaskData)
}
RefPtr<PluginThreadTask> task = new PluginThreadTask(aTaskData, semaphore);
ProcessChild::message_loop()->PostTask(task.forget());
ProcessChild::message_loop()->PostTask(do_AddRef(task));
DWORD err = WaitForSingleObject(semaphore, INFINITE);
if (err != WAIT_FAILED) {
return task->Success();

View File

@ -234,4 +234,5 @@ scheme=https
[test_setTimeoutWith0.html]
[test_bug1301094.html]
[test_subworkers_suspended.html]
skip-if = toolkit == 'android' #bug 1366501
[test_bug1317725.html]

View File

@ -820,26 +820,27 @@ DrawTargetD2D1::PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask,
options |= D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND;
}
RefPtr<ID2D1BitmapBrush> mask;
RefPtr<ID2D1ImageBrush> mask;
Matrix maskTransform = aMaskTransform;
RefPtr<ID2D1PathGeometry> clip;
if (aMask) {
RefPtr<ID2D1Image> image = GetImageForSurface(aMask, maskTransform, ExtendMode::CLAMP);
mDC->SetTransform(D2D1::IdentityMatrix());
mTransformDirty = true;
RefPtr<ID2D1Image> image = GetImageForSurface(aMask, maskTransform, ExtendMode::CLAMP);
// The mask is given in user space. Our layer will apply it in device space.
maskTransform = maskTransform * mTransform;
if (image) {
RefPtr<ID2D1Bitmap> bitmap;
image->QueryInterface((ID2D1Bitmap**)getter_AddRefs(bitmap));
mDC->CreateBitmapBrush(bitmap, D2D1::BitmapBrushProperties(), D2D1::BrushProperties(1.0f, D2DMatrix(maskTransform)), getter_AddRefs(mask));
MOZ_ASSERT(bitmap); // This should always be true since it was created for a surface.
IntSize maskSize = aMask->GetSize();
HRESULT hr = mDC->CreateImageBrush(image,
D2D1::ImageBrushProperties(D2D1::RectF(0, 0, maskSize.width, maskSize.height)),
D2D1::BrushProperties(1.0f, D2DMatrix(maskTransform)),
getter_AddRefs(mask));
if (FAILED(hr)) {
gfxWarning() <<"[D2D1.1] Failed to create a ImageBrush, code: " << hexa(hr);
}
factory()->CreatePathGeometry(getter_AddRefs(clip));
RefPtr<ID2D1GeometrySink> sink;

View File

@ -148,7 +148,7 @@ def target_tasks_cedar(full_task_graph, parameters):
def filter(task):
platform = task.attributes.get('build_platform')
# only select platforms
if platform not in ['linux64']:
if platform not in ('linux64', 'macosx64'):
return False
if task.attributes.get('unittest_suite'):
if not (task.attributes['unittest_suite'].startswith('mochitest') or

View File

@ -1,5 +1,6 @@
[test_ecdsa.https.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1364258
[importVectorKeys step: ECDSA P-256 with SHA-1 verification]
expected: FAIL

View File

@ -1,5 +1,6 @@
[open-features-tokenization-screenx-screeny.html]
type: testharness
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1364696
["screenx==141" should set left position of opened window]
expected: FAIL

View File

@ -195,6 +195,206 @@
"pocket": {
"$ref": "ExtensionURL",
"optional": true
},
"getmsg": {
"$ref": "ExtensionURL",
"optional": true
},
"newmsg": {
"$ref": "ExtensionURL",
"optional": true
},
"address": {
"$ref": "ExtensionURL",
"optional": true
},
"reply": {
"$ref": "ExtensionURL",
"optional": true
},
"replyall": {
"$ref": "ExtensionURL",
"optional": true
},
"replylist": {
"$ref": "ExtensionURL",
"optional": true
},
"forwarding": {
"$ref": "ExtensionURL",
"optional": true
},
"delete": {
"$ref": "ExtensionURL",
"optional": true
},
"junk": {
"$ref": "ExtensionURL",
"optional": true
},
"file": {
"$ref": "ExtensionURL",
"optional": true
},
"nextUnread": {
"$ref": "ExtensionURL",
"optional": true
},
"prevUnread": {
"$ref": "ExtensionURL",
"optional": true
},
"mark": {
"$ref": "ExtensionURL",
"optional": true
},
"tag": {
"$ref": "ExtensionURL",
"optional": true
},
"compact": {
"$ref": "ExtensionURL",
"optional": true
},
"archive": {
"$ref": "ExtensionURL",
"optional": true
},
"chat": {
"$ref": "ExtensionURL",
"optional": true
},
"nextMsg": {
"$ref": "ExtensionURL",
"optional": true
},
"prevMsg": {
"$ref": "ExtensionURL",
"optional": true
},
"QFB": {
"$ref": "ExtensionURL",
"optional": true
},
"conversation": {
"$ref": "ExtensionURL",
"optional": true
},
"newcard": {
"$ref": "ExtensionURL",
"optional": true
},
"newlist": {
"$ref": "ExtensionURL",
"optional": true
},
"editcard": {
"$ref": "ExtensionURL",
"optional": true
},
"newim": {
"$ref": "ExtensionURL",
"optional": true
},
"send": {
"$ref": "ExtensionURL",
"optional": true
},
"spelling": {
"$ref": "ExtensionURL",
"optional": true
},
"attach": {
"$ref": "ExtensionURL",
"optional": true
},
"security": {
"$ref": "ExtensionURL",
"optional": true
},
"save": {
"$ref": "ExtensionURL",
"optional": true
},
"quote": {
"$ref": "ExtensionURL",
"optional": true
},
"buddy": {
"$ref": "ExtensionURL",
"optional": true
},
"join_chat": {
"$ref": "ExtensionURL",
"optional": true
},
"chat_accounts": {
"$ref": "ExtensionURL",
"optional": true
},
"calendar": {
"$ref": "ExtensionURL",
"optional": true
},
"tasks": {
"$ref": "ExtensionURL",
"optional": true
},
"synchronize": {
"$ref": "ExtensionURL",
"optional": true
},
"newevent": {
"$ref": "ExtensionURL",
"optional": true
},
"newtask": {
"$ref": "ExtensionURL",
"optional": true
},
"editevent": {
"$ref": "ExtensionURL",
"optional": true
},
"today": {
"$ref": "ExtensionURL",
"optional": true
},
"category": {
"$ref": "ExtensionURL",
"optional": true
},
"complete": {
"$ref": "ExtensionURL",
"optional": true
},
"priority": {
"$ref": "ExtensionURL",
"optional": true
},
"saveandclose": {
"$ref": "ExtensionURL",
"optional": true
},
"attendees": {
"$ref": "ExtensionURL",
"optional": true
},
"privacy": {
"$ref": "ExtensionURL",
"optional": true
},
"status": {
"$ref": "ExtensionURL",
"optional": true
},
"freebusy": {
"$ref": "ExtensionURL",
"optional": true
},
"timezones": {
"$ref": "ExtensionURL",
"optional": true
}
},
"additionalProperties": { "$ref": "UnrecognizedProperty" }

View File

@ -24,14 +24,6 @@
"kind": "flag",
"description": "has the IAccessibleTable accessibility interface been used"
},
"A11Y_UPDATE_TIME": {
"record_in_processes": ["main", "content"],
"expires_in_version": "default",
"kind": "exponential",
"high": 10000,
"n_buckets": 50,
"description": "time spent updating accessibility (ms)"
},
"ADDON_CONTENT_POLICY_SHIM_BLOCKING_LOADING_MS": {
"record_in_processes": ["main", "content"],
"expires_in_version": "58",

View File

@ -4,7 +4,6 @@
"A11Y_IATABLE_USAGE_FLAG",
"A11Y_INSTANTIATED_FLAG",
"A11Y_ISIMPLEDOM_USAGE_FLAG",
"A11Y_UPDATE_TIME",
"ADDON_SHIM_USAGE",
"AUDIOSTREAM_FIRST_OPEN_MS",
"AUDIOSTREAM_LATER_OPEN_MS",
@ -634,7 +633,6 @@
"A11Y_IATABLE_USAGE_FLAG",
"A11Y_INSTANTIATED_FLAG",
"A11Y_ISIMPLEDOM_USAGE_FLAG",
"A11Y_UPDATE_TIME",
"ADDON_SHIM_USAGE",
"APPLICATION_REPUTATION_COUNT",
"APPLICATION_REPUTATION_LOCAL",
@ -1720,7 +1718,6 @@
"FX_THUMBNAILS_BG_CAPTURE_QUEUE_TIME_MS",
"NEWTAB_PAGE_PINNED_SITES_COUNT",
"WEAVE_COMPLETE_SUCCESS_COUNT",
"A11Y_UPDATE_TIME",
"OSFILE_WRITEATOMIC_JANK_MS",
"STARTUP_MEASUREMENT_ERRORS",
"CERT_CHAIN_KEY_SIZE_STATUS",

View File

@ -65,15 +65,6 @@ public:
{}
NS_IMETHOD Run() override {
// Notify observers that the screen state has just changed.
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
if (observerService) {
observerService->NotifyObservers(
nullptr, "screen-state-changed",
mIsOn ? u"on" : u"off"
);
}
RefPtr<nsScreenGonk> screen = nsScreenManagerGonk::GetPrimaryScreen();
const nsTArray<nsWindow*>& windows = screen->GetTopWindows();