| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 inline void v8SetReturnValueStringOrUndefined(const CallbackInfo& info, const St
ring& string, v8::Isolate* isolate) | 185 inline void v8SetReturnValueStringOrUndefined(const CallbackInfo& info, const St
ring& string, v8::Isolate* isolate) |
| 186 { | 186 { |
| 187 if (string.isNull()) { | 187 if (string.isNull()) { |
| 188 v8SetReturnValueUndefined(info); | 188 v8SetReturnValueUndefined(info); |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 V8PerIsolateData::from(isolate)->stringCache()->setReturnValueFromString(inf
o.GetReturnValue(), string.impl()); | 191 V8PerIsolateData::from(isolate)->stringCache()->setReturnValueFromString(inf
o.GetReturnValue(), string.impl()); |
| 192 } | 192 } |
| 193 | 193 |
| 194 template<typename CallbackInfo> | 194 template<typename CallbackInfo> |
| 195 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl) | 195 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl, v8::Local<v8::Object> creationContext) |
| 196 { | 196 { |
| 197 if (UNLIKELY(!impl)) { | 197 if (UNLIKELY(!impl)) { |
| 198 v8SetReturnValueNull(callbackInfo); | 198 v8SetReturnValueNull(callbackInfo); |
| 199 return; | 199 return; |
| 200 } | 200 } |
| 201 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) | 201 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) |
| 202 return; | 202 return; |
| 203 v8::Local<v8::Object> wrapper = impl->wrap(callbackInfo.GetIsolate(), callba
ckInfo.Holder()); | 203 v8::Local<v8::Object> wrapper = impl->wrap(callbackInfo.GetIsolate(), creati
onContext); |
| 204 v8SetReturnValue(callbackInfo, wrapper); | 204 v8SetReturnValue(callbackInfo, wrapper); |
| 205 } | 205 } |
| 206 | 206 |
| 207 template<typename CallbackInfo> | 207 template<typename CallbackInfo> |
| 208 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ScriptWrappable*
impl) |
| 209 { |
| 210 v8SetReturnValue(callbackInfo, impl, callbackInfo.Holder()); |
| 211 } |
| 212 |
| 213 template<typename CallbackInfo> |
| 208 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) | 214 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Node* impl) |
| 209 { | 215 { |
| 210 if (UNLIKELY(!impl)) { | 216 if (UNLIKELY(!impl)) { |
| 211 v8SetReturnValueNull(callbackInfo); | 217 v8SetReturnValueNull(callbackInfo); |
| 212 return; | 218 return; |
| 213 } | 219 } |
| 214 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) | 220 if (DOMDataStore::setReturnValue(callbackInfo.GetReturnValue(), impl)) |
| 215 return; | 221 return; |
| 216 v8::Local<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(callba
ckInfo.GetIsolate(), callbackInfo.Holder()); | 222 v8::Local<v8::Object> wrapper = ScriptWrappable::fromNode(impl)->wrap(callba
ckInfo.GetIsolate(), callbackInfo.Holder()); |
| 217 v8SetReturnValue(callbackInfo, wrapper); | 223 v8SetReturnValue(callbackInfo, wrapper); |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); | 1071 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); |
| 1066 | 1072 |
| 1067 // Callback functions used by generated code. | 1073 // Callback functions used by generated code. |
| 1068 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1074 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
| 1069 | 1075 |
| 1070 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1076 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
| 1071 | 1077 |
| 1072 } // namespace blink | 1078 } // namespace blink |
| 1073 | 1079 |
| 1074 #endif // V8Binding_h | 1080 #endif // V8Binding_h |
| OLD | NEW |