OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 Document* document = currentDOMWindow(info.GetIsolate())->document(); | 92 Document* document = currentDOMWindow(info.GetIsolate())->document(); |
93 ASSERT(document); | 93 ASSERT(document); |
94 | 94 |
95 // Make sure the document is added to the DOM Node map. Otherwise, the TestI
nterfaceEventTarget instance | 95 // Make sure the document is added to the DOM Node map. Otherwise, the TestI
nterfaceEventTarget instance |
96 // may end up being the only node in the map and get garbage-collected prema
turely. | 96 // may end up being the only node in the map and get garbage-collected prema
turely. |
97 toV8(document, info.Holder(), info.GetIsolate()); | 97 toV8(document, info.Holder(), info.GetIsolate()); |
98 | 98 |
99 RefPtr<TestInterfaceEventTarget> impl = TestInterfaceEventTarget::createForJ
SConstructor(*document); | 99 RefPtr<TestInterfaceEventTarget> impl = TestInterfaceEventTarget::createForJ
SConstructor(*document); |
| 100 |
100 v8::Handle<v8::Object> wrapper = info.Holder(); | 101 v8::Handle<v8::Object> wrapper = info.Holder(); |
101 | |
102 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl.re
lease(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, info.
GetIsolate(), WrapperConfiguration::Independent); | 102 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventTarget>(impl.re
lease(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, info.
GetIsolate(), WrapperConfiguration::Independent); |
103 v8SetReturnValue(info, wrapper); | 103 v8SetReturnValue(info, wrapper); |
104 } | 104 } |
105 | 105 |
106 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventTargetConstructor::domTempl
ate(v8::Isolate* isolate) | 106 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventTargetConstructor::domTempl
ate(v8::Isolate* isolate) |
107 { | 107 { |
108 static int domTemplateKey; // This address is used for a key to look up the
dom template. | 108 static int domTemplateKey; // This address is used for a key to look up the
dom template. |
109 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 109 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
110 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); | 110 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl
ateKey); |
111 if (!result.IsEmpty()) | 111 if (!result.IsEmpty()) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 fromInternalPointer(object)->deref(); | 197 fromInternalPointer(object)->deref(); |
198 } | 198 } |
199 | 199 |
200 template<> | 200 template<> |
201 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 201 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
202 { | 202 { |
203 return toV8(impl, creationContext, isolate); | 203 return toV8(impl, creationContext, isolate); |
204 } | 204 } |
205 | 205 |
206 } // namespace WebCore | 206 } // namespace WebCore |
OLD | NEW |