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

#include "chrome_user_metrics_extension.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_cast_5fassistant_5flogs_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_CastAssistantLogsProto_cast_5fassistant_5flogs_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_cast_5flogs_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_CastLogsProto_cast_5flogs_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_chrome_5fos_5fapp_5flist_5flaunch_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ChromeOSAppListLaunchEventProto_chrome_5fos_5fapp_5flist_5flaunch_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_histogram_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HistogramEventProto_histogram_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_memory_5fleak_5freport_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_MemoryLeakReportProto_memory_5fleak_5freport_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_omnibox_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_OmniboxEventProto_omnibox_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_perf_5fdata_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<6> scc_info_PerfDataProto_perf_5fdata_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_printer_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PrinterEventProto_printer_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_reporting_5finfo_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ReportingInfo_reporting_5finfo_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_sampled_5fprofile_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_SampledProfile_sampled_5fprofile_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_structured_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_StructuredEventProto_structured_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_system_5fprofile_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<13> scc_info_SystemProfileProto_system_5fprofile_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_trace_5flog_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TraceLog_trace_5flog_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_translate_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TranslateEventProto_translate_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_user_5faction_5fevent_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_UserActionEventProto_user_5faction_5fevent_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_user_5fdemographics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_UserDemographicsProto_user_5fdemographics_2eproto;
namespace metrics {
class ChromeUserMetricsExtensionDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ChromeUserMetricsExtension> _instance;
} _ChromeUserMetricsExtension_default_instance_;
}  // namespace metrics
static void InitDefaultsscc_info_ChromeUserMetricsExtension_chrome_5fuser_5fmetrics_5fextension_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::metrics::_ChromeUserMetricsExtension_default_instance_;
    new (ptr) ::metrics::ChromeUserMetricsExtension();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::metrics::ChromeUserMetricsExtension::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<16> scc_info_ChromeUserMetricsExtension_chrome_5fuser_5fmetrics_5fextension_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 16, InitDefaultsscc_info_ChromeUserMetricsExtension_chrome_5fuser_5fmetrics_5fextension_2eproto}, {
      &scc_info_SystemProfileProto_system_5fprofile_2eproto.base,
      &scc_info_UserDemographicsProto_user_5fdemographics_2eproto.base,
      &scc_info_UserActionEventProto_user_5faction_5fevent_2eproto.base,
      &scc_info_OmniboxEventProto_omnibox_5fevent_2eproto.base,
      &scc_info_HistogramEventProto_histogram_5fevent_2eproto.base,
      &scc_info_TranslateEventProto_translate_5fevent_2eproto.base,
      &scc_info_PrinterEventProto_printer_5fevent_2eproto.base,
      &scc_info_ChromeOSAppListLaunchEventProto_chrome_5fos_5fapp_5flist_5flaunch_5fevent_2eproto.base,
      &scc_info_StructuredEventProto_structured_5fevent_2eproto.base,
      &scc_info_PerfDataProto_perf_5fdata_2eproto.base,
      &scc_info_SampledProfile_sampled_5fprofile_2eproto.base,
      &scc_info_CastLogsProto_cast_5flogs_2eproto.base,
      &scc_info_MemoryLeakReportProto_memory_5fleak_5freport_2eproto.base,
      &scc_info_CastAssistantLogsProto_cast_5fassistant_5flogs_2eproto.base,
      &scc_info_ReportingInfo_reporting_5finfo_2eproto.base,
      &scc_info_TraceLog_trace_5flog_2eproto.base,}};

namespace metrics {
bool ChromeUserMetricsExtension_Product_IsValid(int value) {
  switch (value) {
    case 0:
    case 20:
    case 25:
    case 35:
    case 56:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ChromeUserMetricsExtension_Product_strings[5] = {};

static const char ChromeUserMetricsExtension_Product_names[] =
  "ANDROID_WEBLAYER"
  "ANDROID_WEBVIEW"
  "CAST"
  "CAST_ASSISTANT"
  "CHROME";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ChromeUserMetricsExtension_Product_entries[] = {
  { {ChromeUserMetricsExtension_Product_names + 0, 16}, 56 },
  { {ChromeUserMetricsExtension_Product_names + 16, 15}, 20 },
  { {ChromeUserMetricsExtension_Product_names + 31, 4}, 35 },
  { {ChromeUserMetricsExtension_Product_names + 35, 14}, 25 },
  { {ChromeUserMetricsExtension_Product_names + 49, 6}, 0 },
};

static const int ChromeUserMetricsExtension_Product_entries_by_number[] = {
  4, // 0 -> CHROME
  1, // 20 -> ANDROID_WEBVIEW
  3, // 25 -> CAST_ASSISTANT
  2, // 35 -> CAST
  0, // 56 -> ANDROID_WEBLAYER
};

const std::string& ChromeUserMetricsExtension_Product_Name(
    ChromeUserMetricsExtension_Product value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          ChromeUserMetricsExtension_Product_entries,
          ChromeUserMetricsExtension_Product_entries_by_number,
          5, ChromeUserMetricsExtension_Product_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      ChromeUserMetricsExtension_Product_entries,
      ChromeUserMetricsExtension_Product_entries_by_number,
      5, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     ChromeUserMetricsExtension_Product_strings[idx].get();
}
bool ChromeUserMetricsExtension_Product_Parse(
    const std::string& name, ChromeUserMetricsExtension_Product* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      ChromeUserMetricsExtension_Product_entries, 5, name, &int_value);
  if (success) {
    *value = static_cast<ChromeUserMetricsExtension_Product>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::CHROME;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::ANDROID_WEBVIEW;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::CAST_ASSISTANT;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::CAST;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::ANDROID_WEBLAYER;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::Product_MIN;
constexpr ChromeUserMetricsExtension_Product ChromeUserMetricsExtension::Product_MAX;
constexpr int ChromeUserMetricsExtension::Product_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)

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

void ChromeUserMetricsExtension::InitAsDefaultInstance() {
  ::metrics::_ChromeUserMetricsExtension_default_instance_._instance.get_mutable()->system_profile_ = const_cast< ::metrics::SystemProfileProto*>(
      ::metrics::SystemProfileProto::internal_default_instance());
  ::metrics::_ChromeUserMetricsExtension_default_instance_._instance.get_mutable()->user_demographics_ = const_cast< ::metrics::UserDemographicsProto*>(
      ::metrics::UserDemographicsProto::internal_default_instance());
  ::metrics::_ChromeUserMetricsExtension_default_instance_._instance.get_mutable()->cast_logs_ = const_cast< ::metrics::CastLogsProto*>(
      ::metrics::CastLogsProto::internal_default_instance());
  ::metrics::_ChromeUserMetricsExtension_default_instance_._instance.get_mutable()->cast_assistant_logs_ = const_cast< ::metrics::CastAssistantLogsProto*>(
      ::metrics::CastAssistantLogsProto::internal_default_instance());
  ::metrics::_ChromeUserMetricsExtension_default_instance_._instance.get_mutable()->reporting_info_ = const_cast< ::metrics::ReportingInfo*>(
      ::metrics::ReportingInfo::internal_default_instance());
}
class ChromeUserMetricsExtension::_Internal {
 public:
  using HasBits = decltype(std::declval<ChromeUserMetricsExtension>()._has_bits_);
  static void set_has_product(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_client_id(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_session_id(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static const ::metrics::SystemProfileProto& system_profile(const ChromeUserMetricsExtension* msg);
  static void set_has_system_profile(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::metrics::UserDemographicsProto& user_demographics(const ChromeUserMetricsExtension* msg);
  static void set_has_user_demographics(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static const ::metrics::CastLogsProto& cast_logs(const ChromeUserMetricsExtension* msg);
  static void set_has_cast_logs(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::metrics::CastAssistantLogsProto& cast_assistant_logs(const ChromeUserMetricsExtension* msg);
  static void set_has_cast_assistant_logs(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::metrics::ReportingInfo& reporting_info(const ChromeUserMetricsExtension* msg);
  static void set_has_reporting_info(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

const ::metrics::SystemProfileProto&
ChromeUserMetricsExtension::_Internal::system_profile(const ChromeUserMetricsExtension* msg) {
  return *msg->system_profile_;
}
const ::metrics::UserDemographicsProto&
ChromeUserMetricsExtension::_Internal::user_demographics(const ChromeUserMetricsExtension* msg) {
  return *msg->user_demographics_;
}
const ::metrics::CastLogsProto&
ChromeUserMetricsExtension::_Internal::cast_logs(const ChromeUserMetricsExtension* msg) {
  return *msg->cast_logs_;
}
const ::metrics::CastAssistantLogsProto&
ChromeUserMetricsExtension::_Internal::cast_assistant_logs(const ChromeUserMetricsExtension* msg) {
  return *msg->cast_assistant_logs_;
}
const ::metrics::ReportingInfo&
ChromeUserMetricsExtension::_Internal::reporting_info(const ChromeUserMetricsExtension* msg) {
  return *msg->reporting_info_;
}
void ChromeUserMetricsExtension::clear_system_profile() {
  if (system_profile_ != nullptr) system_profile_->Clear();
  _has_bits_[0] &= ~0x00000001u;
}
void ChromeUserMetricsExtension::clear_user_demographics() {
  if (user_demographics_ != nullptr) user_demographics_->Clear();
  _has_bits_[0] &= ~0x00000010u;
}
void ChromeUserMetricsExtension::clear_user_action_event() {
  user_action_event_.Clear();
}
void ChromeUserMetricsExtension::clear_omnibox_event() {
  omnibox_event_.Clear();
}
void ChromeUserMetricsExtension::clear_histogram_event() {
  histogram_event_.Clear();
}
void ChromeUserMetricsExtension::clear_translate_event() {
  translate_event_.Clear();
}
void ChromeUserMetricsExtension::clear_printer_event() {
  printer_event_.Clear();
}
void ChromeUserMetricsExtension::clear_chrome_os_app_list_launch_event() {
  chrome_os_app_list_launch_event_.Clear();
}
void ChromeUserMetricsExtension::clear_structured_event() {
  structured_event_.Clear();
}
void ChromeUserMetricsExtension::clear_perf_data() {
  perf_data_.Clear();
}
void ChromeUserMetricsExtension::clear_sampled_profile() {
  sampled_profile_.Clear();
}
void ChromeUserMetricsExtension::clear_cast_logs() {
  if (cast_logs_ != nullptr) cast_logs_->Clear();
  _has_bits_[0] &= ~0x00000002u;
}
void ChromeUserMetricsExtension::clear_memory_leak_report() {
  memory_leak_report_.Clear();
}
void ChromeUserMetricsExtension::clear_cast_assistant_logs() {
  if (cast_assistant_logs_ != nullptr) cast_assistant_logs_->Clear();
  _has_bits_[0] &= ~0x00000004u;
}
void ChromeUserMetricsExtension::clear_reporting_info() {
  if (reporting_info_ != nullptr) reporting_info_->Clear();
  _has_bits_[0] &= ~0x00000008u;
}
void ChromeUserMetricsExtension::clear_trace_log() {
  trace_log_.Clear();
}
ChromeUserMetricsExtension::ChromeUserMetricsExtension()
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:metrics.ChromeUserMetricsExtension)
}
ChromeUserMetricsExtension::ChromeUserMetricsExtension(const ChromeUserMetricsExtension& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_),
      user_action_event_(from.user_action_event_),
      omnibox_event_(from.omnibox_event_),
      histogram_event_(from.histogram_event_),
      perf_data_(from.perf_data_),
      sampled_profile_(from.sampled_profile_),
      memory_leak_report_(from.memory_leak_report_),
      translate_event_(from.translate_event_),
      printer_event_(from.printer_event_),
      trace_log_(from.trace_log_),
      chrome_os_app_list_launch_event_(from.chrome_os_app_list_launch_event_),
      structured_event_(from.structured_event_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from.has_system_profile()) {
    system_profile_ = new ::metrics::SystemProfileProto(*from.system_profile_);
  } else {
    system_profile_ = nullptr;
  }
  if (from.has_cast_logs()) {
    cast_logs_ = new ::metrics::CastLogsProto(*from.cast_logs_);
  } else {
    cast_logs_ = nullptr;
  }
  if (from.has_cast_assistant_logs()) {
    cast_assistant_logs_ = new ::metrics::CastAssistantLogsProto(*from.cast_assistant_logs_);
  } else {
    cast_assistant_logs_ = nullptr;
  }
  if (from.has_reporting_info()) {
    reporting_info_ = new ::metrics::ReportingInfo(*from.reporting_info_);
  } else {
    reporting_info_ = nullptr;
  }
  if (from.has_user_demographics()) {
    user_demographics_ = new ::metrics::UserDemographicsProto(*from.user_demographics_);
  } else {
    user_demographics_ = nullptr;
  }
  ::memcpy(&client_id_, &from.client_id_,
    static_cast<size_t>(reinterpret_cast<char*>(&product_) -
    reinterpret_cast<char*>(&client_id_)) + sizeof(product_));
  // @@protoc_insertion_point(copy_constructor:metrics.ChromeUserMetricsExtension)
}

void ChromeUserMetricsExtension::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ChromeUserMetricsExtension_chrome_5fuser_5fmetrics_5fextension_2eproto.base);
  ::memset(&system_profile_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&product_) -
      reinterpret_cast<char*>(&system_profile_)) + sizeof(product_));
}

ChromeUserMetricsExtension::~ChromeUserMetricsExtension() {
  // @@protoc_insertion_point(destructor:metrics.ChromeUserMetricsExtension)
  SharedDtor();
}

void ChromeUserMetricsExtension::SharedDtor() {
  if (this != internal_default_instance()) delete system_profile_;
  if (this != internal_default_instance()) delete cast_logs_;
  if (this != internal_default_instance()) delete cast_assistant_logs_;
  if (this != internal_default_instance()) delete reporting_info_;
  if (this != internal_default_instance()) delete user_demographics_;
}

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


void ChromeUserMetricsExtension::Clear() {
// @@protoc_insertion_point(message_clear_start:metrics.ChromeUserMetricsExtension)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  user_action_event_.Clear();
  omnibox_event_.Clear();
  histogram_event_.Clear();
  perf_data_.Clear();
  sampled_profile_.Clear();
  memory_leak_report_.Clear();
  translate_event_.Clear();
  printer_event_.Clear();
  trace_log_.Clear();
  chrome_os_app_list_launch_event_.Clear();
  structured_event_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(system_profile_ != nullptr);
      system_profile_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(cast_logs_ != nullptr);
      cast_logs_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(cast_assistant_logs_ != nullptr);
      cast_assistant_logs_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(reporting_info_ != nullptr);
      reporting_info_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      GOOGLE_DCHECK(user_demographics_ != nullptr);
      user_demographics_->Clear();
    }
  }
  if (cached_has_bits & 0x000000e0u) {
    ::memset(&client_id_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&product_) -
        reinterpret_cast<char*>(&client_id_)) + sizeof(product_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* ChromeUserMetricsExtension::_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 fixed64 client_id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 9)) {
          _Internal::set_has_client_id(&has_bits);
          client_id_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint64>(ptr);
          ptr += sizeof(::PROTOBUF_NAMESPACE_ID::uint64);
        } else goto handle_unusual;
        continue;
      // optional int32 session_id = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_session_id(&has_bits);
          session_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .metrics.SystemProfileProto system_profile = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ctx->ParseMessage(mutable_system_profile(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.UserActionEventProto user_action_event = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_user_action_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.OmniboxEventProto omnibox_event = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_omnibox_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 42);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.HistogramEventProto histogram_event = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_histogram_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 50);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.PerfDataProto perf_data = 8 [deprecated = true];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_perf_data(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 66);
        } else goto handle_unusual;
        continue;
      // optional int32 product = 10 [default = 0];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
          _Internal::set_has_product(&has_bits);
          product_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.SampledProfile sampled_profile = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_sampled_profile(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 90);
        } else goto handle_unusual;
        continue;
      // optional .metrics.CastLogsProto cast_logs = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
          ptr = ctx->ParseMessage(mutable_cast_logs(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.MemoryLeakReportProto memory_leak_report = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_memory_leak_report(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 106);
        } else goto handle_unusual;
        continue;
      // optional .metrics.CastAssistantLogsProto cast_assistant_logs = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
          ptr = ctx->ParseMessage(mutable_cast_assistant_logs(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.TranslateEventProto translate_event = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_translate_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 122);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.PrinterEventProto printer_event = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(add_printer_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 386);
        } else goto handle_unusual;
        continue;
      // optional .metrics.ReportingInfo reporting_info = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) {
          ptr = ctx->ParseMessage(mutable_reporting_info(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.TraceLog trace_log = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 154)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(add_trace_log(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 410);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(add_chrome_os_app_list_launch_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 418);
        } else goto handle_unusual;
        continue;
      // optional .metrics.UserDemographicsProto user_demographics = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 170)) {
          ptr = ctx->ParseMessage(mutable_user_demographics(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .metrics.StructuredEventProto structured_event = 22;
      case 22:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 178)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(add_structured_event(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint16>(ptr) == 434);
        } 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 ChromeUserMetricsExtension::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:metrics.ChromeUserMetricsExtension)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional fixed64 client_id = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (9 & 0xFF)) {
          _Internal::set_has_client_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FIXED64>(
                 input, &client_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 session_id = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          _Internal::set_has_session_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
                 input, &session_id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.SystemProfileProto system_profile = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_system_profile()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.UserActionEventProto user_action_event = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_user_action_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.OmniboxEventProto omnibox_event = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_omnibox_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.HistogramEventProto histogram_event = 6;
      case 6: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_histogram_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.PerfDataProto perf_data = 8 [deprecated = true];
      case 8: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_perf_data()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional int32 product = 10 [default = 0];
      case 10: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
          _Internal::set_has_product(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::int32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT32>(
                 input, &product_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.SampledProfile sampled_profile = 11;
      case 11: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (90 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_sampled_profile()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.CastLogsProto cast_logs = 12;
      case 12: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (98 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_cast_logs()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.MemoryLeakReportProto memory_leak_report = 13;
      case 13: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (106 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_memory_leak_report()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.CastAssistantLogsProto cast_assistant_logs = 14;
      case 14: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_cast_assistant_logs()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.TranslateEventProto translate_event = 15;
      case 15: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (122 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_translate_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.PrinterEventProto printer_event = 16;
      case 16: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (130 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_printer_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.ReportingInfo reporting_info = 17;
      case 17: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (138 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_reporting_info()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.TraceLog trace_log = 19;
      case 19: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (154 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_trace_log()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20;
      case 20: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (162 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_chrome_os_app_list_launch_event()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .metrics.UserDemographicsProto user_demographics = 21;
      case 21: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (170 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_user_demographics()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .metrics.StructuredEventProto structured_event = 22;
      case 22: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (178 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_structured_event()));
        } 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:metrics.ChromeUserMetricsExtension)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:metrics.ChromeUserMetricsExtension)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void ChromeUserMetricsExtension::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:metrics.ChromeUserMetricsExtension)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional fixed64 client_id = 1;
  if (cached_has_bits & 0x00000020u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed64(1, this->client_id(), output);
  }

  // optional int32 session_id = 2;
  if (cached_has_bits & 0x00000040u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(2, this->session_id(), output);
  }

  // optional .metrics.SystemProfileProto system_profile = 3;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      3, _Internal::system_profile(this), output);
  }

  // repeated .metrics.UserActionEventProto user_action_event = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->user_action_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      4,
      this->user_action_event(static_cast<int>(i)),
      output);
  }

  // repeated .metrics.OmniboxEventProto omnibox_event = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->omnibox_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      5,
      this->omnibox_event(static_cast<int>(i)),
      output);
  }

  // repeated .metrics.HistogramEventProto histogram_event = 6;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->histogram_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      6,
      this->histogram_event(static_cast<int>(i)),
      output);
  }

  // repeated .metrics.PerfDataProto perf_data = 8 [deprecated = true];
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->perf_data_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      8,
      this->perf_data(static_cast<int>(i)),
      output);
  }

  // optional int32 product = 10 [default = 0];
  if (cached_has_bits & 0x00000080u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32(10, this->product(), output);
  }

  // repeated .metrics.SampledProfile sampled_profile = 11;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->sampled_profile_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      11,
      this->sampled_profile(static_cast<int>(i)),
      output);
  }

  // optional .metrics.CastLogsProto cast_logs = 12;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      12, _Internal::cast_logs(this), output);
  }

  // repeated .metrics.MemoryLeakReportProto memory_leak_report = 13;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->memory_leak_report_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      13,
      this->memory_leak_report(static_cast<int>(i)),
      output);
  }

  // optional .metrics.CastAssistantLogsProto cast_assistant_logs = 14;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      14, _Internal::cast_assistant_logs(this), output);
  }

  // repeated .metrics.TranslateEventProto translate_event = 15;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->translate_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      15,
      this->translate_event(static_cast<int>(i)),
      output);
  }

  // repeated .metrics.PrinterEventProto printer_event = 16;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->printer_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      16,
      this->printer_event(static_cast<int>(i)),
      output);
  }

  // optional .metrics.ReportingInfo reporting_info = 17;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      17, _Internal::reporting_info(this), output);
  }

  // repeated .metrics.TraceLog trace_log = 19;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->trace_log_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      19,
      this->trace_log(static_cast<int>(i)),
      output);
  }

  // repeated .metrics.ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->chrome_os_app_list_launch_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      20,
      this->chrome_os_app_list_launch_event(static_cast<int>(i)),
      output);
  }

  // optional .metrics.UserDemographicsProto user_demographics = 21;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      21, _Internal::user_demographics(this), output);
  }

  // repeated .metrics.StructuredEventProto structured_event = 22;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->structured_event_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessage(
      22,
      this->structured_event(static_cast<int>(i)),
      output);
  }

  output->WriteRaw(_internal_metadata_.unknown_fields().data(),
                   static_cast<int>(_internal_metadata_.unknown_fields().size()));
  // @@protoc_insertion_point(serialize_end:metrics.ChromeUserMetricsExtension)
}

size_t ChromeUserMetricsExtension::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:metrics.ChromeUserMetricsExtension)
  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;

  // repeated .metrics.UserActionEventProto user_action_event = 4;
  {
    unsigned int count = static_cast<unsigned int>(this->user_action_event_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->user_action_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.OmniboxEventProto omnibox_event = 5;
  {
    unsigned int count = static_cast<unsigned int>(this->omnibox_event_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->omnibox_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.HistogramEventProto histogram_event = 6;
  {
    unsigned int count = static_cast<unsigned int>(this->histogram_event_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->histogram_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.PerfDataProto perf_data = 8 [deprecated = true];
  {
    unsigned int count = static_cast<unsigned int>(this->perf_data_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->perf_data(static_cast<int>(i)));
    }
  }

  // repeated .metrics.SampledProfile sampled_profile = 11;
  {
    unsigned int count = static_cast<unsigned int>(this->sampled_profile_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->sampled_profile(static_cast<int>(i)));
    }
  }

  // repeated .metrics.MemoryLeakReportProto memory_leak_report = 13;
  {
    unsigned int count = static_cast<unsigned int>(this->memory_leak_report_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->memory_leak_report(static_cast<int>(i)));
    }
  }

  // repeated .metrics.TranslateEventProto translate_event = 15;
  {
    unsigned int count = static_cast<unsigned int>(this->translate_event_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->translate_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.PrinterEventProto printer_event = 16;
  {
    unsigned int count = static_cast<unsigned int>(this->printer_event_size());
    total_size += 2UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->printer_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.TraceLog trace_log = 19;
  {
    unsigned int count = static_cast<unsigned int>(this->trace_log_size());
    total_size += 2UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->trace_log(static_cast<int>(i)));
    }
  }

  // repeated .metrics.ChromeOSAppListLaunchEventProto chrome_os_app_list_launch_event = 20;
  {
    unsigned int count = static_cast<unsigned int>(this->chrome_os_app_list_launch_event_size());
    total_size += 2UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->chrome_os_app_list_launch_event(static_cast<int>(i)));
    }
  }

  // repeated .metrics.StructuredEventProto structured_event = 22;
  {
    unsigned int count = static_cast<unsigned int>(this->structured_event_size());
    total_size += 2UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->structured_event(static_cast<int>(i)));
    }
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional .metrics.SystemProfileProto system_profile = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *system_profile_);
    }

    // optional .metrics.CastLogsProto cast_logs = 12;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *cast_logs_);
    }

    // optional .metrics.CastAssistantLogsProto cast_assistant_logs = 14;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *cast_assistant_logs_);
    }

    // optional .metrics.ReportingInfo reporting_info = 17;
    if (cached_has_bits & 0x00000008u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *reporting_info_);
    }

    // optional .metrics.UserDemographicsProto user_demographics = 21;
    if (cached_has_bits & 0x00000010u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *user_demographics_);
    }

    // optional fixed64 client_id = 1;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 + 8;
    }

    // optional int32 session_id = 2;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->session_id());
    }

    // optional int32 product = 10 [default = 0];
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->product());
    }

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

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

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

  user_action_event_.MergeFrom(from.user_action_event_);
  omnibox_event_.MergeFrom(from.omnibox_event_);
  histogram_event_.MergeFrom(from.histogram_event_);
  perf_data_.MergeFrom(from.perf_data_);
  sampled_profile_.MergeFrom(from.sampled_profile_);
  memory_leak_report_.MergeFrom(from.memory_leak_report_);
  translate_event_.MergeFrom(from.translate_event_);
  printer_event_.MergeFrom(from.printer_event_);
  trace_log_.MergeFrom(from.trace_log_);
  chrome_os_app_list_launch_event_.MergeFrom(from.chrome_os_app_list_launch_event_);
  structured_event_.MergeFrom(from.structured_event_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      mutable_system_profile()->::metrics::SystemProfileProto::MergeFrom(from.system_profile());
    }
    if (cached_has_bits & 0x00000002u) {
      mutable_cast_logs()->::metrics::CastLogsProto::MergeFrom(from.cast_logs());
    }
    if (cached_has_bits & 0x00000004u) {
      mutable_cast_assistant_logs()->::metrics::CastAssistantLogsProto::MergeFrom(from.cast_assistant_logs());
    }
    if (cached_has_bits & 0x00000008u) {
      mutable_reporting_info()->::metrics::ReportingInfo::MergeFrom(from.reporting_info());
    }
    if (cached_has_bits & 0x00000010u) {
      mutable_user_demographics()->::metrics::UserDemographicsProto::MergeFrom(from.user_demographics());
    }
    if (cached_has_bits & 0x00000020u) {
      client_id_ = from.client_id_;
    }
    if (cached_has_bits & 0x00000040u) {
      session_id_ = from.session_id_;
    }
    if (cached_has_bits & 0x00000080u) {
      product_ = from.product_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

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

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

void ChromeUserMetricsExtension::InternalSwap(ChromeUserMetricsExtension* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  CastToBase(&user_action_event_)->InternalSwap(CastToBase(&other->user_action_event_));
  CastToBase(&omnibox_event_)->InternalSwap(CastToBase(&other->omnibox_event_));
  CastToBase(&histogram_event_)->InternalSwap(CastToBase(&other->histogram_event_));
  CastToBase(&perf_data_)->InternalSwap(CastToBase(&other->perf_data_));
  CastToBase(&sampled_profile_)->InternalSwap(CastToBase(&other->sampled_profile_));
  CastToBase(&memory_leak_report_)->InternalSwap(CastToBase(&other->memory_leak_report_));
  CastToBase(&translate_event_)->InternalSwap(CastToBase(&other->translate_event_));
  CastToBase(&printer_event_)->InternalSwap(CastToBase(&other->printer_event_));
  CastToBase(&trace_log_)->InternalSwap(CastToBase(&other->trace_log_));
  CastToBase(&chrome_os_app_list_launch_event_)->InternalSwap(CastToBase(&other->chrome_os_app_list_launch_event_));
  CastToBase(&structured_event_)->InternalSwap(CastToBase(&other->structured_event_));
  swap(system_profile_, other->system_profile_);
  swap(cast_logs_, other->cast_logs_);
  swap(cast_assistant_logs_, other->cast_assistant_logs_);
  swap(reporting_info_, other->reporting_info_);
  swap(user_demographics_, other->user_demographics_);
  swap(client_id_, other->client_id_);
  swap(session_id_, other->session_id_);
  swap(product_, other->product_);
}

std::string ChromeUserMetricsExtension::GetTypeName() const {
  return "metrics.ChromeUserMetricsExtension";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace metrics
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::metrics::ChromeUserMetricsExtension* Arena::CreateMaybeMessage< ::metrics::ChromeUserMetricsExtension >(Arena* arena) {
  return Arena::CreateInternal< ::metrics::ChromeUserMetricsExtension >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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