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

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

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/DataView.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 4d7b8c43d0a40af0aecb4b810b8fecb7bba8f5b4..2bb4d8c8965b9691d11f7ea78639d34ebf9013f5 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1284,7 +1284,7 @@ void CanvasRenderingContext2D::drawImageInternal(Image* image, const FloatRect&
void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap, float x, float y, ExceptionState& es)
{
if (!bitmap) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
drawImage(bitmap, x, y, bitmap->width(), bitmap->height(), es);
@@ -1294,7 +1294,7 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
float x, float y, float width, float height, ExceptionState& es)
{
if (!bitmap) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
if (!bitmap->bitmapRect().width() || !bitmap->bitmapRect().height())
@@ -1308,7 +1308,7 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
float dx, float dy, float dw, float dh, ExceptionState& es)
{
if (!bitmap) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
@@ -1323,7 +1323,7 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
if (!dstRect.width() || !dstRect.height())
return;
if (!srcRect.width() || !srcRect.height()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return;
}
@@ -1359,7 +1359,7 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionState& es)
{
if (!image) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
LayoutSize size = sizeFor(image);
@@ -1370,7 +1370,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
float x, float y, float width, float height, ExceptionState& es)
{
if (!image) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
LayoutSize size = sizeFor(image);
@@ -1392,7 +1392,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, ExceptionState& es)
{
if (!image) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
@@ -1406,7 +1406,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
LayoutSize size = sizeFor(image);
if (!size.width() || !size.height()) {
- es.throwDOMException(InvalidStateError);
+ es.throwUninformativeAndGenericDOMException(InvalidStateError);
return;
}
@@ -1418,7 +1418,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
FloatRect imageRect = FloatRect(FloatPoint(), size);
if (!srcRect.width() || !srcRect.height()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return;
}
if (!imageRect.intersects(normalizedSrcRect))
@@ -1461,19 +1461,19 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
const FloatRect& dstRect, ExceptionState& es)
{
if (!sourceCanvas) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas->size());
if (!srcCanvasRect.width() || !srcCanvasRect.height()) {
- es.throwDOMException(InvalidStateError);
+ es.throwUninformativeAndGenericDOMException(InvalidStateError);
return;
}
if (!srcRect.width() || !srcRect.height()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return;
}
@@ -1531,7 +1531,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionState& es)
{
if (!video) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
IntSize size = sizeFor(video);
@@ -1542,7 +1542,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
float x, float y, float width, float height, ExceptionState& es)
{
if (!video) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
IntSize size = sizeFor(video);
@@ -1559,7 +1559,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionState& es)
{
if (!video) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
@@ -1568,7 +1568,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
FloatRect videoRect = FloatRect(FloatPoint(), sizeFor(video));
if (!srcRect.width() || !srcRect.height()) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return;
}
@@ -1692,7 +1692,7 @@ template<class T> void CanvasRenderingContext2D::fullCanvasCompositedFill(const
PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1, ExceptionState& es)
{
if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(x1) || !std::isfinite(y1)) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return 0;
}
@@ -1703,12 +1703,12 @@ PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float
PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionState& es)
{
if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(r0) || !std::isfinite(x1) || !std::isfinite(y1) || !std::isfinite(r1)) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return 0;
}
if (r0 < 0 || r1 < 0) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return 0;
}
@@ -1720,7 +1720,7 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLImageEleme
const String& repetitionType, ExceptionState& es)
{
if (!image) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return 0;
}
bool repeatX, repeatY;
@@ -1748,11 +1748,11 @@ PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem
const String& repetitionType, ExceptionState& es)
{
if (!canvas) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return 0;
}
if (!canvas->width() || !canvas->height()) {
- es.throwDOMException(InvalidStateError);
+ es.throwUninformativeAndGenericDOMException(InvalidStateError);
return 0;
}
@@ -1832,7 +1832,7 @@ static PassRefPtr<ImageData> createEmptyImageData(const IntSize& size)
PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(PassRefPtr<ImageData> imageData, ExceptionState& es) const
{
if (!imageData) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return 0;
}
@@ -1842,11 +1842,11 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(PassRefPtr<Image
PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionState& es) const
{
if (!sw || !sh) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return 0;
}
if (!std::isfinite(sw) || !std::isfinite(sh)) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return 0;
}
@@ -1881,11 +1881,11 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi
}
if (!sw || !sh) {
- es.throwDOMException(IndexSizeError);
+ es.throwUninformativeAndGenericDOMException(IndexSizeError);
return 0;
}
if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std::isfinite(sh)) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return 0;
}
@@ -1921,7 +1921,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi
void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionState& es)
{
if (!data) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
putImageData(data, dx, dy, 0, 0, data->width(), data->height(), es);
@@ -1930,7 +1930,7 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionState& es)
{
if (!data) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), es);
@@ -1951,11 +1951,11 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::Coordi
float dirtyWidth, float dirtyHeight, ExceptionState& es)
{
if (!data) {
- es.throwDOMException(TypeMismatchError);
+ es.throwUninformativeAndGenericDOMException(TypeMismatchError);
return;
}
if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !std::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight)) {
- es.throwDOMException(NotSupportedError);
+ es.throwUninformativeAndGenericDOMException(NotSupportedError);
return;
}
« no previous file with comments | « Source/core/html/canvas/CanvasPattern.cpp ('k') | Source/core/html/canvas/DataView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698