| Index: base/process/process_info_fuchsia.cc
|
| diff --git a/base/process/process_info_fuchsia.cc b/base/process/process_info_fuchsia.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..53f6029ab7a5b333171dbc99c9a75e84d7c90a61
|
| --- /dev/null
|
| +++ b/base/process/process_info_fuchsia.cc
|
| @@ -0,0 +1,30 @@
|
| +// 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_info.h"
|
| +
|
| +#include <magenta/syscalls.h>
|
| +
|
| +#include "base/time/time.h"
|
| +
|
| +namespace base {
|
| +
|
| +// static
|
| +const Time CurrentProcessInfo::CreationTime() {
|
| +#if 0 // TODO(fuchsia): This requires a newer drop of the Fuchsia SDK.
|
| + mx_info_thread_stats_t thread_stats;
|
| + if (mx_object_get_info(mx_thread_self(), MX_INFO_THREAD_STATS, &thread_stats,
|
| + sizeof(thread_stats), nullptr, nullptr) != NO_ERROR) {
|
| + return Time();
|
| + }
|
| + Time current_time = Time::Now();
|
| + TimeDelta total_runtime = TimeDelta::FromMicroseconds(
|
| + thread_stats.total_runtime / base::Time::kNanosecondsPerMicrosecond);
|
| + return Time(current_time - total_runtime);
|
| +#else
|
| + return Time();
|
| +#endif
|
| +}
|
| +
|
| +} // namespace base
|
|
|