v8::Persistent<v8::FunctionTemplate> V8WebGLProgram::GetTemplate()
{
    V8PerIsolateData* data = V8PerIsolateData::current();
    V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    if (result != data->templateMap().end())
        return result->value;

    v8::HandleScope handleScope;
    v8::Persistent<v8::FunctionTemplate> templ =
        ConfigureV8WebGLProgramTemplate(GetRawTemplate());
    data->templateMap().add(&info, templ);
    return templ;
}
Example #2
0
v8::Persistent<v8::FunctionTemplate> V8WebGLProgram::GetTemplate() {
  static v8::Persistent<v8::FunctionTemplate> V8WebGLProgram_cache_ = ConfigureV8WebGLProgramTemplate(GetRawTemplate());
  return V8WebGLProgram_cache_;
}