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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 class V8PromiseCustom { | 32 class V8PromiseCustom { |
33 public: | 33 public: |
34 enum InternalFieldIndex { | 34 enum InternalFieldIndex { |
35 InternalStateIndex, | 35 InternalStateIndex, |
36 InternalResultIndex, | 36 InternalResultIndex, |
37 InternalFulfillCallbackIndex, | 37 InternalFulfillCallbackIndex, |
38 InternalRejectCallbackIndex, | 38 InternalRejectCallbackIndex, |
39 InternalFieldCount, // This entry must always be at the bottom. | 39 InternalFieldCount, // This entry must always be at the bottom. |
40 }; | 40 }; |
41 | 41 |
| 42 enum WrapperCallbackEnvironmentFieldIndex { |
| 43 WrapperCallbackEnvironmentPromiseIndex, |
| 44 WrapperCallbackEnvironmentPromiseResolverIndex, |
| 45 WrapperCallbackEnvironmentCallbackIndex, |
| 46 WrapperCallbackEnvironmentFieldCount, // This entry must always be at th
e bottom. |
| 47 }; |
| 48 |
42 enum PromiseAlgorithm { | 49 enum PromiseAlgorithm { |
43 FulfillAlgorithm, | 50 FulfillAlgorithm, |
44 ResolveAlgorithm, | 51 ResolveAlgorithm, |
45 RejectAlgorithm, | 52 RejectAlgorithm, |
46 }; | 53 }; |
47 | 54 |
48 enum PromiseState { | 55 enum PromiseState { |
49 Pending, | 56 Pending, |
50 Fulfilled, | 57 Fulfilled, |
51 Rejected, | 58 Rejected, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 static void setState(v8::Handle<v8::Object> internal, PromiseState); | 101 static void setState(v8::Handle<v8::Object> internal, PromiseState); |
95 | 102 |
96 // Call |function| synchronously or asynchronously, depending on |mode|. | 103 // Call |function| synchronously or asynchronously, depending on |mode|. |
97 // If |function| throws an exception, this function catches it and does not
rethrow. | 104 // If |function| throws an exception, this function catches it and does not
rethrow. |
98 static void call(v8::Handle<v8::Function> /* function */, v8::Handle<v8::Obj
ect> receiver, v8::Handle<v8::Value> result, SynchronousMode /* mode */, v8::Iso
late*); | 105 static void call(v8::Handle<v8::Function> /* function */, v8::Handle<v8::Obj
ect> receiver, v8::Handle<v8::Value> result, SynchronousMode /* mode */, v8::Iso
late*); |
99 }; | 106 }; |
100 | 107 |
101 } // namespace WebCore | 108 } // namespace WebCore |
102 | 109 |
103 #endif // V8PromiseCustom_h | 110 #endif // V8PromiseCustom_h |
OLD | NEW |