fuchsia: Implement SnapshotTime()

Bug: crashpad:196
Change-Id: I398a8e933c64fca33e2620543c4c9d52a07f7d8f
Reviewed-on: https://chromium-review.googlesource.com/1005835
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Scott Graham 2018-04-10 14:27:54 -07:00 committed by Commit Bot
parent c7fe30dddb
commit cf55a7ef55
2 changed files with 10 additions and 3 deletions

View File

@ -18,13 +18,18 @@
namespace crashpad {
ProcessSnapshotFuchsia::ProcessSnapshotFuchsia() {}
ProcessSnapshotFuchsia::ProcessSnapshotFuchsia() = default;
ProcessSnapshotFuchsia::~ProcessSnapshotFuchsia() {}
ProcessSnapshotFuchsia::~ProcessSnapshotFuchsia() = default;
bool ProcessSnapshotFuchsia::Initialize(zx_handle_t process) {
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
if (gettimeofday(&snapshot_time_, nullptr) != 0) {
PLOG(ERROR) << "gettimeofday";
return false;
}
if (!process_reader_.Initialize(process)) {
return false;
}
@ -87,7 +92,7 @@ pid_t ProcessSnapshotFuchsia::ParentProcessID() const {
void ProcessSnapshotFuchsia::SnapshotTime(timeval* snapshot_time) const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
NOTREACHED(); // TODO(scottmg): https://crashpad.chromium.org/bug/196
*snapshot_time = snapshot_time_;
}
void ProcessSnapshotFuchsia::ProcessStartTime(timeval* start_time) const {

View File

@ -15,6 +15,7 @@
#ifndef CRASHPAD_SNAPSHOT_FUCHSIA_PROCESS_SNAPSHOT_FUCHSIA_H_
#define CRASHPAD_SNAPSHOT_FUCHSIA_PROCESS_SNAPSHOT_FUCHSIA_H_
#include <sys/time.h>
#include <zircon/types.h>
#include <memory>
@ -84,6 +85,7 @@ class ProcessSnapshotFuchsia : public ProcessSnapshot {
std::vector<std::unique_ptr<internal::ModuleSnapshotElf>> modules_;
ProcessReaderFuchsia process_reader_;
std::map<std::string, std::string> annotations_simple_map_;
timeval snapshot_time_;
InitializationStateDcheck initialized_;
DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotFuchsia);