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

Side by Side Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 2494833002: Revert of Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 #include "core/offscreencanvas/OffscreenCanvas.h" 5 #include "core/offscreencanvas/OffscreenCanvas.h"
6 6
7 #include "core/dom/ExceptionCode.h" 7 #include "core/dom/ExceptionCode.h"
8 #include "core/fileapi/Blob.h" 8 #include "core/fileapi/Blob.h"
9 #include "core/html/ImageData.h" 9 #include "core/html/ImageData.h"
10 #include "core/html/canvas/CanvasAsyncBlobCreator.h" 10 #include "core/html/canvas/CanvasAsyncBlobCreator.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bool OffscreenCanvas::isAccelerated() const { 177 bool OffscreenCanvas::isAccelerated() const {
178 return m_context && m_context->isAccelerated(); 178 return m_context && m_context->isAccelerated();
179 } 179 }
180 180
181 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() { 181 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() {
182 if (!m_frameDispatcher) { 182 if (!m_frameDispatcher) {
183 // The frame dispatcher connects the current thread of OffscreenCanvas 183 // The frame dispatcher connects the current thread of OffscreenCanvas
184 // (either main or worker) to the browser process and remains unchanged 184 // (either main or worker) to the browser process and remains unchanged
185 // throughout the lifetime of this OffscreenCanvas. 185 // throughout the lifetime of this OffscreenCanvas.
186 m_frameDispatcher = wrapUnique(new OffscreenCanvasFrameDispatcherImpl( 186 m_frameDispatcher = wrapUnique(new OffscreenCanvasFrameDispatcherImpl(
187 m_clientId, m_sinkId, m_localId, m_nonceHigh, m_nonceLow, width(), 187 m_clientId, m_sinkId, m_localId, m_nonce, width(), height()));
188 height()));
189 } 188 }
190 return m_frameDispatcher.get(); 189 return m_frameDispatcher.get();
191 } 190 }
192 191
193 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState, 192 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState,
194 const ImageEncodeOptions& options, 193 const ImageEncodeOptions& options,
195 ExceptionState& exceptionState) { 194 ExceptionState& exceptionState) {
196 if (this->isNeutered()) { 195 if (this->isNeutered()) {
197 exceptionState.throwDOMException(InvalidStateError, 196 exceptionState.throwDOMException(InvalidStateError,
198 "OffscreenCanvas object is detached."); 197 "OffscreenCanvas object is detached.");
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 asyncCreator->scheduleAsyncBlobCreation(options.quality()); 234 asyncCreator->scheduleAsyncBlobCreation(options.quality());
236 235
237 return resolver->promise(); 236 return resolver->promise();
238 } 237 }
239 238
240 DEFINE_TRACE(OffscreenCanvas) { 239 DEFINE_TRACE(OffscreenCanvas) {
241 visitor->trace(m_context); 240 visitor->trace(m_context);
242 } 241 }
243 242
244 } // namespace blink 243 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698