summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2016-03-24 20:11:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 03:13:39 +0000
commit6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5 (patch)
tree98e6e6494387fc2a87e0f60f6b4892fe1de2919c /content
parente18e7a6d2e1971e9b50b0ca3fe1fc9f17b264193 (diff)
downloadchromium_src-6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5.zip
chromium_src-6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5.tar.gz
chromium_src-6d1bfc385d5f190c3b37e8df0793ae75af5ae6f5.tar.bz2
Make lost context callback a base::Closure thru the WGC3DProvider.
This makes the WebGraphicsContext3DProvider have a method to set a lost context callback, and has that method take a SameThreadClosure, wrapped inside a WebClosure. The SameThreadClosure is converted to a base::Closure and passed thru by the WebGraphicsContext3DProviderImpl (which lives in content/) to the actual ContextProvider::SetLostContextCallback() method. This skips going through WebGraphicsContext3D in blink for the callback, though internally the provider does call the same method on WebGraphicsContext3DImpl, which blink used to hijack from it later. This removes the setter method from the WebGraphicsContext3D public API exposed to blink. It introduces a new public/platform/callback/ directory for the WebClosure in order to make separate DEPS rules for this class. It makes use of base::Bind/Callback which has previously not been allowed in blink, though only to wrap a WTF::SameThreadClosure. It also makes use of base/logging.h directly (previously we were unable to use DCHECK in public/platform since the files there build both with and without BLINK_IMPLEMENTATION and in the without case wtf/ is not available to be included. It also uses scoped_ptr since that is nicer than raw pointers and base::Callback understands it but doesn't understand OwnPtr. R=kbr@chromium.org, kinuko@chromium.org, piman@chromium.org BUG=584497 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel Review URL: https://codereview.chromium.org/1830033003 Cr-Commit-Position: refs/heads/master@{#383233}
Diffstat (limited to 'content')
-rw-r--r--content/renderer/webgraphicscontext3d_provider_impl.cc6
-rw-r--r--content/renderer/webgraphicscontext3d_provider_impl.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/content/renderer/webgraphicscontext3d_provider_impl.cc b/content/renderer/webgraphicscontext3d_provider_impl.cc
index 5151e8a..28a3327 100644
--- a/content/renderer/webgraphicscontext3d_provider_impl.cc
+++ b/content/renderer/webgraphicscontext3d_provider_impl.cc
@@ -5,6 +5,7 @@
#include "content/renderer/webgraphicscontext3d_provider_impl.h"
#include "cc/blink/context_provider_web_context.h"
+#include "third_party/WebKit/public/platform/callback/WebClosure.h"
namespace content {
@@ -27,4 +28,9 @@ GrContext* WebGraphicsContext3DProviderImpl::grContext() {
return provider_->GrContext();
}
+void WebGraphicsContext3DProviderImpl::setLostContextCallback(
+ blink::WebClosure c) {
+ provider_->SetLostContextCallback(c.TakeBaseClosure());
+}
+
} // namespace content
diff --git a/content/renderer/webgraphicscontext3d_provider_impl.h b/content/renderer/webgraphicscontext3d_provider_impl.h
index de155bd..7b1d88c 100644
--- a/content/renderer/webgraphicscontext3d_provider_impl.h
+++ b/content/renderer/webgraphicscontext3d_provider_impl.h
@@ -33,6 +33,7 @@ class CONTENT_EXPORT WebGraphicsContext3DProviderImpl
blink::WebGraphicsContext3D* context3d() override;
gpu::gles2::GLES2Interface* contextGL() override;
GrContext* grContext() override;
+ void setLostContextCallback(blink::WebClosure) override;
private:
scoped_refptr<cc_blink::ContextProviderWebContext> provider_;