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

Unified Diff: mojo/apps/js/bindings/gl/context.cc

Issue 118423004: Add support for wrapping classes indirectly inherited from gin::Wrappable<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update StatsCollectionController Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/apps/js/bindings/gl/context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/apps/js/bindings/gl/context.cc
diff --git a/mojo/apps/js/bindings/gl/context.cc b/mojo/apps/js/bindings/gl/context.cc
index efba8e534d05ab1963e26a459bf0c3ef2535378e..c0bb74a4dbe2effa906392434fa9878478e2f932 100644
--- a/mojo/apps/js/bindings/gl/context.cc
+++ b/mojo/apps/js/bindings/gl/context.cc
@@ -21,16 +21,6 @@ gin::Handle<Context> Context::Create(v8::Isolate* isolate, uint64_t encoded,
return gin::CreateHandle(isolate, new Context(encoded, width, height));
}
-v8::Local<v8::ObjectTemplate> Context::GetObjectTemplate(
- v8::Isolate* isolate) {
- return gin::ObjectTemplateBuilder(isolate)
- .SetValue("VERTEX_SHADER", GL_VERTEX_SHADER)
- .SetMethod("createShader", CreateShader)
- .SetMethod("shaderSource", ShaderSource)
- .SetMethod("compileShader", CompileShader)
- .Build();
-}
-
gin::Handle<Shader> Context::CreateShader(const gin::Arguments& args,
GLenum type) {
gin::Handle<Shader> result;
@@ -60,6 +50,15 @@ void Context::CompileShader(const gin::Arguments& args,
}
}
+gin::ObjectTemplateBuilder Context::GetObjectTemplateBuilder(
+ v8::Isolate* isolate) {
+ return gin::Wrappable<Context>::GetObjectTemplateBuilder(isolate)
+ .SetValue("VERTEX_SHADER", GL_VERTEX_SHADER)
+ .SetMethod("createShader", CreateShader)
+ .SetMethod("shaderSource", ShaderSource)
+ .SetMethod("compileShader", CompileShader);
+}
+
Context::Context(uint64_t encoded, int width, int height)
: encoded_(encoded) {
// TODO(aa): When we want to support multiple contexts, we should add
« no previous file with comments | « mojo/apps/js/bindings/gl/context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698