Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Issue 2143033005: Transfer components of SurfaceId in OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
index 7025234cad0bc6311574752511096c81c41e4c10..1bc0896e8fedbc820994f5082d4fc800b6e3de74 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
@@ -47,6 +47,16 @@ public:
bool originClean() const;
void setOriginTainted() { m_originClean = false; }
+ void setSurfaceId(uint32_t clientId, uint32_t localId, uint64_t nonce)
+ {
+ m_clientId = clientId;
+ m_localId = localId;
+ m_nonce = nonce;
+ }
+ uint32_t clientId() const { return m_clientId; }
+ uint32_t localId() const { return m_localId; }
+ uint64_t nonce() const { return m_nonce; }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -62,6 +72,14 @@ private:
bool m_isNeutered = false;
bool m_originClean;
+
+ // cc::SurfaceId is broken into three integer components as this can be used
+ // in transfer of OffscreenCanvas across threads
+ // If this object is not created via HTMLCanvasElement.transferControlToOffscreen(),
+ // then the following members would remain as initialized zero values.
+ uint32_t m_clientId = 0;
+ uint32_t m_localId = 0;
+ uint64_t m_nonce = 0;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698