v8::Persistent<v8::FunctionTemplate> V8StyleSheet::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 =
        ConfigureV8StyleSheetTemplate(GetRawTemplate());
    data->templateMap().add(&info, templ);
    return templ;
}
Exemplo n.º 2
0
v8::Persistent<v8::FunctionTemplate> V8StyleSheet::GetTemplate()
{
    static v8::Persistent<v8::FunctionTemplate> V8StyleSheetCache = ConfigureV8StyleSheetTemplate(GetRawTemplate());
    return V8StyleSheetCache;
}