Add the dumbest new builtin that works
This commit is contained in:
parent
fb6f5320e7
commit
a7ac7ba4c1
3 changed files with 29 additions and 0 deletions
27
atom/common/api/atom_api_process_stats.cc
Normal file
27
atom/common/api/atom_api_process_stats.cc
Normal file
|
@ -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 <string>
|
||||
#include <vector>
|
||||
|
||||
#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<v8::Object> exports, v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context, void* priv) {
|
||||
mate::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("addTwoNumbers", &AddTwoNumbers);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_process_stats, Initialize)
|
|
@ -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);
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue