// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: chrome/browser/tab/protocol/tab_state.proto
// Protobuf C++ Version: 7.35.1

#include "chrome/browser/tab/protocol/tab_state.pb.h"

#include <algorithm>
#include <type_traits>
#include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/generated_message_tctable_impl.h"
#include "google/protobuf/internal_visibility.h"
#include "google/protobuf/extension_set.h"
#include "google/protobuf/generated_message_util.h"
#include "google/protobuf/wire_format_lite.h"
#include "google/protobuf/io/zero_copy_stream_impl_lite.h"
// @@protoc_insertion_point(includes)

// Must be included last.
#include "google/protobuf/port_def.inc"
PROTOBUF_PRAGMA_INIT_SEG
namespace _pb = ::google::protobuf;
namespace _pbi = ::google::protobuf::internal;
namespace _fl = ::google::protobuf::internal::field_layout;
namespace tabs_pb {
class TabState::_Internal {
 public:
  using HasBits = decltype(::std::declval<TabState>()._impl_._has_bits_);
  static constexpr ::int32_t kHasBitsOffset =
      8 * PROTOBUF_FIELD_OFFSET(TabState, _impl_._has_bits_);
};

constexpr TabState::ParseTableT_ TabState::InternalGenerateParseTable_(const ::_pbi::ClassData* class_data) {
  return ParseTableT_{
    {
      PROTOBUF_FIELD_OFFSET(TabState, _impl_._has_bits_),
      0, // no _extensions_
      16, 120,  // max_field_number, fast_idx_mask
      offsetof(ParseTableT_, field_lookup_table),
      4294902784,  // skipmap
      offsetof(ParseTableT_, field_entries),
      15,  // num_field_entries
      1,  // num_aux_entries
      offsetof(ParseTableT_, aux_entries),
      class_data,
      nullptr,  // post_loop_handler
      ::_pbi::TcParser::GenericFallbackLite,  // fallback
      #ifdef PROTOBUF_PREFETCH_PARSE_TABLE
      ::_pbi::TcParser::GetTable<::tabs_pb::TabState>(),  // to_prefetch
      #endif  // PROTOBUF_PREFETCH_PARSE_TABLE
    }, {{
      // optional string url = 16;
      {::_pbi::TcParser::FastBS2,
       {386, 2, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.url_)}},
      // optional int32 parent_id = 1;
      {::_pbi::TcParser::FastV32S1,
       {8, 4, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.parent_id_)}},
      // optional int32 root_id = 2;
      {::_pbi::TcParser::FastV32S1,
       {16, 5, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.root_id_)}},
      // optional int64 timestamp_millis = 3;
      {::_pbi::TcParser::FastV64S1,
       {24, 6, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.timestamp_millis_)}},
      // optional bytes web_contents_state_bytes = 4;
      {::_pbi::TcParser::FastBS1,
       {34, 0, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.web_contents_state_bytes_)}},
      // optional string opener_app_id = 5;
      {::_pbi::TcParser::FastBS1,
       {42, 1, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.opener_app_id_)}},
      // optional int32 theme_color = 6;
      {::_pbi::TcParser::FastV32S1,
       {48, 7, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.theme_color_)}},
      // optional int32 launch_type_at_creation = 7;
      {::_pbi::TcParser::FastV32S1,
       {56, 8, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.launch_type_at_creation_)}},
      // optional int32 user_agent = 8;
      {::_pbi::TcParser::FastV32S1,
       {64, 10, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.user_agent_)}},
      // optional int64 last_navigation_committed_timestamp_millis = 9;
      {::_pbi::TcParser::FastV64S1,
       {72, 9, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.last_navigation_committed_timestamp_millis_)}},
      // optional .tabs_pb.Token tab_group_id = 10;
      {::_pbi::TcParser::FastMtS1,
       {82, 3, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_group_id_)}},
      {::_pbi::TcParser::MiniParse, {}},
      // optional bool tab_has_sensitive_content = 12;
      {::_pbi::TcParser::FastV8S1,
       {96, 11, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_has_sensitive_content_)}},
      // optional bool is_pinned = 13;
      {::_pbi::TcParser::FastV8S1,
       {104, 12, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.is_pinned_)}},
      // optional int32 web_contents_state_version = 14;
      {::_pbi::TcParser::FastV32S1,
       {112, 13, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.web_contents_state_version_)}},
      // optional int32 tab_id = 15;
      {::_pbi::TcParser::FastV32S1,
       {120, 14, 0,
        PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_id_)}},
    }}, {{
      65535, 65535
    }}, {{
      // optional int32 parent_id = 1;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.parent_id_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int32 root_id = 2;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.root_id_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int64 timestamp_millis = 3;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.timestamp_millis_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)},
      // optional bytes web_contents_state_bytes = 4;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.web_contents_state_bytes_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)},
      // optional string opener_app_id = 5;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.opener_app_id_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)},
      // optional int32 theme_color = 6;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.theme_color_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int32 launch_type_at_creation = 7;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.launch_type_at_creation_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int32 user_agent = 8;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.user_agent_), _Internal::kHasBitsOffset + 10, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int64 last_navigation_committed_timestamp_millis = 9;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.last_navigation_committed_timestamp_millis_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt64)},
      // optional .tabs_pb.Token tab_group_id = 10;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_group_id_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
      // optional bool tab_has_sensitive_content = 12;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_has_sensitive_content_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)},
      // optional bool is_pinned = 13;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.is_pinned_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)},
      // optional int32 web_contents_state_version = 14;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.web_contents_state_version_), _Internal::kHasBitsOffset + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional int32 tab_id = 15;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_id_), _Internal::kHasBitsOffset + 14, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)},
      // optional string url = 16;
      {PROTOBUF_FIELD_OFFSET(TabState, _impl_.url_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)},
    }},
    {{
        #ifndef PROTOBUF_MESSAGE_GLOBALS
        {::_pbi::TcParser::GetTable<::tabs_pb::Token>()},
        #else
        {::_pbi::FieldAuxMessageGlobals(), &::tabs_pb::Token_globals_},
        #endif
    }},
    {{
    }},
  };
}


inline constexpr TabState::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    ::_pbi::ConstantInitialized) noexcept
      : _cached_size_{0},
        web_contents_state_bytes_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        opener_app_id_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        url_(
            &::google::protobuf::internal::fixed_address_empty_string,
            ::_pbi::ConstantInitialized()),
        tab_group_id_{nullptr},
        parent_id_{0},
        root_id_{0},
        timestamp_millis_{::int64_t{0}},
        theme_color_{0},
        launch_type_at_creation_{0},
        last_navigation_committed_timestamp_millis_{::int64_t{0}},
        user_agent_{0},
        tab_has_sensitive_content_{false},
        is_pinned_{false},
        web_contents_state_version_{0},
        tab_id_{0} {}

template <typename>
constexpr TabState::TabState(::_pbi::ConstantInitialized,
                       const ::_pbi::ClassData* PROTOBUF_NONNULL class_data)
    : ::google::protobuf::MessageLite(
#if defined(PROTOBUF_CUSTOM_VTABLE)
          class_data
#endif  // PROTOBUF_CUSTOM_VTABLE
          ),
      _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) {
}
inline void* PROTOBUF_NONNULL TabState::PlacementNew_(
    const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem,
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) {
  return ::new (mem) TabState(arena);
}
constexpr auto TabState::InternalNewImpl_() {
  return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(TabState), alignof(TabState));
}
constexpr auto TabState::InternalGenerateClassData_(
    const MessageLite& prototype,
    const ::google::protobuf::internal::TcParseTableBase* tc_table) {
  return ::google::protobuf::internal::ClassDataLite{
      {
          &prototype,
#ifndef PROTOBUF_MESSAGE_GLOBALS
          &_table_.header,
#else
          tc_table,
#endif
          nullptr,  // IsInitialized
          &TabState::MergeImpl,
          ::google::protobuf::MessageLite::GetNewImpl<TabState>(),
#if defined(PROTOBUF_CUSTOM_VTABLE)
          &TabState::SharedDtor,
          ::google::protobuf::MessageLite::GetClearImpl<TabState>(), &TabState::ByteSizeLong,
              &TabState::_InternalSerialize,
#endif  // PROTOBUF_CUSTOM_VTABLE
          PROTOBUF_FIELD_OFFSET(TabState, _impl_._cached_size_),
          true,
      },
      "tabs_pb.TabState",
  };
}
struct TabStateGlobalsTypeInternal : ::_pbi::MessageGlobalsBase {
  constexpr TabStateGlobalsTypeInternal()
      :
#ifndef PROTOBUF_MESSAGE_GLOBALS
        _default(::_pbi::ConstantInitialized{},
                 TabState_class_data_.base())
#else   // !PROTOBUF_MESSAGE_GLOBALS
        MessageGlobalsBase(TabState::InternalGenerateClassData_(
            _default, &TabState_globals_._table.header)),
        _default(::_pbi::ConstantInitialized{}, GetClassData()),
        _table(::_pbi::PrivateAccess::GenerateParseTable<TabState>(
            GetClassData()))
#endif  // PROTOBUF_MESSAGE_GLOBALS
  {
  }
  ~TabStateGlobalsTypeInternal() {}
  union {
    alignas(::_pbi::kMaxMessageAlignment) TabState _default;
  };
#ifdef PROTOBUF_MESSAGE_GLOBALS
  decltype(::_pbi::PrivateAccess::GenerateParseTable<TabState>(
      ::std::declval<const ::_pbi::ClassData*>())) _table;
#endif
};
#ifdef PROTOBUF_MESSAGE_GLOBALS
static_assert(PROTOBUF_FIELD_OFFSET(TabStateGlobalsTypeInternal, _default) ==
              ::_pbi::MessageGlobalsBase::OffsetToDefault());
#endif  // PROTOBUF_MESSAGE_GLOBALS

PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
    PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_MESSAGE_GLOBALS_CONST TabStateGlobalsTypeInternal TabState_globals_
        PROTOBUF_MESSAGE_GLOBALS_SECTION(.data.rel.ro);
#if defined(PROTOBUF_CUSTOM_VTABLE)
namespace {
const ::_pbi::ClassData* TabState_get_class_data() {
#ifdef PROTOBUF_MESSAGE_GLOBALS
  return TabState_globals_.GetClassData();
#else
  return TabState_class_data_.base();
#endif  // PROTOBUF_MESSAGE_GLOBALS
}
}  // namespace
#endif  // PROTOBUF_CUSTOM_VTABLE
}  // namespace tabs_pb
namespace tabs_pb {
// ===================================================================

void TabState::clear_tab_group_id() {
  ::google::protobuf::internal::TSanWrite(&_impl_);
  if (_impl_.tab_group_id_ != nullptr) _impl_.tab_group_id_->Clear();
  ClearHasBit(_impl_._has_bits_[0], 0x00000008U);
}
TabState::TabState(::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, TabState_get_class_data()) {
#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  SharedCtor(arena);
  // @@protoc_insertion_point(arena_constructor:tabs_pb.TabState)
}
PROTOBUF_NDEBUG_INLINE TabState::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from,
    [[maybe_unused]] const ::tabs_pb::TabState& from_msg)
      : _has_bits_{from._has_bits_},
        _cached_size_{0},
        web_contents_state_bytes_(arena, from.web_contents_state_bytes_),
        opener_app_id_(arena, from.opener_app_id_),
        url_(arena, from.url_) {}

TabState::TabState(
    ::google::protobuf::Arena* PROTOBUF_NULLABLE arena,
    const TabState& from)
#if defined(PROTOBUF_CUSTOM_VTABLE)
    : ::google::protobuf::MessageLite(arena, TabState_get_class_data()) {

#else   // PROTOBUF_CUSTOM_VTABLE
    : ::google::protobuf::MessageLite(arena) {
#endif  // PROTOBUF_CUSTOM_VTABLE
  TabState* const _this = this;
  (void)_this;
  _internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
  new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from);
  ::uint32_t cached_has_bits = _impl_._has_bits_[0];
  _impl_.tab_group_id_ = (CheckHasBit(cached_has_bits, 0x00000008U))
                ? ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.tab_group_id_)
                : nullptr;
  ::memcpy(reinterpret_cast<char*>(&_impl_) +
               offsetof(Impl_, parent_id_),
           reinterpret_cast<const char*>(&from._impl_) +
               offsetof(Impl_, parent_id_),
           offsetof(Impl_, tab_id_) -
               offsetof(Impl_, parent_id_) +
               sizeof(Impl_::tab_id_));

  // @@protoc_insertion_point(copy_constructor:tabs_pb.TabState)
}
PROTOBUF_NDEBUG_INLINE TabState::Impl_::Impl_(
    [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility,
    [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena)
      : _cached_size_{0},
        web_contents_state_bytes_(arena),
        opener_app_id_(arena),
        url_(arena) {}

inline void TabState::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) {
  new (&_impl_) Impl_(internal_visibility(), arena);
  ::memset(reinterpret_cast<char*>(&_impl_) +
               offsetof(Impl_, tab_group_id_),
           0,
           offsetof(Impl_, tab_id_) -
               offsetof(Impl_, tab_group_id_) +
               sizeof(Impl_::tab_id_));
}
TabState::~TabState() {
  // @@protoc_insertion_point(destructor:tabs_pb.TabState)
  SharedDtor(*this);
}
inline void TabState::SharedDtor(MessageLite& self) {
  TabState& this_ = static_cast<TabState&>(self);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  this_._internal_metadata_.Delete<::std::string>();
  ABSL_DCHECK(this_.GetArena() == nullptr);
  this_._impl_.web_contents_state_bytes_.Destroy();
  this_._impl_.opener_app_id_.Destroy();
  this_._impl_.url_.Destroy();
  delete this_._impl_.tab_group_id_;
  this_._impl_.~Impl_();
}

#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::google::protobuf::internal::ClassDataLite TabState_class_data_ =
    TabState::InternalGenerateClassData_(TabState_globals_._default);

PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
TabState::GetClassData() const {
  return TabState_class_data_.base();
}
#else
PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
TabState::GetClassData() const {
  return TabState_globals_.GetClassData();
}
#endif  // !PROTOBUF_MESSAGE_GLOBALS
#ifndef PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const TabState::ParseTableT_
    TabState::_table_ =
        TabState::InternalGenerateParseTable_(TabState_class_data_.base());
#endif  // !PROTOBUF_MESSAGE_GLOBALS
PROTOBUF_NOINLINE void TabState::Clear() {
// @@protoc_insertion_point(message_clear_start:tabs_pb.TabState)
  ::google::protobuf::internal::TSanWrite(&_impl_);
  ::uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _impl_.web_contents_state_bytes_.ClearNonDefaultToEmpty();
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _impl_.opener_app_id_.ClearNonDefaultToEmpty();
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _impl_.url_.ClearNonDefaultToEmpty();
    }
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      ABSL_DCHECK(_impl_.tab_group_id_ != nullptr);
      _impl_.tab_group_id_->Clear();
    }
  }
  if (BatchCheckHasBit(cached_has_bits, 0x000000f0U)) {
    ::memset(&_impl_.parent_id_, 0, static_cast<::size_t>(
        reinterpret_cast<char*>(&_impl_.theme_color_) -
        reinterpret_cast<char*>(&_impl_.parent_id_)) + sizeof(_impl_.theme_color_));
  }
  if (BatchCheckHasBit(cached_has_bits, 0x00007f00U)) {
    ::memset(&_impl_.launch_type_at_creation_, 0, static_cast<::size_t>(
        reinterpret_cast<char*>(&_impl_.tab_id_) -
        reinterpret_cast<char*>(&_impl_.launch_type_at_creation_)) + sizeof(_impl_.tab_id_));
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::std::string>();
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::uint8_t* PROTOBUF_NONNULL TabState::_InternalSerialize(
    const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) {
  const TabState& this_ = static_cast<const TabState&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::uint8_t* PROTOBUF_NONNULL TabState::_InternalSerialize(
    ::uint8_t* PROTOBUF_NONNULL target,
    ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const {
  const TabState& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    this_.CheckHasBitConsistency();
  }
  // @@protoc_insertion_point(serialize_to_array_start:tabs_pb.TabState)
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = this_._impl_._has_bits_[0];
  // optional int32 parent_id = 1;
  if (CheckHasBit(cached_has_bits, 0x00000010U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>(
            stream, this_._internal_parent_id(), target);
  }

  // optional int32 root_id = 2;
  if (CheckHasBit(cached_has_bits, 0x00000020U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<2>(
            stream, this_._internal_root_id(), target);
  }

  // optional int64 timestamp_millis = 3;
  if (CheckHasBit(cached_has_bits, 0x00000040U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt64ToArrayWithField<3>(
            stream, this_._internal_timestamp_millis(), target);
  }

  // optional bytes web_contents_state_bytes = 4;
  if (CheckHasBit(cached_has_bits, 0x00000001U)) {
    const ::std::string& _s = this_._internal_web_contents_state_bytes();
    target = stream->WriteBytesMaybeAliased(4, _s, target);
  }

  // optional string opener_app_id = 5;
  if (CheckHasBit(cached_has_bits, 0x00000002U)) {
    const ::std::string& _s = this_._internal_opener_app_id();
    target = stream->WriteStringMaybeAliased(5, _s, target);
  }

  // optional int32 theme_color = 6;
  if (CheckHasBit(cached_has_bits, 0x00000080U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<6>(
            stream, this_._internal_theme_color(), target);
  }

  // optional int32 launch_type_at_creation = 7;
  if (CheckHasBit(cached_has_bits, 0x00000100U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<7>(
            stream, this_._internal_launch_type_at_creation(), target);
  }

  // optional int32 user_agent = 8;
  if (CheckHasBit(cached_has_bits, 0x00000400U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<8>(
            stream, this_._internal_user_agent(), target);
  }

  // optional int64 last_navigation_committed_timestamp_millis = 9;
  if (CheckHasBit(cached_has_bits, 0x00000200U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt64ToArrayWithField<9>(
            stream, this_._internal_last_navigation_committed_timestamp_millis(), target);
  }

  // optional .tabs_pb.Token tab_group_id = 10;
  if (CheckHasBit(cached_has_bits, 0x00000008U)) {
    target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
        10, *this_._impl_.tab_group_id_, this_._impl_.tab_group_id_->GetCachedSize(), target,
        stream);
  }

  // optional bool tab_has_sensitive_content = 12;
  if (CheckHasBit(cached_has_bits, 0x00000800U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        12, this_._internal_tab_has_sensitive_content(), target);
  }

  // optional bool is_pinned = 13;
  if (CheckHasBit(cached_has_bits, 0x00001000U)) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(
        13, this_._internal_is_pinned(), target);
  }

  // optional int32 web_contents_state_version = 14;
  if (CheckHasBit(cached_has_bits, 0x00002000U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<14>(
            stream, this_._internal_web_contents_state_version(), target);
  }

  // optional int32 tab_id = 15;
  if (CheckHasBit(cached_has_bits, 0x00004000U)) {
    target =
        ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<15>(
            stream, this_._internal_tab_id(), target);
  }

  // optional string url = 16;
  if (CheckHasBit(cached_has_bits, 0x00000004U)) {
    const ::std::string& _s = this_._internal_url();
    target = stream->WriteStringMaybeAliased(16, _s, target);
  }

  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(
        this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).data(),
        static_cast<int>(this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:tabs_pb.TabState)
  return target;
}

#if defined(PROTOBUF_CUSTOM_VTABLE)
::size_t TabState::ByteSizeLong(const MessageLite& base) {
  const TabState& this_ = static_cast<const TabState&>(base);
#else   // PROTOBUF_CUSTOM_VTABLE
::size_t TabState::ByteSizeLong() const {
  const TabState& this_ = *this;
#endif  // PROTOBUF_CUSTOM_VTABLE
  // @@protoc_insertion_point(message_byte_size_start:tabs_pb.TabState)
  ::size_t total_size = 0;

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

  ::_pbi::Prefetch5LinesFrom7Lines(&this_);
  cached_has_bits = this_._impl_._has_bits_[0];
  total_size += ::absl::popcount(0x00001800U & cached_has_bits) * 2;
  if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) {
    // optional bytes web_contents_state_bytes = 4;
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize(
                                      this_._internal_web_contents_state_bytes());
    }
    // optional string opener_app_id = 5;
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(
                                      this_._internal_opener_app_id());
    }
    // optional string url = 16;
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      total_size += 2 + ::google::protobuf::internal::WireFormatLite::StringSize(
                                      this_._internal_url());
    }
    // optional .tabs_pb.Token tab_group_id = 10;
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      total_size += 1 +
                    ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.tab_group_id_);
    }
    // optional int32 parent_id = 1;
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_parent_id());
    }
    // optional int32 root_id = 2;
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_root_id());
    }
    // optional int64 timestamp_millis = 3;
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
          this_._internal_timestamp_millis());
    }
    // optional int32 theme_color = 6;
    if (CheckHasBit(cached_has_bits, 0x00000080U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_theme_color());
    }
  }
  if (BatchCheckHasBit(cached_has_bits, 0x00006700U)) {
    // optional int32 launch_type_at_creation = 7;
    if (CheckHasBit(cached_has_bits, 0x00000100U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_launch_type_at_creation());
    }
    // optional int64 last_navigation_committed_timestamp_millis = 9;
    if (CheckHasBit(cached_has_bits, 0x00000200U)) {
      total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(
          this_._internal_last_navigation_committed_timestamp_millis());
    }
    // optional int32 user_agent = 8;
    if (CheckHasBit(cached_has_bits, 0x00000400U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_user_agent());
    }
    // optional int32 web_contents_state_version = 14;
    if (CheckHasBit(cached_has_bits, 0x00002000U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_web_contents_state_version());
    }
    // optional int32 tab_id = 15;
    if (CheckHasBit(cached_has_bits, 0x00004000U)) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(
          this_._internal_tab_id());
    }
  }
  if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) {
    total_size += this_._internal_metadata_.unknown_fields<::std::string>(::google::protobuf::internal::GetEmptyString).size();
  }
  this_._impl_._cached_size_.Set(::_pbi::ToCachedSize(total_size));
  return total_size;
}

void TabState::MergeImpl(::google::protobuf::MessageLite& to_msg,
                      const ::google::protobuf::MessageLite& from_msg) {
   auto* const _this = static_cast<TabState*>(&to_msg);
  auto& from = static_cast<const TabState&>(from_msg);
  if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) {
    from.CheckHasBitConsistency();
  }
  ::google::protobuf::Arena* arena = _this->GetArena();
  // @@protoc_insertion_point(class_specific_merge_from_start:tabs_pb.TabState)
  ABSL_DCHECK_NE(&from, _this);
  ::uint32_t cached_has_bits = 0;
  (void)cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (BatchCheckHasBit(cached_has_bits, 0x000000ffU)) {
    if (CheckHasBit(cached_has_bits, 0x00000001U)) {
      _this->_internal_set_web_contents_state_bytes(from._internal_web_contents_state_bytes());
    }
    if (CheckHasBit(cached_has_bits, 0x00000002U)) {
      _this->_internal_set_opener_app_id(from._internal_opener_app_id());
    }
    if (CheckHasBit(cached_has_bits, 0x00000004U)) {
      _this->_internal_set_url(from._internal_url());
    }
    if (CheckHasBit(cached_has_bits, 0x00000008U)) {
      ABSL_DCHECK(from._impl_.tab_group_id_ != nullptr);
      if (_this->_impl_.tab_group_id_ == nullptr) {
        _this->_impl_.tab_group_id_ = ::google::protobuf::MessageLite::CopyConstruct(arena, *from._impl_.tab_group_id_);
      } else {
        _this->_impl_.tab_group_id_->MergeFrom(*from._impl_.tab_group_id_);
      }
    }
    if (CheckHasBit(cached_has_bits, 0x00000010U)) {
      _this->_impl_.parent_id_ = from._impl_.parent_id_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000020U)) {
      _this->_impl_.root_id_ = from._impl_.root_id_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000040U)) {
      _this->_impl_.timestamp_millis_ = from._impl_.timestamp_millis_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000080U)) {
      _this->_impl_.theme_color_ = from._impl_.theme_color_;
    }
  }
  if (BatchCheckHasBit(cached_has_bits, 0x00007f00U)) {
    if (CheckHasBit(cached_has_bits, 0x00000100U)) {
      _this->_impl_.launch_type_at_creation_ = from._impl_.launch_type_at_creation_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000200U)) {
      _this->_impl_.last_navigation_committed_timestamp_millis_ = from._impl_.last_navigation_committed_timestamp_millis_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000400U)) {
      _this->_impl_.user_agent_ = from._impl_.user_agent_;
    }
    if (CheckHasBit(cached_has_bits, 0x00000800U)) {
      _this->_impl_.tab_has_sensitive_content_ = from._impl_.tab_has_sensitive_content_;
    }
    if (CheckHasBit(cached_has_bits, 0x00001000U)) {
      _this->_impl_.is_pinned_ = from._impl_.is_pinned_;
    }
    if (CheckHasBit(cached_has_bits, 0x00002000U)) {
      _this->_impl_.web_contents_state_version_ = from._impl_.web_contents_state_version_;
    }
    if (CheckHasBit(cached_has_bits, 0x00004000U)) {
      _this->_impl_.tab_id_ = from._impl_.tab_id_;
    }
  }
  _this->_impl_._has_bits_[0] |= cached_has_bits;
  _this->_internal_metadata_.MergeFrom<::std::string>(
      from._internal_metadata_);
}

void TabState::CopyFrom(const TabState& from) {
  // @@protoc_insertion_point(class_specific_copy_from_start:tabs_pb.TabState)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}


void TabState::InternalSwap(TabState* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) {
  using ::std::swap;
  auto* arena = GetArena();
  ABSL_DCHECK_EQ(arena, other->GetArena());
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.web_contents_state_bytes_, &other->_impl_.web_contents_state_bytes_, arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.opener_app_id_, &other->_impl_.opener_app_id_, arena);
  ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.url_, &other->_impl_.url_, arena);
  ::google::protobuf::internal::memswap<
      PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_id_)
      + sizeof(TabState::_impl_.tab_id_)
      - PROTOBUF_FIELD_OFFSET(TabState, _impl_.tab_group_id_)>(
          reinterpret_cast<char*>(&_impl_.tab_group_id_),
          reinterpret_cast<char*>(&other->_impl_.tab_group_id_));
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace tabs_pb
namespace google {
namespace protobuf {
}  // namespace protobuf
}  // namespace google
// @@protoc_insertion_point(global_scope)
#include "google/protobuf/port_undef.inc"
