| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "bindings/v8/ScriptState.h" | 6 #include "bindings/v8/ScriptState.h" |
| 7 | 7 |
| 8 #include "bindings/v8/V8Binding.h" | 8 #include "bindings/v8/V8Binding.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 data.GetValue()->SetAlignedPointerInEmbedderData(v8ContextPerContextDataInde
x, 0); | 24 data.GetValue()->SetAlignedPointerInEmbedderData(v8ContextPerContextDataInde
x, 0); |
| 25 data.GetParameter()->clearContext(); | 25 data.GetParameter()->clearContext(); |
| 26 data.GetParameter()->deref(); | 26 data.GetParameter()->deref(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 ScriptState::ScriptState(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperW
orld> world) | 29 ScriptState::ScriptState(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperW
orld> world) |
| 30 : m_isolate(context->GetIsolate()) | 30 : m_isolate(context->GetIsolate()) |
| 31 , m_context(m_isolate, context) | 31 , m_context(m_isolate, context) |
| 32 , m_world(world) | 32 , m_world(world) |
| 33 , m_perContextData(V8PerContextData::create(context)) | 33 , m_perContextData(V8PerContextData::create(context)) |
| 34 , m_activityLogger(0) |
| 34 { | 35 { |
| 35 ASSERT(m_world); | 36 ASSERT(m_world); |
| 36 m_context.setWeak(this, &weakCallback); | 37 m_context.setWeak(this, &weakCallback); |
| 37 context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this)
; | 38 context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this)
; |
| 38 } | 39 } |
| 39 | 40 |
| 40 ScriptState::~ScriptState() | 41 ScriptState::~ScriptState() |
| 41 { | 42 { |
| 42 ASSERT(!m_perContextData); | 43 ASSERT(!m_perContextData); |
| 43 ASSERT(m_context.isEmpty()); | 44 ASSERT(m_context.isEmpty()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 } | 69 } |
| 69 | 70 |
| 70 ScriptState* ScriptState::forMainWorld(LocalFrame* frame) | 71 ScriptState* ScriptState::forMainWorld(LocalFrame* frame) |
| 71 { | 72 { |
| 72 v8::Isolate* isolate = toIsolate(frame); | 73 v8::Isolate* isolate = toIsolate(frame); |
| 73 v8::HandleScope handleScope(isolate); | 74 v8::HandleScope handleScope(isolate); |
| 74 return ScriptState::from(toV8Context(isolate, frame, DOMWrapperWorld::mainWo
rld())); | 75 return ScriptState::from(toV8Context(isolate, frame, DOMWrapperWorld::mainWo
rld())); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } | 78 } |
| OLD | NEW |