| 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 #ifndef ModuleProxy_h | 5 #ifndef ModuleProxy_h |
| 6 #define ModuleProxy_h | 6 #define ModuleProxy_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" |
| 8 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 9 #include <v8.h> | 10 #include <v8.h> |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 14 class ExecutionContext; |
| 15 |
| 13 // A proxy class to invoke functions implemented in bindings/modules | 16 // A proxy class to invoke functions implemented in bindings/modules |
| 14 // from bindings/core. | 17 // from bindings/core. |
| 15 class ModuleProxy { | 18 class CORE_EXPORT ModuleProxy { |
| 16 USING_FAST_MALLOC(ModuleProxy); | 19 USING_FAST_MALLOC(ModuleProxy); |
| 17 public: | 20 public: |
| 18 static ModuleProxy& moduleProxy(); | 21 static ModuleProxy& moduleProxy(); |
| 19 | 22 |
| 23 ExecutionContext* toExecutionContextForModules(v8::Local<v8::Context>); |
| 24 void registerToExecutionContextForModules(ExecutionContext* (*toExecutionCon
textForModules)(v8::Local<v8::Context>)); |
| 25 |
| 26 v8::Local<v8::Context> toV8ContextForModules(ExecutionContext*); |
| 27 void registerToV8ContextForModules(v8::Local<v8::Context> (*toV8ContextForMo
dules)(ExecutionContext*)); |
| 28 |
| 20 private: | 29 private: |
| 21 ModuleProxy() { } | 30 ModuleProxy() { } |
| 31 |
| 32 ExecutionContext* (*m_toExecutionContextForModules)(v8::Local<v8::Context>)
= nullptr; |
| 33 v8::Local<v8::Context> (*m_toV8ContextForModules)(ExecutionContext*) = nullp
tr; |
| 22 }; | 34 }; |
| 23 | 35 |
| 24 } // namespace blink | 36 } // namespace blink |
| 25 | 37 |
| 26 #endif // ModuleProxy_h | 38 #endif // ModuleProxy_h |
| OLD | NEW |