Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |