| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 static v8::Local<v8::Object> createPromise(v8::Handle<v8::Object> creationCo
ntext, v8::Isolate*); | 65 static v8::Local<v8::Object> createPromise(v8::Handle<v8::Object> creationCo
ntext, v8::Isolate*); |
| 66 | 66 |
| 67 // |promise| must be a Promise instance. | 67 // |promise| must be a Promise instance. |
| 68 static v8::Local<v8::Object> getInternal(v8::Handle<v8::Object> promise); | 68 static v8::Local<v8::Object> getInternal(v8::Handle<v8::Object> promise); |
| 69 | 69 |
| 70 // |internal| must be a Promise internal object. | 70 // |internal| must be a Promise internal object. |
| 71 static PromiseState getState(v8::Handle<v8::Object> internal); | 71 static PromiseState getState(v8::Handle<v8::Object> internal); |
| 72 | 72 |
| 73 // |internal| must be a Promise internal object. | |
| 74 // Set a |promise|'s state and result that correspond to the state. | |
| 75 static void setState(v8::Handle<v8::Object> internal, PromiseState, v8::Hand
le<v8::Value>, v8::Isolate*); | |
| 76 | |
| 77 // Return true if |maybePromise| is a Promise instance. | 73 // Return true if |maybePromise| is a Promise instance. |
| 78 static bool isPromise(v8::Handle<v8::Value> maybePromise, v8::Isolate*); | 74 static bool isPromise(v8::Handle<v8::Value> maybePromise, v8::Isolate*); |
| 79 | 75 |
| 80 // Coerces |maybePromise| to a Promise instance. | 76 // Coerces |maybePromise| to a Promise instance. |
| 81 static v8::Local<v8::Object> toPromise(v8::Handle<v8::Value> maybePromise, v
8::Isolate*); | 77 static v8::Local<v8::Object> toPromise(v8::Handle<v8::Value> maybePromise, v
8::Isolate*); |
| 82 | 78 |
| 83 // |promise| must be a Promise instance. | 79 // |promise| must be a Promise instance. |
| 84 static void resolve(v8::Handle<v8::Object> promise, v8::Handle<v8::Value> re
sult, v8::Isolate*); | 80 static void resolve(v8::Handle<v8::Object> promise, v8::Handle<v8::Value> re
sult, v8::Isolate*); |
| 85 | 81 |
| 86 // |promise| must be a Promise instance. | 82 // |promise| must be a Promise instance. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 123 |
| 128 // |promise| must be a Promise instance. | 124 // |promise| must be a Promise instance. |
| 129 // Applies a transformation to an argument and use it to update derived | 125 // Applies a transformation to an argument and use it to update derived |
| 130 // promies. | 126 // promies. |
| 131 static void callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8::Funct
ion> handler, v8::Handle<v8::Value> argument, PromiseState originatorState, v8::
Isolate*); | 127 static void callHandler(v8::Handle<v8::Object> promise, v8::Handle<v8::Funct
ion> handler, v8::Handle<v8::Value> argument, PromiseState originatorState, v8::
Isolate*); |
| 132 }; | 128 }; |
| 133 | 129 |
| 134 } // namespace WebCore | 130 } // namespace WebCore |
| 135 | 131 |
| 136 #endif // V8PromiseCustom_h | 132 #endif // V8PromiseCustom_h |
| OLD | NEW |