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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const void* key, | 186 const void* key, |
187 v8::Local<v8::FunctionTemplate> value) { | 187 v8::Local<v8::FunctionTemplate> value) { |
188 auto& map = selectInterfaceTemplateMap(world); | 188 auto& map = selectInterfaceTemplateMap(world); |
189 map.insert(key, v8::Eternal<v8::FunctionTemplate>(isolate(), value)); | 189 map.insert(key, v8::Eternal<v8::FunctionTemplate>(isolate(), value)); |
190 } | 190 } |
191 | 191 |
192 v8::Local<v8::Context> V8PerIsolateData::ensureScriptRegexpContext() { | 192 v8::Local<v8::Context> V8PerIsolateData::ensureScriptRegexpContext() { |
193 if (!m_scriptRegexpScriptState) { | 193 if (!m_scriptRegexpScriptState) { |
194 LEAK_SANITIZER_DISABLED_SCOPE; | 194 LEAK_SANITIZER_DISABLED_SCOPE; |
195 v8::Local<v8::Context> context(v8::Context::New(isolate())); | 195 v8::Local<v8::Context> context(v8::Context::New(isolate())); |
196 m_scriptRegexpScriptState = | 196 m_scriptRegexpScriptState = ScriptState::create( |
197 ScriptState::create(context, DOMWrapperWorld::create(isolate())); | 197 context, |
| 198 DOMWrapperWorld::create(isolate(), DOMWrapperWorld::WorldType::RegExp)); |
198 } | 199 } |
199 return m_scriptRegexpScriptState->context(); | 200 return m_scriptRegexpScriptState->context(); |
200 } | 201 } |
201 | 202 |
202 void V8PerIsolateData::clearScriptRegexpContext() { | 203 void V8PerIsolateData::clearScriptRegexpContext() { |
203 if (m_scriptRegexpScriptState) | 204 if (m_scriptRegexpScriptState) |
204 m_scriptRegexpScriptState->disposePerContextData(); | 205 m_scriptRegexpScriptState->disposePerContextData(); |
205 m_scriptRegexpScriptState.clear(); | 206 m_scriptRegexpScriptState.clear(); |
206 } | 207 } |
207 | 208 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 ScriptWrappableVisitor* current = currentVisitor(); | 291 ScriptWrappableVisitor* current = currentVisitor(); |
291 if (current) | 292 if (current) |
292 current->performCleanup(); | 293 current->performCleanup(); |
293 | 294 |
294 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( | 295 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( |
295 m_savedVisitor); | 296 m_savedVisitor); |
296 m_isolate->SetEmbedderHeapTracer(currentVisitor()); | 297 m_isolate->SetEmbedderHeapTracer(currentVisitor()); |
297 } | 298 } |
298 | 299 |
299 } // namespace blink | 300 } // namespace blink |
OLD | NEW |