Merge inbound to mozilla-central. a=merge

This commit is contained in:
Noemi Erli 2018-05-14 12:19:19 +03:00
Родитель dd58b60c98 f5fa8a68b9
Коммит 65f29ab888
10 изменённых файлов: 19 добавлений и 135 удалений

Просмотреть файл

@ -26,7 +26,6 @@ class AsyncCanvasRenderer;
class ClientCanvasRenderer;
class CopyableCanvasRenderer;
class PersistentBufferProvider;
class WebRenderCanvasRendererSync;
class WebRenderCanvasRendererAsync;
struct CanvasInitializeData {
@ -83,8 +82,6 @@ struct CanvasInitializeData {
// ClientCanvasLayer.
// WebRenderCanvasRenderer inherites ShareableCanvasRenderer and provides all
// functionality that WebRender uses.
// WebRenderCanvasRendererSync inherites WebRenderCanvasRenderer and be used in
// WebRenderCanvasLayer.
// WebRenderCanvasRendererAsync inherites WebRenderCanvasRenderer and be used in
// layers-free mode of WebRender.
//
@ -108,13 +105,12 @@ struct CanvasInitializeData {
// | |
// +--------------------+ +---------+-------------+
// |ClientCanvasRenderer| |WebRenderCanvasRenderer|
// +--------------------+ +--------+--+-----------+
// ^ ^
// +-----------------------+ +----+
// | |
// +-------------+-------------+ +-------------+--------------+
// |WebRenderCanvasRendererSync| |WebRenderCanvasRendererAsync|
// +---------------------------+ +----------------------------+
// +--------------------+ +-----------+-----------+
// ^
// |
// +-------------+--------------+
// |WebRenderCanvasRendererAsync|
// +----------------------------+
class CanvasRenderer
{
public:
@ -136,7 +132,6 @@ public:
virtual CopyableCanvasRenderer* AsCopyableCanvasRenderer() { return nullptr; }
virtual ClientCanvasRenderer* AsClientCanvasRenderer() { return nullptr; }
virtual WebRenderCanvasRendererSync* AsWebRenderCanvasRendererSync() { return nullptr; }
virtual WebRenderCanvasRendererAsync* AsWebRenderCanvasRendererAsync() { return nullptr; }
protected:

Просмотреть файл

@ -28,70 +28,6 @@ WebRenderCanvasRenderer::Initialize(const CanvasInitializeData& aData)
ShareableCanvasRenderer::Initialize(aData);
}
WebRenderCanvasRendererSync::~WebRenderCanvasRendererSync()
{
Destroy();
}
void
WebRenderCanvasRendererSync::Initialize(const CanvasInitializeData& aData)
{
WebRenderCanvasRenderer::Initialize(aData);
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
bool
WebRenderCanvasRendererSync::CreateCompositable()
{
if (!mCanvasClient) {
TextureFlags flags = TextureFlags::DEFAULT;
if (mOriginPos == gl::OriginPos::BottomLeft) {
flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
}
if (!mIsAlphaPremultiplied) {
flags |= TextureFlags::NON_PREMULTIPLIED;
}
mCanvasClient = CanvasClient::CreateCanvasClient(GetCanvasClientType(),
GetForwarder(),
flags);
if (!mCanvasClient) {
return false;
}
mCanvasClient->Connect();
}
if (mExternalImageId.isNothing()) {
mExternalImageId = Some(mManager->WrBridge()->AllocExternalImageIdForCompositable(mCanvasClient));
}
return true;
}
void
WebRenderCanvasRendererSync::ClearCachedResources()
{
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
void
WebRenderCanvasRendererSync::Destroy()
{
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
WebRenderCanvasRendererAsync::~WebRenderCanvasRendererAsync()
{
Destroy();

Просмотреть файл

@ -29,27 +29,6 @@ protected:
WebRenderLayerManager* mManager;
};
class WebRenderCanvasRendererSync : public WebRenderCanvasRenderer
{
public:
explicit WebRenderCanvasRendererSync(WebRenderLayerManager* aManager)
: WebRenderCanvasRenderer(aManager)
{ }
virtual ~WebRenderCanvasRendererSync();
WebRenderCanvasRendererSync* AsWebRenderCanvasRendererSync() override { return this; }
void Initialize(const CanvasInitializeData& aData) override;
bool CreateCompositable() override;
void ClearCachedResources() override;
void Destroy() override;
wr::MaybeExternalImageId GetExternalImageId() { return mExternalImageId; }
protected:
wr::MaybeExternalImageId mExternalImageId;
};
class WebRenderCanvasRendererAsync : public WebRenderCanvasRenderer
{
public:

Просмотреть файл

@ -256,7 +256,7 @@ js::gc::ArenaLists::clearFreeList(AllocKind i)
if (!old->isEmpty())
old->getArena()->checkNoMarkedFreeCells();
#endif
freeLists()[i] = &placeholder;
freeLists()[i] = &emptySentinel;
}
js::gc::Arena*

Просмотреть файл

@ -234,7 +234,7 @@ class ArenaLists
// Because the JITs can allocate from the free lists, they cannot be null.
// We use a placeholder FreeSpan that is empty (and wihout an associated
// Arena) so the JITs can fall back gracefully.
static FreeSpan placeholder;
static FreeSpan emptySentinel;
ZoneOrGCTaskData<AllAllocKindArray<ArenaList>> arenaLists_;
ArenaList& arenaLists(AllocKind i) { return arenaLists_.ref()[i]; }

Просмотреть файл

@ -400,7 +400,7 @@ FOR_EACH_ALLOCKIND(EXPAND_THING_SIZE)
#undef EXPAND_THING_SIZE
};
FreeSpan ArenaLists::placeholder;
FreeSpan ArenaLists::emptySentinel;
#undef CHECK_THING_SIZE_INNER
#undef CHECK_THING_SIZE
@ -3087,7 +3087,7 @@ ArenaLists::ArenaLists(JSRuntime* rt, Zone* zone)
savedEmptyArenas(zone, nullptr)
{
for (auto i : AllAllocKinds()) {
freeLists()[i] = &placeholder;
freeLists()[i] = &emptySentinel;
backgroundFinalizeState(i) = BFS_DONE;
arenaListsToSweep(i) = nullptr;
}

Просмотреть файл

@ -2482,7 +2482,7 @@ pref("security.csp.enableStrictDynamic", true);
#if defined(DEBUG) && !defined(ANDROID)
// about:welcome has been added until Bug 1448359 is fixed at which time home, newtab, and welcome will all be removed.
pref("csp.content_privileged_about_uris_without_csp", "blank,home,newtab,printpreview,srcdoc,studies,welcome");
pref("csp.content_privileged_about_uris_without_csp", "blank,home,newtab,printpreview,srcdoc,welcome");
#endif
#ifdef NIGHTLY_BUILD

Просмотреть файл

@ -5,6 +5,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; script-src resource:; style-src resource: chrome:"/>
<title>about:studies</title>
<link rel="stylesheet" href="chrome://global/skin/global.css">
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">

Просмотреть файл

@ -12,11 +12,6 @@
#include "nsIURI.h"
#if defined(XP_WIN)
// wpcevents.h requires this be elevated
#if (WINVER < 0x0600)
# undef WINVER
# define WINVER 0x0600
#endif
#include <wpcapi.h>
#include <wpcevent.h>
#endif

Просмотреть файл

@ -18,16 +18,8 @@
using namespace mozilla;
static const CLSID CLSID_WinParentalControls = {0xE77CC89B,0x7401,0x4C04,{0x8C,0xED,0x14,0x9D,0xB3,0x5A,0xDD,0x04}};
static const IID IID_IWinParentalControls = {0x28B4D88B,0xE072,0x49E6,{0x80,0x4D,0x26,0xED,0xBE,0x21,0xA7,0xB9}};
NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
static HINSTANCE gAdvAPIDLLInst = nullptr;
decltype(EventWrite)* gEventWrite = nullptr;
decltype(EventRegister)* gEventRegister = nullptr;
decltype(EventUnregister)* gEventUnregister = nullptr;
nsParentalControlsService::nsParentalControlsService() :
mEnabled(false)
@ -36,8 +28,8 @@ nsParentalControlsService::nsParentalControlsService() :
{
HRESULT hr;
CoInitialize(nullptr);
hr = CoCreateInstance(CLSID_WinParentalControls, nullptr, CLSCTX_INPROC,
IID_IWinParentalControls, (void**)&mPC);
hr = CoCreateInstance(__uuidof(WindowsParentalControls), nullptr,
CLSCTX_INPROC, IID_PPV_ARGS(&mPC));
if (FAILED(hr))
return;
@ -58,13 +50,6 @@ nsParentalControlsService::nsParentalControlsService() :
: settings != WPCFLAG_NO_RESTRICTION;
if (enable) {
gAdvAPIDLLInst = ::LoadLibrary("Advapi32.dll");
if(gAdvAPIDLLInst)
{
gEventWrite = (decltype(EventWrite)*) GetProcAddress(gAdvAPIDLLInst, "EventWrite");
gEventRegister = (decltype(EventRegister)*) GetProcAddress(gAdvAPIDLLInst, "EventRegister");
gEventUnregister = (decltype(EventUnregister)*) GetProcAddress(gAdvAPIDLLInst, "EventUnregister");
}
mEnabled = true;
}
}
@ -74,11 +59,9 @@ nsParentalControlsService::~nsParentalControlsService()
if (mPC)
mPC->Release();
if (gEventUnregister && mProvider)
gEventUnregister(mProvider);
if (gAdvAPIDLLInst)
::FreeLibrary(gAdvAPIDLLInst);
if (mProvider) {
EventUnregister(mProvider);
}
}
//------------------------------------------------------------------------
@ -150,9 +133,7 @@ nsParentalControlsService::Log(int16_t aEntryType, bool blocked, nsIURI *aSource
// Register a Vista log event provider associated with the parental controls channel.
if (!mProvider) {
if (!gEventRegister)
return NS_ERROR_NOT_AVAILABLE;
if (gEventRegister(&WPCPROV, nullptr, nullptr, &mProvider) != ERROR_SUCCESS)
if (EventRegister(&WPCPROV, nullptr, nullptr, &mProvider) != ERROR_SUCCESS)
return NS_ERROR_OUT_OF_MEMORY;
}
@ -295,9 +276,6 @@ nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, nsIFil
{
nsAutoCString curi;
if (!gEventWrite)
return;
// Note, EventDataDescCreate is a macro defined in the headers, not a function
aSource->GetSpec(curi);
@ -335,7 +313,7 @@ nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, nsIFil
EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_PATH], (const void*)fill, sizeof(fill));
}
gEventWrite(mProvider, &WPCEVENT_WEB_FILEDOWNLOAD, ARRAYSIZE(eventData), eventData);
EventWrite(mProvider, &WPCEVENT_WEB_FILEDOWNLOAD, ARRAYSIZE(eventData), eventData);
}
NS_IMETHODIMP