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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 void clear() | 91 void clear() |
92 { | 92 { |
93 m_promise.clear(); | 93 m_promise.clear(); |
94 } | 94 } |
95 | 95 |
96 // Constructs and returns a ScriptPromise from |value|. | 96 // Constructs and returns a ScriptPromise from |value|. |
97 // if |value| is not a Promise object, returns a Promise object | 97 // if |value| is not a Promise object, returns a Promise object |
98 // resolved with |value|. | 98 // resolved with |value|. |
99 // Returns |value| itself if it is a Promise. | 99 // Returns |value| itself if it is a Promise. |
100 static ScriptPromise cast(ScriptState*, const ScriptValue& /*value*/); | 100 static ScriptPromise cast(const ScriptValue& /*value*/); |
101 static ScriptPromise cast(ScriptState*, v8::Handle<v8::Value> /*value*/); | 101 static ScriptPromise cast(ScriptState*, v8::Handle<v8::Value> /*value*/); |
102 | 102 |
103 static ScriptPromise reject(ScriptState*, const ScriptValue&); | 103 static ScriptPromise reject(const ScriptValue&); |
104 static ScriptPromise reject(ScriptState*, v8::Handle<v8::Value>); | 104 static ScriptPromise reject(ScriptState*, v8::Handle<v8::Value>); |
105 | 105 |
106 static ScriptPromise rejectWithDOMException(ScriptState*, PassRefPtrWillBeRa
wPtr<DOMException>); | 106 static ScriptPromise rejectWithDOMException(ScriptState*, PassRefPtrWillBeRa
wPtr<DOMException>); |
107 | 107 |
108 private: | 108 private: |
109 RefPtr<ScriptState> m_scriptState; | 109 RefPtr<ScriptState> m_scriptState; |
110 ScriptValue m_promise; | 110 ScriptValue m_promise; |
111 }; | 111 }; |
112 | 112 |
113 } // namespace WebCore | 113 } // namespace WebCore |
114 | 114 |
115 | 115 |
116 #endif // ScriptPromise_h | 116 #endif // ScriptPromise_h |
OLD | NEW |