diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index 0a051b64c9..fcb65e7396 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -54,23 +54,15 @@ void UvOnCallback(uv_async_t* handle) { g_v8_callback.Run(); } +void Crash() { + static_cast(NULL)->crash = true; +} + // Called when there is a fatal error in V8, we just crash the process here so // we can get the stack trace. void FatalErrorCallback(const char* location, const char* message) { LOG(ERROR) << "Fatal error in V8: " << location << " " << message; - static_cast(NULL)->crash = true; -} - -v8::Handle DumpStackFrame(v8::Isolate* isolate, - v8::Handle stack_frame) { - mate::Dictionary frame_dict(isolate); - frame_dict.Set("line", stack_frame->GetLineNumber()); - frame_dict.Set("column", stack_frame->GetColumn()); - return mate::ConvertToV8(isolate, frame_dict);; -} - -void Crash() { - static_cast(NULL)->crash = true; + Crash(); } void ActivateUVLoop() { @@ -81,19 +73,6 @@ void Log(const base::string16& message) { logging::LogMessage("CONSOLE", 0, 0).stream() << message; } -v8::Handle GetCurrentStackTrace(v8::Isolate* isolate, - int stack_limit) { - v8::Local stack_trace = v8::StackTrace::CurrentStackTrace( - isolate, stack_limit, v8::StackTrace::kDetailed); - - int frame_count = stack_trace->GetFrameCount(); - v8::Local result = v8::Array::New(isolate, frame_count); - for (int i = 0; i < frame_count; ++i) - result->Set(i, DumpStackFrame(isolate, stack_trace->GetFrame(i))); - - return result; -} - void ScheduleCallback(const base::Closure& callback) { g_v8_callback = callback; uv_async_send(&g_callback_uv_handle); @@ -117,7 +96,6 @@ void AtomBindings::BindTo(v8::Isolate* isolate, dict.SetMethod("crash", &Crash); dict.SetMethod("activateUvLoop", &ActivateUVLoop); dict.SetMethod("log", &Log); - dict.SetMethod("getCurrentStackTrace", &GetCurrentStackTrace); dict.SetMethod("scheduleCallback", &ScheduleCallback); v8::Handle versions; diff --git a/atom/common/api/atom_bindings.h b/atom/common/api/atom_bindings.h index 067a035024..fadb535848 100644 --- a/atom/common/api/atom_bindings.h +++ b/atom/common/api/atom_bindings.h @@ -5,8 +5,6 @@ #ifndef ATOM_COMMON_API_ATOM_BINDINGS_H_ #define ATOM_COMMON_API_ATOM_BINDINGS_H_ -#include "base/basictypes.h" -#include "base/callback_forward.h" #include "base/strings/string16.h" #include "v8/include/v8.h"