summaryrefslogtreecommitdiffstats
path: root/dom/html/HTMLCanvasElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/html/HTMLCanvasElement.h')
-rw-r--r--dom/html/HTMLCanvasElement.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h
index 76c1cbf..99b9be8 100644
--- a/dom/html/HTMLCanvasElement.h
+++ b/dom/html/HTMLCanvasElement.h
@@ -201,7 +201,7 @@ class HTMLCanvasElement final : public nsGenericHTMLElement,
/**
* Determine whether the canvas is write-only.
*/
- bool IsWriteOnly();
+ bool IsWriteOnly() const;
/**
* Force the canvas to be write-only.
@@ -209,6 +209,12 @@ class HTMLCanvasElement final : public nsGenericHTMLElement,
void SetWriteOnly();
/**
+ * Force the canvas to be write-only, except for readers from
+ * a specific extension's content script expanded principal.
+ */
+ void SetWriteOnly(nsIPrincipal* aExpandedReader);
+
+ /**
* Notify that some canvas content has changed and the window may
* need to be updated. aDamageRect is in canvas coordinates.
*/
@@ -369,7 +375,14 @@ class HTMLCanvasElement final : public nsGenericHTMLElement,
// We also transitively set it when script paints a canvas which
// is itself write-only.
bool mWriteOnly;
-
+
+ // When this canvas is (only) tainted by an image from an extension
+ // content script, allow reads from the same extension afterwards.
+ RefPtr<nsIPrincipal> mExpandedReader;
+
+ // Determines if the caller should be able to read the content.
+ bool CallerCanRead(JSContext* aCx);
+
bool IsPrintCallbackDone();
void HandlePrintCallback(nsPresContext::nsPresContextType aType);