Commit e160c7fb authored by Scott Graham's avatar Scott Graham Committed by Commit Bot

fuchsia: stub unavailable functions

GetSystemCommitCharge() isn't available. It likely won't be as the
general system design doesn't allow a process much information other
than about itself.

EnableTerminationOnHeapCorruption() doesn't have an analog (at least
today).

GetParentProcessId() doesn't have a direct mapping. We could retrieve
the parent job, but that wouldn't be a process. In any case, getppid()
isn't implemented, so the test would currently fail.

Bug: 706592
Change-Id: I218f80d92a64e92ac3f49aa21ec55ef522cd0435
Reviewed-on: https://chromium-review.googlesource.com/516523
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#474956}
parent 6757c956
...@@ -1250,8 +1250,10 @@ component("base") { ...@@ -1250,8 +1250,10 @@ component("base") {
"message_loop/message_pump_fuchsia.h", "message_loop/message_pump_fuchsia.h",
"process/kill_fuchsia.cc", "process/kill_fuchsia.cc",
"process/launch_fuchsia.cc", "process/launch_fuchsia.cc",
"process/memory_fuchsia.cc",
"process/process_fuchsia.cc", "process/process_fuchsia.cc",
"process/process_handle_fuchsia.cc", "process/process_handle_fuchsia.cc",
"process/process_metrics_fuchsia.cc",
"sys_info_fuchsia.cc", "sys_info_fuchsia.cc",
"threading/platform_thread_fuchsia.cc", "threading/platform_thread_fuchsia.cc",
"time/time_conversion_posix.cc", "time/time_conversion_posix.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/process/memory.h"
namespace base {
void EnableTerminationOnHeapCorruption() {
// Nothing to be done here.
}
} // namespace base
...@@ -77,8 +77,10 @@ BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); ...@@ -77,8 +77,10 @@ BASE_EXPORT ProcessHandle GetCurrentProcessHandle();
// processes. // processes.
BASE_EXPORT ProcessId GetProcId(ProcessHandle process); BASE_EXPORT ProcessId GetProcId(ProcessHandle process);
// Returns the ID for the parent of the given process. #if !defined(OS_FUCHSIA)
// Returns the ID for the parent of the given process. Not available on Fuchsia.
BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process); BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process);
#endif // !defined(OS_FUCHSIA)
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Returns the path to the executable of the given process. // Returns the path to the executable of the given process.
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/process/process_metrics.h"
namespace base {
size_t GetSystemCommitCharge() {
// Not available, doesn't seem likely that it will be (for the whole system).
NOTIMPLEMENTED();
return 0;
}
} // namespace bse
...@@ -858,11 +858,14 @@ TEST_F(ProcessUtilTest, GetAppOutputWithExitCode) { ...@@ -858,11 +858,14 @@ TEST_F(ProcessUtilTest, GetAppOutputWithExitCode) {
EXPECT_EQ(exit_code, 2); EXPECT_EQ(exit_code, 2);
} }
// There's no such thing as a parent process id on Fuchsia.
#if !defined(OS_FUCHSIA)
TEST_F(ProcessUtilTest, GetParentProcessId) { TEST_F(ProcessUtilTest, GetParentProcessId) {
base::ProcessId ppid = base::ProcessId ppid =
base::GetParentProcessId(base::GetCurrentProcessHandle()); base::GetParentProcessId(base::GetCurrentProcessHandle());
EXPECT_EQ(ppid, static_cast<base::ProcessId>(getppid())); EXPECT_EQ(ppid, static_cast<base::ProcessId>(getppid()));
} }
#endif // !defined(OS_FUCHSIA)
// TODO(port): port those unit tests. // TODO(port): port those unit tests.
bool IsProcessDead(base::ProcessHandle child) { bool IsProcessDead(base::ProcessHandle child) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment