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

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

Issue 113893005: [gin] Introduce Wrappable::GetObjectTemplate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates 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') | mojo/apps/js/bindings/gl/module.cc » ('j') | 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 27622a73d71f179cfa9406495c458499d7a53109..efba8e534d05ab1963e26a459bf0c3ef2535378e 100644
--- a/mojo/apps/js/bindings/gl/context.cc
+++ b/mojo/apps/js/bindings/gl/context.cc
@@ -8,7 +8,6 @@
#include "gin/arguments.h"
#include "gin/object_template_builder.h"
-#include "gin/per_isolate_data.h"
#include "mojo/public/gles2/gles2.h"
namespace mojo {
@@ -22,21 +21,14 @@ gin::Handle<Context> Context::Create(v8::Isolate* isolate, uint64_t encoded,
return gin::CreateHandle(isolate, new Context(encoded, width, height));
}
-v8::Handle<v8::ObjectTemplate> Context::GetObjectTemplate(
+v8::Local<v8::ObjectTemplate> Context::GetObjectTemplate(
v8::Isolate* isolate) {
- gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
- v8::Local<v8::ObjectTemplate> templ = data->GetObjectTemplate(&kWrapperInfo);
- if (templ.IsEmpty()) {
- templ = gin::ObjectTemplateBuilder(isolate)
- .SetValue("VERTEX_SHADER", GL_VERTEX_SHADER)
- .SetMethod("createShader", CreateShader)
- .SetMethod("shaderSource", ShaderSource)
- .SetMethod("compileShader", CompileShader)
- .Build();
- templ->SetInternalFieldCount(gin::kNumberOfInternalFields);
- data->SetObjectTemplate(&kWrapperInfo, templ);
- }
- return templ;
+ 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,
« no previous file with comments | « mojo/apps/js/bindings/gl/context.h ('k') | mojo/apps/js/bindings/gl/module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698