Merge inbound to mozilla-central. a=merge
authorNoemi Erli <nerli@mozilla.com>
Mon, 14 May 2018 12:19:19 +0300
changeset 472265 45ec8fd380dd2c308e79dbb396ca87f2ce9b3f9c
parent 472259 3985ccc415e92eb0be073e7a6bba94e6751bcfc6 (current diff)
parent 472264 354b5292689e25aed4289fc45af11d1b9da3465b (diff)
child 472270 25f6376adefdbde71cf3855b243bc2b7f237615b
child 472282 1319a24f1db28e2207d95d9fb04f6623187f68a1
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone62.0a1
first release with
nightly linux32
45ec8fd380dd / 62.0a1 / 20180514100123 / files
nightly linux64
45ec8fd380dd / 62.0a1 / 20180514100123 / files
nightly mac
45ec8fd380dd / 62.0a1 / 20180514100123 / files
nightly win32
45ec8fd380dd / 62.0a1 / 20180514100123 / files
nightly win64
45ec8fd380dd / 62.0a1 / 20180514100123 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
--- a/gfx/layers/CanvasRenderer.h
+++ b/gfx/layers/CanvasRenderer.h
@@ -21,17 +21,16 @@
 
 namespace mozilla {
 namespace layers {
 
 class AsyncCanvasRenderer;
 class ClientCanvasRenderer;
 class CopyableCanvasRenderer;
 class PersistentBufferProvider;
-class WebRenderCanvasRendererSync;
 class WebRenderCanvasRendererAsync;
 
 struct CanvasInitializeData {
   CanvasInitializeData()
     : mBufferProvider(nullptr)
     , mGLContext(nullptr)
     , mRenderer(nullptr)
     , mPreTransCallback(nullptr)
@@ -78,18 +77,16 @@ struct CanvasInitializeData {
 // content over IPC. This is pure virtual class because the IPC handling is
 // different in different LayerManager. So that we have following classes inherite
 // ShareableCanvasRenderer.
 //
 // ClientCanvasRenderer inherites ShareableCanvasRenderer and be used in
 // 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.
 //
 // class diagram shows below:
 //
 //                       +--------------+
 //                       |CanvasRenderer|
 //                       +-------+------+
@@ -103,23 +100,22 @@ struct CanvasInitializeData {
 //                   +-----------+-----------+
 //                   |ShareableCanvasRenderer|
 //                   +-----+-----------------+
 //                         ^      ^
 //           +-------------+      +-------+
 //           |                            |
 // +--------------------+       +---------+-------------+
 // |ClientCanvasRenderer|       |WebRenderCanvasRenderer|
-// +--------------------+       +--------+--+-----------+
-//                                       ^  ^
-//               +-----------------------+  +----+
-//               |                               |
-// +-------------+-------------+   +-------------+--------------+
-// |WebRenderCanvasRendererSync|   |WebRenderCanvasRendererAsync|
-// +---------------------------+   +----------------------------+
+// +--------------------+       +-----------+-----------+
+//                                          ^
+//                                          |
+//                           +-------------+--------------+
+//                           |WebRenderCanvasRendererAsync|
+//                           +----------------------------+
 class CanvasRenderer
 {
 public:
   CanvasRenderer();
   virtual ~CanvasRenderer();
 
 public:
   virtual void Initialize(const CanvasInitializeData& aData);
@@ -131,17 +127,16 @@ public:
   const gfx::IntSize& GetSize() const { return mSize; }
 
   void SetDirty() { mDirty = true; }
   void ResetDirty() { mDirty = false; }
   bool IsDirty() const { return mDirty; }
 
   virtual CopyableCanvasRenderer* AsCopyableCanvasRenderer() { return nullptr; }
   virtual ClientCanvasRenderer* AsClientCanvasRenderer() { return nullptr; }
-  virtual WebRenderCanvasRendererSync* AsWebRenderCanvasRendererSync() { return nullptr; }
   virtual WebRenderCanvasRendererAsync* AsWebRenderCanvasRendererAsync() { return nullptr; }
 
 protected:
   void FirePreTransactionCallback()
   {
     if (mPreTransCallback) {
       mPreTransCallback(mPreTransCallbackData);
     }
--- a/gfx/layers/wr/WebRenderCanvasRenderer.cpp
+++ b/gfx/layers/wr/WebRenderCanvasRenderer.cpp
@@ -23,80 +23,16 @@ WebRenderCanvasRenderer::GetForwarder()
 }
 
 void
 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();
 }
 
 void
 WebRenderCanvasRendererAsync::Initialize(const CanvasInitializeData& aData)
 {
--- a/gfx/layers/wr/WebRenderCanvasRenderer.h
+++ b/gfx/layers/wr/WebRenderCanvasRenderer.h
@@ -24,37 +24,16 @@ public:
   void Initialize(const CanvasInitializeData& aData) override;
 
   CompositableForwarder* GetForwarder() override;
 
 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:
   explicit WebRenderCanvasRendererAsync(WebRenderLayerManager* aManager)
     : WebRenderCanvasRenderer(aManager)
   { }
   virtual ~WebRenderCanvasRendererAsync();
 
--- a/js/src/gc/ArenaList-inl.h
+++ b/js/src/gc/ArenaList-inl.h
@@ -251,17 +251,17 @@ js::gc::ArenaLists::setFreeList(AllocKin
 void
 js::gc::ArenaLists::clearFreeList(AllocKind i)
 {
 #ifdef DEBUG
     auto old = freeList(i);
     if (!old->isEmpty())
         old->getArena()->checkNoMarkedFreeCells();
 #endif
-    freeLists()[i] = &placeholder;
+    freeLists()[i] = &emptySentinel;
 }
 
 js::gc::Arena*
 js::gc::ArenaLists::getFirstArena(AllocKind thingKind) const
 {
     return arenaLists(thingKind).head();
 }
 
--- a/js/src/gc/ArenaList.h
+++ b/js/src/gc/ArenaList.h
@@ -229,17 +229,17 @@ class ArenaLists
     FreeSpan* freeList(AllocKind i) const { return freeLists()[i]; }
 
     inline void setFreeList(AllocKind i, FreeSpan* span);
     inline void clearFreeList(AllocKind i);
 
     // 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]; }
     const ArenaList& arenaLists(AllocKind i) const { return arenaLists_.ref()[i]; }
 
     enum BackgroundFinalizeStateEnum { BFS_DONE, BFS_RUN };
 
     typedef mozilla::Atomic<BackgroundFinalizeStateEnum, mozilla::SequentiallyConsistent>
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -395,17 +395,17 @@ FOR_EACH_ALLOCKIND(CHECK_THING_SIZE);
 
 const uint32_t Arena::ThingSizes[] = {
 #define EXPAND_THING_SIZE(allocKind, traceKind, type, sizedType, bgFinal, nursery) \
     sizeof(sizedType),
 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
 
 #define OFFSET(type) uint32_t(ArenaHeaderSize + (ArenaSize - ArenaHeaderSize) % sizeof(type))
 
 const uint32_t Arena::FirstThingOffsets[] = {
 #define EXPAND_FIRST_THING_OFFSET(allocKind, traceKind, type, sizedType, bgFinal, nursery) \
@@ -3082,17 +3082,17 @@ ArenaLists::ArenaLists(JSRuntime* rt, Zo
     incrementalSweptArenas(zone),
     gcShapeArenasToUpdate(zone, nullptr),
     gcAccessorShapeArenasToUpdate(zone, nullptr),
     gcScriptArenasToUpdate(zone, nullptr),
     gcObjectGroupArenasToUpdate(zone, nullptr),
     savedEmptyArenas(zone, nullptr)
 {
     for (auto i : AllAllocKinds()) {
-        freeLists()[i] = &placeholder;
+        freeLists()[i] = &emptySentinel;
         backgroundFinalizeState(i) = BFS_DONE;
         arenaListsToSweep(i) = nullptr;
     }
 }
 
 void
 ReleaseArenaList(JSRuntime* rt, Arena* arena, const AutoLockGC& lock)
 {
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2477,17 +2477,17 @@ pref("security.dialog_enable_delay", 100
 pref("security.notification_enable_delay", 500);
 
 pref("security.csp.enable", true);
 pref("security.csp.experimentalEnabled", false);
 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
 pref("security.csp.enable_violation_events", true);
 #else
 pref("security.csp.enable_violation_events", false);
 #endif
 
--- a/toolkit/components/normandy/content/about-studies/about-studies.html
+++ b/toolkit/components/normandy/content/about-studies/about-studies.html
@@ -1,15 +1,16 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <!DOCTYPE html>
 <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">
     <link rel="stylesheet" href="resource://normandy-content/about-studies/about-studies.css">
   </head>
   <body>
     <div id="app"></div>
     <script src="resource://normandy-vendor/React.js"></script>
--- a/toolkit/components/parentalcontrols/nsParentalControlsService.h
+++ b/toolkit/components/parentalcontrols/nsParentalControlsService.h
@@ -7,21 +7,16 @@
 #define nsParentalControlsService_h__
 
 #include "nsIParentalControlsService.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #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
 
 class nsParentalControlsService : public nsIParentalControlsService
 {
 public:
   NS_DECL_ISUPPORTS
--- a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
+++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
@@ -13,36 +13,28 @@
 #include "nsILocalFileWin.h"
 #include "nsArrayUtils.h"
 #include "nsIXULAppInfo.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/WindowsVersion.h"
 
 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)
 , mProvider(0)
 , mPC(nullptr)
 {
   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;
 
   RefPtr<IWPCSettings> wpcs;
   if (FAILED(mPC->GetUserSettings(nullptr, getter_AddRefs(wpcs)))) {
     // Not available on this os or not enabled for this user account or we're running as admin
     mPC->Release();
     mPC = nullptr;
@@ -53,37 +45,28 @@ nsParentalControlsService::nsParentalCon
   wpcs->GetRestrictions(&settings);
 
   // If we can't determine specifically whether Web Filtering is on/off (i.e.
   // we're on Windows < 8), then assume it's on unless no restrictions are set.
   bool enable = IsWin8OrLater() ? settings & WPCFLAG_WEB_FILTERED
                                 : 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;
   }
 }
 
 nsParentalControlsService::~nsParentalControlsService()
 {
   if (mPC)
     mPC->Release();
 
-  if (gEventUnregister && mProvider)
-    gEventUnregister(mProvider);
-
-  if (gAdvAPIDLLInst)
-    ::FreeLibrary(gAdvAPIDLLInst);
+  if (mProvider) {
+    EventUnregister(mProvider);
+  }
 }
 
 //------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsParentalControlsService::GetParentalControlsEnabled(bool *aResult)
 {
   *aResult = false;
@@ -145,19 +128,17 @@ nsParentalControlsService::Log(int16_t a
   // Confirm we should be logging
   bool enabled;
   GetLoggingEnabled(&enabled);
   if (!enabled)
     return NS_ERROR_NOT_AVAILABLE;
 
   // 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;
   }
 
   switch(aEntryType) {
     case ePCLog_URIVisit:
       // Not needed, Vista's web content filter handles this for us
       break;
     case ePCLog_FileDownload:
@@ -290,19 +271,16 @@ nsParentalControlsService::RequestURIOve
 //------------------------------------------------------------------------
 
 // Sends a file download event to the Vista Event Log
 void
 nsParentalControlsService::LogFileDownload(bool blocked, nsIURI *aSource, nsIFile *aTarget)
 {
   nsAutoCString curi;
 
-  if (!gEventWrite)
-    return;
-
   // Note, EventDataDescCreate is a macro defined in the headers, not a function
 
   aSource->GetSpec(curi);
   nsAutoString uri = NS_ConvertUTF8toUTF16(curi);
 
   // Get the name of the currently running process
   nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
   nsAutoCString asciiAppName;
@@ -330,17 +308,17 @@ nsParentalControlsService::LogFileDownlo
     local->GetCanonicalPath(path);
     EventDataDescCreate(&eventData[WPC_ARGS_FILEDOWNLOADEVENT_PATH], (const void*)path.get(),
                         ((ULONG)path.Length()+1)*sizeof(WCHAR));
   }
   else {
     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
 nsParentalControlsService::IsAllowed(int16_t aAction,
                                      nsIURI *aUri,
                                      bool *_retval)
 {
   return NS_ERROR_NOT_AVAILABLE;