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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 callbackInfo.Holder(), callbackInfo.GetIsolate())); | 364 callbackInfo.Holder(), callbackInfo.GetIsolate())); |
365 } | 365 } |
366 | 366 |
367 template <typename CallbackInfo, typename T, typename Wrappable> | 367 template <typename CallbackInfo, typename T, typename Wrappable> |
368 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, | 368 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, |
369 PassRefPtr<T> impl, | 369 PassRefPtr<T> impl, |
370 const Wrappable* wrappable) { | 370 const Wrappable* wrappable) { |
371 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 371 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
372 } | 372 } |
373 | 373 |
374 template <typename CallbackInfo, typename Wrappable> | |
375 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, | |
376 blink::ScriptPromise promise, | |
dcheng
2016/10/21 06:44:23
Should this be const ScriptPromise&?
horo
2016/10/21 10:56:40
Done.
| |
377 const Wrappable* wrappable) { | |
378 v8SetReturnValue(callbackInfo, promise.v8Value()); | |
379 } | |
380 | |
374 // Convert v8::String to a WTF::String. If the V8 string is not already | 381 // Convert v8::String to a WTF::String. If the V8 string is not already |
375 // an external string then it is transformed into an external string at this | 382 // an external string then it is transformed into an external string at this |
376 // point to avoid repeated conversions. | 383 // point to avoid repeated conversions. |
377 inline String toCoreString(v8::Local<v8::String> value) { | 384 inline String toCoreString(v8::Local<v8::String> value) { |
378 return v8StringToWebCoreString<String>(value, Externalize); | 385 return v8StringToWebCoreString<String>(value, Externalize); |
379 } | 386 } |
380 | 387 |
381 inline String toCoreStringWithNullCheck(v8::Local<v8::String> value) { | 388 inline String toCoreStringWithNullCheck(v8::Local<v8::String> value) { |
382 if (value.IsEmpty() || value->IsNull()) | 389 if (value.IsEmpty() || value->IsNull()) |
383 return String(); | 390 return String(); |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1149 | 1156 |
1150 // Freeze a V8 object. The type of the first parameter and the return value is | 1157 // Freeze a V8 object. The type of the first parameter and the return value is |
1151 // intentionally v8::Value so that this function can wrap toV8(). | 1158 // intentionally v8::Value so that this function can wrap toV8(). |
1152 // If the argument isn't an object, this will crash. | 1159 // If the argument isn't an object, this will crash. |
1153 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, | 1160 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, |
1154 v8::Isolate*); | 1161 v8::Isolate*); |
1155 | 1162 |
1156 } // namespace blink | 1163 } // namespace blink |
1157 | 1164 |
1158 #endif // V8Binding_h | 1165 #endif // V8Binding_h |
OLD | NEW |