Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: Source/bindings/v8/custom/V8PromiseCustom.h

Issue 18113004: Implement Promise.prototype.then and Promise.prototype.catch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698