Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
3 #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
4 #include "csd.pb.h"
6 #include <algorithm>
8 #include <google/protobuf/stubs/once.h>
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/wire_format_lite_inl.h>
11 // @@protoc_insertion_point(includes)
13 namespace safe_browsing {
15 void protobuf_ShutdownFile_csd_2eproto() {
16 delete ClientPhishingRequest::default_instance_;
17 delete ClientPhishingRequest_Feature::default_instance_;
18 delete ClientPhishingResponse::default_instance_;
19 delete ClientMalwareRequest::default_instance_;
20 delete ClientMalwareRequest_Feature::default_instance_;
21 delete ClientMalwareResponse::default_instance_;
22 delete ClientDownloadRequest::default_instance_;
23 delete ClientDownloadRequest_Digests::default_instance_;
24 delete ClientDownloadRequest_Resource::default_instance_;
25 delete ClientDownloadRequest_CertificateChain::default_instance_;
26 delete ClientDownloadRequest_CertificateChain_Element::default_instance_;
27 delete ClientDownloadRequest_SignatureInfo::default_instance_;
28 delete ClientDownloadResponse::default_instance_;
29 delete ClientDownloadResponse_MoreInfo::default_instance_;
30 delete ClientDownloadReport::default_instance_;
31 delete ClientDownloadReport_UserInformation::default_instance_;
32 delete ClientUploadResponse::default_instance_;
33 }
35 void protobuf_AddDesc_csd_2eproto() {
36 static bool already_here = false;
37 if (already_here) return;
38 already_here = true;
39 GOOGLE_PROTOBUF_VERIFY_VERSION;
41 ClientPhishingRequest::default_instance_ = new ClientPhishingRequest();
42 ClientPhishingRequest_Feature::default_instance_ = new ClientPhishingRequest_Feature();
43 ClientPhishingResponse::default_instance_ = new ClientPhishingResponse();
44 ClientMalwareRequest::default_instance_ = new ClientMalwareRequest();
45 ClientMalwareRequest_Feature::default_instance_ = new ClientMalwareRequest_Feature();
46 ClientMalwareResponse::default_instance_ = new ClientMalwareResponse();
47 ClientDownloadRequest::default_instance_ = new ClientDownloadRequest();
48 ClientDownloadRequest_Digests::default_instance_ = new ClientDownloadRequest_Digests();
49 ClientDownloadRequest_Resource::default_instance_ = new ClientDownloadRequest_Resource();
50 ClientDownloadRequest_CertificateChain::default_instance_ = new ClientDownloadRequest_CertificateChain();
51 ClientDownloadRequest_CertificateChain_Element::default_instance_ = new ClientDownloadRequest_CertificateChain_Element();
52 ClientDownloadRequest_SignatureInfo::default_instance_ = new ClientDownloadRequest_SignatureInfo();
53 ClientDownloadResponse::default_instance_ = new ClientDownloadResponse();
54 ClientDownloadResponse_MoreInfo::default_instance_ = new ClientDownloadResponse_MoreInfo();
55 ClientDownloadReport::default_instance_ = new ClientDownloadReport();
56 ClientDownloadReport_UserInformation::default_instance_ = new ClientDownloadReport_UserInformation();
57 ClientUploadResponse::default_instance_ = new ClientUploadResponse();
58 ClientPhishingRequest::default_instance_->InitAsDefaultInstance();
59 ClientPhishingRequest_Feature::default_instance_->InitAsDefaultInstance();
60 ClientPhishingResponse::default_instance_->InitAsDefaultInstance();
61 ClientMalwareRequest::default_instance_->InitAsDefaultInstance();
62 ClientMalwareRequest_Feature::default_instance_->InitAsDefaultInstance();
63 ClientMalwareResponse::default_instance_->InitAsDefaultInstance();
64 ClientDownloadRequest::default_instance_->InitAsDefaultInstance();
65 ClientDownloadRequest_Digests::default_instance_->InitAsDefaultInstance();
66 ClientDownloadRequest_Resource::default_instance_->InitAsDefaultInstance();
67 ClientDownloadRequest_CertificateChain::default_instance_->InitAsDefaultInstance();
68 ClientDownloadRequest_CertificateChain_Element::default_instance_->InitAsDefaultInstance();
69 ClientDownloadRequest_SignatureInfo::default_instance_->InitAsDefaultInstance();
70 ClientDownloadResponse::default_instance_->InitAsDefaultInstance();
71 ClientDownloadResponse_MoreInfo::default_instance_->InitAsDefaultInstance();
72 ClientDownloadReport::default_instance_->InitAsDefaultInstance();
73 ClientDownloadReport_UserInformation::default_instance_->InitAsDefaultInstance();
74 ClientUploadResponse::default_instance_->InitAsDefaultInstance();
75 ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_csd_2eproto);
76 }
78 // Force AddDescriptors() to be called at static initialization time.
79 struct StaticDescriptorInitializer_csd_2eproto {
80 StaticDescriptorInitializer_csd_2eproto() {
81 protobuf_AddDesc_csd_2eproto();
82 }
83 } static_descriptor_initializer_csd_2eproto_;
86 // ===================================================================
88 #ifndef _MSC_VER
89 const int ClientPhishingRequest_Feature::kNameFieldNumber;
90 const int ClientPhishingRequest_Feature::kValueFieldNumber;
91 #endif // !_MSC_VER
93 ClientPhishingRequest_Feature::ClientPhishingRequest_Feature()
94 : ::google::protobuf::MessageLite() {
95 SharedCtor();
96 }
98 void ClientPhishingRequest_Feature::InitAsDefaultInstance() {
99 }
101 ClientPhishingRequest_Feature::ClientPhishingRequest_Feature(const ClientPhishingRequest_Feature& from)
102 : ::google::protobuf::MessageLite() {
103 SharedCtor();
104 MergeFrom(from);
105 }
107 void ClientPhishingRequest_Feature::SharedCtor() {
108 _cached_size_ = 0;
109 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
110 value_ = 0;
111 ::memset(_has_bits_, 0, sizeof(_has_bits_));
112 }
114 ClientPhishingRequest_Feature::~ClientPhishingRequest_Feature() {
115 SharedDtor();
116 }
118 void ClientPhishingRequest_Feature::SharedDtor() {
119 if (name_ != &::google::protobuf::internal::kEmptyString) {
120 delete name_;
121 }
122 if (this != default_instance_) {
123 }
124 }
126 void ClientPhishingRequest_Feature::SetCachedSize(int size) const {
127 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
128 _cached_size_ = size;
129 GOOGLE_SAFE_CONCURRENT_WRITES_END();
130 }
131 const ClientPhishingRequest_Feature& ClientPhishingRequest_Feature::default_instance() {
132 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
133 }
135 ClientPhishingRequest_Feature* ClientPhishingRequest_Feature::default_instance_ = NULL;
137 ClientPhishingRequest_Feature* ClientPhishingRequest_Feature::New() const {
138 return new ClientPhishingRequest_Feature;
139 }
141 void ClientPhishingRequest_Feature::Clear() {
142 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
143 if (has_name()) {
144 if (name_ != &::google::protobuf::internal::kEmptyString) {
145 name_->clear();
146 }
147 }
148 value_ = 0;
149 }
150 ::memset(_has_bits_, 0, sizeof(_has_bits_));
151 }
153 bool ClientPhishingRequest_Feature::MergePartialFromCodedStream(
154 ::google::protobuf::io::CodedInputStream* input) {
155 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
156 ::google::protobuf::uint32 tag;
157 while ((tag = input->ReadTag()) != 0) {
158 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
159 // required string name = 1;
160 case 1: {
161 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
162 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
163 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
164 input, this->mutable_name()));
165 } else {
166 goto handle_uninterpreted;
167 }
168 if (input->ExpectTag(17)) goto parse_value;
169 break;
170 }
172 // required double value = 2;
173 case 2: {
174 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
175 ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
176 parse_value:
177 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
178 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
179 input, &value_)));
180 set_has_value();
181 } else {
182 goto handle_uninterpreted;
183 }
184 if (input->ExpectAtEnd()) return true;
185 break;
186 }
188 default: {
189 handle_uninterpreted:
190 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
191 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
192 return true;
193 }
194 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
195 break;
196 }
197 }
198 }
199 return true;
200 #undef DO_
201 }
203 void ClientPhishingRequest_Feature::SerializeWithCachedSizes(
204 ::google::protobuf::io::CodedOutputStream* output) const {
205 // required string name = 1;
206 if (has_name()) {
207 ::google::protobuf::internal::WireFormatLite::WriteString(
208 1, this->name(), output);
209 }
211 // required double value = 2;
212 if (has_value()) {
213 ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output);
214 }
216 }
218 int ClientPhishingRequest_Feature::ByteSize() const {
219 int total_size = 0;
221 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
222 // required string name = 1;
223 if (has_name()) {
224 total_size += 1 +
225 ::google::protobuf::internal::WireFormatLite::StringSize(
226 this->name());
227 }
229 // required double value = 2;
230 if (has_value()) {
231 total_size += 1 + 8;
232 }
234 }
235 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
236 _cached_size_ = total_size;
237 GOOGLE_SAFE_CONCURRENT_WRITES_END();
238 return total_size;
239 }
241 void ClientPhishingRequest_Feature::CheckTypeAndMergeFrom(
242 const ::google::protobuf::MessageLite& from) {
243 MergeFrom(*::google::protobuf::down_cast<const ClientPhishingRequest_Feature*>(&from));
244 }
246 void ClientPhishingRequest_Feature::MergeFrom(const ClientPhishingRequest_Feature& from) {
247 GOOGLE_CHECK_NE(&from, this);
248 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
249 if (from.has_name()) {
250 set_name(from.name());
251 }
252 if (from.has_value()) {
253 set_value(from.value());
254 }
255 }
256 }
258 void ClientPhishingRequest_Feature::CopyFrom(const ClientPhishingRequest_Feature& from) {
259 if (&from == this) return;
260 Clear();
261 MergeFrom(from);
262 }
264 bool ClientPhishingRequest_Feature::IsInitialized() const {
265 if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
267 return true;
268 }
270 void ClientPhishingRequest_Feature::Swap(ClientPhishingRequest_Feature* other) {
271 if (other != this) {
272 std::swap(name_, other->name_);
273 std::swap(value_, other->value_);
274 std::swap(_has_bits_[0], other->_has_bits_[0]);
275 std::swap(_cached_size_, other->_cached_size_);
276 }
277 }
279 ::std::string ClientPhishingRequest_Feature::GetTypeName() const {
280 return "safe_browsing.ClientPhishingRequest.Feature";
281 }
284 // -------------------------------------------------------------------
286 #ifndef _MSC_VER
287 const int ClientPhishingRequest::kUrlFieldNumber;
288 const int ClientPhishingRequest::kOBSOLETEHashPrefixFieldNumber;
289 const int ClientPhishingRequest::kClientScoreFieldNumber;
290 const int ClientPhishingRequest::kIsPhishingFieldNumber;
291 const int ClientPhishingRequest::kFeatureMapFieldNumber;
292 const int ClientPhishingRequest::kModelVersionFieldNumber;
293 const int ClientPhishingRequest::kNonModelFeatureMapFieldNumber;
294 const int ClientPhishingRequest::kOBSOLETEReferrerUrlFieldNumber;
295 #endif // !_MSC_VER
297 ClientPhishingRequest::ClientPhishingRequest()
298 : ::google::protobuf::MessageLite() {
299 SharedCtor();
300 }
302 void ClientPhishingRequest::InitAsDefaultInstance() {
303 }
305 ClientPhishingRequest::ClientPhishingRequest(const ClientPhishingRequest& from)
306 : ::google::protobuf::MessageLite() {
307 SharedCtor();
308 MergeFrom(from);
309 }
311 void ClientPhishingRequest::SharedCtor() {
312 _cached_size_ = 0;
313 url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
314 obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
315 client_score_ = 0;
316 is_phishing_ = false;
317 model_version_ = 0;
318 obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
319 ::memset(_has_bits_, 0, sizeof(_has_bits_));
320 }
322 ClientPhishingRequest::~ClientPhishingRequest() {
323 SharedDtor();
324 }
326 void ClientPhishingRequest::SharedDtor() {
327 if (url_ != &::google::protobuf::internal::kEmptyString) {
328 delete url_;
329 }
330 if (obsolete_hash_prefix_ != &::google::protobuf::internal::kEmptyString) {
331 delete obsolete_hash_prefix_;
332 }
333 if (obsolete_referrer_url_ != &::google::protobuf::internal::kEmptyString) {
334 delete obsolete_referrer_url_;
335 }
336 if (this != default_instance_) {
337 }
338 }
340 void ClientPhishingRequest::SetCachedSize(int size) const {
341 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
342 _cached_size_ = size;
343 GOOGLE_SAFE_CONCURRENT_WRITES_END();
344 }
345 const ClientPhishingRequest& ClientPhishingRequest::default_instance() {
346 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
347 }
349 ClientPhishingRequest* ClientPhishingRequest::default_instance_ = NULL;
351 ClientPhishingRequest* ClientPhishingRequest::New() const {
352 return new ClientPhishingRequest;
353 }
355 void ClientPhishingRequest::Clear() {
356 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
357 if (has_url()) {
358 if (url_ != &::google::protobuf::internal::kEmptyString) {
359 url_->clear();
360 }
361 }
362 if (has_obsolete_hash_prefix()) {
363 if (obsolete_hash_prefix_ != &::google::protobuf::internal::kEmptyString) {
364 obsolete_hash_prefix_->clear();
365 }
366 }
367 client_score_ = 0;
368 is_phishing_ = false;
369 model_version_ = 0;
370 if (has_obsolete_referrer_url()) {
371 if (obsolete_referrer_url_ != &::google::protobuf::internal::kEmptyString) {
372 obsolete_referrer_url_->clear();
373 }
374 }
375 }
376 feature_map_.Clear();
377 non_model_feature_map_.Clear();
378 ::memset(_has_bits_, 0, sizeof(_has_bits_));
379 }
381 bool ClientPhishingRequest::MergePartialFromCodedStream(
382 ::google::protobuf::io::CodedInputStream* input) {
383 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
384 ::google::protobuf::uint32 tag;
385 while ((tag = input->ReadTag()) != 0) {
386 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
387 // optional string url = 1;
388 case 1: {
389 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
390 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
391 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
392 input, this->mutable_url()));
393 } else {
394 goto handle_uninterpreted;
395 }
396 if (input->ExpectTag(21)) goto parse_client_score;
397 break;
398 }
400 // required float client_score = 2;
401 case 2: {
402 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
403 ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
404 parse_client_score:
405 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
406 float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
407 input, &client_score_)));
408 set_has_client_score();
409 } else {
410 goto handle_uninterpreted;
411 }
412 if (input->ExpectTag(32)) goto parse_is_phishing;
413 break;
414 }
416 // optional bool is_phishing = 4;
417 case 4: {
418 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
419 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
420 parse_is_phishing:
421 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
422 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
423 input, &is_phishing_)));
424 set_has_is_phishing();
425 } else {
426 goto handle_uninterpreted;
427 }
428 if (input->ExpectTag(42)) goto parse_feature_map;
429 break;
430 }
432 // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5;
433 case 5: {
434 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
435 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
436 parse_feature_map:
437 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
438 input, add_feature_map()));
439 } else {
440 goto handle_uninterpreted;
441 }
442 if (input->ExpectTag(42)) goto parse_feature_map;
443 if (input->ExpectTag(48)) goto parse_model_version;
444 break;
445 }
447 // optional int32 model_version = 6;
448 case 6: {
449 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
450 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
451 parse_model_version:
452 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
453 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
454 input, &model_version_)));
455 set_has_model_version();
456 } else {
457 goto handle_uninterpreted;
458 }
459 if (input->ExpectTag(66)) goto parse_non_model_feature_map;
460 break;
461 }
463 // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8;
464 case 8: {
465 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
466 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
467 parse_non_model_feature_map:
468 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
469 input, add_non_model_feature_map()));
470 } else {
471 goto handle_uninterpreted;
472 }
473 if (input->ExpectTag(66)) goto parse_non_model_feature_map;
474 if (input->ExpectTag(74)) goto parse_OBSOLETE_referrer_url;
475 break;
476 }
478 // optional string OBSOLETE_referrer_url = 9;
479 case 9: {
480 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
481 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
482 parse_OBSOLETE_referrer_url:
483 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
484 input, this->mutable_obsolete_referrer_url()));
485 } else {
486 goto handle_uninterpreted;
487 }
488 if (input->ExpectTag(82)) goto parse_OBSOLETE_hash_prefix;
489 break;
490 }
492 // optional bytes OBSOLETE_hash_prefix = 10;
493 case 10: {
494 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
495 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
496 parse_OBSOLETE_hash_prefix:
497 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
498 input, this->mutable_obsolete_hash_prefix()));
499 } else {
500 goto handle_uninterpreted;
501 }
502 if (input->ExpectAtEnd()) return true;
503 break;
504 }
506 default: {
507 handle_uninterpreted:
508 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
509 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
510 return true;
511 }
512 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
513 break;
514 }
515 }
516 }
517 return true;
518 #undef DO_
519 }
521 void ClientPhishingRequest::SerializeWithCachedSizes(
522 ::google::protobuf::io::CodedOutputStream* output) const {
523 // optional string url = 1;
524 if (has_url()) {
525 ::google::protobuf::internal::WireFormatLite::WriteString(
526 1, this->url(), output);
527 }
529 // required float client_score = 2;
530 if (has_client_score()) {
531 ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->client_score(), output);
532 }
534 // optional bool is_phishing = 4;
535 if (has_is_phishing()) {
536 ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->is_phishing(), output);
537 }
539 // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5;
540 for (int i = 0; i < this->feature_map_size(); i++) {
541 ::google::protobuf::internal::WireFormatLite::WriteMessage(
542 5, this->feature_map(i), output);
543 }
545 // optional int32 model_version = 6;
546 if (has_model_version()) {
547 ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->model_version(), output);
548 }
550 // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8;
551 for (int i = 0; i < this->non_model_feature_map_size(); i++) {
552 ::google::protobuf::internal::WireFormatLite::WriteMessage(
553 8, this->non_model_feature_map(i), output);
554 }
556 // optional string OBSOLETE_referrer_url = 9;
557 if (has_obsolete_referrer_url()) {
558 ::google::protobuf::internal::WireFormatLite::WriteString(
559 9, this->obsolete_referrer_url(), output);
560 }
562 // optional bytes OBSOLETE_hash_prefix = 10;
563 if (has_obsolete_hash_prefix()) {
564 ::google::protobuf::internal::WireFormatLite::WriteBytes(
565 10, this->obsolete_hash_prefix(), output);
566 }
568 }
570 int ClientPhishingRequest::ByteSize() const {
571 int total_size = 0;
573 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
574 // optional string url = 1;
575 if (has_url()) {
576 total_size += 1 +
577 ::google::protobuf::internal::WireFormatLite::StringSize(
578 this->url());
579 }
581 // optional bytes OBSOLETE_hash_prefix = 10;
582 if (has_obsolete_hash_prefix()) {
583 total_size += 1 +
584 ::google::protobuf::internal::WireFormatLite::BytesSize(
585 this->obsolete_hash_prefix());
586 }
588 // required float client_score = 2;
589 if (has_client_score()) {
590 total_size += 1 + 4;
591 }
593 // optional bool is_phishing = 4;
594 if (has_is_phishing()) {
595 total_size += 1 + 1;
596 }
598 // optional int32 model_version = 6;
599 if (has_model_version()) {
600 total_size += 1 +
601 ::google::protobuf::internal::WireFormatLite::Int32Size(
602 this->model_version());
603 }
605 // optional string OBSOLETE_referrer_url = 9;
606 if (has_obsolete_referrer_url()) {
607 total_size += 1 +
608 ::google::protobuf::internal::WireFormatLite::StringSize(
609 this->obsolete_referrer_url());
610 }
612 }
613 // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5;
614 total_size += 1 * this->feature_map_size();
615 for (int i = 0; i < this->feature_map_size(); i++) {
616 total_size +=
617 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
618 this->feature_map(i));
619 }
621 // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8;
622 total_size += 1 * this->non_model_feature_map_size();
623 for (int i = 0; i < this->non_model_feature_map_size(); i++) {
624 total_size +=
625 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
626 this->non_model_feature_map(i));
627 }
629 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
630 _cached_size_ = total_size;
631 GOOGLE_SAFE_CONCURRENT_WRITES_END();
632 return total_size;
633 }
635 void ClientPhishingRequest::CheckTypeAndMergeFrom(
636 const ::google::protobuf::MessageLite& from) {
637 MergeFrom(*::google::protobuf::down_cast<const ClientPhishingRequest*>(&from));
638 }
640 void ClientPhishingRequest::MergeFrom(const ClientPhishingRequest& from) {
641 GOOGLE_CHECK_NE(&from, this);
642 feature_map_.MergeFrom(from.feature_map_);
643 non_model_feature_map_.MergeFrom(from.non_model_feature_map_);
644 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
645 if (from.has_url()) {
646 set_url(from.url());
647 }
648 if (from.has_obsolete_hash_prefix()) {
649 set_obsolete_hash_prefix(from.obsolete_hash_prefix());
650 }
651 if (from.has_client_score()) {
652 set_client_score(from.client_score());
653 }
654 if (from.has_is_phishing()) {
655 set_is_phishing(from.is_phishing());
656 }
657 if (from.has_model_version()) {
658 set_model_version(from.model_version());
659 }
660 if (from.has_obsolete_referrer_url()) {
661 set_obsolete_referrer_url(from.obsolete_referrer_url());
662 }
663 }
664 }
666 void ClientPhishingRequest::CopyFrom(const ClientPhishingRequest& from) {
667 if (&from == this) return;
668 Clear();
669 MergeFrom(from);
670 }
672 bool ClientPhishingRequest::IsInitialized() const {
673 if ((_has_bits_[0] & 0x00000004) != 0x00000004) return false;
675 for (int i = 0; i < feature_map_size(); i++) {
676 if (!this->feature_map(i).IsInitialized()) return false;
677 }
678 for (int i = 0; i < non_model_feature_map_size(); i++) {
679 if (!this->non_model_feature_map(i).IsInitialized()) return false;
680 }
681 return true;
682 }
684 void ClientPhishingRequest::Swap(ClientPhishingRequest* other) {
685 if (other != this) {
686 std::swap(url_, other->url_);
687 std::swap(obsolete_hash_prefix_, other->obsolete_hash_prefix_);
688 std::swap(client_score_, other->client_score_);
689 std::swap(is_phishing_, other->is_phishing_);
690 feature_map_.Swap(&other->feature_map_);
691 std::swap(model_version_, other->model_version_);
692 non_model_feature_map_.Swap(&other->non_model_feature_map_);
693 std::swap(obsolete_referrer_url_, other->obsolete_referrer_url_);
694 std::swap(_has_bits_[0], other->_has_bits_[0]);
695 std::swap(_cached_size_, other->_cached_size_);
696 }
697 }
699 ::std::string ClientPhishingRequest::GetTypeName() const {
700 return "safe_browsing.ClientPhishingRequest";
701 }
704 // ===================================================================
706 #ifndef _MSC_VER
707 const int ClientPhishingResponse::kPhishyFieldNumber;
708 const int ClientPhishingResponse::kOBSOLETEWhitelistExpressionFieldNumber;
709 #endif // !_MSC_VER
711 ClientPhishingResponse::ClientPhishingResponse()
712 : ::google::protobuf::MessageLite() {
713 SharedCtor();
714 }
716 void ClientPhishingResponse::InitAsDefaultInstance() {
717 }
719 ClientPhishingResponse::ClientPhishingResponse(const ClientPhishingResponse& from)
720 : ::google::protobuf::MessageLite() {
721 SharedCtor();
722 MergeFrom(from);
723 }
725 void ClientPhishingResponse::SharedCtor() {
726 _cached_size_ = 0;
727 phishy_ = false;
728 ::memset(_has_bits_, 0, sizeof(_has_bits_));
729 }
731 ClientPhishingResponse::~ClientPhishingResponse() {
732 SharedDtor();
733 }
735 void ClientPhishingResponse::SharedDtor() {
736 if (this != default_instance_) {
737 }
738 }
740 void ClientPhishingResponse::SetCachedSize(int size) const {
741 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
742 _cached_size_ = size;
743 GOOGLE_SAFE_CONCURRENT_WRITES_END();
744 }
745 const ClientPhishingResponse& ClientPhishingResponse::default_instance() {
746 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
747 }
749 ClientPhishingResponse* ClientPhishingResponse::default_instance_ = NULL;
751 ClientPhishingResponse* ClientPhishingResponse::New() const {
752 return new ClientPhishingResponse;
753 }
755 void ClientPhishingResponse::Clear() {
756 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
757 phishy_ = false;
758 }
759 obsolete_whitelist_expression_.Clear();
760 ::memset(_has_bits_, 0, sizeof(_has_bits_));
761 }
763 bool ClientPhishingResponse::MergePartialFromCodedStream(
764 ::google::protobuf::io::CodedInputStream* input) {
765 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
766 ::google::protobuf::uint32 tag;
767 while ((tag = input->ReadTag()) != 0) {
768 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
769 // required bool phishy = 1;
770 case 1: {
771 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
772 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
773 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
774 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
775 input, &phishy_)));
776 set_has_phishy();
777 } else {
778 goto handle_uninterpreted;
779 }
780 if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression;
781 break;
782 }
784 // repeated string OBSOLETE_whitelist_expression = 2;
785 case 2: {
786 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
787 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
788 parse_OBSOLETE_whitelist_expression:
789 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
790 input, this->add_obsolete_whitelist_expression()));
791 } else {
792 goto handle_uninterpreted;
793 }
794 if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression;
795 if (input->ExpectAtEnd()) return true;
796 break;
797 }
799 default: {
800 handle_uninterpreted:
801 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
802 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
803 return true;
804 }
805 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
806 break;
807 }
808 }
809 }
810 return true;
811 #undef DO_
812 }
814 void ClientPhishingResponse::SerializeWithCachedSizes(
815 ::google::protobuf::io::CodedOutputStream* output) const {
816 // required bool phishy = 1;
817 if (has_phishy()) {
818 ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->phishy(), output);
819 }
821 // repeated string OBSOLETE_whitelist_expression = 2;
822 for (int i = 0; i < this->obsolete_whitelist_expression_size(); i++) {
823 ::google::protobuf::internal::WireFormatLite::WriteString(
824 2, this->obsolete_whitelist_expression(i), output);
825 }
827 }
829 int ClientPhishingResponse::ByteSize() const {
830 int total_size = 0;
832 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
833 // required bool phishy = 1;
834 if (has_phishy()) {
835 total_size += 1 + 1;
836 }
838 }
839 // repeated string OBSOLETE_whitelist_expression = 2;
840 total_size += 1 * this->obsolete_whitelist_expression_size();
841 for (int i = 0; i < this->obsolete_whitelist_expression_size(); i++) {
842 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
843 this->obsolete_whitelist_expression(i));
844 }
846 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
847 _cached_size_ = total_size;
848 GOOGLE_SAFE_CONCURRENT_WRITES_END();
849 return total_size;
850 }
852 void ClientPhishingResponse::CheckTypeAndMergeFrom(
853 const ::google::protobuf::MessageLite& from) {
854 MergeFrom(*::google::protobuf::down_cast<const ClientPhishingResponse*>(&from));
855 }
857 void ClientPhishingResponse::MergeFrom(const ClientPhishingResponse& from) {
858 GOOGLE_CHECK_NE(&from, this);
859 obsolete_whitelist_expression_.MergeFrom(from.obsolete_whitelist_expression_);
860 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
861 if (from.has_phishy()) {
862 set_phishy(from.phishy());
863 }
864 }
865 }
867 void ClientPhishingResponse::CopyFrom(const ClientPhishingResponse& from) {
868 if (&from == this) return;
869 Clear();
870 MergeFrom(from);
871 }
873 bool ClientPhishingResponse::IsInitialized() const {
874 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
876 return true;
877 }
879 void ClientPhishingResponse::Swap(ClientPhishingResponse* other) {
880 if (other != this) {
881 std::swap(phishy_, other->phishy_);
882 obsolete_whitelist_expression_.Swap(&other->obsolete_whitelist_expression_);
883 std::swap(_has_bits_[0], other->_has_bits_[0]);
884 std::swap(_cached_size_, other->_cached_size_);
885 }
886 }
888 ::std::string ClientPhishingResponse::GetTypeName() const {
889 return "safe_browsing.ClientPhishingResponse";
890 }
893 // ===================================================================
895 #ifndef _MSC_VER
896 const int ClientMalwareRequest_Feature::kNameFieldNumber;
897 const int ClientMalwareRequest_Feature::kValueFieldNumber;
898 const int ClientMalwareRequest_Feature::kMetainfoFieldNumber;
899 #endif // !_MSC_VER
901 ClientMalwareRequest_Feature::ClientMalwareRequest_Feature()
902 : ::google::protobuf::MessageLite() {
903 SharedCtor();
904 }
906 void ClientMalwareRequest_Feature::InitAsDefaultInstance() {
907 }
909 ClientMalwareRequest_Feature::ClientMalwareRequest_Feature(const ClientMalwareRequest_Feature& from)
910 : ::google::protobuf::MessageLite() {
911 SharedCtor();
912 MergeFrom(from);
913 }
915 void ClientMalwareRequest_Feature::SharedCtor() {
916 _cached_size_ = 0;
917 name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
918 value_ = 0;
919 ::memset(_has_bits_, 0, sizeof(_has_bits_));
920 }
922 ClientMalwareRequest_Feature::~ClientMalwareRequest_Feature() {
923 SharedDtor();
924 }
926 void ClientMalwareRequest_Feature::SharedDtor() {
927 if (name_ != &::google::protobuf::internal::kEmptyString) {
928 delete name_;
929 }
930 if (this != default_instance_) {
931 }
932 }
934 void ClientMalwareRequest_Feature::SetCachedSize(int size) const {
935 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
936 _cached_size_ = size;
937 GOOGLE_SAFE_CONCURRENT_WRITES_END();
938 }
939 const ClientMalwareRequest_Feature& ClientMalwareRequest_Feature::default_instance() {
940 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
941 }
943 ClientMalwareRequest_Feature* ClientMalwareRequest_Feature::default_instance_ = NULL;
945 ClientMalwareRequest_Feature* ClientMalwareRequest_Feature::New() const {
946 return new ClientMalwareRequest_Feature;
947 }
949 void ClientMalwareRequest_Feature::Clear() {
950 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
951 if (has_name()) {
952 if (name_ != &::google::protobuf::internal::kEmptyString) {
953 name_->clear();
954 }
955 }
956 value_ = 0;
957 }
958 metainfo_.Clear();
959 ::memset(_has_bits_, 0, sizeof(_has_bits_));
960 }
962 bool ClientMalwareRequest_Feature::MergePartialFromCodedStream(
963 ::google::protobuf::io::CodedInputStream* input) {
964 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
965 ::google::protobuf::uint32 tag;
966 while ((tag = input->ReadTag()) != 0) {
967 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
968 // required string name = 1;
969 case 1: {
970 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
971 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
972 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
973 input, this->mutable_name()));
974 } else {
975 goto handle_uninterpreted;
976 }
977 if (input->ExpectTag(17)) goto parse_value;
978 break;
979 }
981 // required double value = 2;
982 case 2: {
983 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
984 ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
985 parse_value:
986 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
987 double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
988 input, &value_)));
989 set_has_value();
990 } else {
991 goto handle_uninterpreted;
992 }
993 if (input->ExpectTag(26)) goto parse_metainfo;
994 break;
995 }
997 // repeated string metainfo = 3;
998 case 3: {
999 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1000 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1001 parse_metainfo:
1002 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1003 input, this->add_metainfo()));
1004 } else {
1005 goto handle_uninterpreted;
1006 }
1007 if (input->ExpectTag(26)) goto parse_metainfo;
1008 if (input->ExpectAtEnd()) return true;
1009 break;
1010 }
1012 default: {
1013 handle_uninterpreted:
1014 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1015 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1016 return true;
1017 }
1018 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
1019 break;
1020 }
1021 }
1022 }
1023 return true;
1024 #undef DO_
1025 }
1027 void ClientMalwareRequest_Feature::SerializeWithCachedSizes(
1028 ::google::protobuf::io::CodedOutputStream* output) const {
1029 // required string name = 1;
1030 if (has_name()) {
1031 ::google::protobuf::internal::WireFormatLite::WriteString(
1032 1, this->name(), output);
1033 }
1035 // required double value = 2;
1036 if (has_value()) {
1037 ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output);
1038 }
1040 // repeated string metainfo = 3;
1041 for (int i = 0; i < this->metainfo_size(); i++) {
1042 ::google::protobuf::internal::WireFormatLite::WriteString(
1043 3, this->metainfo(i), output);
1044 }
1046 }
1048 int ClientMalwareRequest_Feature::ByteSize() const {
1049 int total_size = 0;
1051 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1052 // required string name = 1;
1053 if (has_name()) {
1054 total_size += 1 +
1055 ::google::protobuf::internal::WireFormatLite::StringSize(
1056 this->name());
1057 }
1059 // required double value = 2;
1060 if (has_value()) {
1061 total_size += 1 + 8;
1062 }
1064 }
1065 // repeated string metainfo = 3;
1066 total_size += 1 * this->metainfo_size();
1067 for (int i = 0; i < this->metainfo_size(); i++) {
1068 total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
1069 this->metainfo(i));
1070 }
1072 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1073 _cached_size_ = total_size;
1074 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1075 return total_size;
1076 }
1078 void ClientMalwareRequest_Feature::CheckTypeAndMergeFrom(
1079 const ::google::protobuf::MessageLite& from) {
1080 MergeFrom(*::google::protobuf::down_cast<const ClientMalwareRequest_Feature*>(&from));
1081 }
1083 void ClientMalwareRequest_Feature::MergeFrom(const ClientMalwareRequest_Feature& from) {
1084 GOOGLE_CHECK_NE(&from, this);
1085 metainfo_.MergeFrom(from.metainfo_);
1086 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1087 if (from.has_name()) {
1088 set_name(from.name());
1089 }
1090 if (from.has_value()) {
1091 set_value(from.value());
1092 }
1093 }
1094 }
1096 void ClientMalwareRequest_Feature::CopyFrom(const ClientMalwareRequest_Feature& from) {
1097 if (&from == this) return;
1098 Clear();
1099 MergeFrom(from);
1100 }
1102 bool ClientMalwareRequest_Feature::IsInitialized() const {
1103 if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
1105 return true;
1106 }
1108 void ClientMalwareRequest_Feature::Swap(ClientMalwareRequest_Feature* other) {
1109 if (other != this) {
1110 std::swap(name_, other->name_);
1111 std::swap(value_, other->value_);
1112 metainfo_.Swap(&other->metainfo_);
1113 std::swap(_has_bits_[0], other->_has_bits_[0]);
1114 std::swap(_cached_size_, other->_cached_size_);
1115 }
1116 }
1118 ::std::string ClientMalwareRequest_Feature::GetTypeName() const {
1119 return "safe_browsing.ClientMalwareRequest.Feature";
1120 }
1123 // -------------------------------------------------------------------
1125 #ifndef _MSC_VER
1126 const int ClientMalwareRequest::kUrlFieldNumber;
1127 const int ClientMalwareRequest::kFeatureMapFieldNumber;
1128 const int ClientMalwareRequest::kReferrerUrlFieldNumber;
1129 #endif // !_MSC_VER
1131 ClientMalwareRequest::ClientMalwareRequest()
1132 : ::google::protobuf::MessageLite() {
1133 SharedCtor();
1134 }
1136 void ClientMalwareRequest::InitAsDefaultInstance() {
1137 }
1139 ClientMalwareRequest::ClientMalwareRequest(const ClientMalwareRequest& from)
1140 : ::google::protobuf::MessageLite() {
1141 SharedCtor();
1142 MergeFrom(from);
1143 }
1145 void ClientMalwareRequest::SharedCtor() {
1146 _cached_size_ = 0;
1147 url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1148 referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1149 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1150 }
1152 ClientMalwareRequest::~ClientMalwareRequest() {
1153 SharedDtor();
1154 }
1156 void ClientMalwareRequest::SharedDtor() {
1157 if (url_ != &::google::protobuf::internal::kEmptyString) {
1158 delete url_;
1159 }
1160 if (referrer_url_ != &::google::protobuf::internal::kEmptyString) {
1161 delete referrer_url_;
1162 }
1163 if (this != default_instance_) {
1164 }
1165 }
1167 void ClientMalwareRequest::SetCachedSize(int size) const {
1168 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1169 _cached_size_ = size;
1170 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1171 }
1172 const ClientMalwareRequest& ClientMalwareRequest::default_instance() {
1173 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
1174 }
1176 ClientMalwareRequest* ClientMalwareRequest::default_instance_ = NULL;
1178 ClientMalwareRequest* ClientMalwareRequest::New() const {
1179 return new ClientMalwareRequest;
1180 }
1182 void ClientMalwareRequest::Clear() {
1183 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1184 if (has_url()) {
1185 if (url_ != &::google::protobuf::internal::kEmptyString) {
1186 url_->clear();
1187 }
1188 }
1189 if (has_referrer_url()) {
1190 if (referrer_url_ != &::google::protobuf::internal::kEmptyString) {
1191 referrer_url_->clear();
1192 }
1193 }
1194 }
1195 feature_map_.Clear();
1196 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1197 }
1199 bool ClientMalwareRequest::MergePartialFromCodedStream(
1200 ::google::protobuf::io::CodedInputStream* input) {
1201 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
1202 ::google::protobuf::uint32 tag;
1203 while ((tag = input->ReadTag()) != 0) {
1204 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1205 // required string url = 1;
1206 case 1: {
1207 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1208 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1209 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1210 input, this->mutable_url()));
1211 } else {
1212 goto handle_uninterpreted;
1213 }
1214 if (input->ExpectTag(18)) goto parse_feature_map;
1215 break;
1216 }
1218 // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
1219 case 2: {
1220 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1221 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1222 parse_feature_map:
1223 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
1224 input, add_feature_map()));
1225 } else {
1226 goto handle_uninterpreted;
1227 }
1228 if (input->ExpectTag(18)) goto parse_feature_map;
1229 if (input->ExpectTag(34)) goto parse_referrer_url;
1230 break;
1231 }
1233 // optional string referrer_url = 4;
1234 case 4: {
1235 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1236 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1237 parse_referrer_url:
1238 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1239 input, this->mutable_referrer_url()));
1240 } else {
1241 goto handle_uninterpreted;
1242 }
1243 if (input->ExpectAtEnd()) return true;
1244 break;
1245 }
1247 default: {
1248 handle_uninterpreted:
1249 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1250 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1251 return true;
1252 }
1253 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
1254 break;
1255 }
1256 }
1257 }
1258 return true;
1259 #undef DO_
1260 }
1262 void ClientMalwareRequest::SerializeWithCachedSizes(
1263 ::google::protobuf::io::CodedOutputStream* output) const {
1264 // required string url = 1;
1265 if (has_url()) {
1266 ::google::protobuf::internal::WireFormatLite::WriteString(
1267 1, this->url(), output);
1268 }
1270 // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
1271 for (int i = 0; i < this->feature_map_size(); i++) {
1272 ::google::protobuf::internal::WireFormatLite::WriteMessage(
1273 2, this->feature_map(i), output);
1274 }
1276 // optional string referrer_url = 4;
1277 if (has_referrer_url()) {
1278 ::google::protobuf::internal::WireFormatLite::WriteString(
1279 4, this->referrer_url(), output);
1280 }
1282 }
1284 int ClientMalwareRequest::ByteSize() const {
1285 int total_size = 0;
1287 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1288 // required string url = 1;
1289 if (has_url()) {
1290 total_size += 1 +
1291 ::google::protobuf::internal::WireFormatLite::StringSize(
1292 this->url());
1293 }
1295 // optional string referrer_url = 4;
1296 if (has_referrer_url()) {
1297 total_size += 1 +
1298 ::google::protobuf::internal::WireFormatLite::StringSize(
1299 this->referrer_url());
1300 }
1302 }
1303 // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
1304 total_size += 1 * this->feature_map_size();
1305 for (int i = 0; i < this->feature_map_size(); i++) {
1306 total_size +=
1307 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
1308 this->feature_map(i));
1309 }
1311 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1312 _cached_size_ = total_size;
1313 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1314 return total_size;
1315 }
1317 void ClientMalwareRequest::CheckTypeAndMergeFrom(
1318 const ::google::protobuf::MessageLite& from) {
1319 MergeFrom(*::google::protobuf::down_cast<const ClientMalwareRequest*>(&from));
1320 }
1322 void ClientMalwareRequest::MergeFrom(const ClientMalwareRequest& from) {
1323 GOOGLE_CHECK_NE(&from, this);
1324 feature_map_.MergeFrom(from.feature_map_);
1325 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1326 if (from.has_url()) {
1327 set_url(from.url());
1328 }
1329 if (from.has_referrer_url()) {
1330 set_referrer_url(from.referrer_url());
1331 }
1332 }
1333 }
1335 void ClientMalwareRequest::CopyFrom(const ClientMalwareRequest& from) {
1336 if (&from == this) return;
1337 Clear();
1338 MergeFrom(from);
1339 }
1341 bool ClientMalwareRequest::IsInitialized() const {
1342 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
1344 for (int i = 0; i < feature_map_size(); i++) {
1345 if (!this->feature_map(i).IsInitialized()) return false;
1346 }
1347 return true;
1348 }
1350 void ClientMalwareRequest::Swap(ClientMalwareRequest* other) {
1351 if (other != this) {
1352 std::swap(url_, other->url_);
1353 feature_map_.Swap(&other->feature_map_);
1354 std::swap(referrer_url_, other->referrer_url_);
1355 std::swap(_has_bits_[0], other->_has_bits_[0]);
1356 std::swap(_cached_size_, other->_cached_size_);
1357 }
1358 }
1360 ::std::string ClientMalwareRequest::GetTypeName() const {
1361 return "safe_browsing.ClientMalwareRequest";
1362 }
1365 // ===================================================================
1367 #ifndef _MSC_VER
1368 const int ClientMalwareResponse::kBlacklistFieldNumber;
1369 const int ClientMalwareResponse::kBadIpFieldNumber;
1370 #endif // !_MSC_VER
1372 ClientMalwareResponse::ClientMalwareResponse()
1373 : ::google::protobuf::MessageLite() {
1374 SharedCtor();
1375 }
1377 void ClientMalwareResponse::InitAsDefaultInstance() {
1378 }
1380 ClientMalwareResponse::ClientMalwareResponse(const ClientMalwareResponse& from)
1381 : ::google::protobuf::MessageLite() {
1382 SharedCtor();
1383 MergeFrom(from);
1384 }
1386 void ClientMalwareResponse::SharedCtor() {
1387 _cached_size_ = 0;
1388 blacklist_ = false;
1389 bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1390 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1391 }
1393 ClientMalwareResponse::~ClientMalwareResponse() {
1394 SharedDtor();
1395 }
1397 void ClientMalwareResponse::SharedDtor() {
1398 if (bad_ip_ != &::google::protobuf::internal::kEmptyString) {
1399 delete bad_ip_;
1400 }
1401 if (this != default_instance_) {
1402 }
1403 }
1405 void ClientMalwareResponse::SetCachedSize(int size) const {
1406 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1407 _cached_size_ = size;
1408 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1409 }
1410 const ClientMalwareResponse& ClientMalwareResponse::default_instance() {
1411 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
1412 }
1414 ClientMalwareResponse* ClientMalwareResponse::default_instance_ = NULL;
1416 ClientMalwareResponse* ClientMalwareResponse::New() const {
1417 return new ClientMalwareResponse;
1418 }
1420 void ClientMalwareResponse::Clear() {
1421 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1422 blacklist_ = false;
1423 if (has_bad_ip()) {
1424 if (bad_ip_ != &::google::protobuf::internal::kEmptyString) {
1425 bad_ip_->clear();
1426 }
1427 }
1428 }
1429 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1430 }
1432 bool ClientMalwareResponse::MergePartialFromCodedStream(
1433 ::google::protobuf::io::CodedInputStream* input) {
1434 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
1435 ::google::protobuf::uint32 tag;
1436 while ((tag = input->ReadTag()) != 0) {
1437 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1438 // required bool blacklist = 1;
1439 case 1: {
1440 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1441 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
1442 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1443 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
1444 input, &blacklist_)));
1445 set_has_blacklist();
1446 } else {
1447 goto handle_uninterpreted;
1448 }
1449 if (input->ExpectTag(18)) goto parse_bad_ip;
1450 break;
1451 }
1453 // optional string bad_ip = 2;
1454 case 2: {
1455 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1456 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1457 parse_bad_ip:
1458 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1459 input, this->mutable_bad_ip()));
1460 } else {
1461 goto handle_uninterpreted;
1462 }
1463 if (input->ExpectAtEnd()) return true;
1464 break;
1465 }
1467 default: {
1468 handle_uninterpreted:
1469 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1470 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1471 return true;
1472 }
1473 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
1474 break;
1475 }
1476 }
1477 }
1478 return true;
1479 #undef DO_
1480 }
1482 void ClientMalwareResponse::SerializeWithCachedSizes(
1483 ::google::protobuf::io::CodedOutputStream* output) const {
1484 // required bool blacklist = 1;
1485 if (has_blacklist()) {
1486 ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->blacklist(), output);
1487 }
1489 // optional string bad_ip = 2;
1490 if (has_bad_ip()) {
1491 ::google::protobuf::internal::WireFormatLite::WriteString(
1492 2, this->bad_ip(), output);
1493 }
1495 }
1497 int ClientMalwareResponse::ByteSize() const {
1498 int total_size = 0;
1500 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1501 // required bool blacklist = 1;
1502 if (has_blacklist()) {
1503 total_size += 1 + 1;
1504 }
1506 // optional string bad_ip = 2;
1507 if (has_bad_ip()) {
1508 total_size += 1 +
1509 ::google::protobuf::internal::WireFormatLite::StringSize(
1510 this->bad_ip());
1511 }
1513 }
1514 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1515 _cached_size_ = total_size;
1516 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1517 return total_size;
1518 }
1520 void ClientMalwareResponse::CheckTypeAndMergeFrom(
1521 const ::google::protobuf::MessageLite& from) {
1522 MergeFrom(*::google::protobuf::down_cast<const ClientMalwareResponse*>(&from));
1523 }
1525 void ClientMalwareResponse::MergeFrom(const ClientMalwareResponse& from) {
1526 GOOGLE_CHECK_NE(&from, this);
1527 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1528 if (from.has_blacklist()) {
1529 set_blacklist(from.blacklist());
1530 }
1531 if (from.has_bad_ip()) {
1532 set_bad_ip(from.bad_ip());
1533 }
1534 }
1535 }
1537 void ClientMalwareResponse::CopyFrom(const ClientMalwareResponse& from) {
1538 if (&from == this) return;
1539 Clear();
1540 MergeFrom(from);
1541 }
1543 bool ClientMalwareResponse::IsInitialized() const {
1544 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
1546 return true;
1547 }
1549 void ClientMalwareResponse::Swap(ClientMalwareResponse* other) {
1550 if (other != this) {
1551 std::swap(blacklist_, other->blacklist_);
1552 std::swap(bad_ip_, other->bad_ip_);
1553 std::swap(_has_bits_[0], other->_has_bits_[0]);
1554 std::swap(_cached_size_, other->_cached_size_);
1555 }
1556 }
1558 ::std::string ClientMalwareResponse::GetTypeName() const {
1559 return "safe_browsing.ClientMalwareResponse";
1560 }
1563 // ===================================================================
1565 bool ClientDownloadRequest_ResourceType_IsValid(int value) {
1566 switch(value) {
1567 case 0:
1568 case 1:
1569 case 2:
1570 case 3:
1571 return true;
1572 default:
1573 return false;
1574 }
1575 }
1577 #ifndef _MSC_VER
1578 const ClientDownloadRequest_ResourceType ClientDownloadRequest::DOWNLOAD_URL;
1579 const ClientDownloadRequest_ResourceType ClientDownloadRequest::DOWNLOAD_REDIRECT;
1580 const ClientDownloadRequest_ResourceType ClientDownloadRequest::TAB_URL;
1581 const ClientDownloadRequest_ResourceType ClientDownloadRequest::TAB_REDIRECT;
1582 const ClientDownloadRequest_ResourceType ClientDownloadRequest::ResourceType_MIN;
1583 const ClientDownloadRequest_ResourceType ClientDownloadRequest::ResourceType_MAX;
1584 const int ClientDownloadRequest::ResourceType_ARRAYSIZE;
1585 #endif // _MSC_VER
1586 bool ClientDownloadRequest_DownloadType_IsValid(int value) {
1587 switch(value) {
1588 case 0:
1589 case 1:
1590 case 2:
1591 case 3:
1592 return true;
1593 default:
1594 return false;
1595 }
1596 }
1598 #ifndef _MSC_VER
1599 const ClientDownloadRequest_DownloadType ClientDownloadRequest::WIN_EXECUTABLE;
1600 const ClientDownloadRequest_DownloadType ClientDownloadRequest::CHROME_EXTENSION;
1601 const ClientDownloadRequest_DownloadType ClientDownloadRequest::ANDROID_APK;
1602 const ClientDownloadRequest_DownloadType ClientDownloadRequest::ZIPPED_EXECUTABLE;
1603 const ClientDownloadRequest_DownloadType ClientDownloadRequest::DownloadType_MIN;
1604 const ClientDownloadRequest_DownloadType ClientDownloadRequest::DownloadType_MAX;
1605 const int ClientDownloadRequest::DownloadType_ARRAYSIZE;
1606 #endif // _MSC_VER
1607 #ifndef _MSC_VER
1608 const int ClientDownloadRequest_Digests::kSha256FieldNumber;
1609 const int ClientDownloadRequest_Digests::kSha1FieldNumber;
1610 const int ClientDownloadRequest_Digests::kMd5FieldNumber;
1611 #endif // !_MSC_VER
1613 ClientDownloadRequest_Digests::ClientDownloadRequest_Digests()
1614 : ::google::protobuf::MessageLite() {
1615 SharedCtor();
1616 }
1618 void ClientDownloadRequest_Digests::InitAsDefaultInstance() {
1619 }
1621 ClientDownloadRequest_Digests::ClientDownloadRequest_Digests(const ClientDownloadRequest_Digests& from)
1622 : ::google::protobuf::MessageLite() {
1623 SharedCtor();
1624 MergeFrom(from);
1625 }
1627 void ClientDownloadRequest_Digests::SharedCtor() {
1628 _cached_size_ = 0;
1629 sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1630 sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1631 md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1632 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1633 }
1635 ClientDownloadRequest_Digests::~ClientDownloadRequest_Digests() {
1636 SharedDtor();
1637 }
1639 void ClientDownloadRequest_Digests::SharedDtor() {
1640 if (sha256_ != &::google::protobuf::internal::kEmptyString) {
1641 delete sha256_;
1642 }
1643 if (sha1_ != &::google::protobuf::internal::kEmptyString) {
1644 delete sha1_;
1645 }
1646 if (md5_ != &::google::protobuf::internal::kEmptyString) {
1647 delete md5_;
1648 }
1649 if (this != default_instance_) {
1650 }
1651 }
1653 void ClientDownloadRequest_Digests::SetCachedSize(int size) const {
1654 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1655 _cached_size_ = size;
1656 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1657 }
1658 const ClientDownloadRequest_Digests& ClientDownloadRequest_Digests::default_instance() {
1659 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
1660 }
1662 ClientDownloadRequest_Digests* ClientDownloadRequest_Digests::default_instance_ = NULL;
1664 ClientDownloadRequest_Digests* ClientDownloadRequest_Digests::New() const {
1665 return new ClientDownloadRequest_Digests;
1666 }
1668 void ClientDownloadRequest_Digests::Clear() {
1669 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1670 if (has_sha256()) {
1671 if (sha256_ != &::google::protobuf::internal::kEmptyString) {
1672 sha256_->clear();
1673 }
1674 }
1675 if (has_sha1()) {
1676 if (sha1_ != &::google::protobuf::internal::kEmptyString) {
1677 sha1_->clear();
1678 }
1679 }
1680 if (has_md5()) {
1681 if (md5_ != &::google::protobuf::internal::kEmptyString) {
1682 md5_->clear();
1683 }
1684 }
1685 }
1686 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1687 }
1689 bool ClientDownloadRequest_Digests::MergePartialFromCodedStream(
1690 ::google::protobuf::io::CodedInputStream* input) {
1691 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
1692 ::google::protobuf::uint32 tag;
1693 while ((tag = input->ReadTag()) != 0) {
1694 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1695 // optional bytes sha256 = 1;
1696 case 1: {
1697 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1698 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1699 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1700 input, this->mutable_sha256()));
1701 } else {
1702 goto handle_uninterpreted;
1703 }
1704 if (input->ExpectTag(18)) goto parse_sha1;
1705 break;
1706 }
1708 // optional bytes sha1 = 2;
1709 case 2: {
1710 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1711 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1712 parse_sha1:
1713 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1714 input, this->mutable_sha1()));
1715 } else {
1716 goto handle_uninterpreted;
1717 }
1718 if (input->ExpectTag(26)) goto parse_md5;
1719 break;
1720 }
1722 // optional bytes md5 = 3;
1723 case 3: {
1724 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1725 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1726 parse_md5:
1727 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1728 input, this->mutable_md5()));
1729 } else {
1730 goto handle_uninterpreted;
1731 }
1732 if (input->ExpectAtEnd()) return true;
1733 break;
1734 }
1736 default: {
1737 handle_uninterpreted:
1738 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1739 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
1740 return true;
1741 }
1742 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
1743 break;
1744 }
1745 }
1746 }
1747 return true;
1748 #undef DO_
1749 }
1751 void ClientDownloadRequest_Digests::SerializeWithCachedSizes(
1752 ::google::protobuf::io::CodedOutputStream* output) const {
1753 // optional bytes sha256 = 1;
1754 if (has_sha256()) {
1755 ::google::protobuf::internal::WireFormatLite::WriteBytes(
1756 1, this->sha256(), output);
1757 }
1759 // optional bytes sha1 = 2;
1760 if (has_sha1()) {
1761 ::google::protobuf::internal::WireFormatLite::WriteBytes(
1762 2, this->sha1(), output);
1763 }
1765 // optional bytes md5 = 3;
1766 if (has_md5()) {
1767 ::google::protobuf::internal::WireFormatLite::WriteBytes(
1768 3, this->md5(), output);
1769 }
1771 }
1773 int ClientDownloadRequest_Digests::ByteSize() const {
1774 int total_size = 0;
1776 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1777 // optional bytes sha256 = 1;
1778 if (has_sha256()) {
1779 total_size += 1 +
1780 ::google::protobuf::internal::WireFormatLite::BytesSize(
1781 this->sha256());
1782 }
1784 // optional bytes sha1 = 2;
1785 if (has_sha1()) {
1786 total_size += 1 +
1787 ::google::protobuf::internal::WireFormatLite::BytesSize(
1788 this->sha1());
1789 }
1791 // optional bytes md5 = 3;
1792 if (has_md5()) {
1793 total_size += 1 +
1794 ::google::protobuf::internal::WireFormatLite::BytesSize(
1795 this->md5());
1796 }
1798 }
1799 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1800 _cached_size_ = total_size;
1801 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1802 return total_size;
1803 }
1805 void ClientDownloadRequest_Digests::CheckTypeAndMergeFrom(
1806 const ::google::protobuf::MessageLite& from) {
1807 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_Digests*>(&from));
1808 }
1810 void ClientDownloadRequest_Digests::MergeFrom(const ClientDownloadRequest_Digests& from) {
1811 GOOGLE_CHECK_NE(&from, this);
1812 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1813 if (from.has_sha256()) {
1814 set_sha256(from.sha256());
1815 }
1816 if (from.has_sha1()) {
1817 set_sha1(from.sha1());
1818 }
1819 if (from.has_md5()) {
1820 set_md5(from.md5());
1821 }
1822 }
1823 }
1825 void ClientDownloadRequest_Digests::CopyFrom(const ClientDownloadRequest_Digests& from) {
1826 if (&from == this) return;
1827 Clear();
1828 MergeFrom(from);
1829 }
1831 bool ClientDownloadRequest_Digests::IsInitialized() const {
1833 return true;
1834 }
1836 void ClientDownloadRequest_Digests::Swap(ClientDownloadRequest_Digests* other) {
1837 if (other != this) {
1838 std::swap(sha256_, other->sha256_);
1839 std::swap(sha1_, other->sha1_);
1840 std::swap(md5_, other->md5_);
1841 std::swap(_has_bits_[0], other->_has_bits_[0]);
1842 std::swap(_cached_size_, other->_cached_size_);
1843 }
1844 }
1846 ::std::string ClientDownloadRequest_Digests::GetTypeName() const {
1847 return "safe_browsing.ClientDownloadRequest.Digests";
1848 }
1851 // -------------------------------------------------------------------
1853 #ifndef _MSC_VER
1854 const int ClientDownloadRequest_Resource::kUrlFieldNumber;
1855 const int ClientDownloadRequest_Resource::kTypeFieldNumber;
1856 const int ClientDownloadRequest_Resource::kRemoteIpFieldNumber;
1857 const int ClientDownloadRequest_Resource::kReferrerFieldNumber;
1858 #endif // !_MSC_VER
1860 ClientDownloadRequest_Resource::ClientDownloadRequest_Resource()
1861 : ::google::protobuf::MessageLite() {
1862 SharedCtor();
1863 }
1865 void ClientDownloadRequest_Resource::InitAsDefaultInstance() {
1866 }
1868 ClientDownloadRequest_Resource::ClientDownloadRequest_Resource(const ClientDownloadRequest_Resource& from)
1869 : ::google::protobuf::MessageLite() {
1870 SharedCtor();
1871 MergeFrom(from);
1872 }
1874 void ClientDownloadRequest_Resource::SharedCtor() {
1875 _cached_size_ = 0;
1876 url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1877 type_ = 0;
1878 remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1879 referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
1880 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1881 }
1883 ClientDownloadRequest_Resource::~ClientDownloadRequest_Resource() {
1884 SharedDtor();
1885 }
1887 void ClientDownloadRequest_Resource::SharedDtor() {
1888 if (url_ != &::google::protobuf::internal::kEmptyString) {
1889 delete url_;
1890 }
1891 if (remote_ip_ != &::google::protobuf::internal::kEmptyString) {
1892 delete remote_ip_;
1893 }
1894 if (referrer_ != &::google::protobuf::internal::kEmptyString) {
1895 delete referrer_;
1896 }
1897 if (this != default_instance_) {
1898 }
1899 }
1901 void ClientDownloadRequest_Resource::SetCachedSize(int size) const {
1902 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
1903 _cached_size_ = size;
1904 GOOGLE_SAFE_CONCURRENT_WRITES_END();
1905 }
1906 const ClientDownloadRequest_Resource& ClientDownloadRequest_Resource::default_instance() {
1907 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
1908 }
1910 ClientDownloadRequest_Resource* ClientDownloadRequest_Resource::default_instance_ = NULL;
1912 ClientDownloadRequest_Resource* ClientDownloadRequest_Resource::New() const {
1913 return new ClientDownloadRequest_Resource;
1914 }
1916 void ClientDownloadRequest_Resource::Clear() {
1917 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
1918 if (has_url()) {
1919 if (url_ != &::google::protobuf::internal::kEmptyString) {
1920 url_->clear();
1921 }
1922 }
1923 type_ = 0;
1924 if (has_remote_ip()) {
1925 if (remote_ip_ != &::google::protobuf::internal::kEmptyString) {
1926 remote_ip_->clear();
1927 }
1928 }
1929 if (has_referrer()) {
1930 if (referrer_ != &::google::protobuf::internal::kEmptyString) {
1931 referrer_->clear();
1932 }
1933 }
1934 }
1935 ::memset(_has_bits_, 0, sizeof(_has_bits_));
1936 }
1938 bool ClientDownloadRequest_Resource::MergePartialFromCodedStream(
1939 ::google::protobuf::io::CodedInputStream* input) {
1940 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
1941 ::google::protobuf::uint32 tag;
1942 while ((tag = input->ReadTag()) != 0) {
1943 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
1944 // required string url = 1;
1945 case 1: {
1946 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1947 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1948 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1949 input, this->mutable_url()));
1950 } else {
1951 goto handle_uninterpreted;
1952 }
1953 if (input->ExpectTag(16)) goto parse_type;
1954 break;
1955 }
1957 // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2;
1958 case 2: {
1959 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1960 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
1961 parse_type:
1962 int value;
1963 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
1964 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
1965 input, &value)));
1966 if (::safe_browsing::ClientDownloadRequest_ResourceType_IsValid(value)) {
1967 set_type(static_cast< ::safe_browsing::ClientDownloadRequest_ResourceType >(value));
1968 }
1969 } else {
1970 goto handle_uninterpreted;
1971 }
1972 if (input->ExpectTag(26)) goto parse_remote_ip;
1973 break;
1974 }
1976 // optional bytes remote_ip = 3;
1977 case 3: {
1978 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1979 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1980 parse_remote_ip:
1981 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
1982 input, this->mutable_remote_ip()));
1983 } else {
1984 goto handle_uninterpreted;
1985 }
1986 if (input->ExpectTag(34)) goto parse_referrer;
1987 break;
1988 }
1990 // optional string referrer = 4;
1991 case 4: {
1992 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
1993 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
1994 parse_referrer:
1995 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
1996 input, this->mutable_referrer()));
1997 } else {
1998 goto handle_uninterpreted;
1999 }
2000 if (input->ExpectAtEnd()) return true;
2001 break;
2002 }
2004 default: {
2005 handle_uninterpreted:
2006 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2007 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2008 return true;
2009 }
2010 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
2011 break;
2012 }
2013 }
2014 }
2015 return true;
2016 #undef DO_
2017 }
2019 void ClientDownloadRequest_Resource::SerializeWithCachedSizes(
2020 ::google::protobuf::io::CodedOutputStream* output) const {
2021 // required string url = 1;
2022 if (has_url()) {
2023 ::google::protobuf::internal::WireFormatLite::WriteString(
2024 1, this->url(), output);
2025 }
2027 // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2;
2028 if (has_type()) {
2029 ::google::protobuf::internal::WireFormatLite::WriteEnum(
2030 2, this->type(), output);
2031 }
2033 // optional bytes remote_ip = 3;
2034 if (has_remote_ip()) {
2035 ::google::protobuf::internal::WireFormatLite::WriteBytes(
2036 3, this->remote_ip(), output);
2037 }
2039 // optional string referrer = 4;
2040 if (has_referrer()) {
2041 ::google::protobuf::internal::WireFormatLite::WriteString(
2042 4, this->referrer(), output);
2043 }
2045 }
2047 int ClientDownloadRequest_Resource::ByteSize() const {
2048 int total_size = 0;
2050 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2051 // required string url = 1;
2052 if (has_url()) {
2053 total_size += 1 +
2054 ::google::protobuf::internal::WireFormatLite::StringSize(
2055 this->url());
2056 }
2058 // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2;
2059 if (has_type()) {
2060 total_size += 1 +
2061 ::google::protobuf::internal::WireFormatLite::EnumSize(this->type());
2062 }
2064 // optional bytes remote_ip = 3;
2065 if (has_remote_ip()) {
2066 total_size += 1 +
2067 ::google::protobuf::internal::WireFormatLite::BytesSize(
2068 this->remote_ip());
2069 }
2071 // optional string referrer = 4;
2072 if (has_referrer()) {
2073 total_size += 1 +
2074 ::google::protobuf::internal::WireFormatLite::StringSize(
2075 this->referrer());
2076 }
2078 }
2079 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2080 _cached_size_ = total_size;
2081 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2082 return total_size;
2083 }
2085 void ClientDownloadRequest_Resource::CheckTypeAndMergeFrom(
2086 const ::google::protobuf::MessageLite& from) {
2087 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_Resource*>(&from));
2088 }
2090 void ClientDownloadRequest_Resource::MergeFrom(const ClientDownloadRequest_Resource& from) {
2091 GOOGLE_CHECK_NE(&from, this);
2092 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2093 if (from.has_url()) {
2094 set_url(from.url());
2095 }
2096 if (from.has_type()) {
2097 set_type(from.type());
2098 }
2099 if (from.has_remote_ip()) {
2100 set_remote_ip(from.remote_ip());
2101 }
2102 if (from.has_referrer()) {
2103 set_referrer(from.referrer());
2104 }
2105 }
2106 }
2108 void ClientDownloadRequest_Resource::CopyFrom(const ClientDownloadRequest_Resource& from) {
2109 if (&from == this) return;
2110 Clear();
2111 MergeFrom(from);
2112 }
2114 bool ClientDownloadRequest_Resource::IsInitialized() const {
2115 if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
2117 return true;
2118 }
2120 void ClientDownloadRequest_Resource::Swap(ClientDownloadRequest_Resource* other) {
2121 if (other != this) {
2122 std::swap(url_, other->url_);
2123 std::swap(type_, other->type_);
2124 std::swap(remote_ip_, other->remote_ip_);
2125 std::swap(referrer_, other->referrer_);
2126 std::swap(_has_bits_[0], other->_has_bits_[0]);
2127 std::swap(_cached_size_, other->_cached_size_);
2128 }
2129 }
2131 ::std::string ClientDownloadRequest_Resource::GetTypeName() const {
2132 return "safe_browsing.ClientDownloadRequest.Resource";
2133 }
2136 // -------------------------------------------------------------------
2138 #ifndef _MSC_VER
2139 const int ClientDownloadRequest_CertificateChain_Element::kCertificateFieldNumber;
2140 #endif // !_MSC_VER
2142 ClientDownloadRequest_CertificateChain_Element::ClientDownloadRequest_CertificateChain_Element()
2143 : ::google::protobuf::MessageLite() {
2144 SharedCtor();
2145 }
2147 void ClientDownloadRequest_CertificateChain_Element::InitAsDefaultInstance() {
2148 }
2150 ClientDownloadRequest_CertificateChain_Element::ClientDownloadRequest_CertificateChain_Element(const ClientDownloadRequest_CertificateChain_Element& from)
2151 : ::google::protobuf::MessageLite() {
2152 SharedCtor();
2153 MergeFrom(from);
2154 }
2156 void ClientDownloadRequest_CertificateChain_Element::SharedCtor() {
2157 _cached_size_ = 0;
2158 certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
2159 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2160 }
2162 ClientDownloadRequest_CertificateChain_Element::~ClientDownloadRequest_CertificateChain_Element() {
2163 SharedDtor();
2164 }
2166 void ClientDownloadRequest_CertificateChain_Element::SharedDtor() {
2167 if (certificate_ != &::google::protobuf::internal::kEmptyString) {
2168 delete certificate_;
2169 }
2170 if (this != default_instance_) {
2171 }
2172 }
2174 void ClientDownloadRequest_CertificateChain_Element::SetCachedSize(int size) const {
2175 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2176 _cached_size_ = size;
2177 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2178 }
2179 const ClientDownloadRequest_CertificateChain_Element& ClientDownloadRequest_CertificateChain_Element::default_instance() {
2180 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
2181 }
2183 ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain_Element::default_instance_ = NULL;
2185 ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain_Element::New() const {
2186 return new ClientDownloadRequest_CertificateChain_Element;
2187 }
2189 void ClientDownloadRequest_CertificateChain_Element::Clear() {
2190 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2191 if (has_certificate()) {
2192 if (certificate_ != &::google::protobuf::internal::kEmptyString) {
2193 certificate_->clear();
2194 }
2195 }
2196 }
2197 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2198 }
2200 bool ClientDownloadRequest_CertificateChain_Element::MergePartialFromCodedStream(
2201 ::google::protobuf::io::CodedInputStream* input) {
2202 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
2203 ::google::protobuf::uint32 tag;
2204 while ((tag = input->ReadTag()) != 0) {
2205 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2206 // optional bytes certificate = 1;
2207 case 1: {
2208 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2209 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2210 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
2211 input, this->mutable_certificate()));
2212 } else {
2213 goto handle_uninterpreted;
2214 }
2215 if (input->ExpectAtEnd()) return true;
2216 break;
2217 }
2219 default: {
2220 handle_uninterpreted:
2221 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2222 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2223 return true;
2224 }
2225 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
2226 break;
2227 }
2228 }
2229 }
2230 return true;
2231 #undef DO_
2232 }
2234 void ClientDownloadRequest_CertificateChain_Element::SerializeWithCachedSizes(
2235 ::google::protobuf::io::CodedOutputStream* output) const {
2236 // optional bytes certificate = 1;
2237 if (has_certificate()) {
2238 ::google::protobuf::internal::WireFormatLite::WriteBytes(
2239 1, this->certificate(), output);
2240 }
2242 }
2244 int ClientDownloadRequest_CertificateChain_Element::ByteSize() const {
2245 int total_size = 0;
2247 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2248 // optional bytes certificate = 1;
2249 if (has_certificate()) {
2250 total_size += 1 +
2251 ::google::protobuf::internal::WireFormatLite::BytesSize(
2252 this->certificate());
2253 }
2255 }
2256 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2257 _cached_size_ = total_size;
2258 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2259 return total_size;
2260 }
2262 void ClientDownloadRequest_CertificateChain_Element::CheckTypeAndMergeFrom(
2263 const ::google::protobuf::MessageLite& from) {
2264 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_CertificateChain_Element*>(&from));
2265 }
2267 void ClientDownloadRequest_CertificateChain_Element::MergeFrom(const ClientDownloadRequest_CertificateChain_Element& from) {
2268 GOOGLE_CHECK_NE(&from, this);
2269 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2270 if (from.has_certificate()) {
2271 set_certificate(from.certificate());
2272 }
2273 }
2274 }
2276 void ClientDownloadRequest_CertificateChain_Element::CopyFrom(const ClientDownloadRequest_CertificateChain_Element& from) {
2277 if (&from == this) return;
2278 Clear();
2279 MergeFrom(from);
2280 }
2282 bool ClientDownloadRequest_CertificateChain_Element::IsInitialized() const {
2284 return true;
2285 }
2287 void ClientDownloadRequest_CertificateChain_Element::Swap(ClientDownloadRequest_CertificateChain_Element* other) {
2288 if (other != this) {
2289 std::swap(certificate_, other->certificate_);
2290 std::swap(_has_bits_[0], other->_has_bits_[0]);
2291 std::swap(_cached_size_, other->_cached_size_);
2292 }
2293 }
2295 ::std::string ClientDownloadRequest_CertificateChain_Element::GetTypeName() const {
2296 return "safe_browsing.ClientDownloadRequest.CertificateChain.Element";
2297 }
2300 // -------------------------------------------------------------------
2302 #ifndef _MSC_VER
2303 const int ClientDownloadRequest_CertificateChain::kElementFieldNumber;
2304 #endif // !_MSC_VER
2306 ClientDownloadRequest_CertificateChain::ClientDownloadRequest_CertificateChain()
2307 : ::google::protobuf::MessageLite() {
2308 SharedCtor();
2309 }
2311 void ClientDownloadRequest_CertificateChain::InitAsDefaultInstance() {
2312 }
2314 ClientDownloadRequest_CertificateChain::ClientDownloadRequest_CertificateChain(const ClientDownloadRequest_CertificateChain& from)
2315 : ::google::protobuf::MessageLite() {
2316 SharedCtor();
2317 MergeFrom(from);
2318 }
2320 void ClientDownloadRequest_CertificateChain::SharedCtor() {
2321 _cached_size_ = 0;
2322 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2323 }
2325 ClientDownloadRequest_CertificateChain::~ClientDownloadRequest_CertificateChain() {
2326 SharedDtor();
2327 }
2329 void ClientDownloadRequest_CertificateChain::SharedDtor() {
2330 if (this != default_instance_) {
2331 }
2332 }
2334 void ClientDownloadRequest_CertificateChain::SetCachedSize(int size) const {
2335 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2336 _cached_size_ = size;
2337 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2338 }
2339 const ClientDownloadRequest_CertificateChain& ClientDownloadRequest_CertificateChain::default_instance() {
2340 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
2341 }
2343 ClientDownloadRequest_CertificateChain* ClientDownloadRequest_CertificateChain::default_instance_ = NULL;
2345 ClientDownloadRequest_CertificateChain* ClientDownloadRequest_CertificateChain::New() const {
2346 return new ClientDownloadRequest_CertificateChain;
2347 }
2349 void ClientDownloadRequest_CertificateChain::Clear() {
2350 element_.Clear();
2351 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2352 }
2354 bool ClientDownloadRequest_CertificateChain::MergePartialFromCodedStream(
2355 ::google::protobuf::io::CodedInputStream* input) {
2356 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
2357 ::google::protobuf::uint32 tag;
2358 while ((tag = input->ReadTag()) != 0) {
2359 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2360 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1;
2361 case 1: {
2362 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2363 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2364 parse_element:
2365 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
2366 input, add_element()));
2367 } else {
2368 goto handle_uninterpreted;
2369 }
2370 if (input->ExpectTag(10)) goto parse_element;
2371 if (input->ExpectAtEnd()) return true;
2372 break;
2373 }
2375 default: {
2376 handle_uninterpreted:
2377 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2378 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2379 return true;
2380 }
2381 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
2382 break;
2383 }
2384 }
2385 }
2386 return true;
2387 #undef DO_
2388 }
2390 void ClientDownloadRequest_CertificateChain::SerializeWithCachedSizes(
2391 ::google::protobuf::io::CodedOutputStream* output) const {
2392 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1;
2393 for (int i = 0; i < this->element_size(); i++) {
2394 ::google::protobuf::internal::WireFormatLite::WriteMessage(
2395 1, this->element(i), output);
2396 }
2398 }
2400 int ClientDownloadRequest_CertificateChain::ByteSize() const {
2401 int total_size = 0;
2403 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1;
2404 total_size += 1 * this->element_size();
2405 for (int i = 0; i < this->element_size(); i++) {
2406 total_size +=
2407 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2408 this->element(i));
2409 }
2411 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2412 _cached_size_ = total_size;
2413 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2414 return total_size;
2415 }
2417 void ClientDownloadRequest_CertificateChain::CheckTypeAndMergeFrom(
2418 const ::google::protobuf::MessageLite& from) {
2419 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_CertificateChain*>(&from));
2420 }
2422 void ClientDownloadRequest_CertificateChain::MergeFrom(const ClientDownloadRequest_CertificateChain& from) {
2423 GOOGLE_CHECK_NE(&from, this);
2424 element_.MergeFrom(from.element_);
2425 }
2427 void ClientDownloadRequest_CertificateChain::CopyFrom(const ClientDownloadRequest_CertificateChain& from) {
2428 if (&from == this) return;
2429 Clear();
2430 MergeFrom(from);
2431 }
2433 bool ClientDownloadRequest_CertificateChain::IsInitialized() const {
2435 return true;
2436 }
2438 void ClientDownloadRequest_CertificateChain::Swap(ClientDownloadRequest_CertificateChain* other) {
2439 if (other != this) {
2440 element_.Swap(&other->element_);
2441 std::swap(_has_bits_[0], other->_has_bits_[0]);
2442 std::swap(_cached_size_, other->_cached_size_);
2443 }
2444 }
2446 ::std::string ClientDownloadRequest_CertificateChain::GetTypeName() const {
2447 return "safe_browsing.ClientDownloadRequest.CertificateChain";
2448 }
2451 // -------------------------------------------------------------------
2453 #ifndef _MSC_VER
2454 const int ClientDownloadRequest_SignatureInfo::kCertificateChainFieldNumber;
2455 const int ClientDownloadRequest_SignatureInfo::kTrustedFieldNumber;
2456 #endif // !_MSC_VER
2458 ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo()
2459 : ::google::protobuf::MessageLite() {
2460 SharedCtor();
2461 }
2463 void ClientDownloadRequest_SignatureInfo::InitAsDefaultInstance() {
2464 }
2466 ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo(const ClientDownloadRequest_SignatureInfo& from)
2467 : ::google::protobuf::MessageLite() {
2468 SharedCtor();
2469 MergeFrom(from);
2470 }
2472 void ClientDownloadRequest_SignatureInfo::SharedCtor() {
2473 _cached_size_ = 0;
2474 trusted_ = false;
2475 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2476 }
2478 ClientDownloadRequest_SignatureInfo::~ClientDownloadRequest_SignatureInfo() {
2479 SharedDtor();
2480 }
2482 void ClientDownloadRequest_SignatureInfo::SharedDtor() {
2483 if (this != default_instance_) {
2484 }
2485 }
2487 void ClientDownloadRequest_SignatureInfo::SetCachedSize(int size) const {
2488 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2489 _cached_size_ = size;
2490 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2491 }
2492 const ClientDownloadRequest_SignatureInfo& ClientDownloadRequest_SignatureInfo::default_instance() {
2493 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
2494 }
2496 ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::default_instance_ = NULL;
2498 ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::New() const {
2499 return new ClientDownloadRequest_SignatureInfo;
2500 }
2502 void ClientDownloadRequest_SignatureInfo::Clear() {
2503 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
2504 trusted_ = false;
2505 }
2506 certificate_chain_.Clear();
2507 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2508 }
2510 bool ClientDownloadRequest_SignatureInfo::MergePartialFromCodedStream(
2511 ::google::protobuf::io::CodedInputStream* input) {
2512 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
2513 ::google::protobuf::uint32 tag;
2514 while ((tag = input->ReadTag()) != 0) {
2515 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2516 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1;
2517 case 1: {
2518 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2519 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2520 parse_certificate_chain:
2521 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
2522 input, add_certificate_chain()));
2523 } else {
2524 goto handle_uninterpreted;
2525 }
2526 if (input->ExpectTag(10)) goto parse_certificate_chain;
2527 if (input->ExpectTag(16)) goto parse_trusted;
2528 break;
2529 }
2531 // optional bool trusted = 2;
2532 case 2: {
2533 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2534 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
2535 parse_trusted:
2536 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2537 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
2538 input, &trusted_)));
2539 set_has_trusted();
2540 } else {
2541 goto handle_uninterpreted;
2542 }
2543 if (input->ExpectAtEnd()) return true;
2544 break;
2545 }
2547 default: {
2548 handle_uninterpreted:
2549 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2550 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2551 return true;
2552 }
2553 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
2554 break;
2555 }
2556 }
2557 }
2558 return true;
2559 #undef DO_
2560 }
2562 void ClientDownloadRequest_SignatureInfo::SerializeWithCachedSizes(
2563 ::google::protobuf::io::CodedOutputStream* output) const {
2564 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1;
2565 for (int i = 0; i < this->certificate_chain_size(); i++) {
2566 ::google::protobuf::internal::WireFormatLite::WriteMessage(
2567 1, this->certificate_chain(i), output);
2568 }
2570 // optional bool trusted = 2;
2571 if (has_trusted()) {
2572 ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->trusted(), output);
2573 }
2575 }
2577 int ClientDownloadRequest_SignatureInfo::ByteSize() const {
2578 int total_size = 0;
2580 if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
2581 // optional bool trusted = 2;
2582 if (has_trusted()) {
2583 total_size += 1 + 1;
2584 }
2586 }
2587 // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1;
2588 total_size += 1 * this->certificate_chain_size();
2589 for (int i = 0; i < this->certificate_chain_size(); i++) {
2590 total_size +=
2591 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2592 this->certificate_chain(i));
2593 }
2595 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2596 _cached_size_ = total_size;
2597 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2598 return total_size;
2599 }
2601 void ClientDownloadRequest_SignatureInfo::CheckTypeAndMergeFrom(
2602 const ::google::protobuf::MessageLite& from) {
2603 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_SignatureInfo*>(&from));
2604 }
2606 void ClientDownloadRequest_SignatureInfo::MergeFrom(const ClientDownloadRequest_SignatureInfo& from) {
2607 GOOGLE_CHECK_NE(&from, this);
2608 certificate_chain_.MergeFrom(from.certificate_chain_);
2609 if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
2610 if (from.has_trusted()) {
2611 set_trusted(from.trusted());
2612 }
2613 }
2614 }
2616 void ClientDownloadRequest_SignatureInfo::CopyFrom(const ClientDownloadRequest_SignatureInfo& from) {
2617 if (&from == this) return;
2618 Clear();
2619 MergeFrom(from);
2620 }
2622 bool ClientDownloadRequest_SignatureInfo::IsInitialized() const {
2624 return true;
2625 }
2627 void ClientDownloadRequest_SignatureInfo::Swap(ClientDownloadRequest_SignatureInfo* other) {
2628 if (other != this) {
2629 certificate_chain_.Swap(&other->certificate_chain_);
2630 std::swap(trusted_, other->trusted_);
2631 std::swap(_has_bits_[0], other->_has_bits_[0]);
2632 std::swap(_cached_size_, other->_cached_size_);
2633 }
2634 }
2636 ::std::string ClientDownloadRequest_SignatureInfo::GetTypeName() const {
2637 return "safe_browsing.ClientDownloadRequest.SignatureInfo";
2638 }
2641 // -------------------------------------------------------------------
2643 #ifndef _MSC_VER
2644 const int ClientDownloadRequest::kUrlFieldNumber;
2645 const int ClientDownloadRequest::kDigestsFieldNumber;
2646 const int ClientDownloadRequest::kLengthFieldNumber;
2647 const int ClientDownloadRequest::kResourcesFieldNumber;
2648 const int ClientDownloadRequest::kSignatureFieldNumber;
2649 const int ClientDownloadRequest::kUserInitiatedFieldNumber;
2650 const int ClientDownloadRequest::kFileBasenameFieldNumber;
2651 const int ClientDownloadRequest::kDownloadTypeFieldNumber;
2652 const int ClientDownloadRequest::kLocaleFieldNumber;
2653 #endif // !_MSC_VER
2655 ClientDownloadRequest::ClientDownloadRequest()
2656 : ::google::protobuf::MessageLite() {
2657 SharedCtor();
2658 }
2660 void ClientDownloadRequest::InitAsDefaultInstance() {
2661 digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance());
2662 signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance());
2663 }
2665 ClientDownloadRequest::ClientDownloadRequest(const ClientDownloadRequest& from)
2666 : ::google::protobuf::MessageLite() {
2667 SharedCtor();
2668 MergeFrom(from);
2669 }
2671 void ClientDownloadRequest::SharedCtor() {
2672 _cached_size_ = 0;
2673 url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
2674 digests_ = NULL;
2675 length_ = GOOGLE_LONGLONG(0);
2676 signature_ = NULL;
2677 user_initiated_ = false;
2678 file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
2679 download_type_ = 0;
2680 locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
2681 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2682 }
2684 ClientDownloadRequest::~ClientDownloadRequest() {
2685 SharedDtor();
2686 }
2688 void ClientDownloadRequest::SharedDtor() {
2689 if (url_ != &::google::protobuf::internal::kEmptyString) {
2690 delete url_;
2691 }
2692 if (file_basename_ != &::google::protobuf::internal::kEmptyString) {
2693 delete file_basename_;
2694 }
2695 if (locale_ != &::google::protobuf::internal::kEmptyString) {
2696 delete locale_;
2697 }
2698 if (this != default_instance_) {
2699 delete digests_;
2700 delete signature_;
2701 }
2702 }
2704 void ClientDownloadRequest::SetCachedSize(int size) const {
2705 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
2706 _cached_size_ = size;
2707 GOOGLE_SAFE_CONCURRENT_WRITES_END();
2708 }
2709 const ClientDownloadRequest& ClientDownloadRequest::default_instance() {
2710 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
2711 }
2713 ClientDownloadRequest* ClientDownloadRequest::default_instance_ = NULL;
2715 ClientDownloadRequest* ClientDownloadRequest::New() const {
2716 return new ClientDownloadRequest;
2717 }
2719 void ClientDownloadRequest::Clear() {
2720 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2721 if (has_url()) {
2722 if (url_ != &::google::protobuf::internal::kEmptyString) {
2723 url_->clear();
2724 }
2725 }
2726 if (has_digests()) {
2727 if (digests_ != NULL) digests_->::safe_browsing::ClientDownloadRequest_Digests::Clear();
2728 }
2729 length_ = GOOGLE_LONGLONG(0);
2730 if (has_signature()) {
2731 if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear();
2732 }
2733 user_initiated_ = false;
2734 if (has_file_basename()) {
2735 if (file_basename_ != &::google::protobuf::internal::kEmptyString) {
2736 file_basename_->clear();
2737 }
2738 }
2739 download_type_ = 0;
2740 }
2741 if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
2742 if (has_locale()) {
2743 if (locale_ != &::google::protobuf::internal::kEmptyString) {
2744 locale_->clear();
2745 }
2746 }
2747 }
2748 resources_.Clear();
2749 ::memset(_has_bits_, 0, sizeof(_has_bits_));
2750 }
2752 bool ClientDownloadRequest::MergePartialFromCodedStream(
2753 ::google::protobuf::io::CodedInputStream* input) {
2754 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
2755 ::google::protobuf::uint32 tag;
2756 while ((tag = input->ReadTag()) != 0) {
2757 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
2758 // required string url = 1;
2759 case 1: {
2760 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2761 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2762 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
2763 input, this->mutable_url()));
2764 } else {
2765 goto handle_uninterpreted;
2766 }
2767 if (input->ExpectTag(18)) goto parse_digests;
2768 break;
2769 }
2771 // required .safe_browsing.ClientDownloadRequest.Digests digests = 2;
2772 case 2: {
2773 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2774 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2775 parse_digests:
2776 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
2777 input, mutable_digests()));
2778 } else {
2779 goto handle_uninterpreted;
2780 }
2781 if (input->ExpectTag(24)) goto parse_length;
2782 break;
2783 }
2785 // required int64 length = 3;
2786 case 3: {
2787 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2788 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
2789 parse_length:
2790 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2791 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
2792 input, &length_)));
2793 set_has_length();
2794 } else {
2795 goto handle_uninterpreted;
2796 }
2797 if (input->ExpectTag(34)) goto parse_resources;
2798 break;
2799 }
2801 // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4;
2802 case 4: {
2803 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2804 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2805 parse_resources:
2806 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
2807 input, add_resources()));
2808 } else {
2809 goto handle_uninterpreted;
2810 }
2811 if (input->ExpectTag(34)) goto parse_resources;
2812 if (input->ExpectTag(42)) goto parse_signature;
2813 break;
2814 }
2816 // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5;
2817 case 5: {
2818 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2819 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2820 parse_signature:
2821 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
2822 input, mutable_signature()));
2823 } else {
2824 goto handle_uninterpreted;
2825 }
2826 if (input->ExpectTag(48)) goto parse_user_initiated;
2827 break;
2828 }
2830 // optional bool user_initiated = 6;
2831 case 6: {
2832 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2833 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
2834 parse_user_initiated:
2835 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2836 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
2837 input, &user_initiated_)));
2838 set_has_user_initiated();
2839 } else {
2840 goto handle_uninterpreted;
2841 }
2842 if (input->ExpectTag(74)) goto parse_file_basename;
2843 break;
2844 }
2846 // optional string file_basename = 9;
2847 case 9: {
2848 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2849 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2850 parse_file_basename:
2851 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
2852 input, this->mutable_file_basename()));
2853 } else {
2854 goto handle_uninterpreted;
2855 }
2856 if (input->ExpectTag(80)) goto parse_download_type;
2857 break;
2858 }
2860 // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE];
2861 case 10: {
2862 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2863 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
2864 parse_download_type:
2865 int value;
2866 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
2867 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
2868 input, &value)));
2869 if (::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)) {
2870 set_download_type(static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(value));
2871 }
2872 } else {
2873 goto handle_uninterpreted;
2874 }
2875 if (input->ExpectTag(90)) goto parse_locale;
2876 break;
2877 }
2879 // optional string locale = 11;
2880 case 11: {
2881 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2882 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
2883 parse_locale:
2884 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
2885 input, this->mutable_locale()));
2886 } else {
2887 goto handle_uninterpreted;
2888 }
2889 if (input->ExpectAtEnd()) return true;
2890 break;
2891 }
2893 default: {
2894 handle_uninterpreted:
2895 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
2896 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
2897 return true;
2898 }
2899 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
2900 break;
2901 }
2902 }
2903 }
2904 return true;
2905 #undef DO_
2906 }
2908 void ClientDownloadRequest::SerializeWithCachedSizes(
2909 ::google::protobuf::io::CodedOutputStream* output) const {
2910 // required string url = 1;
2911 if (has_url()) {
2912 ::google::protobuf::internal::WireFormatLite::WriteString(
2913 1, this->url(), output);
2914 }
2916 // required .safe_browsing.ClientDownloadRequest.Digests digests = 2;
2917 if (has_digests()) {
2918 ::google::protobuf::internal::WireFormatLite::WriteMessage(
2919 2, this->digests(), output);
2920 }
2922 // required int64 length = 3;
2923 if (has_length()) {
2924 ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->length(), output);
2925 }
2927 // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4;
2928 for (int i = 0; i < this->resources_size(); i++) {
2929 ::google::protobuf::internal::WireFormatLite::WriteMessage(
2930 4, this->resources(i), output);
2931 }
2933 // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5;
2934 if (has_signature()) {
2935 ::google::protobuf::internal::WireFormatLite::WriteMessage(
2936 5, this->signature(), output);
2937 }
2939 // optional bool user_initiated = 6;
2940 if (has_user_initiated()) {
2941 ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->user_initiated(), output);
2942 }
2944 // optional string file_basename = 9;
2945 if (has_file_basename()) {
2946 ::google::protobuf::internal::WireFormatLite::WriteString(
2947 9, this->file_basename(), output);
2948 }
2950 // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE];
2951 if (has_download_type()) {
2952 ::google::protobuf::internal::WireFormatLite::WriteEnum(
2953 10, this->download_type(), output);
2954 }
2956 // optional string locale = 11;
2957 if (has_locale()) {
2958 ::google::protobuf::internal::WireFormatLite::WriteString(
2959 11, this->locale(), output);
2960 }
2962 }
2964 int ClientDownloadRequest::ByteSize() const {
2965 int total_size = 0;
2967 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
2968 // required string url = 1;
2969 if (has_url()) {
2970 total_size += 1 +
2971 ::google::protobuf::internal::WireFormatLite::StringSize(
2972 this->url());
2973 }
2975 // required .safe_browsing.ClientDownloadRequest.Digests digests = 2;
2976 if (has_digests()) {
2977 total_size += 1 +
2978 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2979 this->digests());
2980 }
2982 // required int64 length = 3;
2983 if (has_length()) {
2984 total_size += 1 +
2985 ::google::protobuf::internal::WireFormatLite::Int64Size(
2986 this->length());
2987 }
2989 // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5;
2990 if (has_signature()) {
2991 total_size += 1 +
2992 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
2993 this->signature());
2994 }
2996 // optional bool user_initiated = 6;
2997 if (has_user_initiated()) {
2998 total_size += 1 + 1;
2999 }
3001 // optional string file_basename = 9;
3002 if (has_file_basename()) {
3003 total_size += 1 +
3004 ::google::protobuf::internal::WireFormatLite::StringSize(
3005 this->file_basename());
3006 }
3008 // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE];
3009 if (has_download_type()) {
3010 total_size += 1 +
3011 ::google::protobuf::internal::WireFormatLite::EnumSize(this->download_type());
3012 }
3014 }
3015 if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
3016 // optional string locale = 11;
3017 if (has_locale()) {
3018 total_size += 1 +
3019 ::google::protobuf::internal::WireFormatLite::StringSize(
3020 this->locale());
3021 }
3023 }
3024 // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4;
3025 total_size += 1 * this->resources_size();
3026 for (int i = 0; i < this->resources_size(); i++) {
3027 total_size +=
3028 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
3029 this->resources(i));
3030 }
3032 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3033 _cached_size_ = total_size;
3034 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3035 return total_size;
3036 }
3038 void ClientDownloadRequest::CheckTypeAndMergeFrom(
3039 const ::google::protobuf::MessageLite& from) {
3040 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest*>(&from));
3041 }
3043 void ClientDownloadRequest::MergeFrom(const ClientDownloadRequest& from) {
3044 GOOGLE_CHECK_NE(&from, this);
3045 resources_.MergeFrom(from.resources_);
3046 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3047 if (from.has_url()) {
3048 set_url(from.url());
3049 }
3050 if (from.has_digests()) {
3051 mutable_digests()->::safe_browsing::ClientDownloadRequest_Digests::MergeFrom(from.digests());
3052 }
3053 if (from.has_length()) {
3054 set_length(from.length());
3055 }
3056 if (from.has_signature()) {
3057 mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature());
3058 }
3059 if (from.has_user_initiated()) {
3060 set_user_initiated(from.user_initiated());
3061 }
3062 if (from.has_file_basename()) {
3063 set_file_basename(from.file_basename());
3064 }
3065 if (from.has_download_type()) {
3066 set_download_type(from.download_type());
3067 }
3068 }
3069 if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
3070 if (from.has_locale()) {
3071 set_locale(from.locale());
3072 }
3073 }
3074 }
3076 void ClientDownloadRequest::CopyFrom(const ClientDownloadRequest& from) {
3077 if (&from == this) return;
3078 Clear();
3079 MergeFrom(from);
3080 }
3082 bool ClientDownloadRequest::IsInitialized() const {
3083 if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
3085 for (int i = 0; i < resources_size(); i++) {
3086 if (!this->resources(i).IsInitialized()) return false;
3087 }
3088 return true;
3089 }
3091 void ClientDownloadRequest::Swap(ClientDownloadRequest* other) {
3092 if (other != this) {
3093 std::swap(url_, other->url_);
3094 std::swap(digests_, other->digests_);
3095 std::swap(length_, other->length_);
3096 resources_.Swap(&other->resources_);
3097 std::swap(signature_, other->signature_);
3098 std::swap(user_initiated_, other->user_initiated_);
3099 std::swap(file_basename_, other->file_basename_);
3100 std::swap(download_type_, other->download_type_);
3101 std::swap(locale_, other->locale_);
3102 std::swap(_has_bits_[0], other->_has_bits_[0]);
3103 std::swap(_cached_size_, other->_cached_size_);
3104 }
3105 }
3107 ::std::string ClientDownloadRequest::GetTypeName() const {
3108 return "safe_browsing.ClientDownloadRequest";
3109 }
3112 // ===================================================================
3114 bool ClientDownloadResponse_Verdict_IsValid(int value) {
3115 switch(value) {
3116 case 0:
3117 case 1:
3118 case 2:
3119 case 3:
3120 case 4:
3121 return true;
3122 default:
3123 return false;
3124 }
3125 }
3127 #ifndef _MSC_VER
3128 const ClientDownloadResponse_Verdict ClientDownloadResponse::SAFE;
3129 const ClientDownloadResponse_Verdict ClientDownloadResponse::DANGEROUS;
3130 const ClientDownloadResponse_Verdict ClientDownloadResponse::UNCOMMON;
3131 const ClientDownloadResponse_Verdict ClientDownloadResponse::POTENTIALLY_UNWANTED;
3132 const ClientDownloadResponse_Verdict ClientDownloadResponse::DANGEROUS_HOST;
3133 const ClientDownloadResponse_Verdict ClientDownloadResponse::Verdict_MIN;
3134 const ClientDownloadResponse_Verdict ClientDownloadResponse::Verdict_MAX;
3135 const int ClientDownloadResponse::Verdict_ARRAYSIZE;
3136 #endif // _MSC_VER
3137 #ifndef _MSC_VER
3138 const int ClientDownloadResponse_MoreInfo::kDescriptionFieldNumber;
3139 const int ClientDownloadResponse_MoreInfo::kUrlFieldNumber;
3140 #endif // !_MSC_VER
3142 ClientDownloadResponse_MoreInfo::ClientDownloadResponse_MoreInfo()
3143 : ::google::protobuf::MessageLite() {
3144 SharedCtor();
3145 }
3147 void ClientDownloadResponse_MoreInfo::InitAsDefaultInstance() {
3148 }
3150 ClientDownloadResponse_MoreInfo::ClientDownloadResponse_MoreInfo(const ClientDownloadResponse_MoreInfo& from)
3151 : ::google::protobuf::MessageLite() {
3152 SharedCtor();
3153 MergeFrom(from);
3154 }
3156 void ClientDownloadResponse_MoreInfo::SharedCtor() {
3157 _cached_size_ = 0;
3158 description_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
3159 url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
3160 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3161 }
3163 ClientDownloadResponse_MoreInfo::~ClientDownloadResponse_MoreInfo() {
3164 SharedDtor();
3165 }
3167 void ClientDownloadResponse_MoreInfo::SharedDtor() {
3168 if (description_ != &::google::protobuf::internal::kEmptyString) {
3169 delete description_;
3170 }
3171 if (url_ != &::google::protobuf::internal::kEmptyString) {
3172 delete url_;
3173 }
3174 if (this != default_instance_) {
3175 }
3176 }
3178 void ClientDownloadResponse_MoreInfo::SetCachedSize(int size) const {
3179 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3180 _cached_size_ = size;
3181 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3182 }
3183 const ClientDownloadResponse_MoreInfo& ClientDownloadResponse_MoreInfo::default_instance() {
3184 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
3185 }
3187 ClientDownloadResponse_MoreInfo* ClientDownloadResponse_MoreInfo::default_instance_ = NULL;
3189 ClientDownloadResponse_MoreInfo* ClientDownloadResponse_MoreInfo::New() const {
3190 return new ClientDownloadResponse_MoreInfo;
3191 }
3193 void ClientDownloadResponse_MoreInfo::Clear() {
3194 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3195 if (has_description()) {
3196 if (description_ != &::google::protobuf::internal::kEmptyString) {
3197 description_->clear();
3198 }
3199 }
3200 if (has_url()) {
3201 if (url_ != &::google::protobuf::internal::kEmptyString) {
3202 url_->clear();
3203 }
3204 }
3205 }
3206 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3207 }
3209 bool ClientDownloadResponse_MoreInfo::MergePartialFromCodedStream(
3210 ::google::protobuf::io::CodedInputStream* input) {
3211 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
3212 ::google::protobuf::uint32 tag;
3213 while ((tag = input->ReadTag()) != 0) {
3214 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3215 // optional string description = 1;
3216 case 1: {
3217 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3218 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3219 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
3220 input, this->mutable_description()));
3221 } else {
3222 goto handle_uninterpreted;
3223 }
3224 if (input->ExpectTag(18)) goto parse_url;
3225 break;
3226 }
3228 // optional string url = 2;
3229 case 2: {
3230 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3231 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3232 parse_url:
3233 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
3234 input, this->mutable_url()));
3235 } else {
3236 goto handle_uninterpreted;
3237 }
3238 if (input->ExpectAtEnd()) return true;
3239 break;
3240 }
3242 default: {
3243 handle_uninterpreted:
3244 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3245 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3246 return true;
3247 }
3248 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
3249 break;
3250 }
3251 }
3252 }
3253 return true;
3254 #undef DO_
3255 }
3257 void ClientDownloadResponse_MoreInfo::SerializeWithCachedSizes(
3258 ::google::protobuf::io::CodedOutputStream* output) const {
3259 // optional string description = 1;
3260 if (has_description()) {
3261 ::google::protobuf::internal::WireFormatLite::WriteString(
3262 1, this->description(), output);
3263 }
3265 // optional string url = 2;
3266 if (has_url()) {
3267 ::google::protobuf::internal::WireFormatLite::WriteString(
3268 2, this->url(), output);
3269 }
3271 }
3273 int ClientDownloadResponse_MoreInfo::ByteSize() const {
3274 int total_size = 0;
3276 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3277 // optional string description = 1;
3278 if (has_description()) {
3279 total_size += 1 +
3280 ::google::protobuf::internal::WireFormatLite::StringSize(
3281 this->description());
3282 }
3284 // optional string url = 2;
3285 if (has_url()) {
3286 total_size += 1 +
3287 ::google::protobuf::internal::WireFormatLite::StringSize(
3288 this->url());
3289 }
3291 }
3292 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3293 _cached_size_ = total_size;
3294 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3295 return total_size;
3296 }
3298 void ClientDownloadResponse_MoreInfo::CheckTypeAndMergeFrom(
3299 const ::google::protobuf::MessageLite& from) {
3300 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadResponse_MoreInfo*>(&from));
3301 }
3303 void ClientDownloadResponse_MoreInfo::MergeFrom(const ClientDownloadResponse_MoreInfo& from) {
3304 GOOGLE_CHECK_NE(&from, this);
3305 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3306 if (from.has_description()) {
3307 set_description(from.description());
3308 }
3309 if (from.has_url()) {
3310 set_url(from.url());
3311 }
3312 }
3313 }
3315 void ClientDownloadResponse_MoreInfo::CopyFrom(const ClientDownloadResponse_MoreInfo& from) {
3316 if (&from == this) return;
3317 Clear();
3318 MergeFrom(from);
3319 }
3321 bool ClientDownloadResponse_MoreInfo::IsInitialized() const {
3323 return true;
3324 }
3326 void ClientDownloadResponse_MoreInfo::Swap(ClientDownloadResponse_MoreInfo* other) {
3327 if (other != this) {
3328 std::swap(description_, other->description_);
3329 std::swap(url_, other->url_);
3330 std::swap(_has_bits_[0], other->_has_bits_[0]);
3331 std::swap(_cached_size_, other->_cached_size_);
3332 }
3333 }
3335 ::std::string ClientDownloadResponse_MoreInfo::GetTypeName() const {
3336 return "safe_browsing.ClientDownloadResponse.MoreInfo";
3337 }
3340 // -------------------------------------------------------------------
3342 #ifndef _MSC_VER
3343 const int ClientDownloadResponse::kVerdictFieldNumber;
3344 const int ClientDownloadResponse::kMoreInfoFieldNumber;
3345 const int ClientDownloadResponse::kTokenFieldNumber;
3346 #endif // !_MSC_VER
3348 ClientDownloadResponse::ClientDownloadResponse()
3349 : ::google::protobuf::MessageLite() {
3350 SharedCtor();
3351 }
3353 void ClientDownloadResponse::InitAsDefaultInstance() {
3354 more_info_ = const_cast< ::safe_browsing::ClientDownloadResponse_MoreInfo*>(&::safe_browsing::ClientDownloadResponse_MoreInfo::default_instance());
3355 }
3357 ClientDownloadResponse::ClientDownloadResponse(const ClientDownloadResponse& from)
3358 : ::google::protobuf::MessageLite() {
3359 SharedCtor();
3360 MergeFrom(from);
3361 }
3363 void ClientDownloadResponse::SharedCtor() {
3364 _cached_size_ = 0;
3365 verdict_ = 0;
3366 more_info_ = NULL;
3367 token_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
3368 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3369 }
3371 ClientDownloadResponse::~ClientDownloadResponse() {
3372 SharedDtor();
3373 }
3375 void ClientDownloadResponse::SharedDtor() {
3376 if (token_ != &::google::protobuf::internal::kEmptyString) {
3377 delete token_;
3378 }
3379 if (this != default_instance_) {
3380 delete more_info_;
3381 }
3382 }
3384 void ClientDownloadResponse::SetCachedSize(int size) const {
3385 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3386 _cached_size_ = size;
3387 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3388 }
3389 const ClientDownloadResponse& ClientDownloadResponse::default_instance() {
3390 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
3391 }
3393 ClientDownloadResponse* ClientDownloadResponse::default_instance_ = NULL;
3395 ClientDownloadResponse* ClientDownloadResponse::New() const {
3396 return new ClientDownloadResponse;
3397 }
3399 void ClientDownloadResponse::Clear() {
3400 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3401 verdict_ = 0;
3402 if (has_more_info()) {
3403 if (more_info_ != NULL) more_info_->::safe_browsing::ClientDownloadResponse_MoreInfo::Clear();
3404 }
3405 if (has_token()) {
3406 if (token_ != &::google::protobuf::internal::kEmptyString) {
3407 token_->clear();
3408 }
3409 }
3410 }
3411 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3412 }
3414 bool ClientDownloadResponse::MergePartialFromCodedStream(
3415 ::google::protobuf::io::CodedInputStream* input) {
3416 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
3417 ::google::protobuf::uint32 tag;
3418 while ((tag = input->ReadTag()) != 0) {
3419 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3420 // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
3421 case 1: {
3422 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3423 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
3424 int value;
3425 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
3426 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
3427 input, &value)));
3428 if (::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value)) {
3429 set_verdict(static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(value));
3430 }
3431 } else {
3432 goto handle_uninterpreted;
3433 }
3434 if (input->ExpectTag(18)) goto parse_more_info;
3435 break;
3436 }
3438 // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2;
3439 case 2: {
3440 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3441 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3442 parse_more_info:
3443 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3444 input, mutable_more_info()));
3445 } else {
3446 goto handle_uninterpreted;
3447 }
3448 if (input->ExpectTag(26)) goto parse_token;
3449 break;
3450 }
3452 // optional bytes token = 3;
3453 case 3: {
3454 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3455 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3456 parse_token:
3457 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
3458 input, this->mutable_token()));
3459 } else {
3460 goto handle_uninterpreted;
3461 }
3462 if (input->ExpectAtEnd()) return true;
3463 break;
3464 }
3466 default: {
3467 handle_uninterpreted:
3468 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3469 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3470 return true;
3471 }
3472 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
3473 break;
3474 }
3475 }
3476 }
3477 return true;
3478 #undef DO_
3479 }
3481 void ClientDownloadResponse::SerializeWithCachedSizes(
3482 ::google::protobuf::io::CodedOutputStream* output) const {
3483 // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
3484 if (has_verdict()) {
3485 ::google::protobuf::internal::WireFormatLite::WriteEnum(
3486 1, this->verdict(), output);
3487 }
3489 // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2;
3490 if (has_more_info()) {
3491 ::google::protobuf::internal::WireFormatLite::WriteMessage(
3492 2, this->more_info(), output);
3493 }
3495 // optional bytes token = 3;
3496 if (has_token()) {
3497 ::google::protobuf::internal::WireFormatLite::WriteBytes(
3498 3, this->token(), output);
3499 }
3501 }
3503 int ClientDownloadResponse::ByteSize() const {
3504 int total_size = 0;
3506 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3507 // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
3508 if (has_verdict()) {
3509 total_size += 1 +
3510 ::google::protobuf::internal::WireFormatLite::EnumSize(this->verdict());
3511 }
3513 // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2;
3514 if (has_more_info()) {
3515 total_size += 1 +
3516 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
3517 this->more_info());
3518 }
3520 // optional bytes token = 3;
3521 if (has_token()) {
3522 total_size += 1 +
3523 ::google::protobuf::internal::WireFormatLite::BytesSize(
3524 this->token());
3525 }
3527 }
3528 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3529 _cached_size_ = total_size;
3530 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3531 return total_size;
3532 }
3534 void ClientDownloadResponse::CheckTypeAndMergeFrom(
3535 const ::google::protobuf::MessageLite& from) {
3536 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadResponse*>(&from));
3537 }
3539 void ClientDownloadResponse::MergeFrom(const ClientDownloadResponse& from) {
3540 GOOGLE_CHECK_NE(&from, this);
3541 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3542 if (from.has_verdict()) {
3543 set_verdict(from.verdict());
3544 }
3545 if (from.has_more_info()) {
3546 mutable_more_info()->::safe_browsing::ClientDownloadResponse_MoreInfo::MergeFrom(from.more_info());
3547 }
3548 if (from.has_token()) {
3549 set_token(from.token());
3550 }
3551 }
3552 }
3554 void ClientDownloadResponse::CopyFrom(const ClientDownloadResponse& from) {
3555 if (&from == this) return;
3556 Clear();
3557 MergeFrom(from);
3558 }
3560 bool ClientDownloadResponse::IsInitialized() const {
3561 if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
3563 return true;
3564 }
3566 void ClientDownloadResponse::Swap(ClientDownloadResponse* other) {
3567 if (other != this) {
3568 std::swap(verdict_, other->verdict_);
3569 std::swap(more_info_, other->more_info_);
3570 std::swap(token_, other->token_);
3571 std::swap(_has_bits_[0], other->_has_bits_[0]);
3572 std::swap(_cached_size_, other->_cached_size_);
3573 }
3574 }
3576 ::std::string ClientDownloadResponse::GetTypeName() const {
3577 return "safe_browsing.ClientDownloadResponse";
3578 }
3581 // ===================================================================
3583 bool ClientDownloadReport_Reason_IsValid(int value) {
3584 switch(value) {
3585 case 0:
3586 case 1:
3587 case 2:
3588 return true;
3589 default:
3590 return false;
3591 }
3592 }
3594 #ifndef _MSC_VER
3595 const ClientDownloadReport_Reason ClientDownloadReport::SHARE;
3596 const ClientDownloadReport_Reason ClientDownloadReport::FALSE_POSITIVE;
3597 const ClientDownloadReport_Reason ClientDownloadReport::APPEAL;
3598 const ClientDownloadReport_Reason ClientDownloadReport::Reason_MIN;
3599 const ClientDownloadReport_Reason ClientDownloadReport::Reason_MAX;
3600 const int ClientDownloadReport::Reason_ARRAYSIZE;
3601 #endif // _MSC_VER
3602 #ifndef _MSC_VER
3603 const int ClientDownloadReport_UserInformation::kEmailFieldNumber;
3604 #endif // !_MSC_VER
3606 ClientDownloadReport_UserInformation::ClientDownloadReport_UserInformation()
3607 : ::google::protobuf::MessageLite() {
3608 SharedCtor();
3609 }
3611 void ClientDownloadReport_UserInformation::InitAsDefaultInstance() {
3612 }
3614 ClientDownloadReport_UserInformation::ClientDownloadReport_UserInformation(const ClientDownloadReport_UserInformation& from)
3615 : ::google::protobuf::MessageLite() {
3616 SharedCtor();
3617 MergeFrom(from);
3618 }
3620 void ClientDownloadReport_UserInformation::SharedCtor() {
3621 _cached_size_ = 0;
3622 email_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
3623 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3624 }
3626 ClientDownloadReport_UserInformation::~ClientDownloadReport_UserInformation() {
3627 SharedDtor();
3628 }
3630 void ClientDownloadReport_UserInformation::SharedDtor() {
3631 if (email_ != &::google::protobuf::internal::kEmptyString) {
3632 delete email_;
3633 }
3634 if (this != default_instance_) {
3635 }
3636 }
3638 void ClientDownloadReport_UserInformation::SetCachedSize(int size) const {
3639 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3640 _cached_size_ = size;
3641 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3642 }
3643 const ClientDownloadReport_UserInformation& ClientDownloadReport_UserInformation::default_instance() {
3644 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
3645 }
3647 ClientDownloadReport_UserInformation* ClientDownloadReport_UserInformation::default_instance_ = NULL;
3649 ClientDownloadReport_UserInformation* ClientDownloadReport_UserInformation::New() const {
3650 return new ClientDownloadReport_UserInformation;
3651 }
3653 void ClientDownloadReport_UserInformation::Clear() {
3654 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3655 if (has_email()) {
3656 if (email_ != &::google::protobuf::internal::kEmptyString) {
3657 email_->clear();
3658 }
3659 }
3660 }
3661 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3662 }
3664 bool ClientDownloadReport_UserInformation::MergePartialFromCodedStream(
3665 ::google::protobuf::io::CodedInputStream* input) {
3666 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
3667 ::google::protobuf::uint32 tag;
3668 while ((tag = input->ReadTag()) != 0) {
3669 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3670 // optional string email = 1;
3671 case 1: {
3672 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3673 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3674 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
3675 input, this->mutable_email()));
3676 } else {
3677 goto handle_uninterpreted;
3678 }
3679 if (input->ExpectAtEnd()) return true;
3680 break;
3681 }
3683 default: {
3684 handle_uninterpreted:
3685 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3686 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3687 return true;
3688 }
3689 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
3690 break;
3691 }
3692 }
3693 }
3694 return true;
3695 #undef DO_
3696 }
3698 void ClientDownloadReport_UserInformation::SerializeWithCachedSizes(
3699 ::google::protobuf::io::CodedOutputStream* output) const {
3700 // optional string email = 1;
3701 if (has_email()) {
3702 ::google::protobuf::internal::WireFormatLite::WriteString(
3703 1, this->email(), output);
3704 }
3706 }
3708 int ClientDownloadReport_UserInformation::ByteSize() const {
3709 int total_size = 0;
3711 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3712 // optional string email = 1;
3713 if (has_email()) {
3714 total_size += 1 +
3715 ::google::protobuf::internal::WireFormatLite::StringSize(
3716 this->email());
3717 }
3719 }
3720 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3721 _cached_size_ = total_size;
3722 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3723 return total_size;
3724 }
3726 void ClientDownloadReport_UserInformation::CheckTypeAndMergeFrom(
3727 const ::google::protobuf::MessageLite& from) {
3728 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadReport_UserInformation*>(&from));
3729 }
3731 void ClientDownloadReport_UserInformation::MergeFrom(const ClientDownloadReport_UserInformation& from) {
3732 GOOGLE_CHECK_NE(&from, this);
3733 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3734 if (from.has_email()) {
3735 set_email(from.email());
3736 }
3737 }
3738 }
3740 void ClientDownloadReport_UserInformation::CopyFrom(const ClientDownloadReport_UserInformation& from) {
3741 if (&from == this) return;
3742 Clear();
3743 MergeFrom(from);
3744 }
3746 bool ClientDownloadReport_UserInformation::IsInitialized() const {
3748 return true;
3749 }
3751 void ClientDownloadReport_UserInformation::Swap(ClientDownloadReport_UserInformation* other) {
3752 if (other != this) {
3753 std::swap(email_, other->email_);
3754 std::swap(_has_bits_[0], other->_has_bits_[0]);
3755 std::swap(_cached_size_, other->_cached_size_);
3756 }
3757 }
3759 ::std::string ClientDownloadReport_UserInformation::GetTypeName() const {
3760 return "safe_browsing.ClientDownloadReport.UserInformation";
3761 }
3764 // -------------------------------------------------------------------
3766 #ifndef _MSC_VER
3767 const int ClientDownloadReport::kReasonFieldNumber;
3768 const int ClientDownloadReport::kDownloadRequestFieldNumber;
3769 const int ClientDownloadReport::kUserInformationFieldNumber;
3770 const int ClientDownloadReport::kCommentFieldNumber;
3771 const int ClientDownloadReport::kDownloadResponseFieldNumber;
3772 #endif // !_MSC_VER
3774 ClientDownloadReport::ClientDownloadReport()
3775 : ::google::protobuf::MessageLite() {
3776 SharedCtor();
3777 }
3779 void ClientDownloadReport::InitAsDefaultInstance() {
3780 download_request_ = const_cast< ::safe_browsing::ClientDownloadRequest*>(&::safe_browsing::ClientDownloadRequest::default_instance());
3781 user_information_ = const_cast< ::safe_browsing::ClientDownloadReport_UserInformation*>(&::safe_browsing::ClientDownloadReport_UserInformation::default_instance());
3782 download_response_ = const_cast< ::safe_browsing::ClientDownloadResponse*>(&::safe_browsing::ClientDownloadResponse::default_instance());
3783 }
3785 ClientDownloadReport::ClientDownloadReport(const ClientDownloadReport& from)
3786 : ::google::protobuf::MessageLite() {
3787 SharedCtor();
3788 MergeFrom(from);
3789 }
3791 void ClientDownloadReport::SharedCtor() {
3792 _cached_size_ = 0;
3793 reason_ = 0;
3794 download_request_ = NULL;
3795 user_information_ = NULL;
3796 comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
3797 download_response_ = NULL;
3798 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3799 }
3801 ClientDownloadReport::~ClientDownloadReport() {
3802 SharedDtor();
3803 }
3805 void ClientDownloadReport::SharedDtor() {
3806 if (comment_ != &::google::protobuf::internal::kEmptyString) {
3807 delete comment_;
3808 }
3809 if (this != default_instance_) {
3810 delete download_request_;
3811 delete user_information_;
3812 delete download_response_;
3813 }
3814 }
3816 void ClientDownloadReport::SetCachedSize(int size) const {
3817 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
3818 _cached_size_ = size;
3819 GOOGLE_SAFE_CONCURRENT_WRITES_END();
3820 }
3821 const ClientDownloadReport& ClientDownloadReport::default_instance() {
3822 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
3823 }
3825 ClientDownloadReport* ClientDownloadReport::default_instance_ = NULL;
3827 ClientDownloadReport* ClientDownloadReport::New() const {
3828 return new ClientDownloadReport;
3829 }
3831 void ClientDownloadReport::Clear() {
3832 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3833 reason_ = 0;
3834 if (has_download_request()) {
3835 if (download_request_ != NULL) download_request_->::safe_browsing::ClientDownloadRequest::Clear();
3836 }
3837 if (has_user_information()) {
3838 if (user_information_ != NULL) user_information_->::safe_browsing::ClientDownloadReport_UserInformation::Clear();
3839 }
3840 if (has_comment()) {
3841 if (comment_ != &::google::protobuf::internal::kEmptyString) {
3842 comment_->clear();
3843 }
3844 }
3845 if (has_download_response()) {
3846 if (download_response_ != NULL) download_response_->::safe_browsing::ClientDownloadResponse::Clear();
3847 }
3848 }
3849 ::memset(_has_bits_, 0, sizeof(_has_bits_));
3850 }
3852 bool ClientDownloadReport::MergePartialFromCodedStream(
3853 ::google::protobuf::io::CodedInputStream* input) {
3854 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
3855 ::google::protobuf::uint32 tag;
3856 while ((tag = input->ReadTag()) != 0) {
3857 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
3858 // optional .safe_browsing.ClientDownloadReport.Reason reason = 1;
3859 case 1: {
3860 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3861 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
3862 int value;
3863 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
3864 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
3865 input, &value)));
3866 if (::safe_browsing::ClientDownloadReport_Reason_IsValid(value)) {
3867 set_reason(static_cast< ::safe_browsing::ClientDownloadReport_Reason >(value));
3868 }
3869 } else {
3870 goto handle_uninterpreted;
3871 }
3872 if (input->ExpectTag(18)) goto parse_download_request;
3873 break;
3874 }
3876 // optional .safe_browsing.ClientDownloadRequest download_request = 2;
3877 case 2: {
3878 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3879 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3880 parse_download_request:
3881 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3882 input, mutable_download_request()));
3883 } else {
3884 goto handle_uninterpreted;
3885 }
3886 if (input->ExpectTag(26)) goto parse_user_information;
3887 break;
3888 }
3890 // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3;
3891 case 3: {
3892 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3893 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3894 parse_user_information:
3895 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3896 input, mutable_user_information()));
3897 } else {
3898 goto handle_uninterpreted;
3899 }
3900 if (input->ExpectTag(34)) goto parse_comment;
3901 break;
3902 }
3904 // optional bytes comment = 4;
3905 case 4: {
3906 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3907 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3908 parse_comment:
3909 DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
3910 input, this->mutable_comment()));
3911 } else {
3912 goto handle_uninterpreted;
3913 }
3914 if (input->ExpectTag(42)) goto parse_download_response;
3915 break;
3916 }
3918 // optional .safe_browsing.ClientDownloadResponse download_response = 5;
3919 case 5: {
3920 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3921 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
3922 parse_download_response:
3923 DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
3924 input, mutable_download_response()));
3925 } else {
3926 goto handle_uninterpreted;
3927 }
3928 if (input->ExpectAtEnd()) return true;
3929 break;
3930 }
3932 default: {
3933 handle_uninterpreted:
3934 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
3935 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
3936 return true;
3937 }
3938 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
3939 break;
3940 }
3941 }
3942 }
3943 return true;
3944 #undef DO_
3945 }
3947 void ClientDownloadReport::SerializeWithCachedSizes(
3948 ::google::protobuf::io::CodedOutputStream* output) const {
3949 // optional .safe_browsing.ClientDownloadReport.Reason reason = 1;
3950 if (has_reason()) {
3951 ::google::protobuf::internal::WireFormatLite::WriteEnum(
3952 1, this->reason(), output);
3953 }
3955 // optional .safe_browsing.ClientDownloadRequest download_request = 2;
3956 if (has_download_request()) {
3957 ::google::protobuf::internal::WireFormatLite::WriteMessage(
3958 2, this->download_request(), output);
3959 }
3961 // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3;
3962 if (has_user_information()) {
3963 ::google::protobuf::internal::WireFormatLite::WriteMessage(
3964 3, this->user_information(), output);
3965 }
3967 // optional bytes comment = 4;
3968 if (has_comment()) {
3969 ::google::protobuf::internal::WireFormatLite::WriteBytes(
3970 4, this->comment(), output);
3971 }
3973 // optional .safe_browsing.ClientDownloadResponse download_response = 5;
3974 if (has_download_response()) {
3975 ::google::protobuf::internal::WireFormatLite::WriteMessage(
3976 5, this->download_response(), output);
3977 }
3979 }
3981 int ClientDownloadReport::ByteSize() const {
3982 int total_size = 0;
3984 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
3985 // optional .safe_browsing.ClientDownloadReport.Reason reason = 1;
3986 if (has_reason()) {
3987 total_size += 1 +
3988 ::google::protobuf::internal::WireFormatLite::EnumSize(this->reason());
3989 }
3991 // optional .safe_browsing.ClientDownloadRequest download_request = 2;
3992 if (has_download_request()) {
3993 total_size += 1 +
3994 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
3995 this->download_request());
3996 }
3998 // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3;
3999 if (has_user_information()) {
4000 total_size += 1 +
4001 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
4002 this->user_information());
4003 }
4005 // optional bytes comment = 4;
4006 if (has_comment()) {
4007 total_size += 1 +
4008 ::google::protobuf::internal::WireFormatLite::BytesSize(
4009 this->comment());
4010 }
4012 // optional .safe_browsing.ClientDownloadResponse download_response = 5;
4013 if (has_download_response()) {
4014 total_size += 1 +
4015 ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
4016 this->download_response());
4017 }
4019 }
4020 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4021 _cached_size_ = total_size;
4022 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4023 return total_size;
4024 }
4026 void ClientDownloadReport::CheckTypeAndMergeFrom(
4027 const ::google::protobuf::MessageLite& from) {
4028 MergeFrom(*::google::protobuf::down_cast<const ClientDownloadReport*>(&from));
4029 }
4031 void ClientDownloadReport::MergeFrom(const ClientDownloadReport& from) {
4032 GOOGLE_CHECK_NE(&from, this);
4033 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4034 if (from.has_reason()) {
4035 set_reason(from.reason());
4036 }
4037 if (from.has_download_request()) {
4038 mutable_download_request()->::safe_browsing::ClientDownloadRequest::MergeFrom(from.download_request());
4039 }
4040 if (from.has_user_information()) {
4041 mutable_user_information()->::safe_browsing::ClientDownloadReport_UserInformation::MergeFrom(from.user_information());
4042 }
4043 if (from.has_comment()) {
4044 set_comment(from.comment());
4045 }
4046 if (from.has_download_response()) {
4047 mutable_download_response()->::safe_browsing::ClientDownloadResponse::MergeFrom(from.download_response());
4048 }
4049 }
4050 }
4052 void ClientDownloadReport::CopyFrom(const ClientDownloadReport& from) {
4053 if (&from == this) return;
4054 Clear();
4055 MergeFrom(from);
4056 }
4058 bool ClientDownloadReport::IsInitialized() const {
4060 if (has_download_request()) {
4061 if (!this->download_request().IsInitialized()) return false;
4062 }
4063 if (has_download_response()) {
4064 if (!this->download_response().IsInitialized()) return false;
4065 }
4066 return true;
4067 }
4069 void ClientDownloadReport::Swap(ClientDownloadReport* other) {
4070 if (other != this) {
4071 std::swap(reason_, other->reason_);
4072 std::swap(download_request_, other->download_request_);
4073 std::swap(user_information_, other->user_information_);
4074 std::swap(comment_, other->comment_);
4075 std::swap(download_response_, other->download_response_);
4076 std::swap(_has_bits_[0], other->_has_bits_[0]);
4077 std::swap(_cached_size_, other->_cached_size_);
4078 }
4079 }
4081 ::std::string ClientDownloadReport::GetTypeName() const {
4082 return "safe_browsing.ClientDownloadReport";
4083 }
4086 // ===================================================================
4088 bool ClientUploadResponse_UploadStatus_IsValid(int value) {
4089 switch(value) {
4090 case 0:
4091 case 1:
4092 return true;
4093 default:
4094 return false;
4095 }
4096 }
4098 #ifndef _MSC_VER
4099 const ClientUploadResponse_UploadStatus ClientUploadResponse::SUCCESS;
4100 const ClientUploadResponse_UploadStatus ClientUploadResponse::UPLOAD_FAILURE;
4101 const ClientUploadResponse_UploadStatus ClientUploadResponse::UploadStatus_MIN;
4102 const ClientUploadResponse_UploadStatus ClientUploadResponse::UploadStatus_MAX;
4103 const int ClientUploadResponse::UploadStatus_ARRAYSIZE;
4104 #endif // _MSC_VER
4105 #ifndef _MSC_VER
4106 const int ClientUploadResponse::kStatusFieldNumber;
4107 const int ClientUploadResponse::kPermalinkFieldNumber;
4108 #endif // !_MSC_VER
4110 ClientUploadResponse::ClientUploadResponse()
4111 : ::google::protobuf::MessageLite() {
4112 SharedCtor();
4113 }
4115 void ClientUploadResponse::InitAsDefaultInstance() {
4116 }
4118 ClientUploadResponse::ClientUploadResponse(const ClientUploadResponse& from)
4119 : ::google::protobuf::MessageLite() {
4120 SharedCtor();
4121 MergeFrom(from);
4122 }
4124 void ClientUploadResponse::SharedCtor() {
4125 _cached_size_ = 0;
4126 status_ = 0;
4127 permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
4128 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4129 }
4131 ClientUploadResponse::~ClientUploadResponse() {
4132 SharedDtor();
4133 }
4135 void ClientUploadResponse::SharedDtor() {
4136 if (permalink_ != &::google::protobuf::internal::kEmptyString) {
4137 delete permalink_;
4138 }
4139 if (this != default_instance_) {
4140 }
4141 }
4143 void ClientUploadResponse::SetCachedSize(int size) const {
4144 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4145 _cached_size_ = size;
4146 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4147 }
4148 const ClientUploadResponse& ClientUploadResponse::default_instance() {
4149 if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto(); return *default_instance_;
4150 }
4152 ClientUploadResponse* ClientUploadResponse::default_instance_ = NULL;
4154 ClientUploadResponse* ClientUploadResponse::New() const {
4155 return new ClientUploadResponse;
4156 }
4158 void ClientUploadResponse::Clear() {
4159 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4160 status_ = 0;
4161 if (has_permalink()) {
4162 if (permalink_ != &::google::protobuf::internal::kEmptyString) {
4163 permalink_->clear();
4164 }
4165 }
4166 }
4167 ::memset(_has_bits_, 0, sizeof(_has_bits_));
4168 }
4170 bool ClientUploadResponse::MergePartialFromCodedStream(
4171 ::google::protobuf::io::CodedInputStream* input) {
4172 #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
4173 ::google::protobuf::uint32 tag;
4174 while ((tag = input->ReadTag()) != 0) {
4175 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
4176 // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1;
4177 case 1: {
4178 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4179 ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
4180 int value;
4181 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
4182 int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
4183 input, &value)));
4184 if (::safe_browsing::ClientUploadResponse_UploadStatus_IsValid(value)) {
4185 set_status(static_cast< ::safe_browsing::ClientUploadResponse_UploadStatus >(value));
4186 }
4187 } else {
4188 goto handle_uninterpreted;
4189 }
4190 if (input->ExpectTag(18)) goto parse_permalink;
4191 break;
4192 }
4194 // optional string permalink = 2;
4195 case 2: {
4196 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4197 ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
4198 parse_permalink:
4199 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
4200 input, this->mutable_permalink()));
4201 } else {
4202 goto handle_uninterpreted;
4203 }
4204 if (input->ExpectAtEnd()) return true;
4205 break;
4206 }
4208 default: {
4209 handle_uninterpreted:
4210 if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
4211 ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
4212 return true;
4213 }
4214 DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
4215 break;
4216 }
4217 }
4218 }
4219 return true;
4220 #undef DO_
4221 }
4223 void ClientUploadResponse::SerializeWithCachedSizes(
4224 ::google::protobuf::io::CodedOutputStream* output) const {
4225 // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1;
4226 if (has_status()) {
4227 ::google::protobuf::internal::WireFormatLite::WriteEnum(
4228 1, this->status(), output);
4229 }
4231 // optional string permalink = 2;
4232 if (has_permalink()) {
4233 ::google::protobuf::internal::WireFormatLite::WriteString(
4234 2, this->permalink(), output);
4235 }
4237 }
4239 int ClientUploadResponse::ByteSize() const {
4240 int total_size = 0;
4242 if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4243 // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1;
4244 if (has_status()) {
4245 total_size += 1 +
4246 ::google::protobuf::internal::WireFormatLite::EnumSize(this->status());
4247 }
4249 // optional string permalink = 2;
4250 if (has_permalink()) {
4251 total_size += 1 +
4252 ::google::protobuf::internal::WireFormatLite::StringSize(
4253 this->permalink());
4254 }
4256 }
4257 GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
4258 _cached_size_ = total_size;
4259 GOOGLE_SAFE_CONCURRENT_WRITES_END();
4260 return total_size;
4261 }
4263 void ClientUploadResponse::CheckTypeAndMergeFrom(
4264 const ::google::protobuf::MessageLite& from) {
4265 MergeFrom(*::google::protobuf::down_cast<const ClientUploadResponse*>(&from));
4266 }
4268 void ClientUploadResponse::MergeFrom(const ClientUploadResponse& from) {
4269 GOOGLE_CHECK_NE(&from, this);
4270 if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
4271 if (from.has_status()) {
4272 set_status(from.status());
4273 }
4274 if (from.has_permalink()) {
4275 set_permalink(from.permalink());
4276 }
4277 }
4278 }
4280 void ClientUploadResponse::CopyFrom(const ClientUploadResponse& from) {
4281 if (&from == this) return;
4282 Clear();
4283 MergeFrom(from);
4284 }
4286 bool ClientUploadResponse::IsInitialized() const {
4288 return true;
4289 }
4291 void ClientUploadResponse::Swap(ClientUploadResponse* other) {
4292 if (other != this) {
4293 std::swap(status_, other->status_);
4294 std::swap(permalink_, other->permalink_);
4295 std::swap(_has_bits_[0], other->_has_bits_[0]);
4296 std::swap(_cached_size_, other->_cached_size_);
4297 }
4298 }
4300 ::std::string ClientUploadResponse::GetTypeName() const {
4301 return "safe_browsing.ClientUploadResponse";
4302 }
4305 // @@protoc_insertion_point(namespace_scope)
4307 } // namespace safe_browsing
4309 // @@protoc_insertion_point(global_scope)