| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return v8StringToWebCoreString<AtomicString>(value, Externalize); | 180 return v8StringToWebCoreString<AtomicString>(value, Externalize); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Convert v8 types to a WTF::String. If the V8 string is not already | 183 // Convert v8 types to a WTF::String. If the V8 string is not already |
| 184 // an external string then it is transformed into an external string at this | 184 // an external string then it is transformed into an external string at this |
| 185 // point to avoid repeated conversions. | 185 // point to avoid repeated conversions. |
| 186 // | 186 // |
| 187 // FIXME: Replace all the call sites with V8TRYCATCH_FOR_V8STRINGRESOURCE(). | 187 // FIXME: Replace all the call sites with V8TRYCATCH_FOR_V8STRINGRESOURCE(). |
| 188 // Using this method will lead to a wrong behavior, because you cannot stop
the | 188 // Using this method will lead to a wrong behavior, because you cannot stop
the |
| 189 // execution when an exception is thrown inside stringResource.prepare(). | 189 // execution when an exception is thrown inside stringResource.prepare(). |
| 190 inline String toWebCoreString(v8::Handle<v8::Value> value) | |
| 191 { | |
| 192 V8StringResource<> stringResource(value); | |
| 193 if (!stringResource.prepare()) | |
| 194 return String(); | |
| 195 return stringResource; | |
| 196 } | |
| 197 | |
| 198 // FIXME: See the above comment. | |
| 199 inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value) | 190 inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value) |
| 200 { | 191 { |
| 201 V8StringResource<WithNullCheck> stringResource(value); | 192 V8StringResource<WithNullCheck> stringResource(value); |
| 202 if (!stringResource.prepare()) | 193 if (!stringResource.prepare()) |
| 203 return String(); | 194 return String(); |
| 204 return stringResource; | 195 return stringResource; |
| 205 } | 196 } |
| 206 | 197 |
| 207 // FIXME: See the above comment. | 198 // FIXME: See the above comment. |
| 208 inline String toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>
value) | 199 inline String toWebCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>
value) |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 705 |
| 715 // Converts a DOM object to a v8 value. | 706 // Converts a DOM object to a v8 value. |
| 716 // This is a no-inline version of toV8(). If you want to call toV8() | 707 // This is a no-inline version of toV8(). If you want to call toV8() |
| 717 // without creating #include cycles, you can use this function instead. | 708 // without creating #include cycles, you can use this function instead. |
| 718 // Each specialized implementation will be generated. | 709 // Each specialized implementation will be generated. |
| 719 template<typename T> | 710 template<typename T> |
| 720 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate*); | 711 v8::Handle<v8::Value> toV8NoInline(T* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate*); |
| 721 } // namespace WebCore | 712 } // namespace WebCore |
| 722 | 713 |
| 723 #endif // V8Binding_h | 714 #endif // V8Binding_h |
| OLD | NEW |