OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (result != domTemplateMap.end()) | 118 if (result != domTemplateMap.end()) |
119 return result->value.newLocal(m_isolate); | 119 return result->value.newLocal(m_isolate); |
120 return v8::Local<v8::FunctionTemplate>(); | 120 return v8::Local<v8::FunctionTemplate>(); |
121 } | 121 } |
122 | 122 |
123 void V8PerIsolateData::setDOMTemplate(void* domTemplateKey, v8::Handle<v8::Funct
ionTemplate> templ) | 123 void V8PerIsolateData::setDOMTemplate(void* domTemplateKey, v8::Handle<v8::Funct
ionTemplate> templ) |
124 { | 124 { |
125 currentDOMTemplateMap().add(domTemplateKey, UnsafePersistent<v8::FunctionTem
plate>(m_isolate, templ)); | 125 currentDOMTemplateMap().add(domTemplateKey, UnsafePersistent<v8::FunctionTem
plate>(m_isolate, templ)); |
126 } | 126 } |
127 | 127 |
128 v8::Local<v8::Context> V8PerIsolateData::ensureDomInJSContext() | 128 v8::Local<v8::Context> V8PerIsolateData::ensureRegexContext() |
129 { | 129 { |
130 if (!m_domInJSPerContextData) | 130 if (!m_perContextDataForRegex) |
131 m_domInJSPerContextData = V8PerContextData::create(v8::Context::New(m_is
olate), DOMWrapperWorld::create()); | 131 m_perContextDataForRegex = V8PerContextData::create(v8::Context::New(m_i
solate), DOMWrapperWorld::create()); |
132 return m_domInJSPerContextData->context(); | 132 return m_perContextDataForRegex->context(); |
133 } | 133 } |
134 | 134 |
135 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V
alue> value) | 135 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V
alue> value) |
136 { | 136 { |
137 return hasInstance(info, value, m_domTemplateMapForMainWorld) | 137 return hasInstance(info, value, m_domTemplateMapForMainWorld) |
138 || hasInstance(info, value, m_domTemplateMapForNonMainWorld); | 138 || hasInstance(info, value, m_domTemplateMapForNonMainWorld); |
139 } | 139 } |
140 | 140 |
141 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V
alue> value, DOMTemplateMap& domTemplateMap) | 141 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V
alue> value, DOMTemplateMap& domTemplateMap) |
142 { | 142 { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() | 187 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() |
188 { | 188 { |
189 if (m_toStringTemplate.isEmpty()) | 189 if (m_toStringTemplate.isEmpty()) |
190 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c
onstructorOfToString)); | 190 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c
onstructorOfToString)); |
191 return m_toStringTemplate.newLocal(m_isolate); | 191 return m_toStringTemplate.newLocal(m_isolate); |
192 } | 192 } |
193 | 193 |
194 } // namespace WebCore | 194 } // namespace WebCore |
OLD | NEW |