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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2550373005: Make WebTaskRunner ThreadSafeRefCounted (Closed)
Patch Set: +DISALLOW_COPY_AND_ASSIGN for win build fix Created 3 years, 11 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
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 static std::unique_ptr<WebGraphicsContext3DProvider> 594 static std::unique_ptr<WebGraphicsContext3DProvider>
595 createContextProviderOnWorkerThread( 595 createContextProviderOnWorkerThread(
596 Platform::ContextAttributes contextAttributes, 596 Platform::ContextAttributes contextAttributes,
597 Platform::GraphicsInfo* glInfo, 597 Platform::GraphicsInfo* glInfo,
598 const KURL& url) { 598 const KURL& url) {
599 WaitableEvent waitableEvent; 599 WaitableEvent waitableEvent;
600 ContextProviderCreationInfo creationInfo; 600 ContextProviderCreationInfo creationInfo;
601 creationInfo.contextAttributes = contextAttributes; 601 creationInfo.contextAttributes = contextAttributes;
602 creationInfo.glInfo = glInfo; 602 creationInfo.glInfo = glInfo;
603 creationInfo.url = url; 603 creationInfo.url = url;
604 WebTaskRunner* taskRunner = 604 RefPtr<WebTaskRunner> taskRunner =
605 Platform::current()->mainThread()->getWebTaskRunner(); 605 Platform::current()->mainThread()->getWebTaskRunner();
606 taskRunner->postTask(BLINK_FROM_HERE, 606 taskRunner->postTask(BLINK_FROM_HERE,
607 crossThreadBind(&createContextProviderOnMainThread, 607 crossThreadBind(&createContextProviderOnMainThread,
608 crossThreadUnretained(&creationInfo), 608 crossThreadUnretained(&creationInfo),
609 crossThreadUnretained(&waitableEvent))); 609 crossThreadUnretained(&waitableEvent)));
610 waitableEvent.wait(); 610 waitableEvent.wait();
611 return std::move(creationInfo.createdContextProvider); 611 return std::move(creationInfo.createdContextProvider);
612 } 612 }
613 613
614 std::unique_ptr<WebGraphicsContext3DProvider> 614 std::unique_ptr<WebGraphicsContext3DProvider>
(...skipping 7203 matching lines...) Expand 10 before | Expand all | Expand 10 after
7818 7818
7819 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7819 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7820 HTMLCanvasElementOrOffscreenCanvas& result) const { 7820 HTMLCanvasElementOrOffscreenCanvas& result) const {
7821 if (canvas()) 7821 if (canvas())
7822 result.setHTMLCanvasElement(canvas()); 7822 result.setHTMLCanvasElement(canvas());
7823 else 7823 else
7824 result.setOffscreenCanvas(offscreenCanvas()); 7824 result.setOffscreenCanvas(offscreenCanvas());
7825 } 7825 }
7826 7826
7827 } // namespace blink 7827 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp ('k') | third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698