// third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom.cc is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2013 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.

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif

#include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom.h"

#include <math.h>
#include <stdint.h>
#include <utility>

#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/common/task_annotator.h"
#include "base/trace_event/trace_conversion_helper.h"
#include "base/trace_event/traced_value.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"

#include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom-params-data.h"
#include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom-shared-message-ids.h"

#include "third_party/blink/public/mojom/page/record_content_to_visible_time_request.mojom-import-headers.h"


#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_PAGE_RECORD_CONTENT_TO_VISIBLE_TIME_REQUEST_MOJOM_JUMBO_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_PAGE_RECORD_CONTENT_TO_VISIBLE_TIME_REQUEST_MOJOM_JUMBO_H_
#endif
namespace blink {
namespace mojom {
RecordContentToVisibleTimeRequest::RecordContentToVisibleTimeRequest()
    : event_start_time(),
      destination_is_loaded(),
      show_reason_tab_switching(false),
      show_reason_unoccluded(false),
      show_reason_bfcache_restore(false) {}

RecordContentToVisibleTimeRequest::RecordContentToVisibleTimeRequest(
    ::base::TimeTicks event_start_time_in,
    bool destination_is_loaded_in,
    bool show_reason_tab_switching_in,
    bool show_reason_unoccluded_in,
    bool show_reason_bfcache_restore_in)
    : event_start_time(std::move(event_start_time_in)),
      destination_is_loaded(std::move(destination_is_loaded_in)),
      show_reason_tab_switching(std::move(show_reason_tab_switching_in)),
      show_reason_unoccluded(std::move(show_reason_unoccluded_in)),
      show_reason_bfcache_restore(std::move(show_reason_bfcache_restore_in)) {}

RecordContentToVisibleTimeRequest::~RecordContentToVisibleTimeRequest() = default;

void RecordContentToVisibleTimeRequest::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("event_start_time", base::trace_event::ValueToString(this->event_start_time, "<value of type ::base::TimeTicks>"));
  value->SetBoolean("destination_is_loaded", this->destination_is_loaded);
  value->SetBoolean("show_reason_tab_switching", this->show_reason_tab_switching);
  value->SetBoolean("show_reason_unoccluded", this->show_reason_unoccluded);
  value->SetBoolean("show_reason_bfcache_restore", this->show_reason_bfcache_restore);
}

bool RecordContentToVisibleTimeRequest::Validate(
    const void* data,
    mojo::internal::ValidationContext* validation_context) {
  return Data_::Validate(data, validation_context);
}
}  // namespace mojom
}  // namespace blink

namespace mojo {


// static
bool StructTraits<::blink::mojom::RecordContentToVisibleTimeRequest::DataView, ::blink::mojom::RecordContentToVisibleTimeRequestPtr>::Read(
    ::blink::mojom::RecordContentToVisibleTimeRequest::DataView input,
    ::blink::mojom::RecordContentToVisibleTimeRequestPtr* output) {
  bool success = true;
  ::blink::mojom::RecordContentToVisibleTimeRequestPtr result(::blink::mojom::RecordContentToVisibleTimeRequest::New());
  
      if (success && !input.ReadEventStartTime(&result->event_start_time))
        success = false;
      if (success)
        result->destination_is_loaded = input.destination_is_loaded();
      if (success)
        result->show_reason_tab_switching = input.show_reason_tab_switching();
      if (success)
        result->show_reason_unoccluded = input.show_reason_unoccluded();
      if (success)
        result->show_reason_bfcache_restore = input.show_reason_bfcache_restore();
  *output = std::move(result);
  return success;
}

}  // namespace mojo

#if defined(__clang__)
#pragma clang diagnostic pop
#endif