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

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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Changed SurfaceManager::kRootSurfaceId to a private field to avoid static initialization 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_nonce, width(), height())); 187 m_clientId, m_sinkId, m_localId, m_nonceHigh, m_nonceLow, width(),
188 height()));
188 } 189 }
189 return m_frameDispatcher.get(); 190 return m_frameDispatcher.get();
190 } 191 }
191 192
192 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState, 193 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState,
193 const ImageEncodeOptions& options, 194 const ImageEncodeOptions& options,
194 ExceptionState& exceptionState) { 195 ExceptionState& exceptionState) {
195 if (this->isNeutered()) { 196 if (this->isNeutered()) {
196 exceptionState.throwDOMException(InvalidStateError, 197 exceptionState.throwDOMException(InvalidStateError,
197 "OffscreenCanvas object is detached."); 198 "OffscreenCanvas object is detached.");
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 asyncCreator->scheduleAsyncBlobCreation(options.quality()); 235 asyncCreator->scheduleAsyncBlobCreation(options.quality());
235 236
236 return resolver->promise(); 237 return resolver->promise();
237 } 238 }
238 239
239 DEFINE_TRACE(OffscreenCanvas) { 240 DEFINE_TRACE(OffscreenCanvas) {
240 visitor->trace(m_context); 241 visitor->trace(m_context);
241 } 242 }
242 243
243 } // namespace blink 244 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698