| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 ScriptValue getScriptValue() const { return m_promise; } | 79 ScriptValue getScriptValue() const { return m_promise; } |
| 80 | 80 |
| 81 v8::Local<v8::Value> v8Value() const { return m_promise.v8Value(); } | 81 v8::Local<v8::Value> v8Value() const { return m_promise.v8Value(); } |
| 82 | 82 |
| 83 v8::Isolate* isolate() const { return m_promise.isolate(); } | 83 v8::Isolate* isolate() const { return m_promise.isolate(); } |
| 84 | 84 |
| 85 bool isEmpty() const { return m_promise.isEmpty(); } | 85 bool isEmpty() const { return m_promise.isEmpty(); } |
| 86 | 86 |
| 87 void clear() { m_promise.clear(); } | 87 void clear() { m_promise.clear(); } |
| 88 | 88 |
| 89 void setReference(const v8::Persistent<v8::Object>& parent, | |
| 90 v8::Isolate* isolate) { | |
| 91 m_promise.setReference(parent, isolate); | |
| 92 } | |
| 93 | |
| 94 bool operator==(const ScriptPromise& value) const { | 89 bool operator==(const ScriptPromise& value) const { |
| 95 return m_promise == value.m_promise; | 90 return m_promise == value.m_promise; |
| 96 } | 91 } |
| 97 | 92 |
| 98 bool operator!=(const ScriptPromise& value) const { | 93 bool operator!=(const ScriptPromise& value) const { |
| 99 return !operator==(value); | 94 return !operator==(value); |
| 100 } | 95 } |
| 101 | 96 |
| 102 // Constructs and returns a ScriptPromise from |value|. | 97 // Constructs and returns a ScriptPromise from |value|. |
| 103 // if |value| is not a Promise object, returns a Promise object | 98 // if |value| is not a Promise object, returns a Promise object |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 static void increaseInstanceCount(); | 137 static void increaseInstanceCount(); |
| 143 static void decreaseInstanceCount(); | 138 static void decreaseInstanceCount(); |
| 144 | 139 |
| 145 RefPtr<ScriptState> m_scriptState; | 140 RefPtr<ScriptState> m_scriptState; |
| 146 ScriptValue m_promise; | 141 ScriptValue m_promise; |
| 147 }; | 142 }; |
| 148 | 143 |
| 149 } // namespace blink | 144 } // namespace blink |
| 150 | 145 |
| 151 #endif // ScriptPromise_h | 146 #endif // ScriptPromise_h |
| OLD | NEW |