Home | History | Annotate | Download | only in v8

Lines Matching defs:scriptState

21 // ScriptState is created when v8::Context is created.
22 // ScriptState is destroyed when v8::Context is garbage-collected and
23 // all V8 proxy objects that have references to the ScriptState are destructed.
24 class ScriptState : public RefCounted<ScriptState> {
25 WTF_MAKE_NONCOPYABLE(ScriptState);
29 // You need to make sure that scriptState->context() is not empty before creating a Scope.
30 explicit Scope(ScriptState* scriptState)
31 : m_handleScope(scriptState->isolate())
32 , m_context(scriptState->context())
48 static PassRefPtr<ScriptState> create(v8::Handle<v8::Context>, PassRefPtr<DOMWrapperWorld>);
49 virtual ~ScriptState();
51 static ScriptState* current(v8::Isolate* isolate)
56 static ScriptState* from(v8::Handle<v8::Context> context)
59 ScriptState* scriptState = static_cast<ScriptState*>(context->GetAlignedPointerFromEmbedderData(v8ContextPerContextDataIndex));
60 // ScriptState::from() must not be called for a context that does not have
62 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(scriptState);
63 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(scriptState->context() == context);
64 return scriptState;
67 static ScriptState* forMainWorld(LocalFrame*);
88 ScriptState(v8::Handle<v8::Context>, PassRefPtr<DOMWrapperWorld>);
99 // V8PerContextData --(Persistent)--> v8::Context --(RefPtr)--> ScriptState --(OwnPtr)--> V8PerContextData
105 class ScriptStateForTesting : public ScriptState {
118 // ScriptStateProtectingContext keeps the context associated with the ScriptState alive.
123 ScriptStateProtectingContext(ScriptState* scriptState)
124 : m_scriptState(scriptState)
130 ScriptState* operator->() const { return m_scriptState.get(); }
131 ScriptState* get() const { return m_scriptState.get(); }
139 RefPtr<ScriptState> m_scriptState;