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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h

Issue 2418413004: binding: Creates a reject promise always in the current realm. (Closed)
Patch Set: Added a layout test. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h b/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h
index 7ae374b518de2d4a750f35a397bb60c9535875e6..2a269a8220134c71ea9ac7ea83bd608983023f1c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h
+++ b/third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.h
@@ -41,21 +41,22 @@ class CORE_EXPORT ExceptionToRejectPromiseScope {
public:
ExceptionToRejectPromiseScope(const v8::FunctionCallbackInfo<v8::Value>& info,
- ScriptState* scriptState,
ExceptionState& exceptionState)
: m_info(info),
- m_scriptState(scriptState),
m_exceptionState(exceptionState) {}
~ExceptionToRejectPromiseScope() {
if (!m_exceptionState.hadException())
return;
- v8SetReturnValue(m_info, m_exceptionState.reject(m_scriptState).v8Value());
+ // As exceptions must always be created in the current realm, reject
+ // promises must also be created in the current realm while regular promises
+ // are created in the relevant realm of the context object.
+ ScriptState* scriptState = ScriptState::forFunctionObject(m_info);
haraken 2016/10/18 18:46:56 Just help me understand: - Is ExceptionToRejectPr
Yuki 2016/10/19 06:06:58 Other ScriptPromise::reject() are called after we
+ v8SetReturnValue(m_info, m_exceptionState.reject(scriptState).v8Value());
}
private:
const v8::FunctionCallbackInfo<v8::Value>& m_info;
- ScriptState* m_scriptState;
ExceptionState& m_exceptionState;
};

Powered by Google App Engine
This is Rietveld 408576698