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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/canvas/CanvasPattern.cpp ('k') | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 08fa65f30be506fb3db9ce397d823b7137427ce8..659bad1f26b125e4af7d3383a492b0c5fe8b4c27 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1189,7 +1189,7 @@ static inline FloatRect normalizeRect(const FloatRect& rect)
void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec)
{
if (!image) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
LayoutSize s = size(image);
@@ -1200,7 +1200,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
float x, float y, float width, float height, ExceptionCode& ec)
{
if (!image) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
LayoutSize s = size(image);
@@ -1222,7 +1222,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode, ExceptionCode& ec)
{
if (!image) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -1307,14 +1307,14 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
const FloatRect& dstRect, ExceptionCode& ec)
{
if (!sourceCanvas) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas->size());
if (!srcCanvasRect.width() || !srcCanvasRect.height()) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return;
}
@@ -1367,7 +1367,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionCode& ec)
{
if (!video) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
IntSize s = size(video);
@@ -1378,7 +1378,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
float x, float y, float width, float height, ExceptionCode& ec)
{
if (!video) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
IntSize s = size(video);
@@ -1396,7 +1396,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
ExceptionCode& ec)
{
if (!video) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
@@ -1627,7 +1627,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLImageEleme
const String& repetitionType, ExceptionCode& ec)
{
if (!image) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
bool repeatX, repeatY;
@@ -1656,11 +1656,11 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem
const String& repetitionType, ExceptionCode& ec)
{
if (!canvas) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return 0;
}
if (!canvas->width() || !canvas->height()) {
- ec = INVALID_STATE_ERR;
+ ec = InvalidStateError;
return 0;
}
@@ -1787,7 +1787,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi
if (!canvas()->originClean()) {
DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Unable to get image data from canvas because the canvas has been tainted by cross-origin data.")));
canvas()->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);
- ec = SECURITY_ERR;
+ ec = SecurityError;
return 0;
}
@@ -1832,7 +1832,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi
void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionCode& ec)
{
if (!data) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
putImageData(data, dx, dy, 0, 0, data->width(), data->height(), ec);
@@ -1841,7 +1841,7 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionCode& ec)
{
if (!data) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), ec);
@@ -1862,7 +1862,7 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::Coordi
float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
{
if (!data) {
- ec = TYPE_MISMATCH_ERR;
+ ec = TypeMismatchError;
return;
}
if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !std::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight)) {
« no previous file with comments | « Source/core/html/canvas/CanvasPattern.cpp ('k') | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698