SRA-SiliconValley/webkit-webcl — pull request #480 by arenevier (2014-03-11 23:34:51+00:00)
Title: 2014-03-11  Arnaud Renevier  <a.renevier@samsung.com>

Refactor exception handling.

The goal is to put all WebKit specific code in a single file. That way,
porting to blink will be more easy.

We create a function setExceptionFromComputeErrorCode which sets
exception code to the code matching the computeContext error.

We also create a special function setExtensionsNotEnabledException
because EXTENSION_NOT_ENABLED doesn't have a matching computeContext
error code.

And also, we create a willThrowException function that returns true if
the exceptionCode has been set to an error code.

Lastly, we define ExceptionObject to be ExceptionCode. Then, when
porting to blink, we'll be able to define ExceptionObject to be
ExceptionState, and be able to call the 3 functions without
modifications.

Bug #478

Reviewed by NOBODY (OOPS!).

No new tests (OOPS!).

* Modules/webcl/WebCL.cpp:
(WebCore::WebCL::getPlatforms):
(WebCore::WebCL::waitForEvents):
(WebCore::WebCL::createContext):
* Modules/webcl/WebCL.h:
* Modules/webcl/WebCLBuffer.cpp:
(WebCore::WebCLBuffer::create):
(WebCore::WebCLBuffer::createSubBuffer):
* Modules/webcl/WebCLBuffer.h:
* Modules/webcl/WebCLCommandQueue.cpp:
(WebCore::WebCLCommandQueue::create):
(WebCore::WebCLCommandQueue::getInfo):
(WebCore::WebCLCommandQueue::ccEventListFromWebCLEventList):
(WebCore::WebCLCommandQueue::computeEventFromWebCLEventIfApplicable):
(WebCore::WebCLCommandQueue::enqueueWriteBufferBase):
(WebCore::WebCLCommandQueue::enqueueWriteBuffer):
(WebCore::WebCLCommandQueue::enqueueWriteBufferRectBase):
(WebCore::WebCLCommandQueue::enqueueWriteBufferRect):
(WebCore::WebCLCommandQueue::enqueueReadBufferBase):
(WebCore::WebCLCommandQueue::enqueueReadBuffer):
(WebCore::WebCLCommandQueue::enqueueReadImageBase):
(WebCore::WebCLCommandQueue::enqueueReadImage):
(WebCore::WebCLCommandQueue::enqueueReadBufferRectBase):
(WebCore::WebCLCommandQueue::enqueueReadBufferRect):
(WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
(WebCore::WebCLCommandQueue::enqueueWaitForEvents):
(WebCore::WebCLCommandQueue::finish):
(WebCore::WebCLCommandQueue::flush):
(WebCore::WebCLCommandQueue::enqueueWriteImageBase):
(WebCore::WebCLCommandQueue::enqueueWriteImage):
(WebCore::WebCLCommandQueue::enqueueCopyImage):
(WebCore::WebCLCommandQueue::enqueueCopyImageToBuffer):
(WebCore::WebCLCommandQueue::enqueueCopyBufferToImage):
(WebCore::WebCLCommandQueue::enqueueCopyBuffer):
(WebCore::WebCLCommandQueue::enqueueCopyBufferRect):
(WebCore::WebCLCommandQueue::enqueueBarrier):
(WebCore::WebCLCommandQueue::enqueueMarker):
(WebCore::WebCLCommandQueue::enqueueAcquireGLObjects):
(WebCore::WebCLCommandQueue::enqueueReleaseGLObjects):
* Modules/webcl/WebCLCommandQueue.h:
* Modules/webcl/WebCLContext.cpp:
(WebCore::WebCLContext::create):
(WebCore::WebCLContext::getInfo):
(WebCore::WebCLContext::createCommandQueue):
(WebCore::WebCLContext::createProgram):
(WebCore::WebCLContext::postCreateCommandQueue):
(WebCore::WebCLContext::postCreateBuffer):
(WebCore::WebCLContext::createBufferBase):
(WebCore::WebCLContext::createBuffer):
(WebCore::WebCLContext::createImage2DBase):
(WebCore::WebCLContext::createImage):
(WebCore::WebCLContext::createSampler):
(WebCore::WebCLContext::createUserEvent):
(WebCore::WebCLContext::getSupportedImageFormats):
(WebCore::WebCLContext::createFromGLBuffer):
(WebCore::WebCLContext::createFromGLRenderbuffer):
(WebCore::WebCLContext::createFromGLTexture):
* Modules/webcl/WebCLContext.h:
* Modules/webcl/WebCLDevice.cpp:
(WebCore::WebCLDevice::getInfo):
* Modules/webcl/WebCLDevice.h:
* Modules/webcl/WebCLEvent.cpp:
(WebCore::WebCLEvent::getInfo):
(WebCore::WebCLEvent::getProfilingInfo):
(WebCore::WebCLEvent::setCallback):
(WebCore::WebCLEvent::processCallbackRegisterQueueForEvent):
* Modules/webcl/WebCLEvent.h:
* Modules/webcl/WebCLException.cpp:
(WebCore::setExceptionFromComputeErrorCode):
(WebCore::setExtensionsNotEnabledException):
(WebCore::willThrowException):
* Modules/webcl/WebCLException.h:
* Modules/webcl/WebCLExtensionsAccessor.h:
* Modules/webcl/WebCLHTMLInterop.cpp:
(WebCore::WebCLHTMLInterop::extractDataFromCanvas):
(WebCore::WebCLHTMLInterop::extractDataFromImage):
(WebCore::WebCLHTMLInterop::extractDataFromImageData):
* Modules/webcl/WebCLHTMLInterop.h:
* Modules/webcl/WebCLImage.cpp:
(WebCore::WebCLImage::create):
(WebCore::WebCLImage::getGLTextureInfo):
(WebCore::WebCLImage::getInfo):
* Modules/webcl/WebCLImage.h:
* Modules/webcl/WebCLKernel.cpp:
(WebCore::WebCLKernel::create):
(WebCore::WebCLKernel::createKernelsInProgram):
(WebCore::WebCLKernel::getInfo):
(WebCore::WebCLKernel::getWorkGroupInfo):
(WebCore::WebCLKernel::setArg):
(WebCore::WebCLKernel::getArgInfo):
* Modules/webcl/WebCLKernel.h:
* Modules/webcl/WebCLMemoryInitializer.cpp:
(WebCore::WebCLMemoryInitializer::ensureMemoryInitialization):
(WebCore::WebCLMemoryInitializer::commandQueueCreated):
(WebCore::WebCLMemoryInitializer::bufferCreated):
(WebCore::WebCLMemoryInitializer::processPendingMemoryInitializationList):
(WebCore::WebCLMemoryInitializer::initializeOrQueueMemoryInitializationOfMemoryObject):
* Modules/webcl/WebCLMemoryInitializer.h:
* Modules/webcl/WebCLMemoryObject.cpp:
(WebCore::WebCLMemoryObject::getInfo):
(WebCore::WebCLMemoryObject::getGLObjectInfo):
* Modules/webcl/WebCLMemoryObject.h:
* Modules/webcl/WebCLObject.h:
* Modules/webcl/WebCLPlatform.cpp:
(WebCore::WebCLPlatform::getInfo):
(WebCore::WebCLPlatform::getDevices):
* Modules/webcl/WebCLPlatform.h:
* Modules/webcl/WebCLProgram.cpp:
(WebCore::WebCLProgram::create):
(WebCore::WebCLProgram::getInfo):
(WebCore::WebCLProgram::getBuildInfo):
(WebCore::WebCLProgram::createKernel):
(WebCore::WebCLProgram::createKernelsInProgram):
(WebCore::WebCLProgram::build):
(WebCore::WebCLProgram::ccDeviceListFromWebCLDeviceList):
* Modules/webcl/WebCLProgram.h:
* Modules/webcl/WebCLSampler.cpp:
(WebCore::WebCLSampler::create):
(WebCore::WebCLSampler::getInfo):
* Modules/webcl/WebCLSampler.h:
* Modules/webcl/WebCLUserEvent.cpp:
(WebCore::WebCLUserEvent::create):
(WebCore::WebCLUserEvent::setStatus):
(WebCore::WebCLUserEvent::getInfo):
* Modules/webcl/WebCLUserEvent.h: