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

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

Issue 2223813002: Use CanvasBlobSerialization task runner for canvas serialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp » ('j') | 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 706
707 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState) 707 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState)
708 { 708 {
709 if (!originClean()) { 709 if (!originClean()) {
710 exceptionState.throwSecurityError("Tainted canvases may not be exported. "); 710 exceptionState.throwSecurityError("Tainted canvases may not be exported. ");
711 return; 711 return;
712 } 712 }
713 713
714 if (!isPaintable()) { 714 if (!isPaintable()) {
715 // If the canvas element's bitmap has no pixels 715 // If the canvas element's bitmap has no pixels
716 TaskRunnerHelper::getUnthrottledTaskRunner(&document())->postTask(BLINK_ FROM_HERE, WTF::bind(&BlobCallback::handleEvent, wrapPersistent(callback), nullp tr)); 716 TaskRunnerHelper::get(TaskType::CanvasBlobSerialization, &document())->p ostTask(BLINK_FROM_HERE, WTF::bind(&BlobCallback::handleEvent, wrapPersistent(ca llback), nullptr));
717 return; 717 return;
718 } 718 }
719 719
720 double startTime = WTF::monotonicallyIncreasingTime(); 720 double startTime = WTF::monotonicallyIncreasingTime();
721 double quality = UndefinedQualityValue; 721 double quality = UndefinedQualityValue;
722 if (!qualityArgument.isEmpty()) { 722 if (!qualityArgument.isEmpty()) {
723 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); 723 v8::Local<v8::Value> v8Value = qualityArgument.v8Value();
724 if (v8Value->IsNumber()) { 724 if (v8Value->IsNumber()) {
725 quality = v8Value.As<v8::Number>()->Value(); 725 quality = v8Value.As<v8::Number>()->Value();
726 } 726 }
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 1228
1229 bool HTMLCanvasElement::createSurfaceLayer() 1229 bool HTMLCanvasElement::createSurfaceLayer()
1230 { 1230 {
1231 DCHECK(!m_surfaceLayerBridge); 1231 DCHECK(!m_surfaceLayerBridge);
1232 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl()); 1232 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl());
1233 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient))); 1233 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient)));
1234 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( )); 1234 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( ));
1235 } 1235 }
1236 1236
1237 } // namespace blink 1237 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698