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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContext.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, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 5118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5129 if (!image || !image->cachedImage()) { 5129 if (!image || !image->cachedImage()) {
5130 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no im age"); 5130 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no im age");
5131 return false; 5131 return false;
5132 } 5132 }
5133 const KURL& url = image->cachedImage()->response().url(); 5133 const KURL& url = image->cachedImage()->response().url();
5134 if (url.isNull() || url.isEmpty() || !url.isValid()) { 5134 if (url.isNull() || url.isEmpty() || !url.isValid()) {
5135 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "inval id image"); 5135 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "inval id image");
5136 return false; 5136 return false;
5137 } 5137 }
5138 if (wouldTaintOrigin(image)) { 5138 if (wouldTaintOrigin(image)) {
5139 ec = SECURITY_ERR; 5139 ec = SecurityError;
5140 return false; 5140 return false;
5141 } 5141 }
5142 return true; 5142 return true;
5143 } 5143 }
5144 5144
5145 bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas, ExceptionCode& ec) 5145 bool WebGLRenderingContext::validateHTMLCanvasElement(const char* functionName, HTMLCanvasElement* canvas, ExceptionCode& ec)
5146 { 5146 {
5147 if (!canvas || !canvas->buffer()) { 5147 if (!canvas || !canvas->buffer()) {
5148 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no ca nvas"); 5148 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no ca nvas");
5149 return false; 5149 return false;
5150 } 5150 }
5151 if (wouldTaintOrigin(canvas)) { 5151 if (wouldTaintOrigin(canvas)) {
5152 ec = SECURITY_ERR; 5152 ec = SecurityError;
5153 return false; 5153 return false;
5154 } 5154 }
5155 return true; 5155 return true;
5156 } 5156 }
5157 5157
5158 bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, H TMLVideoElement* video, ExceptionCode& ec) 5158 bool WebGLRenderingContext::validateHTMLVideoElement(const char* functionName, H TMLVideoElement* video, ExceptionCode& ec)
5159 { 5159 {
5160 if (!video || !video->videoWidth() || !video->videoHeight()) { 5160 if (!video || !video->videoWidth() || !video->videoHeight()) {
5161 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no vi deo"); 5161 synthesizeGLError(GraphicsContext3D::INVALID_VALUE, functionName, "no vi deo");
5162 return false; 5162 return false;
5163 } 5163 }
5164 if (wouldTaintOrigin(video)) { 5164 if (wouldTaintOrigin(video)) {
5165 ec = SECURITY_ERR; 5165 ec = SecurityError;
5166 return false; 5166 return false;
5167 } 5167 }
5168 return true; 5168 return true;
5169 } 5169 }
5170 5170
5171 bool WebGLRenderingContext::validateDrawArrays(const char* functionName, GC3Denu m mode, GC3Dint first, GC3Dsizei count) 5171 bool WebGLRenderingContext::validateDrawArrays(const char* functionName, GC3Denu m mode, GC3Dint first, GC3Dsizei count)
5172 { 5172 {
5173 if (isContextLost() || !validateDrawMode(functionName, mode)) 5173 if (isContextLost() || !validateDrawMode(functionName, mode))
5174 return false; 5174 return false;
5175 5175
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
5581 5581
5582 void WebGLRenderingContext::multisamplingChanged(bool enabled) 5582 void WebGLRenderingContext::multisamplingChanged(bool enabled)
5583 { 5583 {
5584 if (m_multisamplingAllowed != enabled) { 5584 if (m_multisamplingAllowed != enabled) {
5585 m_multisamplingAllowed = enabled; 5585 m_multisamplingAllowed = enabled;
5586 forceLostContext(WebGLRenderingContext::AutoRecoverSyntheticLostContext) ; 5586 forceLostContext(WebGLRenderingContext::AutoRecoverSyntheticLostContext) ;
5587 } 5587 }
5588 } 5588 }
5589 5589
5590 } // namespace WebCore 5590 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/html/track/TextTrack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698