1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /******************************************************************************* 18 * AUTOGENERATED - DO NOT EDIT 19 ******************************************************************************* 20 * This file has been generated from the protobuf message 21 * perfetto/config/chrome/chrome_config.proto 22 * by 23 * ../../tools/proto_to_cpp/proto_to_cpp.cc. 24 * If you need to make changes here, change the .proto file and then run 25 * ./tools/gen_tracing_cpp_headers_from_protos 26 */ 27 28 #include "perfetto/tracing/core/chrome_config.h" 29 30 #include "perfetto/config/chrome/chrome_config.pb.h" 31 32 namespace perfetto { 33 34 ChromeConfig::ChromeConfig() = default; 35 ChromeConfig::~ChromeConfig() = default; 36 ChromeConfig::ChromeConfig(const ChromeConfig&) = default; 37 ChromeConfig& ChromeConfig::operator=(const ChromeConfig&) = default; 38 ChromeConfig::ChromeConfig(ChromeConfig&&) noexcept = default; 39 ChromeConfig& ChromeConfig::operator=(ChromeConfig&&) = default; 40 41 #pragma GCC diagnostic push 42 #pragma GCC diagnostic ignored "-Wfloat-equal" operator ==(const ChromeConfig & other) const43bool ChromeConfig::operator==(const ChromeConfig& other) const { 44 return (trace_config_ == other.trace_config_) && 45 (privacy_filtering_enabled_ == other.privacy_filtering_enabled_); 46 } 47 #pragma GCC diagnostic pop 48 FromProto(const perfetto::protos::ChromeConfig & proto)49void ChromeConfig::FromProto(const perfetto::protos::ChromeConfig& proto) { 50 static_assert(sizeof(trace_config_) == sizeof(proto.trace_config()), 51 "size mismatch"); 52 trace_config_ = static_cast<decltype(trace_config_)>(proto.trace_config()); 53 54 static_assert(sizeof(privacy_filtering_enabled_) == 55 sizeof(proto.privacy_filtering_enabled()), 56 "size mismatch"); 57 privacy_filtering_enabled_ = 58 static_cast<decltype(privacy_filtering_enabled_)>( 59 proto.privacy_filtering_enabled()); 60 unknown_fields_ = proto.unknown_fields(); 61 } 62 ToProto(perfetto::protos::ChromeConfig * proto) const63void ChromeConfig::ToProto(perfetto::protos::ChromeConfig* proto) const { 64 proto->Clear(); 65 66 static_assert(sizeof(trace_config_) == sizeof(proto->trace_config()), 67 "size mismatch"); 68 proto->set_trace_config( 69 static_cast<decltype(proto->trace_config())>(trace_config_)); 70 71 static_assert(sizeof(privacy_filtering_enabled_) == 72 sizeof(proto->privacy_filtering_enabled()), 73 "size mismatch"); 74 proto->set_privacy_filtering_enabled( 75 static_cast<decltype(proto->privacy_filtering_enabled())>( 76 privacy_filtering_enabled_)); 77 *(proto->mutable_unknown_fields()) = unknown_fields_; 78 } 79 80 } // namespace perfetto 81