Chromium Code Reviews| Index: src/promise-utils.h |
| diff --git a/src/promise-utils.h b/src/promise-utils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66f291526a38b3a5f900a3914350560ba552450a |
| --- /dev/null |
| +++ b/src/promise-utils.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8_PROMISE_UTILS_H_ |
| +#define V8_PROMISE_UTILS_H_ |
| + |
| +#include "src/objects.h" |
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class PromiseUtils : public AllStatic { |
|
adamk
2016/11/10 18:10:54
Please add a comment for this class.
gsathya
2016/11/11 02:34:37
Done. Feel free to suggest something better.
|
| + public: |
| + enum PromiseResolvingFunctionContextSlot { |
|
adamk
2016/11/10 18:10:54
Looks like this is no longer used?
gsathya
2016/11/11 02:34:37
Done.
|
| + kAlreadyVisitedSlot = 4, |
| + kPromiseSlot, |
| + kDebugEventSlot, |
| + }; |
| + |
| + static MUST_USE_RESULT Handle<JSObject> GetPromise(Isolate* isolate, |
| + Handle<Context> context); |
|
adamk
2016/11/10 18:10:55
Please add a comment for this block of functions;
gsathya
2016/11/11 02:34:37
Done.
|
| + static MUST_USE_RESULT Handle<Object> GetDebugEvent(Isolate* isolate, |
| + Handle<Context> context); |
| + static MUST_USE_RESULT Handle<Smi> GetAlreadyVisited(Isolate* isolate, |
|
adamk
2016/11/10 18:10:54
MUST_USE_RESULT on a Handle generally isn't necess
gsathya
2016/11/11 02:34:37
Done.
|
| + Handle<Context> context); |
| + static void SetAlreadyVisitedToTrue(Handle<Context> context); |
|
adamk
2016/11/10 18:10:55
SetAlreadyVisited() is a good enough name, I'd say
gsathya
2016/11/11 02:34:37
Done.
|
| + |
| + static void CreateResolvingFunctions(Isolate* isolate, |
| + Handle<JSObject> promise, |
| + Handle<Object> debug_event, |
| + Handle<JSFunction>* resolve, |
| + Handle<JSFunction>* reject); |
| +}; |
| +} // namespace internal |
| +} // namespace v8 |
| + |
| +#endif // V8_PROMISE_UTILS_H_ |