| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/core/v8/V8BindingForTesting.h" | 6 #include "bindings/core/v8/V8BindingForTesting.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 PassRefPtr<ScriptStateForTesting> ScriptStateForTesting::create(v8::Handle<v8::C
ontext> context, PassRefPtr<DOMWrapperWorld> world) | 12 PassRefPtr<ScriptStateForTesting> ScriptStateForTesting::create(v8::Local<v8::Co
ntext> context, PassRefPtr<DOMWrapperWorld> world) |
| 13 { | 13 { |
| 14 RefPtr<ScriptStateForTesting> scriptState = adoptRef(new ScriptStateForTesti
ng(context, world)); | 14 RefPtr<ScriptStateForTesting> scriptState = adoptRef(new ScriptStateForTesti
ng(context, world)); |
| 15 // This ref() is for keeping this ScriptState alive as long as the v8::Conte
xt is alive. | 15 // This ref() is for keeping this ScriptState alive as long as the v8::Conte
xt is alive. |
| 16 // This is deref()ed in the weak callback of the v8::Context. | 16 // This is deref()ed in the weak callback of the v8::Context. |
| 17 scriptState->ref(); | 17 scriptState->ref(); |
| 18 return scriptState; | 18 return scriptState; |
| 19 } | 19 } |
| 20 | 20 |
| 21 ScriptStateForTesting::ScriptStateForTesting(v8::Handle<v8::Context> context, Pa
ssRefPtr<DOMWrapperWorld> world) | 21 ScriptStateForTesting::ScriptStateForTesting(v8::Local<v8::Context> context, Pas
sRefPtr<DOMWrapperWorld> world) |
| 22 : ScriptState(context, world) | 22 : ScriptState(context, world) |
| 23 { | 23 { |
| 24 } | 24 } |
| 25 | 25 |
| 26 ExecutionContext* ScriptStateForTesting::executionContext() const | 26 ExecutionContext* ScriptStateForTesting::executionContext() const |
| 27 { | 27 { |
| 28 return m_executionContext; | 28 return m_executionContext; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void ScriptStateForTesting::setExecutionContext(ExecutionContext* executionConte
xt) | 31 void ScriptStateForTesting::setExecutionContext(ExecutionContext* executionConte
xt) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 { | 55 { |
| 56 return m_scriptState->isolate(); | 56 return m_scriptState->isolate(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 v8::Local<v8::Context> V8TestingScope::context() const | 59 v8::Local<v8::Context> V8TestingScope::context() const |
| 60 { | 60 { |
| 61 return m_scriptState->context(); | 61 return m_scriptState->context(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |