// third_party/blink/public/mojom/appcache/appcache_info.mojom-blink.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/appcache/appcache_info.mojom-blink.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/appcache/appcache_info.mojom-params-data.h"
#include "third_party/blink/public/mojom/appcache/appcache_info.mojom-shared-message-ids.h"

#include "third_party/blink/public/mojom/appcache/appcache_info.mojom-blink-import-headers.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"


#ifndef THIRD_PARTY_BLINK_PUBLIC_MOJOM_APPCACHE_APPCACHE_INFO_MOJOM_BLINK_JUMBO_H_
#define THIRD_PARTY_BLINK_PUBLIC_MOJOM_APPCACHE_APPCACHE_INFO_MOJOM_BLINK_JUMBO_H_
#endif
namespace blink {
namespace mojom {
namespace blink {
AppCacheInfo::AppCacheInfo()
    : manifest_url(),
      creation_time(),
      last_update_time(),
      last_access_time(),
      token_expires(),
      cache_id(),
      group_id(),
      status(),
      response_sizes(),
      padding_sizes(),
      is_complete(),
      manifest_parser_version(),
      manifest_scope() {}

AppCacheInfo::AppCacheInfo(
    const ::blink::KURL& manifest_url_in,
    ::base::Time creation_time_in,
    ::base::Time last_update_time_in,
    ::base::Time last_access_time_in,
    ::base::Time token_expires_in,
    int64_t cache_id_in,
    int64_t group_id_in,
    AppCacheStatus status_in,
    int64_t response_sizes_in,
    int64_t padding_sizes_in,
    bool is_complete_in,
    int64_t manifest_parser_version_in,
    const WTF::String& manifest_scope_in)
    : manifest_url(std::move(manifest_url_in)),
      creation_time(std::move(creation_time_in)),
      last_update_time(std::move(last_update_time_in)),
      last_access_time(std::move(last_access_time_in)),
      token_expires(std::move(token_expires_in)),
      cache_id(std::move(cache_id_in)),
      group_id(std::move(group_id_in)),
      status(std::move(status_in)),
      response_sizes(std::move(response_sizes_in)),
      padding_sizes(std::move(padding_sizes_in)),
      is_complete(std::move(is_complete_in)),
      manifest_parser_version(std::move(manifest_parser_version_in)),
      manifest_scope(std::move(manifest_scope_in)) {}

AppCacheInfo::~AppCacheInfo() = default;

void AppCacheInfo::AsValueInto(base::trace_event::TracedValue* value) const {
  value->SetString("manifest_url", base::trace_event::ValueToString(this->manifest_url, "<value of type const ::blink::KURL&>"));
  value->SetString("creation_time", base::trace_event::ValueToString(this->creation_time, "<value of type ::base::Time>"));
  value->SetString("last_update_time", base::trace_event::ValueToString(this->last_update_time, "<value of type ::base::Time>"));
  value->SetString("last_access_time", base::trace_event::ValueToString(this->last_access_time, "<value of type ::base::Time>"));
  value->SetString("token_expires", base::trace_event::ValueToString(this->token_expires, "<value of type ::base::Time>"));
  value->SetString("cache_id", base::NumberToString(this->cache_id));
  value->SetString("group_id", base::NumberToString(this->group_id));
  value->SetString("status", base::trace_event::ValueToString(this->status));
  value->SetString("response_sizes", base::NumberToString(this->response_sizes));
  value->SetString("padding_sizes", base::NumberToString(this->padding_sizes));
  value->SetBoolean("is_complete", this->is_complete);
  value->SetString("manifest_parser_version", base::NumberToString(this->manifest_parser_version));
  value->SetString("manifest_scope", this->manifest_scope.Utf8());
}

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

namespace mojo {


// static
bool StructTraits<::blink::mojom::blink::AppCacheInfo::DataView, ::blink::mojom::blink::AppCacheInfoPtr>::Read(
    ::blink::mojom::blink::AppCacheInfo::DataView input,
    ::blink::mojom::blink::AppCacheInfoPtr* output) {
  bool success = true;
  ::blink::mojom::blink::AppCacheInfoPtr result(::blink::mojom::blink::AppCacheInfo::New());
  
      if (success && !input.ReadManifestUrl(&result->manifest_url))
        success = false;
      if (success && !input.ReadCreationTime(&result->creation_time))
        success = false;
      if (success && !input.ReadLastUpdateTime(&result->last_update_time))
        success = false;
      if (success && !input.ReadLastAccessTime(&result->last_access_time))
        success = false;
      if (success && !input.ReadTokenExpires(&result->token_expires))
        success = false;
      if (success)
        result->cache_id = input.cache_id();
      if (success)
        result->group_id = input.group_id();
      if (success && !input.ReadStatus(&result->status))
        success = false;
      if (success)
        result->response_sizes = input.response_sizes();
      if (success)
        result->padding_sizes = input.padding_sizes();
      if (success)
        result->is_complete = input.is_complete();
      if (success)
        result->manifest_parser_version = input.manifest_parser_version();
      if (success && !input.ReadManifestScope(&result->manifest_scope))
        success = false;
  *output = std::move(result);
  return success;
}

}  // namespace mojo

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