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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Return true if the internal object is detached from |resolver|. | 93 // Return true if the internal object is detached from |resolver|. |
94 // |resolver| must be a PromiseResolver instance. | 94 // |resolver| must be a PromiseResolver instance. |
95 static bool isInternalDetached(v8::Handle<v8::Object> resolver); | 95 static bool isInternalDetached(v8::Handle<v8::Object> resolver); |
96 | 96 |
97 // Detach the internal object from |resolver|. | 97 // Detach the internal object from |resolver|. |
98 // |resolver| must be a PromiseResolver instance. | 98 // |resolver| must be a PromiseResolver instance. |
99 static void detachInternal(v8::Handle<v8::Object> resolver, v8::Isolate*); | 99 static void detachInternal(v8::Handle<v8::Object> resolver, v8::Isolate*); |
100 | 100 |
101 // Clear the Promise / PromiseResolver internal object with the given state
and result. | 101 // Clear the Promise / PromiseResolver internal object with the given state
and result. |
102 // This function clears callbacks in the object. | 102 // This function clears callbacks in the object. |
103 static void clearInternal(v8::Handle<v8::Object> internal, PromiseState, v8:
:Handle<v8::Value> result); | 103 static void clearInternal(v8::Handle<v8::Object> internal, PromiseState, v8:
:Handle<v8::Value> result, v8::Isolate*); |
104 | 104 |
105 // |internal| must be an Promise / PromiseResolver internal object. | 105 // |internal| must be an Promise / PromiseResolver internal object. |
106 static PromiseState getState(v8::Handle<v8::Object> internal); | 106 static PromiseState getState(v8::Handle<v8::Object> internal); |
107 // |internal| must be an Promise / PromiseResolver internal object. | 107 // |internal| must be an Promise / PromiseResolver internal object. |
108 static void setState(v8::Handle<v8::Object> internal, PromiseState); | 108 static void setState(v8::Handle<v8::Object> internal, PromiseState, v8::Isol
ate*); |
109 | 109 |
110 // Call |function| synchronously or asynchronously, depending on |mode|. | 110 // Call |function| synchronously or asynchronously, depending on |mode|. |
111 // If |function| throws an exception, this function catches it and does not
rethrow. | 111 // 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*); | 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*); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace WebCore | 115 } // namespace WebCore |
116 | 116 |
117 #endif // V8PromiseCustom_h | 117 #endif // V8PromiseCustom_h |
OLD | NEW |