2014-01-12  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Make WebCL::waitForEvents less hang-prone
        Issue #401

        Reviewed by Igor.

        Restrict the events accepted by the WebCL::waitForEvents method in two ways:
        1) only WebCLEvents that hold valid CCEvent can be waited on.
        An exception is thrown otherwise.
        2) for now, fail to accept WebCLUserEvents. Reasons:
        2.1) Logical: if application is waiting on an event
        (blocked), it won't be able to set this event status to
        'complete', so the browser will hang undefinitively.
        2.2) We might consider reverting both restrictions above
        when we support the asynchronous variant of this method.

        * Modules/webcl/WebCL.cpp:
        (WebCore::WebCL::waitForEvents):
2014-01-12  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        WebCLUserEvent::setStatus can only be called once.
        Issue #402

        Reviewed by Igor.

        As per the spec.

        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::WebCLUserEvent):
        (WebCore::WebCLUserEvent::setStatus):
        * Modules/webcl/WebCLUserEvent.h:
2014-01-12  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Fix WebCLUserEvent::setStatus acceptable values list.
        Issue #403

        Reviewed by Igor.

        Both negative values or 'complete' should be acceptable
        as valid input.

        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::setStatus):
2014-01-12  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Fix WebCLEvent/WebCLUserEvent::getInfo
        Need the bug URL (OOPS!).

        Reviewed by NOBODY (OOPS!).

        No new tests (OOPS!).
        Patch makes WebCLEvent::getInfo virtual, and adds an
        overload to WebCLUserEvent.
        WebCLUserEvent::getInfo supports queries for both
        COMMAND_QUEUE and CONTEXT, and defers to the base class
        other values.

        WebCLUserEvent now safily only verifies if platformObject
        if valid, instead of checking 'm_commandQueue', etc.

        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::getInfo):
        * Modules/webcl/WebCLEvent.h:
        (WebCore::WebCLEvent::callbackRegisterQueue):
        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::getInfo):
2014-01-09  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Throw an exception if getProfilingInfo is called from an WebCLUserEvent.
        Need the bug URL (OOPS!).

        Reviewed by NOBODY (OOPS!).

        As per the spec

        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::getProfilingInfo):
2014-01-12  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Validate eventWaitList content before actually passing it down to OpenCL.
        Issue #399

        Reviewed by NOBODY (OOPS!).

        events in an eventWaitList (almost all CommandQueue APIs
        optionally take it) have to hold valid platform objects
        (i.e. CCEvents). They can be either originated from
        an explicit create user event call, or implicitly populated
        by one of the previous CommandQueue calls.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::ccEventListFromWebCLEventList):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferBase):
        (WebCore::WebCLCommandQueue::enqueueWriteBufferRectBase):
        (WebCore::WebCLCommandQueue::enqueueReadBufferBase):
        (WebCore::WebCLCommandQueue::enqueueReadImageBase):
        (WebCore::WebCLCommandQueue::enqueueReadBufferRectBase):
        (WebCore::WebCLCommandQueue::enqueueNDRangeKernel):
        (WebCore::WebCLCommandQueue::enqueueWriteImageBase):
        (WebCore::WebCLCommandQueue::enqueueCopyImage):
        (WebCore::WebCLCommandQueue::enqueueCopyImageToBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferToImage):
        (WebCore::WebCLCommandQueue::enqueueCopyBuffer):
        (WebCore::WebCLCommandQueue::enqueueCopyBufferRect):
        (WebCore::WebCLCommandQueue::enqueueAcquireGLObjects):
        (WebCore::WebCLCommandQueue::enqueueReleaseGLObjects):
2014-01-13  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Check events' context
        Issue #404

        Reviewed by NOBODY (OOPS!).

        WebCLEvents must share the same context of
        its associated command queue.

        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::ccEventListFromWebCLEventList):
        * Modules/webcl/WebCLCommandQueue.h:
        * Modules/webcl/WebCLEvent.cpp:
        (WebCore::WebCLEvent::context):
        * Modules/webcl/WebCLEvent.h:
        * Modules/webcl/WebCLProgram.cpp:
        (WebCore::WebCLProgram::build):
        * Modules/webcl/WebCLUserEvent.cpp:
        (WebCore::WebCLUserEvent::context):
        * Modules/webcl/WebCLUserEvent.h: