| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // This method will be implemented by the code generator. | 90 // This method will be implemented by the code generator. |
| 91 template<typename T> | 91 template<typename T> |
| 92 void resolve(T* value, v8::Handle<v8::Object> creationContext) { resolve(toV
8NoInline(value, creationContext, m_isolate)); } | 92 void resolve(T* value, v8::Handle<v8::Object> creationContext) { resolve(toV
8NoInline(value, creationContext, m_isolate)); } |
| 93 template<typename T> | 93 template<typename T> |
| 94 void reject(T* value, v8::Handle<v8::Object> creationContext) { reject(toV8N
oInline(value, creationContext, m_isolate)); } | 94 void reject(T* value, v8::Handle<v8::Object> creationContext) { reject(toV8N
oInline(value, creationContext, m_isolate)); } |
| 95 | 95 |
| 96 template<typename T> | 96 template<typename T> |
| 97 void resolve(PassRefPtr<T> value, v8::Handle<v8::Object> creationContext) {
resolve(value.get(), creationContext); } | 97 void resolve(PassRefPtr<T> value, v8::Handle<v8::Object> creationContext) {
resolve(value.get(), creationContext); } |
| 98 template<typename T> | 98 template<typename T> |
| 99 void resolve(RawPtr<T> value, v8::Handle<v8::Object> creationContext) { reso
lve(value.get(), creationContext); } | |
| 100 template<typename T> | |
| 101 void reject(PassRefPtr<T> value, v8::Handle<v8::Object> creationContext) { r
eject(value.get(), creationContext); } | 99 void reject(PassRefPtr<T> value, v8::Handle<v8::Object> creationContext) { r
eject(value.get(), creationContext); } |
| 102 template<typename T> | |
| 103 void reject(RawPtr<T> value, v8::Handle<v8::Object> creationContext) { rejec
t(value.get(), creationContext); } | |
| 104 | 100 |
| 105 template<typename T> | 101 template<typename T> |
| 106 inline void resolve(T* value, ExecutionContext*); | 102 inline void resolve(T* value, ExecutionContext*); |
| 107 template<typename T> | 103 template<typename T> |
| 108 inline void reject(T* value, ExecutionContext*); | 104 inline void reject(T* value, ExecutionContext*); |
| 109 | 105 |
| 110 template<typename T> | 106 template<typename T> |
| 111 void resolve(PassRefPtr<T> value, ExecutionContext* context) { resolve(value
.get(), context); } | 107 void resolve(PassRefPtr<T> value, ExecutionContext* context) { resolve(value
.get(), context); } |
| 112 template<typename T> | 108 template<typename T> |
| 113 void resolve(RawPtr<T> value, ExecutionContext* context) { resolve(value.get
(), context); } | |
| 114 template<typename T> | |
| 115 void reject(PassRefPtr<T> value, ExecutionContext* context) { reject(value.g
et(), context); } | 109 void reject(PassRefPtr<T> value, ExecutionContext* context) { reject(value.g
et(), context); } |
| 116 template<typename T> | |
| 117 void reject(RawPtr<T> value, ExecutionContext* context) { reject(value.get()
, context); } | |
| 118 | 110 |
| 119 template<typename T> | 111 template<typename T> |
| 120 inline void resolve(T* value); | 112 inline void resolve(T* value); |
| 121 template<typename T> | 113 template<typename T> |
| 122 inline void reject(T* value); | 114 inline void reject(T* value); |
| 123 | 115 |
| 124 template<typename T> | 116 template<typename T> |
| 125 void resolve(PassRefPtr<T> value) { resolve(value.get()); } | 117 void resolve(PassRefPtr<T> value) { resolve(value.get()); } |
| 126 template<typename T> | 118 template<typename T> |
| 127 void resolve(RawPtr<T> value) { resolve(value.get()); } | |
| 128 template<typename T> | |
| 129 void reject(PassRefPtr<T> value) { reject(value.get()); } | 119 void reject(PassRefPtr<T> value) { reject(value.get()); } |
| 130 template<typename T> | |
| 131 void reject(RawPtr<T> value) { reject(value.get()); } | |
| 132 | 120 |
| 133 void resolve(ScriptValue); | 121 void resolve(ScriptValue); |
| 134 void reject(ScriptValue); | 122 void reject(ScriptValue); |
| 135 | 123 |
| 136 private: | 124 private: |
| 137 ScriptPromiseResolver(ScriptPromise); | 125 ScriptPromiseResolver(ScriptPromise); |
| 138 void resolve(v8::Handle<v8::Value>); | 126 void resolve(v8::Handle<v8::Value>); |
| 139 void reject(v8::Handle<v8::Value>); | 127 void reject(v8::Handle<v8::Value>); |
| 140 | 128 |
| 141 v8::Isolate* m_isolate; | 129 v8::Isolate* m_isolate; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 169 void ScriptPromiseResolver::reject(T* value) | 157 void ScriptPromiseResolver::reject(T* value) |
| 170 { | 158 { |
| 171 ASSERT(m_isolate->InContext()); | 159 ASSERT(m_isolate->InContext()); |
| 172 reject(value, v8::Object::New(m_isolate)); | 160 reject(value, v8::Object::New(m_isolate)); |
| 173 } | 161 } |
| 174 | 162 |
| 175 } // namespace WebCore | 163 } // namespace WebCore |
| 176 | 164 |
| 177 | 165 |
| 178 #endif // ScriptPromiseResolver_h | 166 #endif // ScriptPromiseResolver_h |
| OLD | NEW |