diff --git a/atom/common/api/atom_api_process_stats.cc b/atom/common/api/atom_api_process_stats.cc new file mode 100644 index 000000000000..8023c5a9d215 --- /dev/null +++ b/atom/common/api/atom_api_process_stats.cc @@ -0,0 +1,27 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "atom/common/api/atom_api_native_image.h" + +#include +#include + +#include "atom/common/node_includes.h" +#include "native_mate/dictionary.h" + +namespace { + +int32_t AddTwoNumbers(int32_t a, int32_t b) { + return a + b; +} + +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { + mate::Dictionary dict(context->GetIsolate(), exports); + dict.SetMethod("addTwoNumbers", &AddTwoNumbers); +} + +} // namespace + +NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_process_stats, Initialize) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index b3c36fdd8e03..d2d5ebd48890 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -54,6 +54,7 @@ REFERENCE_MODULE(atom_common_clipboard); REFERENCE_MODULE(atom_common_crash_reporter); REFERENCE_MODULE(atom_common_native_image); REFERENCE_MODULE(atom_common_screen); +REFERENCE_MODULE(atom_common_process_stats); REFERENCE_MODULE(atom_common_shell); REFERENCE_MODULE(atom_common_v8_util); REFERENCE_MODULE(atom_renderer_ipc); diff --git a/filenames.gypi b/filenames.gypi index f9bbe8f75f1b..8899b902fca3 100644 --- a/filenames.gypi +++ b/filenames.gypi @@ -292,6 +292,7 @@ 'atom/common/api/atom_api_native_image.cc', 'atom/common/api/atom_api_native_image.h', 'atom/common/api/atom_api_native_image_mac.mm', + 'atom/common/api/atom_api_process_stats.cc', 'atom/common/api/atom_api_shell.cc', 'atom/common/api/atom_api_v8_util.cc', 'atom/common/api/atom_bindings.cc',