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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 callbackInfo.Holder(), callbackInfo.GetIsolate())); | 363 callbackInfo.Holder(), callbackInfo.GetIsolate())); |
364 } | 364 } |
365 | 365 |
366 template <typename CallbackInfo, typename T, typename Wrappable> | 366 template <typename CallbackInfo, typename T, typename Wrappable> |
367 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, | 367 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, |
368 PassRefPtr<T> impl, | 368 PassRefPtr<T> impl, |
369 const Wrappable* wrappable) { | 369 const Wrappable* wrappable) { |
370 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 370 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
371 } | 371 } |
372 | 372 |
| 373 template <typename CallbackInfo, typename T> |
| 374 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, |
| 375 const v8::Local<T> handle, |
| 376 const ScriptWrappable*) { |
| 377 v8SetReturnValue(callbackInfo, handle); |
| 378 } |
| 379 |
373 // Convert v8::String to a WTF::String. If the V8 string is not already | 380 // Convert v8::String to a WTF::String. If the V8 string is not already |
374 // an external string then it is transformed into an external string at this | 381 // an external string then it is transformed into an external string at this |
375 // point to avoid repeated conversions. | 382 // point to avoid repeated conversions. |
376 inline String toCoreString(v8::Local<v8::String> value) { | 383 inline String toCoreString(v8::Local<v8::String> value) { |
377 return v8StringToWebCoreString<String>(value, Externalize); | 384 return v8StringToWebCoreString<String>(value, Externalize); |
378 } | 385 } |
379 | 386 |
380 inline String toCoreStringWithNullCheck(v8::Local<v8::String> value) { | 387 inline String toCoreStringWithNullCheck(v8::Local<v8::String> value) { |
381 if (value.IsEmpty() || value->IsNull()) | 388 if (value.IsEmpty() || value->IsNull()) |
382 return String(); | 389 return String(); |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 // If the argument isn't an object, this will crash. | 1167 // If the argument isn't an object, this will crash. |
1161 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, | 1168 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, |
1162 v8::Isolate*); | 1169 v8::Isolate*); |
1163 | 1170 |
1164 CORE_EXPORT v8::Local<v8::Value> fromJSONString(v8::Isolate*, | 1171 CORE_EXPORT v8::Local<v8::Value> fromJSONString(v8::Isolate*, |
1165 const String& stringifiedJSON, | 1172 const String& stringifiedJSON, |
1166 ExceptionState&); | 1173 ExceptionState&); |
1167 } // namespace blink | 1174 } // namespace blink |
1168 | 1175 |
1169 #endif // V8Binding_h | 1176 #endif // V8Binding_h |
OLD | NEW |