v8::Handle<v8::Object> menu,
const char* method,
int command_id) {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
v8::Handle<v8::Value> delegate = menu->Get(v8::String::New("delegate"));
}
bool Menu::IsCommandIdChecked(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return CallDelegate(v8::False(),
const_cast<Menu*>(this)->handle(),
}
bool Menu::IsCommandIdEnabled(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return CallDelegate(v8::True(),
const_cast<Menu*>(this)->handle(),
}
bool Menu::IsCommandIdVisible(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return CallDelegate(v8::True(),
const_cast<Menu*>(this)->handle(),
bool Menu::GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
v8::Handle<v8::Value> shortcut = CallDelegate(v8::Undefined(),
handle(),
}
bool Menu::IsItemForCommandIdDynamic(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return CallDelegate(v8::False(),
const_cast<Menu*>(this)->handle(),
}
string16 Menu::GetLabelForCommandId(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return FromV8Value(CallDelegate(v8::False(),
const_cast<Menu*>(this)->handle(),
}
string16 Menu::GetSublabelForCommandId(int command_id) const {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
return FromV8Value(CallDelegate(v8::False(),
const_cast<Menu*>(this)->handle(),
}
void Menu::ExecuteCommand(int command_id, int event_flags) {
+ v8::Locker locker(node_isolate);
v8::HandleScope handle_scope(node_isolate);
CallDelegate(v8::False(), handle(), "executeCommand", command_id);
}
}
EventEmitter::~EventEmitter() {
+ // Use Locker in browser process.
+ scoped_ptr<v8::Locker> locker;
+ if (node::g_standalone_mode)
+ locker.reset(new v8::Locker(node_isolate));
+
// Clear the aligned pointer, it should have been done by ObjectWrap but
// somehow node v0.11.x changed this behaviour.
v8::HandleScope handle_scope(node_isolate);
}
bool EventEmitter::Emit(const std::string& name, base::ListValue* args) {
+ // Use Locker in browser process.
+ scoped_ptr<v8::Locker> locker;
+ if (node::g_standalone_mode)
+ locker.reset(new v8::Locker(node_isolate));
+
v8::HandleScope handle_scope(node_isolate);
v8::Handle<v8::Context> context = v8::Context::GetCurrent();