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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 v8::Handle<v8::Context> context() const { return m_context; } | 73 v8::Handle<v8::Context> context() const { return m_context; } |
74 | 74 |
75 private: | 75 private: |
76 bool m_didEnterContext; | 76 bool m_didEnterContext; |
77 v8::Handle<v8::Context> m_context; | 77 v8::Handle<v8::Context> m_context; |
78 }; | 78 }; |
79 | 79 |
80 static v8::Local<v8::Object> wrapInShadowTemplate(v8::Local<v8::Object> wrapper,
Node* impl, v8::Isolate* isolate) | 80 static v8::Local<v8::Object> wrapInShadowTemplate(v8::Local<v8::Object> wrapper,
Node* impl, v8::Isolate* isolate) |
81 { | 81 { |
82 // This is only for getting a unique pointer which we can pass to privateTem
plate. | 82 // This is only for getting a unique pointer which we can pass to privateTem
plate. |
83 static const char* shadowTemplateUniqueKey = "wrapInShadowTemplate"; | 83 static int shadowTemplateUniqueKey; |
84 WrapperWorldType currentWorldType = worldType(isolate); | 84 WrapperWorldType currentWorldType = worldType(isolate); |
85 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 85 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
86 v8::Handle<v8::FunctionTemplate> shadowTemplate = data->privateTemplateIfExi
sts(currentWorldType, &shadowTemplateUniqueKey); | 86 v8::Handle<v8::FunctionTemplate> shadowTemplate = data->privateTemplateIfExi
sts(currentWorldType, &shadowTemplateUniqueKey); |
87 if (shadowTemplate.IsEmpty()) { | 87 if (shadowTemplate.IsEmpty()) { |
88 shadowTemplate = v8::FunctionTemplate::New(); | 88 shadowTemplate = v8::FunctionTemplate::New(); |
89 if (shadowTemplate.IsEmpty()) | 89 if (shadowTemplate.IsEmpty()) |
90 return v8::Local<v8::Object>(); | 90 return v8::Local<v8::Object>(); |
91 shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument")); | 91 shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument")); |
92 shadowTemplate->Inherit(V8HTMLDocument::GetTemplate(isolate, currentWorl
dType)); | 92 shadowTemplate->Inherit(V8HTMLDocument::GetTemplate(isolate, currentWorl
dType)); |
93 shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument
::internalFieldCount); | 93 shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument
::internalFieldCount); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value); | 165 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value); |
166 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount); | 166 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount); |
167 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex))
; | 167 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex))
; |
168 | 168 |
169 const WrapperTypeInfo* typeInfo = static_cast<const WrapperTypeInfo*>(wrappe
r->GetAlignedPointerFromInternalField(v8DOMWrapperTypeIndex)); | 169 const WrapperTypeInfo* typeInfo = static_cast<const WrapperTypeInfo*>(wrappe
r->GetAlignedPointerFromInternalField(v8DOMWrapperTypeIndex)); |
170 return typeInfo == type; | 170 return typeInfo == type; |
171 } | 171 } |
172 | 172 |
173 } // namespace WebCore | 173 } // namespace WebCore |
OLD | NEW |