| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013, Google Inc. All rights reserved. | 2 * Copyright (C) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef V8PromiseCustom_h | 25 #ifndef V8PromiseCustom_h |
| 26 #define V8PromiseCustom_h | 26 #define V8PromiseCustom_h |
| 27 | 27 |
| 28 #include "bindings/v8/WrapperTypeInfo.h" |
| 29 |
| 28 #include <v8.h> | 30 #include <v8.h> |
| 29 | 31 |
| 30 namespace WebCore { | 32 namespace WebCore { |
| 31 | 33 |
| 32 class V8PromiseCustom { | 34 class V8PromiseCustom { |
| 33 public: | 35 public: |
| 34 enum InternalFieldIndex { | 36 enum InternalFieldIndex { |
| 35 InternalStateIndex, | 37 InternalStateIndex, |
| 36 InternalResultIndex, | 38 InternalResultIndex, |
| 37 InternalFulfillCallbackIndex, | 39 InternalFulfillCallbackIndex, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 PromiseEveryEnvironmentIndexIndex, | 54 PromiseEveryEnvironmentIndexIndex, |
| 53 PromiseEveryEnvironmentResultsIndex, | 55 PromiseEveryEnvironmentResultsIndex, |
| 54 PromiseEveryEnvironmentFieldCount, // This entry must always be at the b
ottom. | 56 PromiseEveryEnvironmentFieldCount, // This entry must always be at the b
ottom. |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 enum PrimitiveWrapperFieldIndex { | 59 enum PrimitiveWrapperFieldIndex { |
| 58 PrimitiveWrapperPrimitiveIndex, | 60 PrimitiveWrapperPrimitiveIndex, |
| 59 PrimitiveWrapperFieldCount, // This entry must always be at the bottom. | 61 PrimitiveWrapperFieldCount, // This entry must always be at the bottom. |
| 60 }; | 62 }; |
| 61 | 63 |
| 64 enum ResolverFieldIndex { |
| 65 ResolverInternalIndex = v8DOMWrapperObjectIndex, |
| 66 ResolverFieldCount, // This entry must always be at the bottom. |
| 67 }; |
| 68 |
| 62 enum PromiseState { | 69 enum PromiseState { |
| 63 Pending, | 70 Pending, |
| 64 Fulfilled, | 71 Fulfilled, |
| 65 Rejected, | 72 Rejected, |
| 66 PendingWithResolvedFlagSet, | 73 PendingWithResolvedFlagSet, |
| 67 }; | 74 }; |
| 68 | 75 |
| 69 enum SynchronousMode { | 76 enum SynchronousMode { |
| 70 Synchronous, | 77 Synchronous, |
| 71 Asynchronous, | 78 Asynchronous, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 static void setState(v8::Handle<v8::Object> internal, PromiseState, v8::Isol
ate*); | 115 static void setState(v8::Handle<v8::Object> internal, PromiseState, v8::Isol
ate*); |
| 109 | 116 |
| 110 // Call |function| synchronously or asynchronously, depending on |mode|. | 117 // Call |function| synchronously or asynchronously, depending on |mode|. |
| 111 // If |function| throws an exception, this function catches it and does not
rethrow. | 118 // If |function| throws an exception, this function catches it and does not
rethrow. |
| 112 static void call(v8::Handle<v8::Function> /* function */, v8::Handle<v8::Obj
ect> receiver, v8::Handle<v8::Value> result, SynchronousMode /* mode */, v8::Iso
late*); | 119 static void call(v8::Handle<v8::Function> /* function */, v8::Handle<v8::Obj
ect> receiver, v8::Handle<v8::Value> result, SynchronousMode /* mode */, v8::Iso
late*); |
| 113 }; | 120 }; |
| 114 | 121 |
| 115 } // namespace WebCore | 122 } // namespace WebCore |
| 116 | 123 |
| 117 #endif // V8PromiseCustom_h | 124 #endif // V8PromiseCustom_h |
| OLD | NEW |