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 <v8.h> | |
9 | |
10 namespace blink { | 8 namespace blink { |
11 | 9 |
12 class Event; | |
13 class EventTarget; | |
14 class ExecutionContext; | 10 class ExecutionContext; |
15 | 11 |
16 // A proxy class to invoke functions implemented in bindings/modules | 12 // A proxy class to invoke functions implemented in bindings/modules |
17 // from bindings/core. | 13 // from bindings/core. |
18 class ModuleProxy { | 14 class ModuleProxy { |
19 public: | 15 public: |
20 static ModuleProxy& moduleProxy(); | 16 static ModuleProxy& moduleProxy(); |
21 | 17 |
22 v8::Handle<v8::Object> wrapForEvent(Event*, v8::Handle<v8::Object>, v8::Isol
ate*); | |
23 void registerWrapForEvent(v8::Handle<v8::Object> (*wrapForEvent)(Event*, v8:
:Handle<v8::Object>, v8::Isolate*)); | |
24 | |
25 v8::Handle<v8::Value> toV8ForEventTarget(EventTarget*, v8::Handle<v8::Object
>, v8::Isolate*); | |
26 void registerToV8ForEventTarget(v8::Handle<v8::Value> (*toV8ForEventTarget)(
EventTarget*, v8::Handle<v8::Object>, v8::Isolate*)); | |
27 | |
28 void didLeaveScriptContextForRecursionScope(ExecutionContext&); | 18 void didLeaveScriptContextForRecursionScope(ExecutionContext&); |
29 void registerDidLeaveScriptContextForRecursionScope(void (*didLeaveScriptCon
text)(ExecutionContext&)); | 19 void registerDidLeaveScriptContextForRecursionScope(void (*didLeaveScriptCon
text)(ExecutionContext&)); |
30 | 20 |
31 private: | 21 private: |
32 ModuleProxy() : m_wrapForEvent(0) { } | 22 ModuleProxy() : m_didLeaveScriptContextForRecursionScope(0) { } |
33 | 23 |
34 v8::Handle<v8::Object> (*m_wrapForEvent)(Event*, v8::Handle<v8::Object>, v8:
:Isolate*); | |
35 v8::Handle<v8::Value> (*m_toV8ForEventTarget)(EventTarget*, v8::Handle<v8::O
bject>, v8::Isolate*); | |
36 void (*m_didLeaveScriptContextForRecursionScope)(ExecutionContext&); | 24 void (*m_didLeaveScriptContextForRecursionScope)(ExecutionContext&); |
37 }; | 25 }; |
38 | 26 |
39 } // namespace blink | 27 } // namespace blink |
40 | 28 |
41 #endif // ModuleProxy_h | 29 #endif // ModuleProxy_h |
OLD | NEW |