2013-06-01 07:57:37 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2013-11-13 09:29:35 +00:00
|
|
|
#include "common/api/atom_api_crash_reporter.h"
|
2013-06-01 07:57:37 +00:00
|
|
|
|
2013-11-13 09:29:35 +00:00
|
|
|
#include "common/crash_reporter/crash_reporter.h"
|
2013-09-24 01:41:54 +00:00
|
|
|
#include "common/v8_conversions.h"
|
2013-06-01 07:57:37 +00:00
|
|
|
#include "vendor/node/src/node.h"
|
|
|
|
#include "vendor/node/src/node_internals.h"
|
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
namespace api {
|
|
|
|
|
|
|
|
// static
|
2013-11-13 11:12:13 +00:00
|
|
|
v8::Handle<v8::Value> CrashReporter::SetProductName(const v8::Arguments& args) {
|
|
|
|
crash_reporter::CrashReporter::SetProductName(FromV8Value(args[0]));
|
|
|
|
return v8::Undefined();
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
v8::Handle<v8::Value> CrashReporter::SetCompanyName(const v8::Arguments& args) {
|
2013-09-24 01:41:54 +00:00
|
|
|
crash_reporter::CrashReporter::SetCompanyName(FromV8Value(args[0]));
|
2013-06-01 07:57:37 +00:00
|
|
|
return v8::Undefined();
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
v8::Handle<v8::Value> CrashReporter::SetSubmissionURL(
|
2013-11-13 11:12:13 +00:00
|
|
|
const v8::Arguments& args) {
|
2013-09-24 01:41:54 +00:00
|
|
|
crash_reporter::CrashReporter::SetSubmissionURL(FromV8Value(args[0]));
|
2013-06-01 07:57:37 +00:00
|
|
|
return v8::Undefined();
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2013-11-13 11:12:13 +00:00
|
|
|
v8::Handle<v8::Value> CrashReporter::SetAutoSubmit(const v8::Arguments& args) {
|
2013-09-24 01:41:54 +00:00
|
|
|
crash_reporter::CrashReporter::SetAutoSubmit(FromV8Value(args[0]));
|
2013-06-01 07:57:37 +00:00
|
|
|
return v8::Undefined();
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
void CrashReporter::Initialize(v8::Handle<v8::Object> target) {
|
2013-11-13 11:12:13 +00:00
|
|
|
node::SetMethod(target, "setProductName", SetProductName);
|
2013-06-01 07:57:37 +00:00
|
|
|
node::SetMethod(target, "setCompanyName", SetCompanyName);
|
2013-06-02 07:15:56 +00:00
|
|
|
node::SetMethod(target, "setSubmissionUrl", SetSubmissionURL);
|
2013-06-01 07:57:37 +00:00
|
|
|
node::SetMethod(target, "setAutoSubmit", SetAutoSubmit);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace api
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
2013-11-13 09:29:35 +00:00
|
|
|
NODE_MODULE(atom_common_crash_reporter, atom::api::CrashReporter::Initialize)
|