Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 16d1b69

Browse files
hujiajiedarktears
authored andcommitted
[Android] Use RefPtr to ref the associated WebCLContext in WebCLObject.
Object derived from WebCLObject only keeps a weak reference to the associated WebCLContext object, so it may happen that the WebCLContext object is destructred after GC while the WebCLObject instance is still alive. Use-after-free will happen then, for example, in WebCLObject::~WebCLObject(). The following code shows a POC (xwalk needs to be started with --js-flags=--expose-gc to call garbage collection explicitly): var f = function () { var context = webcl.createContext(); return context.createCommandQueue(); }; var g = function() { var commandQueue = f(); gc(); // To ensure WebCLContext::~WebCLContext() is called. commandQueue.release(); }; g(); gc(); // To ensure WebCLCommandQueue::~WebCLCommandQueue is called. Use-after-free happens in WebCLObject::~WebCLObject(). This patch changes the raw pointer used in WebCLObject to RefPtr so that the WebCLContext object will not be destructed until all WebCLObject instances in this context are dead. No circular reference should be introduced here since WebCLObject instances are tracked with weak pointers in WebCLContext. BUG=XWALK-3979
1 parent 11c8591 commit 16d1b69

19 files changed

+70
-67
lines changed

Source/modules/webcl/WebCL.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void validateWebCLEventList(const Vector<RefPtr<WebCLEvent>>& events, Exc
9393
return;
9494
}
9595

96-
WebCLContext* referenceContext = events[0]->context();
96+
WebCLContext* referenceContext = events[0]->context().get();
9797

9898
for (auto event : events) {
9999
if (event->isReleased() || (event->isUserEvent() && isSyncCall)) {
@@ -102,7 +102,7 @@ static void validateWebCLEventList(const Vector<RefPtr<WebCLEvent>>& events, Exc
102102
}
103103

104104
ASSERT(event->context());
105-
if (!WebCLInputChecker::compareContext(event->context(), referenceContext)) {
105+
if (!WebCLInputChecker::compareContext(event->context().get(), referenceContext)) {
106106
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
107107
return;
108108
}

Source/modules/webcl/WebCLBuffer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ WebCLBuffer::~WebCLBuffer()
2929
{
3030
}
3131

32-
PassRefPtr<WebCLBuffer> WebCLBuffer::create(WebCLContext* context, unsigned memoryFlags, unsigned sizeInBytes, void* data, ExceptionState& es)
32+
PassRefPtr<WebCLBuffer> WebCLBuffer::create(PassRefPtr<WebCLContext> context, unsigned memoryFlags, unsigned sizeInBytes, void* data, ExceptionState& es)
3333
{
3434
cl_context m_clContext = context->getContext();
3535
if (!m_clContext) {
@@ -117,7 +117,7 @@ PassRefPtr<WebCLBuffer> WebCLBuffer::createSubBuffer(unsigned memoryFlags, unsig
117117
return buffer.release();
118118
}
119119

120-
WebCLBuffer::WebCLBuffer(cl_mem clMem, WebCLContext* context, unsigned memoryFlags, unsigned size, WebCLBuffer* parentBuffer)
120+
WebCLBuffer::WebCLBuffer(cl_mem clMem, PassRefPtr<WebCLContext> context, unsigned memoryFlags, unsigned size, WebCLBuffer* parentBuffer)
121121
: WebCLMemoryObject(clMem, size, context, parentBuffer)
122122
, m_memoryFlags(memoryFlags)
123123
{

Source/modules/webcl/WebCLBuffer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class WebCLBuffer : public WebCLMemoryObject {
2020
DEFINE_WRAPPERTYPEINFO();
2121
public:
2222
~WebCLBuffer() override;
23-
static PassRefPtr<WebCLBuffer> create(WebCLContext*, unsigned, unsigned, void*, ExceptionState&);
23+
static PassRefPtr<WebCLBuffer> create(PassRefPtr<WebCLContext>, unsigned, unsigned, void*, ExceptionState&);
2424
PassRefPtr<WebCLBuffer> createSubBuffer(unsigned, unsigned, unsigned, ExceptionState&);
2525

2626
int type() override { return BUFFER; }
2727

2828
private:
29-
WebCLBuffer(cl_mem, WebCLContext*, unsigned, unsigned, WebCLBuffer* parentBuffer = nullptr);
29+
WebCLBuffer(cl_mem, PassRefPtr<WebCLContext>, unsigned, unsigned, WebCLBuffer* parentBuffer = nullptr);
3030

3131
unsigned m_memoryFlags;
3232
};

Source/modules/webcl/WebCLCommandQueue.cpp

+28-28
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ WebCLCommandQueue::~WebCLCommandQueue()
4343
ASSERT(!m_clCommandQueue);
4444
}
4545

46-
PassRefPtr<WebCLCommandQueue> WebCLCommandQueue::create(cl_command_queue commandQueue, WebCLContext* context, WebCLDevice* device)
46+
PassRefPtr<WebCLCommandQueue> WebCLCommandQueue::create(cl_command_queue commandQueue, PassRefPtr<WebCLContext> context, WebCLDevice* device)
4747
{
4848
return adoptRef(new WebCLCommandQueue(commandQueue, context, device));
4949
}
@@ -225,7 +225,7 @@ void WebCLCommandQueue::enqueueWriteBufferBase(WebCLBuffer* mem, bool blockingWr
225225
return;
226226
}
227227

228-
if (!WebCLInputChecker::compareContext(context(), mem->context())) {
228+
if (!WebCLInputChecker::compareContext(context().get(), mem->context().get())) {
229229
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
230230
return;
231231
}
@@ -260,7 +260,7 @@ void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* mem, bool blockingWrite,
260260

261261
void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* buffer, bool blockingWrite, unsigned offset, ImageData* srcPixels, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
262262
{
263-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
263+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
264264
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
265265
return;
266266
}
@@ -275,7 +275,7 @@ void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* buffer, bool blockingWri
275275

276276
void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* buffer, bool blockingWrite, unsigned offset, HTMLCanvasElement* srcCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
277277
{
278-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
278+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
279279
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
280280
return;
281281
}
@@ -291,7 +291,7 @@ void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* buffer, bool blockingWri
291291

292292
void WebCLCommandQueue::enqueueWriteBuffer(WebCLBuffer* buffer, bool blockingWrite, unsigned offset, HTMLImageElement* srcImage, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
293293
{
294-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
294+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
295295
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
296296
return;
297297
}
@@ -326,7 +326,7 @@ void WebCLCommandQueue::enqueueWriteBufferRectBase(WebCLBuffer* mem, bool blocki
326326
return;
327327
}
328328

329-
if (!WebCLInputChecker::compareContext(context(), mem->context())) {
329+
if (!WebCLInputChecker::compareContext(context().get(), mem->context().get())) {
330330
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
331331
return;
332332
}
@@ -372,7 +372,7 @@ void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* mem, bool blockingWr
372372

373373
void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* buffer, bool blockingWrite, const Vector<unsigned>& bufferOrigin, const Vector<unsigned>& hostOrigin, const Vector<unsigned>& region, unsigned bufferRowPitch, unsigned bufferSlicePitch, ImageData* srcPixels, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
374374
{
375-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
375+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
376376
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
377377
return;
378378
}
@@ -387,7 +387,7 @@ void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* buffer, bool blockin
387387

388388
void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* buffer, bool blockingWrite, const Vector<unsigned>& bufferOrigin, const Vector<unsigned>& hostOrigin, const Vector<unsigned>& region, unsigned bufferRowPitch, unsigned bufferSlicePitch, HTMLCanvasElement* srcCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
389389
{
390-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
390+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
391391
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
392392
return;
393393
}
@@ -403,7 +403,7 @@ void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* buffer, bool blockin
403403

404404
void WebCLCommandQueue::enqueueWriteBufferRect(WebCLBuffer* buffer, bool blockingWrite, const Vector<unsigned>& bufferOrigin, const Vector<unsigned>& hostOrigin, const Vector<unsigned>& region, unsigned bufferRowPitch, unsigned bufferSlicePitch, HTMLImageElement* srcImage, const Vector<RefPtr<WebCLEvent>>& eventWaitlist, WebCLEvent* event, ExceptionState& es)
405405
{
406-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
406+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
407407
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
408408
return;
409409
}
@@ -424,7 +424,7 @@ void WebCLCommandQueue::enqueueReadBufferBase(WebCLBuffer* mem, bool blockingRea
424424
return;
425425
}
426426

427-
if (!WebCLInputChecker::compareContext(context(), mem->context())) {
427+
if (!WebCLInputChecker::compareContext(context().get(), mem->context().get())) {
428428
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
429429
return;
430430
}
@@ -469,7 +469,7 @@ void WebCLCommandQueue::enqueueReadBuffer(WebCLBuffer* mem, bool blockingRead, u
469469

470470
void WebCLCommandQueue::enqueueReadBuffer(WebCLBuffer* buffer, bool blockingRead, unsigned offset, unsigned numBytes, HTMLCanvasElement* dstCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
471471
{
472-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
472+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
473473
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
474474
return;
475475
}
@@ -490,7 +490,7 @@ void WebCLCommandQueue::enqueueReadBufferRectBase(WebCLBuffer* mem, bool blockin
490490
return;
491491
}
492492

493-
if (!WebCLInputChecker::compareContext(context(), mem->context())) {
493+
if (!WebCLInputChecker::compareContext(context().get(), mem->context().get())) {
494494
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
495495
return;
496496
}
@@ -550,7 +550,7 @@ void WebCLCommandQueue::enqueueReadBufferRect(WebCLBuffer* mem, bool blockingRea
550550

551551
void WebCLCommandQueue::enqueueReadBufferRect(WebCLBuffer* buffer, bool blockingRead, const Vector<unsigned>& bufferOrigin, const Vector<unsigned>& hostOrigin, const Vector<unsigned>& region, unsigned bufferRowPitch, unsigned bufferSlicePitch, HTMLCanvasElement* dstCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
552552
{
553-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
553+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
554554
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
555555
return;
556556
}
@@ -571,7 +571,7 @@ void WebCLCommandQueue::enqueueReadImageBase(WebCLImage* image, bool blockingRea
571571
return;
572572
}
573573

574-
if (!WebCLInputChecker::compareContext(context(), image->context())) {
574+
if (!WebCLInputChecker::compareContext(context().get(), image->context().get())) {
575575
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
576576
return;
577577
}
@@ -628,7 +628,7 @@ void WebCLCommandQueue::enqueueReadImage(WebCLImage* image, bool blockingRead, c
628628

629629
void WebCLCommandQueue::enqueueReadImage(WebCLImage* image, bool blockingRead, const Vector<unsigned>& origin, const Vector<unsigned>& region, HTMLCanvasElement* dstCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
630630
{
631-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
631+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
632632
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
633633
return;
634634
}
@@ -658,7 +658,7 @@ void WebCLCommandQueue::enqueueNDRangeKernel(WebCLKernel* kernel, unsigned dim,
658658
}
659659
}
660660

661-
if (!WebCLInputChecker::compareContext(context(), kernel->context())) {
661+
if (!WebCLInputChecker::compareContext(context().get(), kernel->context().get())) {
662662
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
663663
return;
664664
}
@@ -769,7 +769,7 @@ void WebCLCommandQueue::enqueueWriteImageBase(WebCLImage* image, bool blockingWr
769769
}
770770
}
771771

772-
if (!WebCLInputChecker::compareContext(context(), image->context())) {
772+
if (!WebCLInputChecker::compareContext(context().get(), image->context().get())) {
773773
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
774774
return;
775775
}
@@ -822,7 +822,7 @@ void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite,
822822

823823
void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite, const Vector<unsigned>& origin, const Vector<unsigned>& region, ImageData* srcPixels, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
824824
{
825-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
825+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
826826
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
827827
return;
828828
}
@@ -837,7 +837,7 @@ void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite,
837837

838838
void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite, const Vector<unsigned>& origin, const Vector<unsigned>& region, HTMLCanvasElement* srcCanvas, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
839839
{
840-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
840+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
841841
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
842842
return;
843843
}
@@ -853,7 +853,7 @@ void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite,
853853

854854
void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite, const Vector<unsigned>& origin, const Vector<unsigned>& region, HTMLImageElement* srcImage, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
855855
{
856-
if (!isExtensionEnabled(context(), "WEBCL_html_image")) {
856+
if (!isExtensionEnabled(context().get(), "WEBCL_html_image")) {
857857
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
858858
return;
859859
}
@@ -869,7 +869,7 @@ void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite,
869869

870870
void WebCLCommandQueue::enqueueWriteImage(WebCLImage* image, bool blockingWrite, HTMLVideoElement* srcVideo, const Vector<RefPtr<WebCLEvent>>& events, WebCLEvent* event, ExceptionState& es)
871871
{
872-
if (!isExtensionEnabled(context(), "WEBCL_html_video")) {
872+
if (!isExtensionEnabled(context().get(), "WEBCL_html_video")) {
873873
es.throwWebCLException(WebCLException::EXTENSION_NOT_ENABLED, WebCLException::extensionNotEnabledMessage);
874874
return;
875875
}
@@ -918,7 +918,7 @@ void WebCLCommandQueue::enqueueCopyBuffer(WebCLBuffer* srcBuffer, WebCLBuffer* d
918918
}
919919
}
920920

921-
if (!WebCLInputChecker::compareContext(context(), srcBuffer->context()) || !WebCLInputChecker::compareContext(context(), dstBuffer->context())) {
921+
if (!WebCLInputChecker::compareContext(context().get(), srcBuffer->context().get()) || !WebCLInputChecker::compareContext(context().get(), dstBuffer->context().get())) {
922922
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
923923
return;
924924
}
@@ -973,7 +973,7 @@ void WebCLCommandQueue::enqueueCopyBufferRect(WebCLBuffer* srcBuffer, WebCLBuffe
973973
}
974974
}
975975

976-
if (!WebCLInputChecker::compareContext(context(), srcBuffer->context()) || !WebCLInputChecker::compareContext(context(), dstBuffer->context())) {
976+
if (!WebCLInputChecker::compareContext(context().get(), srcBuffer->context().get()) || !WebCLInputChecker::compareContext(context().get(), dstBuffer->context().get())) {
977977
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
978978
return;
979979
}
@@ -1040,7 +1040,7 @@ void WebCLCommandQueue::enqueueCopyImage(WebCLImage* srcImage, WebCLImage* dstIm
10401040
}
10411041
}
10421042

1043-
if (!WebCLInputChecker::compareContext(context(), srcImage->context()) || !WebCLInputChecker::compareContext(context(), dstImage->context())) {
1043+
if (!WebCLInputChecker::compareContext(context().get(), srcImage->context().get()) || !WebCLInputChecker::compareContext(context().get(), dstImage->context().get())) {
10441044
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
10451045
return;
10461046
}
@@ -1109,7 +1109,7 @@ void WebCLCommandQueue::enqueueCopyImageToBuffer(WebCLImage* srcImage, WebCLBuff
11091109
}
11101110
}
11111111

1112-
if (!WebCLInputChecker::compareContext(context(), srcImage->context()) || !WebCLInputChecker::compareContext(context(), dstBuffer->context())) {
1112+
if (!WebCLInputChecker::compareContext(context().get(), srcImage->context().get()) || !WebCLInputChecker::compareContext(context().get(), dstBuffer->context().get())) {
11131113
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
11141114
return;
11151115
}
@@ -1169,7 +1169,7 @@ void WebCLCommandQueue::enqueueCopyBufferToImage(WebCLBuffer* srcBuffer, WebCLIm
11691169
}
11701170
}
11711171

1172-
if (!WebCLInputChecker::compareContext(context(), srcBuffer->context()) || !WebCLInputChecker::compareContext(context(), dstImage->context())) {
1172+
if (!WebCLInputChecker::compareContext(context().get(), srcBuffer->context().get()) || !WebCLInputChecker::compareContext(context().get(), dstImage->context().get())) {
11731173
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
11741174
return;
11751175
}
@@ -1205,7 +1205,7 @@ void WebCLCommandQueue::enqueueCopyBufferToImage(WebCLBuffer* srcBuffer, WebCLIm
12051205
WebCLException::throwException(err, es);
12061206
}
12071207

1208-
WebCLCommandQueue::WebCLCommandQueue(cl_command_queue commandQueue, WebCLContext* context, WebCLDevice* device)
1208+
WebCLCommandQueue::WebCLCommandQueue(cl_command_queue commandQueue, PassRefPtr<WebCLContext> context, WebCLDevice* device)
12091209
: WebCLObject(context)
12101210
, m_whenFinishCallback(nullptr)
12111211
, m_eventForCallback(0)
@@ -1222,7 +1222,7 @@ Vector<cl_event> WebCLCommandQueue::WebCLEventVectorToCLEventVector(bool blockin
12221222
es.throwWebCLException(WebCLException::INVALID_EVENT_WAIT_LIST, WebCLException::invalidEventWaitListMessage);
12231223
break;
12241224
}
1225-
if (!WebCLInputChecker::compareContext(context(), event->context())) {
1225+
if (!WebCLInputChecker::compareContext(context().get(), event->context().get())) {
12261226
es.throwWebCLException(WebCLException::INVALID_CONTEXT, WebCLException::invalidContextMessage);
12271227
break;
12281228
}

Source/modules/webcl/WebCLCommandQueue.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class WebCLCommandQueue : public WebCLObject, public ScriptWrappable {
3939
DEFINE_WRAPPERTYPEINFO();
4040
public:
4141
~WebCLCommandQueue() override;
42-
static PassRefPtr<WebCLCommandQueue> create(cl_command_queue, WebCLContext*, WebCLDevice*);
42+
static PassRefPtr<WebCLCommandQueue> create(cl_command_queue, PassRefPtr<WebCLContext>, WebCLDevice*);
4343

4444
ScriptValue getInfo(ScriptState*, int, ExceptionState&);
4545
void enqueueWriteBuffer(WebCLBuffer*, bool, unsigned, unsigned, DOMArrayBufferView*, const Vector<RefPtr<WebCLEvent>>&, WebCLEvent*, ExceptionState&);
@@ -97,7 +97,7 @@ class WebCLCommandQueue : public WebCLObject, public ScriptWrappable {
9797
void enqueueReadImageBase(WebCLImage*, bool, const Vector<unsigned>&, const Vector<unsigned>&, unsigned, void*, size_t, const Vector<RefPtr<WebCLEvent>>&, WebCLEvent*, ExceptionState&);
9898
void enqueueWriteBufferRectBase(WebCLBuffer*, bool, const Vector<unsigned>&, const Vector<unsigned>&, const Vector<unsigned>&, unsigned, unsigned, unsigned, unsigned, void*, size_t, const Vector<RefPtr<WebCLEvent>>&, WebCLEvent*, ExceptionState&);
9999
void enqueueWriteImageBase(WebCLImage*, bool, const Vector<unsigned>&, const Vector<unsigned>&, unsigned, void*, size_t, const Vector<RefPtr<WebCLEvent>>&, WebCLEvent*, ExceptionState&);
100-
WebCLCommandQueue(cl_command_queue, WebCLContext*, WebCLDevice*);
100+
WebCLCommandQueue(cl_command_queue, PassRefPtr<WebCLContext>, WebCLDevice*);
101101
Vector<cl_event> WebCLEventVectorToCLEventVector(bool, Vector<RefPtr<WebCLEvent>>, ExceptionState&);
102102
cl_event* WebCLEventPtrToCLEventPtr(WebCLEvent*, ExceptionState&);
103103
bool isExtensionEnabled(WebCLContext*, const String& name) const;

0 commit comments

Comments
 (0)