Rev 1657 | Rev 1741 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1657 | Rev 1740 | ||
|---|---|---|---|
| Line 70... | Line 70... | ||
| 70 | this->io_service_.post(boost::bind(&Module::SlotOnModuleMessageHandler, this, full_id, command, variables)); |
70 | this->io_service_.post(boost::bind(&Module::SlotOnModuleMessageHandler, this, full_id, command, variables)); |
| 71 | } |
71 | } |
| 72 | 72 | ||
| 73 | void Module::SlotOnModuleChangeHandler(std::string full_id, bool available) |
73 | void Module::SlotOnModuleChangeHandler(std::string full_id, bool available) |
| 74 | { |
74 | { |
| - | 75 | v8::Locker lock; |
|
| 75 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
76 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
| 76 | 77 | ||
| 77 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
78 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
| 78 | 79 | ||
| 79 | ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList); |
80 | ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList); |
| Line 83... | Line 84... | ||
| 83 | this->Call(0, "Module_OnChange", arguments); |
84 | this->Call(0, "Module_OnChange", arguments); |
| 84 | } |
85 | } |
| 85 | 86 | ||
| 86 | void Module::SlotOnModuleMessageHandler(std::string full_id, std::string command, common::StringMap variables) |
87 | void Module::SlotOnModuleMessageHandler(std::string full_id, std::string command, common::StringMap variables) |
| 87 | { |
88 | { |
| - | 89 | v8::Locker lock; |
|
| 88 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
90 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
| 89 | 91 | ||
| 90 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
92 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
| 91 | 93 | ||
| 92 | ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList); |
94 | ArgumentListPointer arguments = ArgumentListPointer(new ArgumentList); |
| Line 106... | Line 108... | ||
| 106 | this->Call(0, "Module_OnMessage", arguments); |
108 | this->Call(0, "Module_OnMessage", arguments); |
| 107 | } |
109 | } |
| 108 | 110 | ||
| 109 | Value Module::Export_SendModuleMessage(const v8::Arguments& args) |
111 | Value Module::Export_SendModuleMessage(const v8::Arguments& args) |
| 110 | { |
112 | { |
| - | 113 | v8::Locker lock; |
|
| 111 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
114 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
| 112 | 115 | ||
| 113 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
116 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
| 114 | 117 | ||
| 115 | if (args.Length() < 3) |
118 | if (args.Length() < 3) |
| Line 139... | Line 142... | ||
| 139 | return v8::Boolean::New(true); |
142 | return v8::Boolean::New(true); |
| 140 | } |
143 | } |
| 141 | 144 | ||
| 142 | Value Module::Export_GetAvailableModules(const v8::Arguments& args) |
145 | Value Module::Export_GetAvailableModules(const v8::Arguments& args) |
| 143 | { |
146 | { |
| - | 147 | v8::Locker lock; |
|
| 144 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
148 | v8::Context::Scope context_scope(vm::Manager::Instance()->GetContext()); |
| 145 | 149 | ||
| 146 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
150 | //LOG.Debug(std::string(__FUNCTION__) + " called!"); |
| 147 | 151 | ||
| 148 | common::StringList available_modules = control::Manager::Instance()->GetAvailableModules(); |
152 | common::StringList available_modules = control::Manager::Instance()->GetAvailableModules(); |