| 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 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // value may not be a Blink's wrapper object. In order to make sure of it, | 63 // value may not be a Blink's wrapper object. In order to make sure of it, |
| 64 // Use isWrapper function instead. | 64 // Use isWrapper function instead. |
| 65 CORE_EXPORT static bool hasInternalFieldsSet(v8::Local<v8::Value>); | 65 CORE_EXPORT static bool hasInternalFieldsSet(v8::Local<v8::Value>); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 inline void V8DOMWrapper::setNativeInfo(v8::Isolate* isolate, v8::Local<v8::Obje
ct> wrapper, const WrapperTypeInfo* wrapperTypeInfo, ScriptWrappable* scriptWrap
pable) | 68 inline void V8DOMWrapper::setNativeInfo(v8::Isolate* isolate, v8::Local<v8::Obje
ct> wrapper, const WrapperTypeInfo* wrapperTypeInfo, ScriptWrappable* scriptWrap
pable) |
| 69 { | 69 { |
| 70 ASSERT(wrapper->InternalFieldCount() >= 2); | 70 ASSERT(wrapper->InternalFieldCount() >= 2); |
| 71 ASSERT(scriptWrappable); | 71 ASSERT(scriptWrappable); |
| 72 ASSERT(wrapperTypeInfo); | 72 ASSERT(wrapperTypeInfo); |
| 73 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, scriptWra
ppable); | 73 int indices[] = { v8DOMWrapperObjectIndex, v8DOMWrapperTypeIndex }; |
| 74 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_cast<
WrapperTypeInfo*>(wrapperTypeInfo)); | 74 void* values[] = { scriptWrappable, const_cast<WrapperTypeInfo*>(wrapperType
Info) }; |
| 75 wrapper->SetAlignedPointerInInternalFields(WTF_ARRAY_LENGTH(indices), indice
s, values); |
| 75 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { | 76 if (RuntimeEnabledFeatures::traceWrappablesEnabled()) { |
| 76 auto perIsolateData = V8PerIsolateData::from(isolate); | 77 auto perIsolateData = V8PerIsolateData::from(isolate); |
| 77 // We notify ScriptWrappableVisitor about the new wrapper association, | 78 // We notify ScriptWrappableVisitor about the new wrapper association, |
| 78 // so the visitor can make sure to trace the association (in case it is | 79 // so the visitor can make sure to trace the association (in case it is |
| 79 // currently tracing). Because of some optimizations, V8 will not | 80 // currently tracing). Because of some optimizations, V8 will not |
| 80 // necessarily detect wrappers created during its incremental marking. | 81 // necessarily detect wrappers created during its incremental marking. |
| 81 perIsolateData->scriptWrappableVisitor() | 82 perIsolateData->scriptWrappableVisitor() |
| 82 ->RegisterV8Reference(std::make_pair( | 83 ->RegisterV8Reference(std::make_pair( |
| 83 const_cast<WrapperTypeInfo*>(wrapperTypeInfo), scriptWrappable))
; | 84 const_cast<WrapperTypeInfo*>(wrapperTypeInfo), scriptWrappable))
; |
| 84 } | 85 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 161 |
| 161 bool m_didEnterContext; | 162 bool m_didEnterContext; |
| 162 v8::Local<v8::Context> m_context; | 163 v8::Local<v8::Context> m_context; |
| 163 v8::TryCatch m_tryCatch; | 164 v8::TryCatch m_tryCatch; |
| 164 bool m_convertExceptions; | 165 bool m_convertExceptions; |
| 165 }; | 166 }; |
| 166 | 167 |
| 167 } // namespace blink | 168 } // namespace blink |
| 168 | 169 |
| 169 #endif // V8DOMWrapper_h | 170 #endif // V8DOMWrapper_h |
| OLD | NEW |