| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 v8::Local<v8::Signature> signature, | 285 v8::Local<v8::Signature> signature, |
| 286 int length) { | 286 int length) { |
| 287 auto& map = selectOperationTemplateMap(world); | 287 auto& map = selectOperationTemplateMap(world); |
| 288 auto result = map.find(key); | 288 auto result = map.find(key); |
| 289 if (result != map.end()) | 289 if (result != map.end()) |
| 290 return result->value.Get(isolate()); | 290 return result->value.Get(isolate()); |
| 291 | 291 |
| 292 v8::Local<v8::FunctionTemplate> templ = | 292 v8::Local<v8::FunctionTemplate> templ = |
| 293 v8::FunctionTemplate::New(isolate(), callback, data, signature, length); | 293 v8::FunctionTemplate::New(isolate(), callback, data, signature, length); |
| 294 templ->RemovePrototype(); | 294 templ->RemovePrototype(); |
| 295 map.add(key, v8::Eternal<v8::FunctionTemplate>(isolate(), templ)); | 295 map.insert(key, v8::Eternal<v8::FunctionTemplate>(isolate(), templ)); |
| 296 return templ; | 296 return templ; |
| 297 } | 297 } |
| 298 | 298 |
| 299 v8::Local<v8::FunctionTemplate> V8PerIsolateData::findInterfaceTemplate( | 299 v8::Local<v8::FunctionTemplate> V8PerIsolateData::findInterfaceTemplate( |
| 300 const DOMWrapperWorld& world, | 300 const DOMWrapperWorld& world, |
| 301 const void* key) { | 301 const void* key) { |
| 302 auto& map = selectInterfaceTemplateMap(world); | 302 auto& map = selectInterfaceTemplateMap(world); |
| 303 auto result = map.find(key); | 303 auto result = map.find(key); |
| 304 if (result != map.end()) | 304 if (result != map.end()) |
| 305 return result->value.Get(isolate()); | 305 return result->value.Get(isolate()); |
| 306 return v8::Local<v8::FunctionTemplate>(); | 306 return v8::Local<v8::FunctionTemplate>(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void V8PerIsolateData::setInterfaceTemplate( | 309 void V8PerIsolateData::setInterfaceTemplate( |
| 310 const DOMWrapperWorld& world, | 310 const DOMWrapperWorld& world, |
| 311 const void* key, | 311 const void* key, |
| 312 v8::Local<v8::FunctionTemplate> value) { | 312 v8::Local<v8::FunctionTemplate> value) { |
| 313 auto& map = selectInterfaceTemplateMap(world); | 313 auto& map = selectInterfaceTemplateMap(world); |
| 314 map.add(key, v8::Eternal<v8::FunctionTemplate>(isolate(), value)); | 314 map.insert(key, v8::Eternal<v8::FunctionTemplate>(isolate(), value)); |
| 315 } | 315 } |
| 316 | 316 |
| 317 v8::Local<v8::Context> V8PerIsolateData::ensureScriptRegexpContext() { | 317 v8::Local<v8::Context> V8PerIsolateData::ensureScriptRegexpContext() { |
| 318 if (!m_scriptRegexpScriptState) { | 318 if (!m_scriptRegexpScriptState) { |
| 319 LEAK_SANITIZER_DISABLED_SCOPE; | 319 LEAK_SANITIZER_DISABLED_SCOPE; |
| 320 v8::Local<v8::Context> context(v8::Context::New(isolate())); | 320 v8::Local<v8::Context> context(v8::Context::New(isolate())); |
| 321 m_scriptRegexpScriptState = | 321 m_scriptRegexpScriptState = |
| 322 ScriptState::create(context, DOMWrapperWorld::create(isolate())); | 322 ScriptState::create(context, DOMWrapperWorld::create(isolate())); |
| 323 } | 323 } |
| 324 return m_scriptRegexpScriptState->context(); | 324 return m_scriptRegexpScriptState->context(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 ScriptWrappableVisitor* current = currentVisitor(); | 415 ScriptWrappableVisitor* current = currentVisitor(); |
| 416 if (current) | 416 if (current) |
| 417 current->performCleanup(); | 417 current->performCleanup(); |
| 418 | 418 |
| 419 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( | 419 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( |
| 420 m_savedVisitor); | 420 m_savedVisitor); |
| 421 m_isolate->SetEmbedderHeapTracer(currentVisitor()); | 421 m_isolate->SetEmbedderHeapTracer(currentVisitor()); |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace blink | 424 } // namespace blink |
| OLD | NEW |