// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: devtools_background_services.proto

#include "devtools_background_services.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_devtools_5fbackground_5fservices_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_devtools_5fbackground_5fservices_2eproto;
namespace content {
namespace devtools {
namespace proto {
class BackgroundServiceEvent_EventMetadataEntry_DoNotUseDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<BackgroundServiceEvent_EventMetadataEntry_DoNotUse> _instance;
} _BackgroundServiceEvent_EventMetadataEntry_DoNotUse_default_instance_;
class BackgroundServiceEventDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<BackgroundServiceEvent> _instance;
} _BackgroundServiceEvent_default_instance_;
}  // namespace proto
}  // namespace devtools
}  // namespace content
static void InitDefaultsscc_info_BackgroundServiceEvent_devtools_5fbackground_5fservices_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::content::devtools::proto::_BackgroundServiceEvent_default_instance_;
    new (ptr) ::content::devtools::proto::BackgroundServiceEvent();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::content::devtools::proto::BackgroundServiceEvent::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_BackgroundServiceEvent_devtools_5fbackground_5fservices_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_BackgroundServiceEvent_devtools_5fbackground_5fservices_2eproto}, {
      &scc_info_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_devtools_5fbackground_5fservices_2eproto.base,}};

static void InitDefaultsscc_info_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_devtools_5fbackground_5fservices_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::content::devtools::proto::_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_default_instance_;
    new (ptr) ::content::devtools::proto::BackgroundServiceEvent_EventMetadataEntry_DoNotUse();
  }
  ::content::devtools::proto::BackgroundServiceEvent_EventMetadataEntry_DoNotUse::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_devtools_5fbackground_5fservices_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_BackgroundServiceEvent_EventMetadataEntry_DoNotUse_devtools_5fbackground_5fservices_2eproto}, {}};

namespace content {
namespace devtools {
namespace proto {
bool BackgroundService_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> BackgroundService_strings[9] = {};

static const char BackgroundService_names[] =
  "BACKGROUND_FETCH"
  "BACKGROUND_SYNC"
  "COUNT"
  "NOTIFICATIONS"
  "PAYMENT_HANDLER"
  "PERIODIC_BACKGROUND_SYNC"
  "PUSH_MESSAGING"
  "TEST_BACKGROUND_SERVICE"
  "UNKNOWN";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry BackgroundService_entries[] = {
  { {BackgroundService_names + 0, 16}, 2 },
  { {BackgroundService_names + 16, 15}, 3 },
  { {BackgroundService_names + 31, 5}, 8 },
  { {BackgroundService_names + 36, 13}, 5 },
  { {BackgroundService_names + 49, 15}, 6 },
  { {BackgroundService_names + 64, 24}, 7 },
  { {BackgroundService_names + 88, 14}, 4 },
  { {BackgroundService_names + 102, 23}, 1 },
  { {BackgroundService_names + 125, 7}, 0 },
};

static const int BackgroundService_entries_by_number[] = {
  8, // 0 -> UNKNOWN
  7, // 1 -> TEST_BACKGROUND_SERVICE
  0, // 2 -> BACKGROUND_FETCH
  1, // 3 -> BACKGROUND_SYNC
  6, // 4 -> PUSH_MESSAGING
  3, // 5 -> NOTIFICATIONS
  4, // 6 -> PAYMENT_HANDLER
  5, // 7 -> PERIODIC_BACKGROUND_SYNC
  2, // 8 -> COUNT
};

const std::string& BackgroundService_Name(
    BackgroundService value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          BackgroundService_entries,
          BackgroundService_entries_by_number,
          9, BackgroundService_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      BackgroundService_entries,
      BackgroundService_entries_by_number,
      9, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     BackgroundService_strings[idx].get();
}
bool BackgroundService_Parse(
    const std::string& name, BackgroundService* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      BackgroundService_entries, 9, name, &int_value);
  if (success) {
    *value = static_cast<BackgroundService>(int_value);
  }
  return success;
}

// ===================================================================

BackgroundServiceEvent_EventMetadataEntry_DoNotUse::BackgroundServiceEvent_EventMetadataEntry_DoNotUse() {}
BackgroundServiceEvent_EventMetadataEntry_DoNotUse::BackgroundServiceEvent_EventMetadataEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void BackgroundServiceEvent_EventMetadataEntry_DoNotUse::MergeFrom(const BackgroundServiceEvent_EventMetadataEntry_DoNotUse& other) {
  MergeFromInternal(other);
}

// ===================================================================

void BackgroundServiceEvent::InitAsDefaultInstance() {
}
class BackgroundServiceEvent::_Internal {
 public:
  using HasBits = decltype(std::declval<BackgroundServiceEvent>()._has_bits_);
  static void set_has_timestamp(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_origin(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_service_worker_registration_id(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_background_service(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_event_name(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_instance_id(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

BackgroundServiceEvent::BackgroundServiceEvent()
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:content.devtools.proto.BackgroundServiceEvent)
}
BackgroundServiceEvent::BackgroundServiceEvent(const BackgroundServiceEvent& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  event_metadata_.MergeFrom(from.event_metadata_);
  origin_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_origin()) {
    origin_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.origin_);
  }
  event_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_event_name()) {
    event_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.event_name_);
  }
  instance_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_instance_id()) {
    instance_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.instance_id_);
  }
  ::memcpy(&timestamp_, &from.timestamp_,
    static_cast<size_t>(reinterpret_cast<char*>(&background_service_) -
    reinterpret_cast<char*>(&timestamp_)) + sizeof(background_service_));
  // @@protoc_insertion_point(copy_constructor:content.devtools.proto.BackgroundServiceEvent)
}

void BackgroundServiceEvent::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BackgroundServiceEvent_devtools_5fbackground_5fservices_2eproto.base);
  origin_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  event_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  instance_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&timestamp_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&background_service_) -
      reinterpret_cast<char*>(&timestamp_)) + sizeof(background_service_));
}

BackgroundServiceEvent::~BackgroundServiceEvent() {
  // @@protoc_insertion_point(destructor:content.devtools.proto.BackgroundServiceEvent)
  SharedDtor();
}

void BackgroundServiceEvent::SharedDtor() {
  origin_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  event_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  instance_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void BackgroundServiceEvent::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const BackgroundServiceEvent& BackgroundServiceEvent::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BackgroundServiceEvent_devtools_5fbackground_5fservices_2eproto.base);
  return *internal_default_instance();
}


void BackgroundServiceEvent::Clear() {
// @@protoc_insertion_point(message_clear_start:content.devtools.proto.BackgroundServiceEvent)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  event_metadata_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      origin_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      event_name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      instance_id_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 0x00000038u) {
    ::memset(&timestamp_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&background_service_) -
        reinterpret_cast<char*>(&timestamp_)) + sizeof(background_service_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* BackgroundServiceEvent::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional int64 timestamp = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_timestamp(&has_bits);
          timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string origin = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_origin(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 service_worker_registration_id = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_service_worker_registration_id(&has_bits);
          service_worker_registration_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .content.devtools.proto.BackgroundService background_service = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::content::devtools::proto::BackgroundService_IsValid(val))) {
            set_background_service(static_cast<::content::devtools::proto::BackgroundService>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional string event_name = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_event_name(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string instance_id = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_instance_id(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // map<string, string> event_metadata = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&event_metadata_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 58);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool BackgroundServiceEvent::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  ::PROTOBUF_NAMESPACE_ID::internal::LiteUnknownFieldSetter unknown_fields_setter(
      &_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::io::StringOutputStream unknown_fields_output(
      unknown_fields_setter.buffer());
  ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream unknown_fields_stream(
      &unknown_fields_output, false);
  // @@protoc_insertion_point(parse_start:content.devtools.proto.BackgroundServiceEvent)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int64 timestamp = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
          _Internal::set_has_timestamp(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &timestamp_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string origin = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_origin()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int64 service_worker_registration_id = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
          _Internal::set_has_service_worker_registration_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
                 input, &service_worker_registration_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .content.devtools.proto.BackgroundService background_service = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::content::devtools::proto::BackgroundService_IsValid(value)) {
            set_background_service(static_cast< ::content::devtools::proto::BackgroundService >(value));
          } else {
            unknown_fields_stream.WriteVarint32(32u);
            unknown_fields_stream.WriteVarint32(
                static_cast<::PROTOBUF_NAMESPACE_ID::uint32>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string event_name = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_event_name()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string instance_id = 6;
      case 6: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_instance_id()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // map<string, string> event_metadata = 7;
      case 7: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
          BackgroundServiceEvent_EventMetadataEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapFieldLite<
              BackgroundServiceEvent_EventMetadataEntry_DoNotUse,
              std::string, std::string,
              ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
              ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
              0 >,
            ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string > > parser(&event_metadata_);
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual(
              input, &parser));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SkipField(
            input, tag, &unknown_fields_stream));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:content.devtools.proto.BackgroundServiceEvent)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:content.devtools.proto.BackgroundServiceEvent)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void BackgroundServiceEvent::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:content.devtools.proto.BackgroundServiceEvent)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int64 timestamp = 1;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(1, this->timestamp(), output);
  }

  // optional string origin = 2;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->origin(), output);
  }

  // optional int64 service_worker_registration_id = 3;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(3, this->service_worker_registration_id(), output);
  }

  // optional .content.devtools.proto.BackgroundService background_service = 4;
  if (cached_has_bits & 0x00000020u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      4, this->background_service(), output);
  }

  // optional string event_name = 5;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->event_name(), output);
  }

  // optional string instance_id = 6;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      6, this->instance_id(), output);
  }

  // map<string, string> event_metadata = 7;
  if (!this->event_metadata().empty()) {
    typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_pointer
        ConstPtr;
    typedef ConstPtr SortItem;
    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
    struct Utf8Check {
      static void Check(ConstPtr p) {
      }
    };

    if (output->IsSerializationDeterministic() &&
        this->event_metadata().size() > 1) {
      ::std::unique_ptr<SortItem[]> items(
          new SortItem[this->event_metadata().size()]);
      typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::size_type size_type;
      size_type n = 0;
      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
          it = this->event_metadata().begin();
          it != this->event_metadata().end(); ++it, ++n) {
        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
      }
      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
      for (size_type i = 0; i < n; i++) {
        BackgroundServiceEvent_EventMetadataEntry_DoNotUse::Funcs::SerializeToCodedStream(7, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output);
        Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
      }
    } else {
      for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
          it = this->event_metadata().begin();
          it != this->event_metadata().end(); ++it) {
        BackgroundServiceEvent_EventMetadataEntry_DoNotUse::Funcs::SerializeToCodedStream(7, it->first, it->second, output);
        Utf8Check::Check(&(*it));
      }
    }
  }

  output->WriteRaw(_internal_metadata_.unknown_fields().data(),
                   static_cast<int>(_internal_metadata_.unknown_fields().size()));
  // @@protoc_insertion_point(serialize_end:content.devtools.proto.BackgroundServiceEvent)
}

size_t BackgroundServiceEvent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:content.devtools.proto.BackgroundServiceEvent)
  size_t total_size = 0;

  total_size += _internal_metadata_.unknown_fields().size();

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // map<string, string> event_metadata = 7;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->event_metadata_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< std::string, std::string >::const_iterator
      it = this->event_metadata().begin();
      it != this->event_metadata().end(); ++it) {
    total_size += BackgroundServiceEvent_EventMetadataEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    // optional string origin = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->origin());
    }

    // optional string event_name = 5;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->event_name());
    }

    // optional string instance_id = 6;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->instance_id());
    }

    // optional int64 timestamp = 1;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->timestamp());
    }

    // optional int64 service_worker_registration_id = 3;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->service_worker_registration_id());
    }

    // optional .content.devtools.proto.BackgroundService background_service = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->background_service());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void BackgroundServiceEvent::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const BackgroundServiceEvent*>(
      &from));
}

void BackgroundServiceEvent::MergeFrom(const BackgroundServiceEvent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:content.devtools.proto.BackgroundServiceEvent)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  event_metadata_.MergeFrom(from.event_metadata_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      origin_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.origin_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      event_name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.event_name_);
    }
    if (cached_has_bits & 0x00000004u) {
      _has_bits_[0] |= 0x00000004u;
      instance_id_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.instance_id_);
    }
    if (cached_has_bits & 0x00000008u) {
      timestamp_ = from.timestamp_;
    }
    if (cached_has_bits & 0x00000010u) {
      service_worker_registration_id_ = from.service_worker_registration_id_;
    }
    if (cached_has_bits & 0x00000020u) {
      background_service_ = from.background_service_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void BackgroundServiceEvent::CopyFrom(const BackgroundServiceEvent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:content.devtools.proto.BackgroundServiceEvent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool BackgroundServiceEvent::IsInitialized() const {
  return true;
}

void BackgroundServiceEvent::InternalSwap(BackgroundServiceEvent* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  event_metadata_.Swap(&other->event_metadata_);
  origin_.Swap(&other->origin_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  event_name_.Swap(&other->event_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  instance_id_.Swap(&other->instance_id_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(timestamp_, other->timestamp_);
  swap(service_worker_registration_id_, other->service_worker_registration_id_);
  swap(background_service_, other->background_service_);
}

std::string BackgroundServiceEvent::GetTypeName() const {
  return "content.devtools.proto.BackgroundServiceEvent";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace proto
}  // namespace devtools
}  // namespace content
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::content::devtools::proto::BackgroundServiceEvent_EventMetadataEntry_DoNotUse* Arena::CreateMaybeMessage< ::content::devtools::proto::BackgroundServiceEvent_EventMetadataEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateInternal< ::content::devtools::proto::BackgroundServiceEvent_EventMetadataEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::content::devtools::proto::BackgroundServiceEvent* Arena::CreateMaybeMessage< ::content::devtools::proto::BackgroundServiceEvent >(Arena* arena) {
  return Arena::CreateInternal< ::content::devtools::proto::BackgroundServiceEvent >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
