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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp

Issue 2420223002: Dispatching errors across iframes don't match webplatform tests
Patch Set: Added nested errors test and scope class." 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/ScriptState.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
index ad5ca71890b36167e71eb14e29d247bfaedb597c..41eea215dc4996d2929366ece7f75ec996082549 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
@@ -103,4 +103,25 @@ ScriptState* ScriptState::forWorld(LocalFrame* frame, DOMWrapperWorld& world) {
return scriptState;
}
+ScriptStateForErrorEvent::Scope::Scope(ScriptState* scriptState,
+ v8::Local<v8::Context> context)
+ : m_scriptState(scriptState) {
+ ExecutionContext* executionContext = m_scriptState->getExecutionContext();
+ RefPtr<ScriptStateForErrorEvent> scriptStateForErrorEvent =
+ ScriptStateForErrorEvent::create(context);
+ executionContext->setErrorEventScriptState(scriptStateForErrorEvent);
+}
+
+ScriptStateForErrorEvent::Scope::~Scope() {
+ ExecutionContext* executionContext = m_scriptState->getExecutionContext();
+ executionContext->clearErrorEventScriptState();
+}
+
+PassRefPtr<ScriptStateForErrorEvent> ScriptStateForErrorEvent::create(
+ v8::Local<v8::Context> context) {
+ RefPtr<ScriptStateForErrorEvent> scriptState =
+ adoptRef(new ScriptStateForErrorEvent(context));
+ return scriptState;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698