| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 static ScriptPromise cast(const ScriptValue& /*value*/); | 99 static ScriptPromise cast(const ScriptValue& /*value*/); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 friend class ScriptPromiseResolver; | |
| 103 | |
| 104 static ScriptPromise createPending(); | |
| 105 static ScriptPromise createPending(ExecutionContext*); | |
| 106 static ScriptPromise createPending(v8::Isolate*) { return createPending(); } | |
| 107 | |
| 108 ScriptValue m_promise; | 102 ScriptValue m_promise; |
| 109 }; | 103 }; |
| 110 | 104 |
| 111 } // namespace WebCore | 105 } // namespace WebCore |
| 112 | 106 |
| 113 | 107 |
| 114 #endif // ScriptPromise_h | 108 #endif // ScriptPromise_h |
| OLD | NEW |