OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 30 matching lines...) Expand all Loading... |
41 class ActiveDOMObject; | 41 class ActiveDOMObject; |
42 class EventTarget; | 42 class EventTarget; |
43 class ScriptWrappable; | 43 class ScriptWrappable; |
44 | 44 |
45 static const int v8DOMWrapperTypeIndex = static_cast<int>(gin::kWrapperInfoIndex
); | 45 static const int v8DOMWrapperTypeIndex = static_cast<int>(gin::kWrapperInfoIndex
); |
46 static const int v8DOMWrapperObjectIndex = static_cast<int>(gin::kEncodedValueIn
dex); | 46 static const int v8DOMWrapperObjectIndex = static_cast<int>(gin::kEncodedValueIn
dex); |
47 static const int v8DefaultWrapperInternalFieldCount = static_cast<int>(gin::kNum
berOfInternalFields); | 47 static const int v8DefaultWrapperInternalFieldCount = static_cast<int>(gin::kNum
berOfInternalFields); |
48 static const int v8PrototypeTypeIndex = 0; | 48 static const int v8PrototypeTypeIndex = 0; |
49 static const int v8PrototypeInternalFieldcount = 1; | 49 static const int v8PrototypeInternalFieldcount = 1; |
50 | 50 |
51 typedef v8::Handle<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*); | 51 typedef v8::Local<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*); |
52 typedef void (*RefObjectFunction)(ScriptWrappable*); | 52 typedef void (*RefObjectFunction)(ScriptWrappable*); |
53 typedef void (*DerefObjectFunction)(ScriptWrappable*); | 53 typedef void (*DerefObjectFunction)(ScriptWrappable*); |
54 typedef void (*TraceFunction)(Visitor*, ScriptWrappable*); | 54 typedef void (*TraceFunction)(Visitor*, ScriptWrappable*); |
55 typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>); | 55 typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>); |
56 typedef void (*ResolveWrapperReachabilityFunction)(v8::Isolate*, ScriptWrappable
*, const v8::Persistent<v8::Object>&); | 56 typedef void (*ResolveWrapperReachabilityFunction)(v8::Isolate*, ScriptWrappable
*, const v8::Persistent<v8::Object>&); |
57 typedef void (*InstallConditionallyEnabledMethodsFunction)(v8::Local<v8::Object>
, v8::Isolate*); | 57 typedef void (*InstallConditionallyEnabledMethodsFunction)(v8::Local<v8::Object>
, v8::Isolate*); |
58 typedef void (*InstallConditionallyEnabledPropertiesFunction)(v8::Local<v8::Obje
ct>, v8::Isolate*); | 58 typedef void (*InstallConditionallyEnabledPropertiesFunction)(v8::Local<v8::Obje
ct>, v8::Isolate*); |
59 | 59 |
60 inline void setObjectGroup(v8::Isolate* isolate, ScriptWrappable* scriptWrappabl
e, const v8::Persistent<v8::Object>& wrapper) | 60 inline void setObjectGroup(v8::Isolate* isolate, ScriptWrappable* scriptWrappabl
e, const v8::Persistent<v8::Object>& wrapper) |
61 { | 61 { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return false; | 112 return false; |
113 } | 113 } |
114 | 114 |
115 void configureWrapper(v8::PersistentBase<v8::Object>* wrapper) const | 115 void configureWrapper(v8::PersistentBase<v8::Object>* wrapper) const |
116 { | 116 { |
117 wrapper->SetWrapperClassId(wrapperClassId); | 117 wrapper->SetWrapperClassId(wrapperClassId); |
118 if (lifetime == Independent) | 118 if (lifetime == Independent) |
119 wrapper->MarkIndependent(); | 119 wrapper->MarkIndependent(); |
120 } | 120 } |
121 | 121 |
122 v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate* isolate) const | 122 v8::Local<v8::FunctionTemplate> domTemplate(v8::Isolate* isolate) const |
123 { | 123 { |
124 return domTemplateFunction(isolate); | 124 return domTemplateFunction(isolate); |
125 } | 125 } |
126 | 126 |
127 void refObject(ScriptWrappable* scriptWrappable) const | 127 void refObject(ScriptWrappable* scriptWrappable) const |
128 { | 128 { |
129 ASSERT(refObjectFunction); | 129 ASSERT(refObjectFunction); |
130 refObjectFunction(scriptWrappable); | 130 refObjectFunction(scriptWrappable); |
131 } | 131 } |
132 | 132 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 inline void releaseObject(v8::Handle<v8::Object> wrapper) | 229 inline void releaseObject(v8::Handle<v8::Object> wrapper) |
230 { | 230 { |
231 toWrapperTypeInfo(wrapper)->derefObject(toScriptWrappable(wrapper)); | 231 toWrapperTypeInfo(wrapper)->derefObject(toScriptWrappable(wrapper)); |
232 } | 232 } |
233 | 233 |
234 } // namespace blink | 234 } // namespace blink |
235 | 235 |
236 #endif // WrapperTypeInfo_h | 236 #endif // WrapperTypeInfo_h |
OLD | NEW |