mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-05 05:34:30 +03:00
Add atom.crashMainProcess and atom.crashRenderProcess
This commit is contained in:
parent
262e2fe1ec
commit
101605e50f
@ -87,6 +87,9 @@ bool AtomCefClient::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
|
||||
else if (name == "getVersion") {
|
||||
GetVersion(messageId, browser);
|
||||
}
|
||||
else if (name == "crash") {
|
||||
__builtin_trap();
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace v8_extensions {
|
||||
const char* methodNames[] = {
|
||||
"writeToPasteboard", "readFromPasteboard", "quit", "watchPath",
|
||||
"unwatchPath", "getWatchedPaths", "unwatchAllPaths", "moveToTrash",
|
||||
"reload", "setWindowState", "getWindowState", "beep"
|
||||
"reload", "setWindowState", "getWindowState", "beep", "crash"
|
||||
};
|
||||
|
||||
CefRefPtr<CefV8Value> nativeObject = CefV8Value::CreateObject(NULL);
|
||||
@ -166,6 +166,10 @@ namespace v8_extensions {
|
||||
NSBeep();
|
||||
}
|
||||
|
||||
else if (name == "crash") {
|
||||
__builtin_trap();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
@ -246,6 +246,12 @@ _.extend atom,
|
||||
getUpdateStatus: (callback) ->
|
||||
@sendMessageToBrowserProcess('getUpdateStatus', [], callback)
|
||||
|
||||
crashMainProcess: ->
|
||||
@sendMessageToBrowserProcess('crash')
|
||||
|
||||
crashRenderProcess: ->
|
||||
$native.crash()
|
||||
|
||||
requireUserInitScript: ->
|
||||
userInitScriptPath = fsUtils.join(config.configDirPath, "user.coffee")
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user