Bug 1639975. Make sure CanvasRenderingContextHelper::mCurrentContextType is initialized. r=nical
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 22 May 2020 09:14:04 +0000
changeset 531710 c60409cd0710b6584acc32d67e9205b6a9a57dba
parent 531709 cf1159646b4577b0e7ed5589689a378c49d75626
child 531711 4c53c244dba1049c7db3fa421e6888301d4ca202
push id37442
push userncsoregi@mozilla.com
push dateSat, 23 May 2020 09:21:24 +0000
treeherdermozilla-central@bbcc193fe0f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1639975
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639975. Make sure CanvasRenderingContextHelper::mCurrentContextType is initialized. r=nical Differential Revision: https://phabricator.services.mozilla.com/D76438
dom/canvas/CanvasRenderingContextHelper.cpp
dom/canvas/CanvasRenderingContextHelper.h
--- a/dom/canvas/CanvasRenderingContextHelper.cpp
+++ b/dom/canvas/CanvasRenderingContextHelper.cpp
@@ -16,16 +16,19 @@
 #include "nsDOMJSUtils.h"
 #include "nsIScriptContext.h"
 #include "nsJSUtils.h"
 #include "ClientWebGLContext.h"
 
 namespace mozilla {
 namespace dom {
 
+CanvasRenderingContextHelper::CanvasRenderingContextHelper()
+    : mCurrentContextType(CanvasContextType::NoContext) {}
+
 void CanvasRenderingContextHelper::ToBlob(
     JSContext* aCx, nsIGlobalObject* aGlobal, BlobCallback& aCallback,
     const nsAString& aType, JS::Handle<JS::Value> aParams, bool aUsePlaceholder,
     ErrorResult& aRv) {
   // Encoder callback when encoding is complete.
   class EncodeCallback : public EncodeCompleteCallback {
    public:
     EncodeCallback(nsIGlobalObject* aGlobal, BlobCallback* aCallback)
--- a/dom/canvas/CanvasRenderingContextHelper.h
+++ b/dom/canvas/CanvasRenderingContextHelper.h
@@ -32,16 +32,18 @@ enum class CanvasContextType : uint8_t {
 };
 
 /**
  * Povides common RenderingContext functionality used by both OffscreenCanvas
  * and HTMLCanvasElement.
  */
 class CanvasRenderingContextHelper {
  public:
+  CanvasRenderingContextHelper();
+
   virtual already_AddRefed<nsISupports> GetContext(
       JSContext* aCx, const nsAString& aContextId,
       JS::Handle<JS::Value> aContextOptions, ErrorResult& aRv);
 
   virtual bool GetOpaqueAttr() = 0;
 
  protected:
   virtual nsresult UpdateContext(JSContext* aCx,