2014-04-08  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        modernize ComputeXXX classes
        Issue #471

        Reviewed by TrustMe.

        Patch makes all ComputeXXX classes
        Ref-count'ed, so we do not need to
        manually control their lifetimes.

        No behavior difference.

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::create):
        (WebCore::WebCLBuffer::WebCLBuffer):
        (WebCore::WebCLBuffer::createSubBuffer):
        * Modules/webcl/WebCLBuffer.h:
        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::create):
        (WebCore::WebCLCommandQueue::WebCLCommandQueue):
        * Modules/webcl/WebCLCommandQueue.h:
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::create):
        (WebCore::WebCLContext::WebCLContext):
        * Modules/webcl/WebCLContext.h:
        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::create):
        (WebCore::WebCLEvent::WebCLEvent):
        * Modules/webcl/WebCLEvent.h:
        * Modules/webcl/WebCLImage.cpp:
        (WebCore::WebCLImage::create):
        (WebCore::WebCLImage::WebCLImage):
        * Modules/webcl/WebCLImage.h:
        * Modules/webcl/WebCLKernel.cpp:
        (WebCore::WebCLKernel::create):
        (WebCore::WebCLKernel::createKernelsInProgram):
        (WebCore::WebCLKernel::WebCLKernel):
        * Modules/webcl/WebCLKernel.h:
        * Modules/webcl/WebCLMemoryInitializer.cpp:
        (WebCore::WebCLMemoryInitializer::~WebCLMemoryInitializer):
        (WebCore::WebCLMemoryInitializer::ensureMemoryInitialization):
        * Modules/webcl/WebCLMemoryInitializer.h:
        * Modules/webcl/WebCLMemoryObject.cpp:
        (WebCore::WebCLMemoryObject::create):
        (WebCore::WebCLMemoryObject::WebCLMemoryObject):
        * Modules/webcl/WebCLMemoryObject.h:
        * Modules/webcl/WebCLObject.h:
        (WebCore::WebCLObjectImpl::platformObject):
        (WebCore::WebCLObjectImpl::releasePlatformObject):
        (WebCore::WebCLObjectImpl::WebCLObjectImpl):
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::create):
        (WebCore::WebCLProgram::WebCLProgram):
        * Modules/webcl/WebCLProgram.h:
        * Modules/webcl/WebCLSampler.cpp:
        (WebCore::WebCLSampler::create):
        (WebCore::WebCLSampler::WebCLSampler):
        * Modules/webcl/WebCLSampler.h:
        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::create):
        (WebCore::WebCLUserEvent::WebCLUserEvent):
        * Modules/webcl/WebCLUserEvent.h:
        * platform/ComputeCommandQueue.h:
        * platform/ComputeContext.h:
        * platform/ComputeEvent.h:
        * platform/ComputeKernel.h:
        * platform/ComputeMemoryObject.h:
        * platform/ComputeProgram.h:
        * platform/ComputeSampler.h:
        * platform/opencl/ComputeCommandQueueCL.cpp:
        (WebCore::ComputeCommandQueue::create):
        * platform/opencl/ComputeContextCL.cpp:
        (WebCore::ComputeContext::create):
        (WebCore::ComputeContext::createCommandQueue):
        (WebCore::ComputeContext::createUserEvent):
        (WebCore::ComputeContext::createProgram):
        (WebCore::ComputeContext::createBuffer):
        (WebCore::ComputeContext::createImage2D):
        (WebCore::ComputeContext::createFromGLBuffer):
        (WebCore::ComputeContext::createFromGLRenderbuffer):
        (WebCore::ComputeContext::createFromGLTexture2D):
        (WebCore::ComputeContext::createSampler):
        * platform/opencl/ComputeEventCL.cpp:
        (WebCore::ComputeEvent::create):
        * platform/opencl/ComputeKernelCL.cpp:
        (WebCore::ComputeKernel::create):
        * platform/opencl/ComputeMemoryObjectCL.cpp:
        (WebCore::ComputeMemoryObject::create):
        (WebCore::ComputeMemoryObject::createSubBuffer):
        * platform/opencl/ComputeProgramCL.cpp:
        (WebCore::ComputeProgram::create):
        (WebCore::ComputeProgram::createKernel):
        (WebCore::ComputeProgram::createKernelsInProgram):
        * platform/opencl/ComputeSamplerCL.cpp:
        (WebCore::ComputeSampler::create):
2014-04-08  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        enqueueNDRangeKernel doesn't support when pass null localWorkSize
        Issue #432

        Spotted by Anthony Liot (WebCL translator).

        Problem is in toNativeArray, which bails out
        if a JSValue that holds a null JSObject is passed.
        Fixed by relax it similarly to toRefPtrNativeArray.

        Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=131240

        * bindings/js/JSDOMBinding.h:
        (WebCore::toNativeArray):