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); } | |
Mads Ager (chromium)
2014/02/07 06:50:46
Can we fold these together into:
void resolve(Pas
| |
100 template<typename T> | |
99 void reject(PassRefPtr<T> value, v8::Handle<v8::Object> creationContext) { r eject(value.get(), creationContext); } | 101 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); } | |
100 | 104 |
101 template<typename T> | 105 template<typename T> |
102 inline void resolve(T* value, ExecutionContext*); | 106 inline void resolve(T* value, ExecutionContext*); |
103 template<typename T> | 107 template<typename T> |
104 inline void reject(T* value, ExecutionContext*); | 108 inline void reject(T* value, ExecutionContext*); |
105 | 109 |
106 template<typename T> | 110 template<typename T> |
107 void resolve(PassRefPtr<T> value, ExecutionContext* context) { resolve(value .get(), context); } | 111 void resolve(PassRefPtr<T> value, ExecutionContext* context) { resolve(value .get(), context); } |
108 template<typename T> | 112 template<typename T> |
113 void resolve(RawPtr<T> value, ExecutionContext* context) { resolve(value.get (), context); } | |
114 template<typename T> | |
109 void reject(PassRefPtr<T> value, ExecutionContext* context) { reject(value.g et(), context); } | 115 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); } | |
110 | 118 |
111 template<typename T> | 119 template<typename T> |
112 inline void resolve(T* value); | 120 inline void resolve(T* value); |
113 template<typename T> | 121 template<typename T> |
114 inline void reject(T* value); | 122 inline void reject(T* value); |
115 | 123 |
116 template<typename T> | 124 template<typename T> |
117 void resolve(PassRefPtr<T> value) { resolve(value.get()); } | 125 void resolve(PassRefPtr<T> value) { resolve(value.get()); } |
118 template<typename T> | 126 template<typename T> |
127 void resolve(RawPtr<T> value) { resolve(value.get()); } | |
128 template<typename T> | |
119 void reject(PassRefPtr<T> value) { reject(value.get()); } | 129 void reject(PassRefPtr<T> value) { reject(value.get()); } |
130 template<typename T> | |
131 void reject(RawPtr<T> value) { reject(value.get()); } | |
120 | 132 |
121 void resolve(ScriptValue); | 133 void resolve(ScriptValue); |
122 void reject(ScriptValue); | 134 void reject(ScriptValue); |
123 | 135 |
124 private: | 136 private: |
125 ScriptPromiseResolver(ScriptPromise); | 137 ScriptPromiseResolver(ScriptPromise); |
126 void resolve(v8::Handle<v8::Value>); | 138 void resolve(v8::Handle<v8::Value>); |
127 void reject(v8::Handle<v8::Value>); | 139 void reject(v8::Handle<v8::Value>); |
128 | 140 |
129 v8::Isolate* m_isolate; | 141 v8::Isolate* m_isolate; |
(...skipping 27 matching lines...) Expand all Loading... | |
157 void ScriptPromiseResolver::reject(T* value) | 169 void ScriptPromiseResolver::reject(T* value) |
158 { | 170 { |
159 ASSERT(m_isolate->InContext()); | 171 ASSERT(m_isolate->InContext()); |
160 reject(value, v8::Object::New(m_isolate)); | 172 reject(value, v8::Object::New(m_isolate)); |
161 } | 173 } |
162 | 174 |
163 } // namespace WebCore | 175 } // namespace WebCore |
164 | 176 |
165 | 177 |
166 #endif // ScriptPromiseResolver_h | 178 #endif // ScriptPromiseResolver_h |
OLD | NEW |