OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef OffscreenCanvas_h | 5 #ifndef OffscreenCanvas_h |
6 #define OffscreenCanvas_h | 6 #define OffscreenCanvas_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 bool originClean() const; | 63 bool originClean() const; |
64 void setOriginTainted() { m_originClean = false; } | 64 void setOriginTainted() { m_originClean = false; } |
65 // TODO(crbug.com/630356): apply the flag to WebGL context as well | 65 // TODO(crbug.com/630356): apply the flag to WebGL context as well |
66 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } | 66 void setDisableReadingFromCanvasTrue() { m_disableReadingFromCanvas = true; } |
67 | 67 |
68 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); | 68 OffscreenCanvasFrameDispatcher* getOrCreateFrameDispatcher(); |
69 | 69 |
70 void setSurfaceId(uint32_t clientId, | 70 void setSurfaceId(uint32_t clientId, |
71 uint32_t sinkId, | 71 uint32_t sinkId, |
72 uint32_t localId, | 72 uint32_t localId, |
73 uint64_t nonce) { | 73 uint64_t nonceHigh, |
| 74 uint64_t nonceLow) { |
74 m_clientId = clientId; | 75 m_clientId = clientId; |
75 m_sinkId = sinkId; | 76 m_sinkId = sinkId; |
76 m_localId = localId; | 77 m_localId = localId; |
77 m_nonce = nonce; | 78 m_nonceHigh = nonceHigh; |
| 79 m_nonceLow = nonceLow; |
78 } | 80 } |
79 uint32_t clientId() const { return m_clientId; } | 81 uint32_t clientId() const { return m_clientId; } |
80 uint32_t sinkId() const { return m_sinkId; } | 82 uint32_t sinkId() const { return m_sinkId; } |
81 uint32_t localId() const { return m_localId; } | 83 uint32_t localId() const { return m_localId; } |
82 uint64_t nonce() const { return m_nonce; } | 84 uint64_t nonceHigh() const { return m_nonceHigh; } |
| 85 uint64_t nonceLow() const { return m_nonceLow; } |
83 | 86 |
84 // CanvasImageSource implementation | 87 // CanvasImageSource implementation |
85 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, | 88 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, |
86 AccelerationHint, | 89 AccelerationHint, |
87 SnapshotReason, | 90 SnapshotReason, |
88 const FloatSize&) const final; | 91 const FloatSize&) const final; |
89 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean; } | 92 bool wouldTaintOrigin(SecurityOrigin*) const final { return !m_originClean; } |
90 bool isOffscreenCanvas() const final { return true; } | 93 bool isOffscreenCanvas() const final { return true; } |
91 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { | 94 FloatSize elementSize(const FloatSize& defaultObjectSize) const final { |
92 return FloatSize(width(), height()); | 95 return FloatSize(width(), height()); |
(...skipping 27 matching lines...) Expand all Loading... |
120 | 123 |
121 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; | 124 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; |
122 // cc::SurfaceId is broken into three integer components as this can be used | 125 // cc::SurfaceId is broken into three integer components as this can be used |
123 // in transfer of OffscreenCanvas across threads | 126 // in transfer of OffscreenCanvas across threads |
124 // If this object is not created via | 127 // If this object is not created via |
125 // HTMLCanvasElement.transferControlToOffscreen(), | 128 // HTMLCanvasElement.transferControlToOffscreen(), |
126 // then the following members would remain as initialized zero values. | 129 // then the following members would remain as initialized zero values. |
127 uint32_t m_clientId = 0; | 130 uint32_t m_clientId = 0; |
128 uint32_t m_sinkId = 0; | 131 uint32_t m_sinkId = 0; |
129 uint32_t m_localId = 0; | 132 uint32_t m_localId = 0; |
130 uint64_t m_nonce = 0; | 133 uint64_t m_nonceHigh = 0; |
| 134 uint64_t m_nonceLow = 0; |
131 }; | 135 }; |
132 | 136 |
133 } // namespace blink | 137 } // namespace blink |
134 | 138 |
135 #endif // OffscreenCanvas_h | 139 #endif // OffscreenCanvas_h |
OLD | NEW |