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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2133623002: Introduce Document::unthrottledTaskRunner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 673
674 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState) 674 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState)
675 { 675 {
676 if (!originClean()) { 676 if (!originClean()) {
677 exceptionState.throwSecurityError("Tainted canvases may not be exported. "); 677 exceptionState.throwSecurityError("Tainted canvases may not be exported. ");
678 return; 678 return;
679 } 679 }
680 680
681 if (!isPaintable()) { 681 if (!isPaintable()) {
682 // If the canvas element's bitmap has no pixels 682 // If the canvas element's bitmap has no pixels
683 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, WTF::bind(&BlobCallback::handleEvent, wrapPersistent(callback), nullptr )); 683 document().unthrottledTaskRunner()->postTask(BLINK_FROM_HERE, WTF::bind( &BlobCallback::handleEvent, wrapPersistent(callback), nullptr));
Sami 2016/07/08 09:13:29 Looks like this can execute script. I wonder if it
dcheng 2016/07/08 10:27:37 What are "things like these"? To me, the distinct
684 return; 684 return;
685 } 685 }
686 686
687 double startTime = WTF::monotonicallyIncreasingTime(); 687 double startTime = WTF::monotonicallyIncreasingTime();
688 double quality = UndefinedQualityValue; 688 double quality = UndefinedQualityValue;
689 if (!qualityArgument.isEmpty()) { 689 if (!qualityArgument.isEmpty()) {
690 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); 690 v8::Local<v8::Value> v8Value = qualityArgument.v8Value();
691 if (v8Value->IsNumber()) { 691 if (v8Value->IsNumber()) {
692 quality = v8Value.As<v8::Number>()->Value(); 692 quality = v8Value.As<v8::Number>()->Value();
693 } 693 }
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 1194
1195 bool HTMLCanvasElement::createSurfaceLayer() 1195 bool HTMLCanvasElement::createSurfaceLayer()
1196 { 1196 {
1197 DCHECK(!m_surfaceLayerBridge); 1197 DCHECK(!m_surfaceLayerBridge);
1198 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl()); 1198 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl());
1199 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient))); 1199 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient)));
1200 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( )); 1200 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( ));
1201 } 1201 }
1202 1202
1203 } // namespace blink 1203 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698