| 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 "bindings/core/v8/ScriptState.h" | 5 #include "bindings/core/v8/ScriptState.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8Binding.h" | 7 #include "bindings/core/v8/V8Binding.h" |
| 8 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 ScriptValue ScriptState::getFromExtrasExports(const char* name) | 90 ScriptValue ScriptState::getFromExtrasExports(const char* name) |
| 91 { | 91 { |
| 92 v8::HandleScope handleScope(m_isolate); | 92 v8::HandleScope handleScope(m_isolate); |
| 93 v8::Local<v8::Value> v8Value; | 93 v8::Local<v8::Value> v8Value; |
| 94 if (!context()->GetExtrasBindingObject()->Get(context(), v8AtomicString(isol
ate(), name)).ToLocal(&v8Value)) | 94 if (!context()->GetExtrasBindingObject()->Get(context(), v8AtomicString(isol
ate(), name)).ToLocal(&v8Value)) |
| 95 return ScriptValue(); | 95 return ScriptValue(); |
| 96 return ScriptValue(this, v8Value); | 96 return ScriptValue(this, v8Value); |
| 97 } | 97 } |
| 98 | 98 |
| 99 ExecutionContext* ScriptState::executionContext() const | 99 ExecutionContext* ScriptState::getExecutionContext() const |
| 100 { | 100 { |
| 101 v8::HandleScope scope(m_isolate); | 101 v8::HandleScope scope(m_isolate); |
| 102 return toExecutionContext(context()); | 102 return toExecutionContext(context()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ScriptState::setExecutionContext(ExecutionContext*) | 105 void ScriptState::setExecutionContext(ExecutionContext*) |
| 106 { | 106 { |
| 107 ASSERT_NOT_REACHED(); | 107 ASSERT_NOT_REACHED(); |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 130 v8::HandleScope handleScope(toIsolate(frame)); | 130 v8::HandleScope handleScope(toIsolate(frame)); |
| 131 v8::Local<v8::Context> context = toV8Context(frame, world); | 131 v8::Local<v8::Context> context = toV8Context(frame, world); |
| 132 if (context.IsEmpty()) | 132 if (context.IsEmpty()) |
| 133 return nullptr; | 133 return nullptr; |
| 134 ScriptState* scriptState = ScriptState::from(context); | 134 ScriptState* scriptState = ScriptState::from(context); |
| 135 ASSERT(scriptState->contextIsValid()); | 135 ASSERT(scriptState->contextIsValid()); |
| 136 return scriptState; | 136 return scriptState; |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |