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/ModuleProxy.h" | 5 #include "bindings/core/v8/ModuleProxy.h" |
6 | 6 |
7 #include "wtf/StdLibExtras.h" | 7 #include "wtf/StdLibExtras.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 ModuleProxy& ModuleProxy::moduleProxy() | 11 ModuleProxy& ModuleProxy::moduleProxy() |
12 { | 12 { |
13 DEFINE_STATIC_LOCAL(ModuleProxy, moduleProxy, ()); | 13 DEFINE_STATIC_LOCAL(ModuleProxy, moduleProxy, ()); |
14 return moduleProxy; | 14 return moduleProxy; |
15 } | 15 } |
16 | 16 |
| 17 ExecutionContext* ModuleProxy::toExecutionContextForModules(v8::Local<v8::Contex
t> context) |
| 18 { |
| 19 RELEASE_ASSERT(m_toExecutionContextForModules); |
| 20 return (*m_toExecutionContextForModules)(context); |
| 21 } |
| 22 |
| 23 void ModuleProxy::registerToExecutionContextForModules(ExecutionContext* (*toExe
cutionContextForModules)(v8::Local<v8::Context>)) |
| 24 { |
| 25 m_toExecutionContextForModules = toExecutionContextForModules; |
| 26 } |
| 27 |
| 28 v8::Local<v8::Context> ModuleProxy::toV8ContextForModules(ExecutionContext* cont
ext) |
| 29 { |
| 30 RELEASE_ASSERT(m_toV8ContextForModules); |
| 31 return (*m_toV8ContextForModules)(context); |
| 32 } |
| 33 |
| 34 void ModuleProxy::registerToV8ContextForModules(v8::Local<v8::Context> (*toV8Con
textForModules)(ExecutionContext*)) |
| 35 { |
| 36 m_toV8ContextForModules = toV8ContextForModules; |
| 37 } |
| 38 |
17 } // namespace blink | 39 } // namespace blink |
OLD | NEW |