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

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

Issue 18878002: Refactoring on DOM/Promises (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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 PromiseEveryEnvironmentIndexIndex, 52 PromiseEveryEnvironmentIndexIndex,
53 PromiseEveryEnvironmentResultsIndex, 53 PromiseEveryEnvironmentResultsIndex,
54 PromiseEveryEnvironmentFieldCount, // This entry must always be at the b ottom. 54 PromiseEveryEnvironmentFieldCount, // This entry must always be at the b ottom.
55 }; 55 };
56 56
57 enum PrimitiveWrapperFieldIndex { 57 enum PrimitiveWrapperFieldIndex {
58 PrimitiveWrapperPrimitiveIndex, 58 PrimitiveWrapperPrimitiveIndex,
59 PrimitiveWrapperFieldCount, // This entry must always be at the bottom. 59 PrimitiveWrapperFieldCount, // This entry must always be at the bottom.
60 }; 60 };
61 61
62 enum PromiseAlgorithm {
63 FulfillAlgorithm,
64 ResolveAlgorithm,
65 RejectAlgorithm,
66 };
67
68 enum PromiseState { 62 enum PromiseState {
69 Pending, 63 Pending,
70 Fulfilled, 64 Fulfilled,
71 Rejected, 65 Rejected,
72 PendingWithResolvedFlagSet, 66 PendingWithResolvedFlagSet,
73 }; 67 };
74 68
75 enum SynchronousMode { 69 enum SynchronousMode {
76 Synchronous, 70 Synchronous,
77 Asynchronous, 71 Asynchronous,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 static void setState(v8::Handle<v8::Object> internal, PromiseState); 108 static void setState(v8::Handle<v8::Object> internal, PromiseState);
115 109
116 // Call |function| synchronously or asynchronously, depending on |mode|. 110 // Call |function| synchronously or asynchronously, depending on |mode|.
117 // 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.
118 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*);
119 }; 113 };
120 114
121 } // namespace WebCore 115 } // namespace WebCore
122 116
123 #endif // V8PromiseCustom_h 117 #endif // V8PromiseCustom_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698