| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return instanceTemplate->Clone(); | 100 return instanceTemplate->Clone(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase( | 103 v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase( |
| 104 const WrapperTypeInfo* type) { | 104 const WrapperTypeInfo* type) { |
| 105 ASSERT(!m_errorPrototype.isEmpty()); | 105 ASSERT(!m_errorPrototype.isEmpty()); |
| 106 | 106 |
| 107 v8::Local<v8::Context> currentContext = context(); | 107 v8::Local<v8::Context> currentContext = context(); |
| 108 v8::Context::Scope scope(currentContext); | 108 v8::Context::Scope scope(currentContext); |
| 109 const DOMWrapperWorld& world = DOMWrapperWorld::world(currentContext); | 109 const DOMWrapperWorld& world = DOMWrapperWorld::world(currentContext); |
| 110 // We shouldn't reach this point for the types that are implemented in v8 such
as typed arrays and | 110 // We shouldn't reach this point for the types that are implemented in v8 such |
| 111 // hence don't have domTemplateFunction. | 111 // as typed arrays and hence don't have domTemplateFunction. |
| 112 ASSERT(type->domTemplateFunction); | 112 ASSERT(type->domTemplateFunction); |
| 113 v8::Local<v8::FunctionTemplate> interfaceTemplate = | 113 v8::Local<v8::FunctionTemplate> interfaceTemplate = |
| 114 type->domTemplate(m_isolate, world); | 114 type->domTemplate(m_isolate, world); |
| 115 // Getting the function might fail if we're running out of stack or memory. | 115 // Getting the function might fail if we're running out of stack or memory. |
| 116 v8::Local<v8::Function> interfaceObject; | 116 v8::Local<v8::Function> interfaceObject; |
| 117 if (!interfaceTemplate->GetFunction(currentContext).ToLocal(&interfaceObject)) | 117 if (!interfaceTemplate->GetFunction(currentContext).ToLocal(&interfaceObject)) |
| 118 return v8::Local<v8::Function>(); | 118 return v8::Local<v8::Function>(); |
| 119 | 119 |
| 120 if (type->parentClass) { | 120 if (type->parentClass) { |
| 121 v8::Local<v8::Object> prototypeTemplate = | 121 v8::Local<v8::Object> prototypeTemplate = |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 return m_compiledPrivateScript.Get(className); | 179 return m_compiledPrivateScript.Get(className); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void V8PerContextData::setCompiledPrivateScript( | 182 void V8PerContextData::setCompiledPrivateScript( |
| 183 String className, | 183 String className, |
| 184 v8::Local<v8::Value> compiledObject) { | 184 v8::Local<v8::Value> compiledObject) { |
| 185 m_compiledPrivateScript.Set(className, compiledObject); | 185 m_compiledPrivateScript.Set(className, compiledObject); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace blink | 188 } // namespace blink |
| OLD | NEW |