OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 inline void v8SetReturnValueStringOrUndefined(const CallbackInfo& info, const St
ring& string, v8::Isolate* isolate) | 184 inline void v8SetReturnValueStringOrUndefined(const CallbackInfo& info, const St
ring& string, v8::Isolate* isolate) |
185 { | 185 { |
186 if (string.isNull()) { | 186 if (string.isNull()) { |
187 v8SetReturnValueUndefined(info); | 187 v8SetReturnValueUndefined(info); |
188 return; | 188 return; |
189 } | 189 } |
190 V8PerIsolateData::from(isolate)->stringCache()->setReturnValueFromString(inf
o.GetReturnValue(), string.impl()); | 190 V8PerIsolateData::from(isolate)->stringCache()->setReturnValueFromString(inf
o.GetReturnValue(), string.impl()); |
191 } | 191 } |
192 | 192 |
193 template<typename CallbackInfo> | 193 template<typename CallbackInfo> |
194 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl) | 194 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl, v8::Local<v8::Object> creationContext) |
195 { | 195 { |
196 if (UNLIKELY(!impl)) { | 196 if (UNLIKELY(!impl)) { |
197 v8SetReturnValueNull(callbackInfo); | 197 v8SetReturnValueNull(callbackInfo); |
198 return; | 198 return; |
199 } | 199 } |
200 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) | 200 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) |
201 return; | 201 return; |
202 v8::Handle<v8::Object> wrapper = impl->wrap(callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 202 v8::Handle<v8::Object> wrapper = impl->wrap(creationContext, callbackInfo.Ge
tIsolate()); |
203 v8SetReturnValue(callbackInfo, wrapper); | 203 v8SetReturnValue(callbackInfo, wrapper); |
204 } | 204 } |
205 | 205 |
206 template<typename CallbackInfo> | 206 template<typename CallbackInfo> |
| 207 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl) |
| 208 { |
| 209 v8SetReturnValue(callbackInfo, impl, callbackInfo.Holder()); |
| 210 } |
| 211 |
| 212 template<typename CallbackInfo> |
207 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) | 213 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) |
208 { | 214 { |
209 if (UNLIKELY(!impl)) { | 215 if (UNLIKELY(!impl)) { |
210 v8SetReturnValueNull(callbackInfo); | 216 v8SetReturnValueNull(callbackInfo); |
211 return; | 217 return; |
212 } | 218 } |
213 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) | 219 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) |
214 return; | 220 return; |
215 v8::Handle<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(callb
ackInfo.Holder(), callbackInfo.GetIsolate()); | 221 v8::Handle<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(callb
ackInfo.Holder(), callbackInfo.GetIsolate()); |
216 v8SetReturnValue(callbackInfo, wrapper); | 222 v8SetReturnValue(callbackInfo, wrapper); |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); | 996 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Handle<v8::Function>); |
991 | 997 |
992 // Callback functions used by generated code. | 998 // Callback functions used by generated code. |
993 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 999 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
994 | 1000 |
995 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1001 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
996 | 1002 |
997 } // namespace blink | 1003 } // namespace blink |
998 | 1004 |
999 #endif // V8Binding_h | 1005 #endif // V8Binding_h |
OLD | NEW |