Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: Source/bindings/v8/ScriptPromiseResolver.cpp

Issue 238723009: Implement V8ValueTraits<T>::toV8Value conversion functions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject(value); 121 m_resolver.v8Value().As<v8::Promise::Resolver>()->Reject(value);
122 } else if (!m_promise.isEmpty()) { 122 } else if (!m_promise.isEmpty()) {
123 v8::Local<v8::Object> promise = m_promise.v8Value().As<v8::Object>(); 123 v8::Local<v8::Object> promise = m_promise.v8Value().As<v8::Object>();
124 ASSERT(V8PromiseCustom::isPromise(promise, m_isolate)); 124 ASSERT(V8PromiseCustom::isPromise(promise, m_isolate));
125 V8PromiseCustom::reject(promise, value, m_isolate); 125 V8PromiseCustom::reject(promise, value, m_isolate);
126 } 126 }
127 m_promise.clear(); 127 m_promise.clear();
128 m_resolver.clear(); 128 m_resolver.clear();
129 } 129 }
130 130
131 void ScriptPromiseResolver::resolve(ScriptValue value)
132 {
133 ASSERT(m_isolate->InContext());
134 resolve(value.v8Value());
135 }
136
137 void ScriptPromiseResolver::reject(ScriptValue value)
138 {
139 ASSERT(m_isolate->InContext());
140 reject(value.v8Value());
141 }
142
143 } // namespace WebCore 131 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptPromiseResolver.h ('k') | Source/bindings/v8/ScriptPromiseResolverWithContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698