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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 96203003: Switch HTMLCanvasElement over to new-style ExceptionState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Capitalize the 'tainted' error messages Created 7 years 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, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 } 1875 }
1876 1876
1877 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f loat sy, float sw, float sh, ExceptionState& exceptionState) const 1877 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f loat sy, float sw, float sh, ExceptionState& exceptionState) const
1878 { 1878 {
1879 return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, s h, exceptionState); 1879 return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, s h, exceptionState);
1880 } 1880 }
1881 1881
1882 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi nateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionSt ate& exceptionState) const 1882 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi nateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionSt ate& exceptionState) const
1883 { 1883 {
1884 if (!canvas()->originClean()) { 1884 if (!canvas()->originClean()) {
1885 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("ge tImageData", "CanvasRenderingContext2D", "the canvas has been tainted by cross-o rigin data.")); 1885 exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("ge tImageData", "CanvasRenderingContext2D", "The canvas has been tainted by cross-o rigin data."));
1886 return 0; 1886 return 0;
1887 } 1887 }
1888 1888
1889 if (!sw || !sh) { 1889 if (!sw || !sh) {
1890 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); 1890 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError);
1891 return 0; 1891 return 0;
1892 } 1892 }
1893 if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std:: isfinite(sh)) { 1893 if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std:: isfinite(sh)) {
1894 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r); 1894 exceptionState.throwUninformativeAndGenericDOMException(NotSupportedErro r);
1895 return 0; 1895 return 0;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 const int focusRingWidth = 5; 2427 const int focusRingWidth = 5;
2428 const int focusRingOutline = 0; 2428 const int focusRingOutline = 0;
2429 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); 2429 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
2430 2430
2431 c->restore(); 2431 c->restore();
2432 2432
2433 didDraw(dirtyRect); 2433 didDraw(dirtyRect);
2434 } 2434 }
2435 2435
2436 } // namespace WebCore 2436 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698