Remove the 'getProcessMemoryInfo' API
* Underlying APIs have been removed in Chromium * https://chromium-review.googlesource.com/c/chromium/src/+/969089 * https://chromium-review.googlesource.com/c/chromium/src/+/953723 * https://bugs.chromium.org/p/chromium/issues/detail?id=819289 * https://github.com/electron/electron/projects/11#card-11509601
This commit is contained in:
parent
833b55107d
commit
14df89f214
9 changed files with 27 additions and 67 deletions
|
@ -55,7 +55,6 @@ void AtomBindings::BindTo(v8::Isolate* isolate, v8::Local<v8::Object> process) {
|
|||
dict.SetMethod("hang", &Hang);
|
||||
dict.SetMethod("log", &Log);
|
||||
dict.SetMethod("getHeapStatistics", &GetHeapStatistics);
|
||||
dict.SetMethod("getProcessMemoryInfo", &GetProcessMemoryInfo);
|
||||
dict.SetMethod("getCreationTime", &GetCreationTime);
|
||||
dict.SetMethod("getSystemMemoryInfo", &GetSystemMemoryInfo);
|
||||
dict.SetMethod("getCPUUsage", base::Bind(&AtomBindings::GetCPUUsage,
|
||||
|
@ -159,26 +158,6 @@ v8::Local<v8::Value> AtomBindings::GetHeapStatistics(v8::Isolate* isolate) {
|
|||
return dict.GetHandle();
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Local<v8::Value> AtomBindings::GetProcessMemoryInfo(v8::Isolate* isolate) {
|
||||
auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics();
|
||||
|
||||
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
|
||||
dict.SetHidden("simple", true);
|
||||
dict.Set("workingSetSize",
|
||||
static_cast<double>(metrics->GetWorkingSetSize() >> 10));
|
||||
dict.Set("peakWorkingSetSize",
|
||||
static_cast<double>(metrics->GetPeakWorkingSetSize() >> 10));
|
||||
|
||||
size_t private_bytes, shared_bytes;
|
||||
if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) {
|
||||
dict.Set("privateBytes", static_cast<double>(private_bytes >> 10));
|
||||
dict.Set("sharedBytes", static_cast<double>(shared_bytes >> 10));
|
||||
}
|
||||
|
||||
return dict.GetHandle();
|
||||
}
|
||||
|
||||
// static
|
||||
v8::Local<v8::Value> AtomBindings::GetCreationTime(v8::Isolate* isolate) {
|
||||
auto timeValue = base::CurrentProcessInfo::CreationTime();
|
||||
|
|
|
@ -36,7 +36,6 @@ class AtomBindings {
|
|||
static void Crash();
|
||||
static void Hang();
|
||||
static v8::Local<v8::Value> GetHeapStatistics(v8::Isolate* isolate);
|
||||
static v8::Local<v8::Value> GetProcessMemoryInfo(v8::Isolate* isolate);
|
||||
static v8::Local<v8::Value> GetCreationTime(v8::Isolate* isolate);
|
||||
static v8::Local<v8::Value> GetSystemMemoryInfo(v8::Isolate* isolate,
|
||||
mate::Arguments* args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue