| 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 654 |
| 655 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c
onst ScriptValue& qualityArgument, ExceptionState& exceptionState) | 655 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c
onst ScriptValue& qualityArgument, ExceptionState& exceptionState) |
| 656 { | 656 { |
| 657 if (!originClean()) { | 657 if (!originClean()) { |
| 658 exceptionState.throwSecurityError("Tainted canvases may not be exported.
"); | 658 exceptionState.throwSecurityError("Tainted canvases may not be exported.
"); |
| 659 return; | 659 return; |
| 660 } | 660 } |
| 661 | 661 |
| 662 if (!isPaintable()) { | 662 if (!isPaintable()) { |
| 663 // If the canvas element's bitmap has no pixels | 663 // If the canvas element's bitmap has no pixels |
| 664 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, bind(&BlobCallback::handleEvent, callback, nullptr)); | 664 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, bind(&BlobCallback::handleEvent, wrapCrossThreadPersistent(callback), n
ullptr)); |
| 665 return; | 665 return; |
| 666 } | 666 } |
| 667 | 667 |
| 668 double quality = UndefinedQualityValue; | 668 double quality = UndefinedQualityValue; |
| 669 if (!qualityArgument.isEmpty()) { | 669 if (!qualityArgument.isEmpty()) { |
| 670 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); | 670 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); |
| 671 if (v8Value->IsNumber()) { | 671 if (v8Value->IsNumber()) { |
| 672 quality = v8Value.As<v8::Number>()->Value(); | 672 quality = v8Value.As<v8::Number>()->Value(); |
| 673 } | 673 } |
| 674 } | 674 } |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 return m_context->getIdFromControl(element); | 1165 return m_context->getIdFromControl(element); |
| 1166 return String(); | 1166 return String(); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void HTMLCanvasElement::createSurfaceLayerBridge() | 1169 void HTMLCanvasElement::createSurfaceLayerBridge() |
| 1170 { | 1170 { |
| 1171 m_surfaceLayerBridge = adoptPtr(new CanvasSurfaceLayerBridge()); | 1171 m_surfaceLayerBridge = adoptPtr(new CanvasSurfaceLayerBridge()); |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 } // namespace blink | 1174 } // namespace blink |
| OLD | NEW |