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

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

Issue 1916283003: [K6] Replace bind() + GCed pointers with retainedRef() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_5c
Patch Set: Rebase Created 4 years, 7 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
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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState) 618 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c onst ScriptValue& qualityArgument, ExceptionState& exceptionState)
619 { 619 {
620 if (!originClean()) { 620 if (!originClean()) {
621 exceptionState.throwSecurityError("Tainted canvases may not be exported. "); 621 exceptionState.throwSecurityError("Tainted canvases may not be exported. ");
622 return; 622 return;
623 } 623 }
624 624
625 if (!isPaintable()) { 625 if (!isPaintable()) {
626 // If the canvas element's bitmap has no pixels 626 // If the canvas element's bitmap has no pixels
627 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, bind(&BlobCallback::handleEvent, callback, nullptr)); 627 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR OM_HERE, bind(&BlobCallback::handleEvent, retainedRef(callback), nullptr));
628 return; 628 return;
629 } 629 }
630 630
631 double quality = UndefinedQualityValue; 631 double quality = UndefinedQualityValue;
632 if (!qualityArgument.isEmpty()) { 632 if (!qualityArgument.isEmpty()) {
633 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); 633 v8::Local<v8::Value> v8Value = qualityArgument.v8Value();
634 if (v8Value->IsNumber()) { 634 if (v8Value->IsNumber()) {
635 quality = v8Value.As<v8::Number>()->Value(); 635 quality = v8Value.As<v8::Number>()->Value();
636 } 636 }
637 } 637 }
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } 1117 }
1118 1118
1119 String HTMLCanvasElement::getIdFromControl(const Element* element) 1119 String HTMLCanvasElement::getIdFromControl(const Element* element)
1120 { 1120 {
1121 if (m_context) 1121 if (m_context)
1122 return m_context->getIdFromControl(element); 1122 return m_context->getIdFromControl(element);
1123 return String(); 1123 return String();
1124 } 1124 }
1125 1125
1126 } // namespace blink 1126 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/core/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698