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

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

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.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
index b0b0fd8530be5f9b3711f8272a63d42d98737c63..c634fbd35eef854a9885f6e9ecad205868f0e654 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
@@ -183,6 +183,34 @@ class ScriptStateProtectingContext {
ScopedPersistent<v8::Context> m_context;
};
+class ScriptStateForErrorEvent : public RefCounted<ScriptStateForErrorEvent> {
+ public:
+ class Scope {
+ STACK_ALLOCATED();
+
+ public:
+ explicit Scope(ScriptState*, v8::Local<v8::Context>);
+ ~Scope();
+
+ private:
+ RefPtr<ScriptState> m_scriptState;
+ };
+
+ static PassRefPtr<ScriptStateForErrorEvent> create(v8::Local<v8::Context>);
+ ScriptState* scriptState() {
+ return ScriptState::from(m_context.newLocal(m_isolate));
+ }
+ v8::Local<v8::Context> context() const {
+ return m_context.newLocal(m_isolate);
+ }
+
+ private:
+ ScriptStateForErrorEvent(v8::Local<v8::Context> context)
+ : m_isolate(context->GetIsolate()), m_context(m_isolate, context) {}
+ v8::Isolate* m_isolate;
+ ScopedPersistent<v8::Context> m_context;
+};
+
} // namespace blink
#endif // ScriptState_h

Powered by Google App Engine
This is Rietveld 408576698