diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /toolkit/components/downloads | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/downloads')
32 files changed, 51955 insertions, 0 deletions
diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp new file mode 100644 index 000000000..7bd219dbf --- /dev/null +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -0,0 +1,1629 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// See +// https://wiki.mozilla.org/Security/Features/Application_Reputation_Design_Doc +// for a description of Chrome's implementation of this feature. +#include "ApplicationReputation.h" +#include "chrome/common/safe_browsing/csd.pb.h" + +#include "nsIArray.h" +#include "nsIApplicationReputation.h" +#include "nsIChannel.h" +#include "nsICryptoHash.h" +#include "nsIHttpChannel.h" +#include "nsIIOService.h" +#include "nsIPrefService.h" +#include "nsISimpleEnumerator.h" +#include "nsIStreamListener.h" +#include "nsIStringStream.h" +#include "nsITimer.h" +#include "nsIUploadChannel2.h" +#include "nsIURI.h" +#include "nsIURL.h" +#include "nsIUrlClassifierDBService.h" +#include "nsIX509Cert.h" +#include "nsIX509CertDB.h" +#include "nsIX509CertList.h" + +#include "mozilla/ArrayUtils.h" +#include "mozilla/BasePrincipal.h" +#include "mozilla/ErrorNames.h" +#include "mozilla/LoadContext.h" +#include "mozilla/Preferences.h" +#include "mozilla/Services.h" +#include "mozilla/Telemetry.h" +#include "mozilla/TimeStamp.h" + +#include "nsAutoPtr.h" +#include "nsCOMPtr.h" +#include "nsDebug.h" +#include "nsError.h" +#include "nsNetCID.h" +#include "nsReadableUtils.h" +#include "nsServiceManagerUtils.h" +#include "nsString.h" +#include "nsTArray.h" +#include "nsThreadUtils.h" +#include "nsXPCOMStrings.h" + +#include "nsIContentPolicy.h" +#include "nsILoadInfo.h" +#include "nsContentUtils.h" + +using mozilla::ArrayLength; +using mozilla::BasePrincipal; +using mozilla::DocShellOriginAttributes; +using mozilla::PrincipalOriginAttributes; +using mozilla::Preferences; +using mozilla::TimeStamp; +using mozilla::Telemetry::Accumulate; +using safe_browsing::ClientDownloadRequest; +using safe_browsing::ClientDownloadRequest_CertificateChain; +using safe_browsing::ClientDownloadRequest_Resource; +using safe_browsing::ClientDownloadRequest_SignatureInfo; + +// Preferences that we need to initialize the query. +#define PREF_SB_APP_REP_URL "browser.safebrowsing.downloads.remote.url" +#define PREF_SB_MALWARE_ENABLED "browser.safebrowsing.malware.enabled" +#define PREF_SB_DOWNLOADS_ENABLED "browser.safebrowsing.downloads.enabled" +#define PREF_SB_DOWNLOADS_REMOTE_ENABLED "browser.safebrowsing.downloads.remote.enabled" +#define PREF_SB_DOWNLOADS_REMOTE_TIMEOUT "browser.safebrowsing.downloads.remote.timeout_ms" +#define PREF_GENERAL_LOCALE "general.useragent.locale" +#define PREF_DOWNLOAD_BLOCK_TABLE "urlclassifier.downloadBlockTable" +#define PREF_DOWNLOAD_ALLOW_TABLE "urlclassifier.downloadAllowTable" + +// Preferences that are needed to action the verdict. +#define PREF_BLOCK_DANGEROUS "browser.safebrowsing.downloads.remote.block_dangerous" +#define PREF_BLOCK_DANGEROUS_HOST "browser.safebrowsing.downloads.remote.block_dangerous_host" +#define PREF_BLOCK_POTENTIALLY_UNWANTED "browser.safebrowsing.downloads.remote.block_potentially_unwanted" +#define PREF_BLOCK_UNCOMMON "browser.safebrowsing.downloads.remote.block_uncommon" + +// MOZ_LOG=ApplicationReputation:5 +mozilla::LazyLogModule ApplicationReputationService::prlog("ApplicationReputation"); +#define LOG(args) MOZ_LOG(ApplicationReputationService::prlog, mozilla::LogLevel::Debug, args) +#define LOG_ENABLED() MOZ_LOG_TEST(ApplicationReputationService::prlog, mozilla::LogLevel::Debug) + +class PendingDBLookup; + +// A single use class private to ApplicationReputationService encapsulating an +// nsIApplicationReputationQuery and an nsIApplicationReputationCallback. Once +// created by ApplicationReputationService, it is guaranteed to call mCallback. +// This class is private to ApplicationReputationService. +class PendingLookup final : public nsIStreamListener, + public nsITimerCallback, + public nsIObserver +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIREQUESTOBSERVER + NS_DECL_NSISTREAMLISTENER + NS_DECL_NSITIMERCALLBACK + NS_DECL_NSIOBSERVER + + // Constructor and destructor. + PendingLookup(nsIApplicationReputationQuery* aQuery, + nsIApplicationReputationCallback* aCallback); + + // Start the lookup. The lookup may have 2 parts: local and remote. In the + // local lookup, PendingDBLookups are created to query the local allow and + // blocklists for various URIs associated with this downloaded file. In the + // event that no results are found, a remote lookup is sent to the Application + // Reputation server. + nsresult StartLookup(); + +private: + ~PendingLookup(); + + friend class PendingDBLookup; + + // Telemetry states. + // Status of the remote response (valid or not). + enum SERVER_RESPONSE_TYPES { + SERVER_RESPONSE_VALID = 0, + SERVER_RESPONSE_FAILED = 1, + SERVER_RESPONSE_INVALID = 2, + }; + + // Number of blocklist and allowlist hits we have seen. + uint32_t mBlocklistCount; + uint32_t mAllowlistCount; + + // The query containing metadata about the downloaded file. + nsCOMPtr<nsIApplicationReputationQuery> mQuery; + + // The callback with which to report the verdict. + nsCOMPtr<nsIApplicationReputationCallback> mCallback; + + // An array of strings created from certificate information used to whitelist + // the downloaded file. + nsTArray<nsCString> mAllowlistSpecs; + // The source URI of the download, the referrer and possibly any redirects. + nsTArray<nsCString> mAnylistSpecs; + + // When we started this query + TimeStamp mStartTime; + + // The channel used to talk to the remote lookup server + nsCOMPtr<nsIChannel> mChannel; + + // Timer to abort this lookup if it takes too long + nsCOMPtr<nsITimer> mTimeoutTimer; + + // A protocol buffer for storing things we need in the remote request. We + // store the resource chain (redirect information) as well as signature + // information extracted using the Windows Authenticode API, if the binary is + // signed. + ClientDownloadRequest mRequest; + + // The response from the application reputation query. This is read in chunks + // as part of our nsIStreamListener implementation and may contain embedded + // NULLs. + nsCString mResponse; + + // Returns true if the file is likely to be binary. + bool IsBinaryFile(); + + // Returns the type of download binary for the file. + ClientDownloadRequest::DownloadType GetDownloadType(const nsAString& aFilename); + + // Clean up and call the callback. PendingLookup must not be used after this + // function is called. + nsresult OnComplete(bool shouldBlock, nsresult rv, + uint32_t verdict = nsIApplicationReputationService::VERDICT_SAFE); + + // Wrapper function for nsIStreamListener.onStopRequest to make it easy to + // guarantee calling the callback + nsresult OnStopRequestInternal(nsIRequest *aRequest, + nsISupports *aContext, + nsresult aResult, + bool* aShouldBlock, + uint32_t* aVerdict); + + // Return the hex-encoded hash of the whole URI. + nsresult GetSpecHash(nsACString& aSpec, nsACString& hexEncodedHash); + + // Strip url parameters, fragments, and user@pass fields from the URI spec + // using nsIURL. Hash data URIs and return blob URIs unfiltered. + nsresult GetStrippedSpec(nsIURI* aUri, nsACString& spec); + + // Escape '/' and '%' in certificate attribute values. + nsCString EscapeCertificateAttribute(const nsACString& aAttribute); + + // Escape ':' in fingerprint values. + nsCString EscapeFingerprint(const nsACString& aAttribute); + + // Generate whitelist strings for the given certificate pair from the same + // certificate chain. + nsresult GenerateWhitelistStringsForPair( + nsIX509Cert* certificate, nsIX509Cert* issuer); + + // Generate whitelist strings for the given certificate chain, which starts + // with the signer and may go all the way to the root cert. + nsresult GenerateWhitelistStringsForChain( + const ClientDownloadRequest_CertificateChain& aChain); + + // For signed binaries, generate strings of the form: + // http://sb-ssl.google.com/safebrowsing/csd/certificate/ + // <issuer_cert_sha1_fingerprint>[/CN=<cn>][/O=<org>][/OU=<unit>] + // for each (cert, issuer) pair in each chain of certificates that is + // associated with the binary. + nsresult GenerateWhitelistStrings(); + + // Parse the XPCOM certificate lists and stick them into the protocol buffer + // version. + nsresult ParseCertificates(nsIArray* aSigArray); + + // Adds the redirects to mAnylistSpecs to be looked up. + nsresult AddRedirects(nsIArray* aRedirects); + + // Helper function to ensure that we call PendingLookup::LookupNext or + // PendingLookup::OnComplete. + nsresult DoLookupInternal(); + + // Looks up all the URIs that may be responsible for allowlisting or + // blocklisting the downloaded file. These URIs may include whitelist strings + // generated by certificates verifying the binary as well as the target URI + // from which the file was downloaded. + nsresult LookupNext(); + + // Sends a query to the remote application reputation service. Returns NS_OK + // on success. + nsresult SendRemoteQuery(); + + // Helper function to ensure that we always call the callback. + nsresult SendRemoteQueryInternal(); +}; + +// A single-use class for looking up a single URI in the safebrowsing DB. This +// class is private to PendingLookup. +class PendingDBLookup final : public nsIUrlClassifierCallback +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIURLCLASSIFIERCALLBACK + + // Constructor and destructor + explicit PendingDBLookup(PendingLookup* aPendingLookup); + + // Look up the given URI in the safebrowsing DBs, optionally on both the allow + // list and the blocklist. If there is a match, call + // PendingLookup::OnComplete. Otherwise, call PendingLookup::LookupNext. + nsresult LookupSpec(const nsACString& aSpec, bool aAllowlistOnly); + +private: + ~PendingDBLookup(); + + // The download appeared on the allowlist, blocklist, or no list (and thus + // could trigger a remote query. + enum LIST_TYPES { + ALLOW_LIST = 0, + BLOCK_LIST = 1, + NO_LIST = 2, + }; + + nsCString mSpec; + bool mAllowlistOnly; + RefPtr<PendingLookup> mPendingLookup; + nsresult LookupSpecInternal(const nsACString& aSpec); +}; + +NS_IMPL_ISUPPORTS(PendingDBLookup, + nsIUrlClassifierCallback) + +PendingDBLookup::PendingDBLookup(PendingLookup* aPendingLookup) : + mAllowlistOnly(false), + mPendingLookup(aPendingLookup) +{ + LOG(("Created pending DB lookup [this = %p]", this)); +} + +PendingDBLookup::~PendingDBLookup() +{ + LOG(("Destroying pending DB lookup [this = %p]", this)); + mPendingLookup = nullptr; +} + +nsresult +PendingDBLookup::LookupSpec(const nsACString& aSpec, + bool aAllowlistOnly) +{ + LOG(("Checking principal %s [this=%p]", aSpec.Data(), this)); + mSpec = aSpec; + mAllowlistOnly = aAllowlistOnly; + nsresult rv = LookupSpecInternal(aSpec); + if (NS_FAILED(rv)) { + nsAutoCString errorName; + mozilla::GetErrorName(rv, errorName); + LOG(("Error in LookupSpecInternal() [rv = %s, this = %p]", + errorName.get(), this)); + return mPendingLookup->LookupNext(); // ignore this lookup and move to next + } + // LookupSpecInternal has called nsIUrlClassifierCallback.lookup, which is + // guaranteed to call HandleEvent. + return rv; +} + +nsresult +PendingDBLookup::LookupSpecInternal(const nsACString& aSpec) +{ + nsresult rv; + + nsCOMPtr<nsIURI> uri; + nsCOMPtr<nsIIOService> ios = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); + rv = ios->NewURI(aSpec, nullptr, nullptr, getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + + PrincipalOriginAttributes attrs; + nsCOMPtr<nsIPrincipal> principal = + BasePrincipal::CreateCodebasePrincipal(uri, attrs); + if (!principal) { + return NS_ERROR_FAILURE; + } + + // Check local lists to see if the URI has already been whitelisted or + // blacklisted. + LOG(("Checking DB service for principal %s [this = %p]", mSpec.get(), this)); + nsCOMPtr<nsIUrlClassifierDBService> dbService = + do_GetService(NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString tables; + nsAutoCString allowlist; + Preferences::GetCString(PREF_DOWNLOAD_ALLOW_TABLE, &allowlist); + if (!allowlist.IsEmpty()) { + tables.Append(allowlist); + } + nsAutoCString blocklist; + Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE, &blocklist); + if (!mAllowlistOnly && !blocklist.IsEmpty()) { + tables.Append(','); + tables.Append(blocklist); + } + return dbService->Lookup(principal, tables, this); +} + +NS_IMETHODIMP +PendingDBLookup::HandleEvent(const nsACString& tables) +{ + // HandleEvent is guaranteed to call either: + // 1) PendingLookup::OnComplete if the URL matches the blocklist, or + // 2) PendingLookup::LookupNext if the URL does not match the blocklist. + // Blocklisting trumps allowlisting. + nsAutoCString blockList; + Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE, &blockList); + if (!mAllowlistOnly && FindInReadable(blockList, tables)) { + mPendingLookup->mBlocklistCount++; + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, BLOCK_LIST); + LOG(("Found principal %s on blocklist [this = %p]", mSpec.get(), this)); + return mPendingLookup->OnComplete(true, NS_OK, + nsIApplicationReputationService::VERDICT_DANGEROUS); + } + + nsAutoCString allowList; + Preferences::GetCString(PREF_DOWNLOAD_ALLOW_TABLE, &allowList); + if (FindInReadable(allowList, tables)) { + mPendingLookup->mAllowlistCount++; + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, ALLOW_LIST); + LOG(("Found principal %s on allowlist [this = %p]", mSpec.get(), this)); + // Don't call onComplete, since blocklisting trumps allowlisting + } else { + LOG(("Didn't find principal %s on any list [this = %p]", mSpec.get(), + this)); + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_LOCAL, NO_LIST); + } + return mPendingLookup->LookupNext(); +} + +NS_IMPL_ISUPPORTS(PendingLookup, + nsIStreamListener, + nsIRequestObserver, + nsIObserver) + +PendingLookup::PendingLookup(nsIApplicationReputationQuery* aQuery, + nsIApplicationReputationCallback* aCallback) : + mBlocklistCount(0), + mAllowlistCount(0), + mQuery(aQuery), + mCallback(aCallback) +{ + LOG(("Created pending lookup [this = %p]", this)); +} + +PendingLookup::~PendingLookup() +{ + LOG(("Destroying pending lookup [this = %p]", this)); +} + +static const char16_t* kBinaryFileExtensions[] = { + // Extracted from the "File Type Policies" Chrome extension + //u".001", + //u".7z", + //u".ace", + //u".action", // Mac script + //u".ad", // Windows + u".ade", // MS Access + u".adp", // MS Access + u".apk", // Android package + u".app", // Executable application + u".application", // MS ClickOnce + u".appref-ms", // MS ClickOnce + //u".arc", + //u".arj", + u".as", // Mac archive + u".asp", // Windows Server script + u".asx", // Windows Media Player + //u".b64", + //u".balz", + u".bas", // Basic script + u".bash", // Linux shell + u".bat", // Windows shell + //u".bhx", + //u".bin", + u".bz", // Linux archive (bzip) + u".bz2", // Linux archive (bzip2) + u".bzip2", // Linux archive (bzip2) + u".cab", // Windows archive + u".cdr", // Mac disk image + u".cfg", // Windows + u".chi", // Windows Help + u".chm", // Windows Help + u".class", // Java + u".cmd", // Windows executable + u".com", // Windows executable + u".command", // Mac script + u".cpgz", // Mac archive + //u".cpio", + u".cpl", // Windows executable + u".crt", // Windows signed certificate + u".crx", // Chrome extensions + u".csh", // Linux shell + u".dart", // Mac disk image + u".dc42", // Apple DiskCopy Image + u".deb", // Linux package + u".dex", // Android + u".diskcopy42", // Apple DiskCopy Image + u".dll", // Windows executable + u".dmg", // Mac disk image + u".dmgpart", // Mac disk image + //u".docb", // MS Office + //u".docm", // MS Word + //u".docx", // MS Word + //u".dotm", // MS Word + //u".dott", // MS Office + u".drv", // Windows driver + u".dvdr", // Mac Disk image + u".efi", // Firmware + u".eml", // MS Outlook + u".exe", // Windows executable + //u".fat", + u".fon", // Windows font + u".fxp", // MS FoxPro + u".gadget", // Windows + u".grp", // Windows + u".gz", // Linux archive (gzip) + u".gzip", // Linux archive (gzip) + u".hfs", // Mac disk image + u".hlp", // Windows Help + u".hqx", // Mac archive + u".hta", // HTML trusted application + u".htt", // MS HTML template + u".img", // Mac disk image + u".imgpart", // Mac disk image + u".inf", // Windows installer + u".ini", // Generic config file + u".ins", // IIS config + //u".inx", // InstallShield + u".iso", // CD image + u".isp", // IIS config + //u".isu", // InstallShield + u".jar", // Java + u".jnlp", // Java + //u".job", // Windows + u".js", // JavaScript script + u".jse", // JScript + u".ksh", // Linux shell + //u".lha", + u".lnk", // Windows + u".local", // Windows + //u".lpaq1", + //u".lpaq5", + //u".lpaq8", + //u".lzh", + //u".lzma", + u".mad", // MS Access + u".maf", // MS Access + u".mag", // MS Access + u".mam", // MS Access + u".manifest", // Windows + u".maq", // MS Access + u".mar", // MS Access + u".mas", // MS Access + u".mat", // MS Access + u".mau", // Media attachment + u".mav", // MS Access + u".maw", // MS Access + u".mda", // MS Access + u".mdb", // MS Access + u".mde", // MS Access + u".mdt", // MS Access + u".mdw", // MS Access + u".mdz", // MS Access + u".mht", // MS HTML + u".mhtml", // MS HTML + u".mim", // MS Mail + u".mmc", // MS Office + u".mof", // Windows + u".mpkg", // Mac installer + u".msc", // Windows executable + u".msg", // MS Outlook + u".msh", // Windows shell + u".msh1", // Windows shell + u".msh1xml", // Windows shell + u".msh2", // Windows shell + u".msh2xml", // Windows shell + u".mshxml", // Windows + u".msi", // Windows installer + u".msp", // Windows installer + u".mst", // Windows installer + u".ndif", // Mac disk image + //u".ntfs", // 7z + u".ocx", // ActiveX + u".ops", // MS Office + //u".out", // Linux binary + //u".paf", // PortableApps package + //u".paq8f", + //u".paq8jd", + //u".paq8l", + //u".paq8o", + u".partial", // Downloads + u".pax", // Mac archive + u".pcd", // Microsoft Visual Test + u".pdf", // Adobe Acrobat + //u".pea", + u".pet", // Linux package + u".pif", // Windows + u".pkg", // Mac installer + u".pl", // Perl script + u".plg", // MS Visual Studio + //u".potx", // MS PowerPoint + //u".ppam", // MS PowerPoint + //u".ppsx", // MS PowerPoint + //u".pptm", // MS PowerPoint + //u".pptx", // MS PowerPoint + u".prf", // MS Outlook + u".prg", // Windows + u".ps1", // Windows shell + u".ps1xml", // Windows shell + u".ps2", // Windows shell + u".ps2xml", // Windows shell + u".psc1", // Windows shell + u".psc2", // Windows shell + u".pst", // MS Outlook + u".pup", // Linux package + u".py", // Python script + u".pyc", // Python binary + u".pyw", // Python GUI + //u".quad", + //u".r00", + //u".r01", + //u".r02", + //u".r03", + //u".r04", + //u".r05", + //u".r06", + //u".r07", + //u".r08", + //u".r09", + //u".r10", + //u".r11", + //u".r12", + //u".r13", + //u".r14", + //u".r15", + //u".r16", + //u".r17", + //u".r18", + //u".r19", + //u".r20", + //u".r21", + //u".r22", + //u".r23", + //u".r24", + //u".r25", + //u".r26", + //u".r27", + //u".r28", + //u".r29", + //u".rar", + u".rb", // Ruby script + u".reg", // Windows Registry + u".rels", // MS Office + //u".rgs", // Windows Registry + u".rpm", // Linux package + //u".rtf", // MS Office + //u".run", // Linux shell + u".scf", // Windows shell + u".scr", // Windows + u".sct", // Windows shell + u".search-ms", // Windows + u".sh", // Linux shell + u".shar", // Linux shell + u".shb", // Windows + u".shs", // Windows shell + //u".sldm", // MS PowerPoint + //u".sldx", // MS PowerPoint + u".slp", // Linux package + u".smi", // Mac disk image + u".sparsebundle", // Mac disk image + u".sparseimage", // Mac disk image + u".spl", // Adobe Flash + //u".squashfs", + u".svg", + u".swf", // Adobe Flash + u".swm", // Windows Imaging + u".sys", // Windows + u".tar", // Linux archive + u".taz", // Linux archive (bzip2) + u".tbz", // Linux archive (bzip2) + u".tbz2", // Linux archive (bzip2) + u".tcsh", // Linux shell + u".tgz", // Linux archive (gzip) + //u".toast", // Roxio disk image + //u".torrent", // Bittorrent + u".tpz", // Linux archive (gzip) + u".txz", // Linux archive (xz) + u".tz", // Linux archive (gzip) + //u".u3p", // U3 Smart Apps + u".udf", // MS Excel + u".udif", // Mac disk image + u".url", // Windows + //u".uu", + //u".uue", + u".vb", // Visual Basic script + u".vbe", // Visual Basic script + u".vbs", // Visual Basic script + //u".vbscript", // Visual Basic script + u".vhd", // Windows virtual hard drive + u".vhdx", // Windows virtual hard drive + u".vmdk", // VMware virtual disk + u".vsd", // MS Visio + u".vsmacros", // MS Visual Studio + u".vss", // MS Visio + u".vst", // MS Visio + u".vsw", // MS Visio + u".website", // Windows + u".wim", // Windows Imaging + //u".workflow", // Mac Automator + //u".wrc", // FreeArc archive + u".ws", // Windows script + u".wsc", // Windows script + u".wsf", // Windows script + u".wsh", // Windows script + u".xar", // MS Excel + u".xbap", // XAML Browser Application + u".xip", // Mac archive + //u".xlsm", // MS Excel + //u".xlsx", // MS Excel + //u".xltm", // MS Excel + //u".xltx", // MS Excel + u".xml", + u".xnk", // MS Exchange + u".xrm-ms", // Windows + u".xsl", // XML Stylesheet + //u".xxe", + u".xz", // Linux archive (xz) + u".z", // InstallShield +#ifdef XP_WIN // disable on Mac/Linux, see 1167493 + u".zip", // Generic archive +#endif + u".zipx", // WinZip + //u".zpaq", +}; + +bool +PendingLookup::IsBinaryFile() +{ + nsString fileName; + nsresult rv = mQuery->GetSuggestedFileName(fileName); + if (NS_FAILED(rv)) { + LOG(("No suggested filename [this = %p]", this)); + return false; + } + LOG(("Suggested filename: %s [this = %p]", + NS_ConvertUTF16toUTF8(fileName).get(), this)); + + for (size_t i = 0; i < ArrayLength(kBinaryFileExtensions); ++i) { + if (StringEndsWith(fileName, nsDependentString(kBinaryFileExtensions[i]))) { + return true; + } + } + + return false; +} + +ClientDownloadRequest::DownloadType +PendingLookup::GetDownloadType(const nsAString& aFilename) { + MOZ_ASSERT(IsBinaryFile()); + + // From https://cs.chromium.org/chromium/src/chrome/common/safe_browsing/download_protection_util.cc?l=17 + if (StringEndsWith(aFilename, NS_LITERAL_STRING(".zip"))) { + return ClientDownloadRequest::ZIPPED_EXECUTABLE; + } else if (StringEndsWith(aFilename, NS_LITERAL_STRING(".apk"))) { + return ClientDownloadRequest::ANDROID_APK; + } else if (StringEndsWith(aFilename, NS_LITERAL_STRING(".app")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".cdr")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".dart")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".dc42")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".diskcopy42")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".dmg")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".dmgpart")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".dvdr")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".img")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".imgpart")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".iso")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".mpkg")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".ndif")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".pkg")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".smi")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".sparsebundle")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".sparseimage")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".toast")) || + StringEndsWith(aFilename, NS_LITERAL_STRING(".udif"))) { + return ClientDownloadRequest::MAC_EXECUTABLE; + } + + return ClientDownloadRequest::WIN_EXECUTABLE; // default to Windows binaries +} + +nsresult +PendingLookup::LookupNext() +{ + // We must call LookupNext or SendRemoteQuery upon return. + // Look up all of the URLs that could allow or block this download. + // Blocklist first. + if (mBlocklistCount > 0) { + return OnComplete(true, NS_OK, + nsIApplicationReputationService::VERDICT_DANGEROUS); + } + int index = mAnylistSpecs.Length() - 1; + nsCString spec; + if (index >= 0) { + // Check the source URI, referrer and redirect chain. + spec = mAnylistSpecs[index]; + mAnylistSpecs.RemoveElementAt(index); + RefPtr<PendingDBLookup> lookup(new PendingDBLookup(this)); + return lookup->LookupSpec(spec, false); + } + // If any of mAnylistSpecs matched the blocklist, go ahead and block. + if (mBlocklistCount > 0) { + return OnComplete(true, NS_OK, + nsIApplicationReputationService::VERDICT_DANGEROUS); + } + // If any of mAnylistSpecs matched the allowlist, go ahead and pass. + if (mAllowlistCount > 0) { + return OnComplete(false, NS_OK); + } + // Only binary signatures remain. + index = mAllowlistSpecs.Length() - 1; + if (index >= 0) { + spec = mAllowlistSpecs[index]; + LOG(("PendingLookup::LookupNext: checking %s on allowlist", spec.get())); + mAllowlistSpecs.RemoveElementAt(index); + RefPtr<PendingDBLookup> lookup(new PendingDBLookup(this)); + return lookup->LookupSpec(spec, true); + } + // There are no more URIs to check against local list. If the file is + // not eligible for remote lookup, bail. + if (!IsBinaryFile()) { + LOG(("Not eligible for remote lookups [this=%x]", this)); + return OnComplete(false, NS_OK); + } + nsresult rv = SendRemoteQuery(); + if (NS_FAILED(rv)) { + return OnComplete(false, rv); + } + return NS_OK; +} + +nsCString +PendingLookup::EscapeCertificateAttribute(const nsACString& aAttribute) +{ + // Escape '/' because it's a field separator, and '%' because Chrome does + nsCString escaped; + escaped.SetCapacity(aAttribute.Length()); + for (unsigned int i = 0; i < aAttribute.Length(); ++i) { + if (aAttribute.Data()[i] == '%') { + escaped.AppendLiteral("%25"); + } else if (aAttribute.Data()[i] == '/') { + escaped.AppendLiteral("%2F"); + } else if (aAttribute.Data()[i] == ' ') { + escaped.AppendLiteral("%20"); + } else { + escaped.Append(aAttribute.Data()[i]); + } + } + return escaped; +} + +nsCString +PendingLookup::EscapeFingerprint(const nsACString& aFingerprint) +{ + // Google's fingerprint doesn't have colons + nsCString escaped; + escaped.SetCapacity(aFingerprint.Length()); + for (unsigned int i = 0; i < aFingerprint.Length(); ++i) { + if (aFingerprint.Data()[i] != ':') { + escaped.Append(aFingerprint.Data()[i]); + } + } + return escaped; +} + +nsresult +PendingLookup::GenerateWhitelistStringsForPair( + nsIX509Cert* certificate, + nsIX509Cert* issuer) +{ + // The whitelist paths have format: + // http://sb-ssl.google.com/safebrowsing/csd/certificate/<issuer_cert_fingerprint>[/CN=<cn>][/O=<org>][/OU=<unit>] + // Any of CN, O, or OU may be omitted from the whitelist entry. Unfortunately + // this is not publicly documented, but the Chrome implementation can be found + // here: + // https://code.google.com/p/chromium/codesearch#search/&q=GetCertificateWhitelistStrings + nsCString whitelistString( + "http://sb-ssl.google.com/safebrowsing/csd/certificate/"); + + nsString fingerprint; + nsresult rv = issuer->GetSha1Fingerprint(fingerprint); + NS_ENSURE_SUCCESS(rv, rv); + whitelistString.Append( + EscapeFingerprint(NS_ConvertUTF16toUTF8(fingerprint))); + + nsString commonName; + rv = certificate->GetCommonName(commonName); + NS_ENSURE_SUCCESS(rv, rv); + if (!commonName.IsEmpty()) { + whitelistString.AppendLiteral("/CN="); + whitelistString.Append( + EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(commonName))); + } + + nsString organization; + rv = certificate->GetOrganization(organization); + NS_ENSURE_SUCCESS(rv, rv); + if (!organization.IsEmpty()) { + whitelistString.AppendLiteral("/O="); + whitelistString.Append( + EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(organization))); + } + + nsString organizationalUnit; + rv = certificate->GetOrganizationalUnit(organizationalUnit); + NS_ENSURE_SUCCESS(rv, rv); + if (!organizationalUnit.IsEmpty()) { + whitelistString.AppendLiteral("/OU="); + whitelistString.Append( + EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(organizationalUnit))); + } + LOG(("Whitelisting %s", whitelistString.get())); + + mAllowlistSpecs.AppendElement(whitelistString); + return NS_OK; +} + +nsresult +PendingLookup::GenerateWhitelistStringsForChain( + const safe_browsing::ClientDownloadRequest_CertificateChain& aChain) +{ + // We need a signing certificate and an issuer to construct a whitelist + // entry. + if (aChain.element_size() < 2) { + return NS_OK; + } + + // Get the signer. + nsresult rv; + nsCOMPtr<nsIX509CertDB> certDB = do_GetService(NS_X509CERTDB_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIX509Cert> signer; + rv = certDB->ConstructX509( + const_cast<char *>(aChain.element(0).certificate().data()), + aChain.element(0).certificate().size(), getter_AddRefs(signer)); + NS_ENSURE_SUCCESS(rv, rv); + + for (int i = 1; i < aChain.element_size(); ++i) { + // Get the issuer. + nsCOMPtr<nsIX509Cert> issuer; + rv = certDB->ConstructX509( + const_cast<char *>(aChain.element(i).certificate().data()), + aChain.element(i).certificate().size(), getter_AddRefs(issuer)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = GenerateWhitelistStringsForPair(signer, issuer); + NS_ENSURE_SUCCESS(rv, rv); + } + return NS_OK; +} + +nsresult +PendingLookup::GenerateWhitelistStrings() +{ + for (int i = 0; i < mRequest.signature().certificate_chain_size(); ++i) { + nsresult rv = GenerateWhitelistStringsForChain( + mRequest.signature().certificate_chain(i)); + NS_ENSURE_SUCCESS(rv, rv); + } + return NS_OK; +} + +nsresult +PendingLookup::AddRedirects(nsIArray* aRedirects) +{ + uint32_t length = 0; + aRedirects->GetLength(&length); + LOG(("ApplicationReputation: Got %u redirects", length)); + nsCOMPtr<nsISimpleEnumerator> iter; + nsresult rv = aRedirects->Enumerate(getter_AddRefs(iter)); + NS_ENSURE_SUCCESS(rv, rv); + + bool hasMoreRedirects = false; + rv = iter->HasMoreElements(&hasMoreRedirects); + NS_ENSURE_SUCCESS(rv, rv); + + while (hasMoreRedirects) { + nsCOMPtr<nsISupports> supports; + rv = iter->GetNext(getter_AddRefs(supports)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIPrincipal> principal = do_QueryInterface(supports, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIURI> uri; + rv = principal->GetURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + + // Add the spec to our list of local lookups. The most recent redirect is + // the last element. + nsCString spec; + rv = GetStrippedSpec(uri, spec); + NS_ENSURE_SUCCESS(rv, rv); + mAnylistSpecs.AppendElement(spec); + LOG(("ApplicationReputation: Appending redirect %s\n", spec.get())); + + // Store the redirect information in the remote request. + ClientDownloadRequest_Resource* resource = mRequest.add_resources(); + resource->set_url(spec.get()); + resource->set_type(ClientDownloadRequest::DOWNLOAD_REDIRECT); + + rv = iter->HasMoreElements(&hasMoreRedirects); + NS_ENSURE_SUCCESS(rv, rv); + } + return NS_OK; +} + +nsresult +PendingLookup::StartLookup() +{ + mStartTime = TimeStamp::Now(); + nsresult rv = DoLookupInternal(); + if (NS_FAILED(rv)) { + return OnComplete(false, NS_OK); + } + return rv; +} + +nsresult +PendingLookup::GetSpecHash(nsACString& aSpec, nsACString& hexEncodedHash) +{ + nsresult rv; + + nsCOMPtr<nsICryptoHash> cryptoHash = + do_CreateInstance("@mozilla.org/security/hash;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + rv = cryptoHash->Init(nsICryptoHash::SHA256); + NS_ENSURE_SUCCESS(rv, rv); + + rv = cryptoHash->Update(reinterpret_cast<const uint8_t*>(aSpec.BeginReading()), + aSpec.Length()); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString binaryHash; + rv = cryptoHash->Finish(false, binaryHash); + NS_ENSURE_SUCCESS(rv, rv); + + // This needs to match HexEncode() in Chrome's + // src/base/strings/string_number_conversions.cc + static const char* const hex = "0123456789ABCDEF"; + hexEncodedHash.SetCapacity(2 * binaryHash.Length()); + for (size_t i = 0; i < binaryHash.Length(); ++i) { + auto c = static_cast<const unsigned char>(binaryHash[i]); + hexEncodedHash.Append(hex[(c >> 4) & 0x0F]); + hexEncodedHash.Append(hex[c & 0x0F]); + } + + return NS_OK; +} + +nsresult +PendingLookup::GetStrippedSpec(nsIURI* aUri, nsACString& escaped) +{ + if (NS_WARN_IF(!aUri)) { + return NS_ERROR_INVALID_ARG; + } + + nsresult rv; + rv = aUri->GetScheme(escaped); + NS_ENSURE_SUCCESS(rv, rv); + + if (escaped.EqualsLiteral("blob")) { + aUri->GetSpec(escaped); + LOG(("PendingLookup::GetStrippedSpec(): blob URL left unstripped as '%s' [this = %p]", + PromiseFlatCString(escaped).get(), this)); + return NS_OK; + + } else if (escaped.EqualsLiteral("data")) { + // Replace URI with "data:<everything before comma>,SHA256(<whole URI>)" + aUri->GetSpec(escaped); + int32_t comma = escaped.FindChar(','); + if (comma > -1 && + static_cast<nsCString::size_type>(comma) < escaped.Length() - 1) { + MOZ_ASSERT(comma > 4, "Data URIs start with 'data:'"); + nsAutoCString hexEncodedHash; + rv = GetSpecHash(escaped, hexEncodedHash); + if (NS_SUCCEEDED(rv)) { + escaped.Truncate(comma + 1); + escaped.Append(hexEncodedHash); + } + } + + LOG(("PendingLookup::GetStrippedSpec(): data URL stripped to '%s' [this = %p]", + PromiseFlatCString(escaped).get(), this)); + return NS_OK; + } + + // If aURI is not an nsIURL, we do not want to check the lists or send a + // remote query. + nsCOMPtr<nsIURL> url = do_QueryInterface(aUri, &rv); + if (NS_FAILED(rv)) { + LOG(("PendingLookup::GetStrippedSpec(): scheme '%s' is not supported [this = %p]", + PromiseFlatCString(escaped).get(), this)); + return rv; + } + + nsCString temp; + rv = url->GetHostPort(temp); + NS_ENSURE_SUCCESS(rv, rv); + + escaped.Append("://"); + escaped.Append(temp); + + rv = url->GetFilePath(temp); + NS_ENSURE_SUCCESS(rv, rv); + + // nsIUrl.filePath starts with '/' + escaped.Append(temp); + + LOG(("PendingLookup::GetStrippedSpec(): URL stripped to '%s' [this = %p]", + PromiseFlatCString(escaped).get(), this)); + return NS_OK; +} + +nsresult +PendingLookup::DoLookupInternal() +{ + // We want to check the target URI, its referrer, and associated redirects + // against the local lists. + nsCOMPtr<nsIURI> uri; + nsresult rv = mQuery->GetSourceURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCString sourceSpec; + rv = GetStrippedSpec(uri, sourceSpec); + NS_ENSURE_SUCCESS(rv, rv); + + mAnylistSpecs.AppendElement(sourceSpec); + + ClientDownloadRequest_Resource* resource = mRequest.add_resources(); + resource->set_url(sourceSpec.get()); + resource->set_type(ClientDownloadRequest::DOWNLOAD_URL); + + nsCOMPtr<nsIURI> referrer = nullptr; + rv = mQuery->GetReferrerURI(getter_AddRefs(referrer)); + if (referrer) { + nsCString referrerSpec; + rv = GetStrippedSpec(referrer, referrerSpec); + NS_ENSURE_SUCCESS(rv, rv); + mAnylistSpecs.AppendElement(referrerSpec); + resource->set_referrer(referrerSpec.get()); + } + nsCOMPtr<nsIArray> redirects; + rv = mQuery->GetRedirects(getter_AddRefs(redirects)); + if (redirects) { + AddRedirects(redirects); + } else { + LOG(("ApplicationReputation: Got no redirects [this=%p]", this)); + } + + // Extract the signature and parse certificates so we can use it to check + // whitelists. + nsCOMPtr<nsIArray> sigArray; + rv = mQuery->GetSignatureInfo(getter_AddRefs(sigArray)); + NS_ENSURE_SUCCESS(rv, rv); + + if (sigArray) { + rv = ParseCertificates(sigArray); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = GenerateWhitelistStrings(); + NS_ENSURE_SUCCESS(rv, rv); + + // Start the call chain. + return LookupNext(); +} + +nsresult +PendingLookup::OnComplete(bool shouldBlock, nsresult rv, uint32_t verdict) +{ + MOZ_ASSERT(!shouldBlock || + verdict != nsIApplicationReputationService::VERDICT_SAFE); + + if (NS_FAILED(rv)) { + nsAutoCString errorName; + mozilla::GetErrorName(rv, errorName); + LOG(("Failed sending remote query for application reputation " + "[rv = %s, this = %p]", errorName.get(), this)); + } + + if (mTimeoutTimer) { + mTimeoutTimer->Cancel(); + mTimeoutTimer = nullptr; + } + + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SHOULD_BLOCK, + shouldBlock); + double t = (TimeStamp::Now() - mStartTime).ToMilliseconds(); + LOG(("Application Reputation verdict is %lu, obtained in %f ms [this = %p]", + verdict, t, this)); + if (shouldBlock) { + LOG(("Application Reputation check failed, blocking bad binary [this = %p]", + this)); + } else { + LOG(("Application Reputation check passed [this = %p]", this)); + } + nsresult res = mCallback->OnComplete(shouldBlock, rv, verdict); + return res; +} + +nsresult +PendingLookup::ParseCertificates(nsIArray* aSigArray) +{ + // If we haven't been set for any reason, bail. + NS_ENSURE_ARG_POINTER(aSigArray); + + // Binaries may be signed by multiple chains of certificates. If there are no + // chains, the binary is unsigned (or we were unable to extract signature + // information on a non-Windows platform) + nsCOMPtr<nsISimpleEnumerator> chains; + nsresult rv = aSigArray->Enumerate(getter_AddRefs(chains)); + NS_ENSURE_SUCCESS(rv, rv); + + bool hasMoreChains = false; + rv = chains->HasMoreElements(&hasMoreChains); + NS_ENSURE_SUCCESS(rv, rv); + + while (hasMoreChains) { + nsCOMPtr<nsISupports> chainSupports; + rv = chains->GetNext(getter_AddRefs(chainSupports)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIX509CertList> certList = do_QueryInterface(chainSupports, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + safe_browsing::ClientDownloadRequest_CertificateChain* certChain = + mRequest.mutable_signature()->add_certificate_chain(); + nsCOMPtr<nsISimpleEnumerator> chainElt; + rv = certList->GetEnumerator(getter_AddRefs(chainElt)); + NS_ENSURE_SUCCESS(rv, rv); + + // Each chain may have multiple certificates. + bool hasMoreCerts = false; + rv = chainElt->HasMoreElements(&hasMoreCerts); + while (hasMoreCerts) { + nsCOMPtr<nsISupports> certSupports; + rv = chainElt->GetNext(getter_AddRefs(certSupports)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIX509Cert> cert = do_QueryInterface(certSupports, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + uint8_t* data = nullptr; + uint32_t len = 0; + rv = cert->GetRawDER(&len, &data); + NS_ENSURE_SUCCESS(rv, rv); + + // Add this certificate to the protobuf to send remotely. + certChain->add_element()->set_certificate(data, len); + free(data); + + rv = chainElt->HasMoreElements(&hasMoreCerts); + NS_ENSURE_SUCCESS(rv, rv); + } + rv = chains->HasMoreElements(&hasMoreChains); + NS_ENSURE_SUCCESS(rv, rv); + } + if (mRequest.signature().certificate_chain_size() > 0) { + mRequest.mutable_signature()->set_trusted(true); + } + return NS_OK; +} + +nsresult +PendingLookup::SendRemoteQuery() +{ + nsresult rv = SendRemoteQueryInternal(); + if (NS_FAILED(rv)) { + return OnComplete(false, rv); + } + // SendRemoteQueryInternal has fired off the query and we call OnComplete in + // the nsIStreamListener.onStopRequest. + return rv; +} + +nsresult +PendingLookup::SendRemoteQueryInternal() +{ + // If we aren't supposed to do remote lookups, bail. + if (!Preferences::GetBool(PREF_SB_DOWNLOADS_REMOTE_ENABLED, false)) { + LOG(("Remote lookups are disabled [this = %p]", this)); + return NS_ERROR_NOT_AVAILABLE; + } + // If the remote lookup URL is empty or absent, bail. + nsCString serviceUrl; + NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_SB_APP_REP_URL, &serviceUrl), + NS_ERROR_NOT_AVAILABLE); + if (serviceUrl.IsEmpty()) { + LOG(("Remote lookup URL is empty [this = %p]", this)); + return NS_ERROR_NOT_AVAILABLE; + } + + // If the blocklist or allowlist is empty (so we couldn't do local lookups), + // bail + { + nsAutoCString table; + NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_DOWNLOAD_BLOCK_TABLE, + &table), + NS_ERROR_NOT_AVAILABLE); + if (table.IsEmpty()) { + LOG(("Blocklist is empty [this = %p]", this)); + return NS_ERROR_NOT_AVAILABLE; + } + } +#ifdef XP_WIN + // The allowlist is only needed to do signature verification on Windows + { + nsAutoCString table; + NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_DOWNLOAD_ALLOW_TABLE, + &table), + NS_ERROR_NOT_AVAILABLE); + if (table.IsEmpty()) { + LOG(("Allowlist is empty [this = %p]", this)); + return NS_ERROR_NOT_AVAILABLE; + } + } +#endif + + LOG(("Sending remote query for application reputation [this = %p]", + this)); + // We did not find a local result, so fire off the query to the + // application reputation service. + nsCOMPtr<nsIURI> uri; + nsresult rv; + rv = mQuery->GetSourceURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + nsCString spec; + rv = GetStrippedSpec(uri, spec); + NS_ENSURE_SUCCESS(rv, rv); + mRequest.set_url(spec.get()); + + uint32_t fileSize; + rv = mQuery->GetFileSize(&fileSize); + NS_ENSURE_SUCCESS(rv, rv); + mRequest.set_length(fileSize); + // We have no way of knowing whether or not a user initiated the + // download. Set it to true to lessen the chance of false positives. + mRequest.set_user_initiated(true); + + nsCString locale; + NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_GENERAL_LOCALE, &locale), + NS_ERROR_NOT_AVAILABLE); + mRequest.set_locale(locale.get()); + nsCString sha256Hash; + rv = mQuery->GetSha256Hash(sha256Hash); + NS_ENSURE_SUCCESS(rv, rv); + mRequest.mutable_digests()->set_sha256(sha256Hash.Data()); + nsString fileName; + rv = mQuery->GetSuggestedFileName(fileName); + NS_ENSURE_SUCCESS(rv, rv); + mRequest.set_file_basename(NS_ConvertUTF16toUTF8(fileName).get()); + mRequest.set_download_type(GetDownloadType(fileName)); + + if (mRequest.signature().trusted()) { + LOG(("Got signed binary for remote application reputation check " + "[this = %p]", this)); + } else { + LOG(("Got unsigned binary for remote application reputation check " + "[this = %p]", this)); + } + + // Serialize the protocol buffer to a string. This can only fail if we are + // out of memory, or if the protocol buffer req is missing required fields + // (only the URL for now). + std::string serialized; + if (!mRequest.SerializeToString(&serialized)) { + return NS_ERROR_UNEXPECTED; + } + LOG(("Serialized protocol buffer [this = %p]: (length=%d) %s", this, + serialized.length(), serialized.c_str())); + + // Set the input stream to the serialized protocol buffer + nsCOMPtr<nsIStringInputStream> sstream = + do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = sstream->SetData(serialized.c_str(), serialized.length()); + NS_ENSURE_SUCCESS(rv, rv); + + // Set up the channel to transmit the request to the service. + nsCOMPtr<nsIIOService> ios = do_GetService(NS_IOSERVICE_CONTRACTID, &rv); + rv = ios->NewChannel2(serviceUrl, + nullptr, + nullptr, + nullptr, // aLoadingNode + nsContentUtils::GetSystemPrincipal(), + nullptr, // aTriggeringPrincipal + nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, + nsIContentPolicy::TYPE_OTHER, + getter_AddRefs(mChannel)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo(); + if (loadInfo) { + loadInfo->SetOriginAttributes( + mozilla::NeckoOriginAttributes(NECKO_SAFEBROWSING_APP_ID, false)); + } + + nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel, &rv)); + NS_ENSURE_SUCCESS(rv, rv); + mozilla::Unused << httpChannel; + + // Upload the protobuf to the application reputation service. + nsCOMPtr<nsIUploadChannel2> uploadChannel = do_QueryInterface(mChannel, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = uploadChannel->ExplicitSetUploadStream(sstream, + NS_LITERAL_CSTRING("application/octet-stream"), serialized.size(), + NS_LITERAL_CSTRING("POST"), false); + NS_ENSURE_SUCCESS(rv, rv); + + // Set the Safebrowsing cookie jar, so that the regular Google cookie is not + // sent with this request. See bug 897516. + DocShellOriginAttributes attrs; + attrs.mAppId = NECKO_SAFEBROWSING_APP_ID; + nsCOMPtr<nsIInterfaceRequestor> loadContext = new mozilla::LoadContext(attrs); + rv = mChannel->SetNotificationCallbacks(loadContext); + NS_ENSURE_SUCCESS(rv, rv); + + uint32_t timeoutMs = Preferences::GetUint(PREF_SB_DOWNLOADS_REMOTE_TIMEOUT, 10000); + mTimeoutTimer = do_CreateInstance(NS_TIMER_CONTRACTID); + mTimeoutTimer->InitWithCallback(this, timeoutMs, nsITimer::TYPE_ONE_SHOT); + + rv = mChannel->AsyncOpen2(this); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +NS_IMETHODIMP +PendingLookup::Notify(nsITimer* aTimer) +{ + LOG(("Remote lookup timed out [this = %p]", this)); + MOZ_ASSERT(aTimer == mTimeoutTimer); + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT, + true); + mChannel->Cancel(NS_ERROR_NET_TIMEOUT); + mTimeoutTimer->Cancel(); + return NS_OK; +} + +/////////////////////////////////////////////////////////////////////////////// +// nsIObserver implementation +NS_IMETHODIMP +PendingLookup::Observe(nsISupports *aSubject, const char *aTopic, + const char16_t *aData) +{ + if (!strcmp(aTopic, "quit-application")) { + if (mTimeoutTimer) { + mTimeoutTimer->Cancel(); + mTimeoutTimer = nullptr; + } + if (mChannel) { + mChannel->Cancel(NS_ERROR_ABORT); + } + } + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIStreamListener +static nsresult +AppendSegmentToString(nsIInputStream* inputStream, + void *closure, + const char *rawSegment, + uint32_t toOffset, + uint32_t count, + uint32_t *writeCount) { + nsAutoCString* decodedData = static_cast<nsAutoCString*>(closure); + decodedData->Append(rawSegment, count); + *writeCount = count; + return NS_OK; +} + +NS_IMETHODIMP +PendingLookup::OnDataAvailable(nsIRequest *aRequest, + nsISupports *aContext, + nsIInputStream *aStream, + uint64_t offset, + uint32_t count) { + uint32_t read; + return aStream->ReadSegments(AppendSegmentToString, &mResponse, count, &read); +} + +NS_IMETHODIMP +PendingLookup::OnStartRequest(nsIRequest *aRequest, + nsISupports *aContext) { + return NS_OK; +} + +NS_IMETHODIMP +PendingLookup::OnStopRequest(nsIRequest *aRequest, + nsISupports *aContext, + nsresult aResult) { + NS_ENSURE_STATE(mCallback); + + bool shouldBlock = false; + uint32_t verdict = nsIApplicationReputationService::VERDICT_SAFE; + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT, + false); + + nsresult rv = OnStopRequestInternal(aRequest, aContext, aResult, + &shouldBlock, &verdict); + OnComplete(shouldBlock, rv, verdict); + return rv; +} + +nsresult +PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, + nsISupports *aContext, + nsresult aResult, + bool* aShouldBlock, + uint32_t* aVerdict) { + if (NS_FAILED(aResult)) { + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_FAILED); + return aResult; + } + + *aShouldBlock = false; + *aVerdict = nsIApplicationReputationService::VERDICT_SAFE; + nsresult rv; + nsCOMPtr<nsIHttpChannel> channel = do_QueryInterface(aRequest, &rv); + if (NS_FAILED(rv)) { + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_FAILED); + return rv; + } + + uint32_t status = 0; + rv = channel->GetResponseStatus(&status); + if (NS_FAILED(rv)) { + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_FAILED); + return rv; + } + + if (status != 200) { + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_FAILED); + return NS_ERROR_NOT_AVAILABLE; + } + + std::string buf(mResponse.Data(), mResponse.Length()); + safe_browsing::ClientDownloadResponse response; + if (!response.ParseFromString(buf)) { + LOG(("Invalid protocol buffer response [this = %p]: %s", this, buf.c_str())); + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_INVALID); + return NS_ERROR_CANNOT_CONVERT_DATA; + } + + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, + SERVER_RESPONSE_VALID); + // Clamp responses 0-7, we only know about 0-4 for now. + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER_VERDICT, + std::min<uint32_t>(response.verdict(), 7)); + switch(response.verdict()) { + case safe_browsing::ClientDownloadResponse::DANGEROUS: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_DANGEROUS, true); + *aVerdict = nsIApplicationReputationService::VERDICT_DANGEROUS; + break; + case safe_browsing::ClientDownloadResponse::DANGEROUS_HOST: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_DANGEROUS_HOST, true); + *aVerdict = nsIApplicationReputationService::VERDICT_DANGEROUS_HOST; + break; + case safe_browsing::ClientDownloadResponse::POTENTIALLY_UNWANTED: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_POTENTIALLY_UNWANTED, false); + *aVerdict = nsIApplicationReputationService::VERDICT_POTENTIALLY_UNWANTED; + break; + case safe_browsing::ClientDownloadResponse::UNCOMMON: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_UNCOMMON, false); + *aVerdict = nsIApplicationReputationService::VERDICT_UNCOMMON; + break; + default: + // Treat everything else as safe + break; + } + + return NS_OK; +} + +NS_IMPL_ISUPPORTS(ApplicationReputationService, + nsIApplicationReputationService) + +ApplicationReputationService* + ApplicationReputationService::gApplicationReputationService = nullptr; + +ApplicationReputationService* +ApplicationReputationService::GetSingleton() +{ + if (gApplicationReputationService) { + NS_ADDREF(gApplicationReputationService); + return gApplicationReputationService; + } + + // We're not initialized yet. + gApplicationReputationService = new ApplicationReputationService(); + if (gApplicationReputationService) { + NS_ADDREF(gApplicationReputationService); + } + + return gApplicationReputationService; +} + +ApplicationReputationService::ApplicationReputationService() +{ + LOG(("Application reputation service started up")); +} + +ApplicationReputationService::~ApplicationReputationService() { + LOG(("Application reputation service shutting down")); + MOZ_ASSERT(gApplicationReputationService == this); + gApplicationReputationService = nullptr; +} + +NS_IMETHODIMP +ApplicationReputationService::QueryReputation( + nsIApplicationReputationQuery* aQuery, + nsIApplicationReputationCallback* aCallback) { + LOG(("Starting application reputation check [query=%p]", aQuery)); + NS_ENSURE_ARG_POINTER(aQuery); + NS_ENSURE_ARG_POINTER(aCallback); + + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_COUNT, true); + nsresult rv = QueryReputationInternal(aQuery, aCallback); + if (NS_FAILED(rv)) { + Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SHOULD_BLOCK, + false); + aCallback->OnComplete(false, rv, + nsIApplicationReputationService::VERDICT_SAFE); + } + return NS_OK; +} + +nsresult ApplicationReputationService::QueryReputationInternal( + nsIApplicationReputationQuery* aQuery, + nsIApplicationReputationCallback* aCallback) { + nsresult rv; + // If malware checks aren't enabled, don't query application reputation. + if (!Preferences::GetBool(PREF_SB_MALWARE_ENABLED, false)) { + return NS_ERROR_NOT_AVAILABLE; + } + + if (!Preferences::GetBool(PREF_SB_DOWNLOADS_ENABLED, false)) { + return NS_ERROR_NOT_AVAILABLE; + } + + nsCOMPtr<nsIURI> uri; + rv = aQuery->GetSourceURI(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + // Bail if the URI hasn't been set. + NS_ENSURE_STATE(uri); + + // Create a new pending lookup and start the call chain. + RefPtr<PendingLookup> lookup(new PendingLookup(aQuery, aCallback)); + NS_ENSURE_STATE(lookup); + + // Add an observer for shutdown + nsCOMPtr<nsIObserverService> observerService = + mozilla::services::GetObserverService(); + if (!observerService) { + return NS_ERROR_FAILURE; + } + + observerService->AddObserver(lookup, "quit-application", false); + return lookup->StartLookup(); +} diff --git a/toolkit/components/downloads/ApplicationReputation.h b/toolkit/components/downloads/ApplicationReputation.h new file mode 100644 index 000000000..0ed68d616 --- /dev/null +++ b/toolkit/components/downloads/ApplicationReputation.h @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef ApplicationReputation_h__ +#define ApplicationReputation_h__ + +#include "nsIApplicationReputation.h" +#include "nsIRequestObserver.h" +#include "nsIStreamListener.h" +#include "nsISupports.h" + +#include "nsCOMPtr.h" +#include "nsString.h" +#include "mozilla/Logging.h" + +class nsIRequest; +class PendingDBLookup; +class PendingLookup; + +class ApplicationReputationService final : + public nsIApplicationReputationService { +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIAPPLICATIONREPUTATIONSERVICE + +public: + static ApplicationReputationService* GetSingleton(); + +private: + friend class PendingLookup; + friend class PendingDBLookup; + /** + * Global singleton object for holding this factory service. + */ + static ApplicationReputationService* gApplicationReputationService; + /** + * MOZ_LOG=ApplicationReputation:5 + */ + static mozilla::LazyLogModule prlog; + /** + * This is a singleton, so disallow construction. + */ + ApplicationReputationService(); + ~ApplicationReputationService(); + /** + * Wrapper function for QueryReputation that makes it easier to ensure the + * callback is called. + */ + nsresult QueryReputationInternal(nsIApplicationReputationQuery* aQuery, + nsIApplicationReputationCallback* aCallback); +}; +#endif /* ApplicationReputation_h__ */ diff --git a/toolkit/components/downloads/SQLFunctions.cpp b/toolkit/components/downloads/SQLFunctions.cpp new file mode 100644 index 000000000..8f2d3e77b --- /dev/null +++ b/toolkit/components/downloads/SQLFunctions.cpp @@ -0,0 +1,146 @@ +/* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/storage.h" +#include "mozilla/storage/Variant.h" +#include "mozilla/mozalloc.h" +#include "nsString.h" +#include "SQLFunctions.h" +#include "nsUTF8Utils.h" +#include "plbase64.h" +#include "prio.h" + +#ifdef XP_WIN +#include <windows.h> +#include <wincrypt.h> +#endif + +// The length of guids that are used by the download manager +#define GUID_LENGTH 12 + +namespace mozilla { +namespace downloads { + +// Keep this file in sync with the GUID-related code in toolkit/places/SQLFunctions.cpp +// and toolkit/places/Helpers.cpp! + +//////////////////////////////////////////////////////////////////////////////// +//// GUID Creation Function + +////////////////////////////////////////////////////////////////////////////// +//// GenerateGUIDFunction + +/* static */ +nsresult +GenerateGUIDFunction::create(mozIStorageConnection *aDBConn) +{ + RefPtr<GenerateGUIDFunction> function = new GenerateGUIDFunction(); + nsresult rv = aDBConn->CreateFunction( + NS_LITERAL_CSTRING("generate_guid"), 0, function + ); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +NS_IMPL_ISUPPORTS( + GenerateGUIDFunction, + mozIStorageFunction +) + +static +nsresult +Base64urlEncode(const uint8_t* aBytes, + uint32_t aNumBytes, + nsCString& _result) +{ + // SetLength does not set aside space for null termination. PL_Base64Encode + // will not null terminate, however, nsCStrings must be null terminated. As a + // result, we set the capacity to be one greater than what we need, and the + // length to our desired length. + uint32_t length = (aNumBytes + 2) / 3 * 4; // +2 due to integer math. + NS_ENSURE_TRUE(_result.SetCapacity(length + 1, mozilla::fallible), + NS_ERROR_OUT_OF_MEMORY); + _result.SetLength(length); + (void)PL_Base64Encode(reinterpret_cast<const char*>(aBytes), aNumBytes, + _result.BeginWriting()); + + // base64url encoding is defined in RFC 4648. It replaces the last two + // alphabet characters of base64 encoding with '-' and '_' respectively. + _result.ReplaceChar('+', '-'); + _result.ReplaceChar('/', '_'); + return NS_OK; +} + +static +nsresult +GenerateRandomBytes(uint32_t aSize, + uint8_t* _buffer) +{ + // On Windows, we'll use its built-in cryptographic API. +#if defined(XP_WIN) + HCRYPTPROV cryptoProvider; + BOOL rc = CryptAcquireContext(&cryptoProvider, 0, 0, PROV_RSA_FULL, + CRYPT_VERIFYCONTEXT | CRYPT_SILENT); + if (rc) { + rc = CryptGenRandom(cryptoProvider, aSize, _buffer); + (void)CryptReleaseContext(cryptoProvider, 0); + } + return rc ? NS_OK : NS_ERROR_FAILURE; + + // On Unix, we'll just read in from /dev/urandom. +#elif defined(XP_UNIX) + NS_ENSURE_ARG_MAX(aSize, INT32_MAX); + PRFileDesc* urandom = PR_Open("/dev/urandom", PR_RDONLY, 0); + nsresult rv = NS_ERROR_FAILURE; + if (urandom) { + int32_t bytesRead = PR_Read(urandom, _buffer, aSize); + if (bytesRead == static_cast<int32_t>(aSize)) { + rv = NS_OK; + } + (void)PR_Close(urandom); + } + return rv; +#endif +} + +nsresult +GenerateGUID(nsCString& _guid) +{ + _guid.Truncate(); + + // Request raw random bytes and base64url encode them. For each set of three + // bytes, we get one character. + const uint32_t kRequiredBytesLength = + static_cast<uint32_t>(GUID_LENGTH / 4 * 3); + + uint8_t buffer[kRequiredBytesLength]; + nsresult rv = GenerateRandomBytes(kRequiredBytesLength, buffer); + NS_ENSURE_SUCCESS(rv, rv); + + rv = Base64urlEncode(buffer, kRequiredBytesLength, _guid); + NS_ENSURE_SUCCESS(rv, rv); + + NS_ASSERTION(_guid.Length() == GUID_LENGTH, "GUID is not the right size!"); + return NS_OK; +} + +////////////////////////////////////////////////////////////////////////////// +//// mozIStorageFunction + +NS_IMETHODIMP +GenerateGUIDFunction::OnFunctionCall(mozIStorageValueArray *aArguments, + nsIVariant **_result) +{ + nsAutoCString guid; + nsresult rv = GenerateGUID(guid); + NS_ENSURE_SUCCESS(rv, rv); + + NS_ADDREF(*_result = new mozilla::storage::UTF8TextVariant(guid)); + return NS_OK; +} + +} // namespace downloads +} // namespace mozilla diff --git a/toolkit/components/downloads/SQLFunctions.h b/toolkit/components/downloads/SQLFunctions.h new file mode 100644 index 000000000..ae207788c --- /dev/null +++ b/toolkit/components/downloads/SQLFunctions.h @@ -0,0 +1,46 @@ +/* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_downloads_SQLFunctions_h +#define mozilla_downloads_SQLFunctions_h + +#include "mozIStorageFunction.h" +#include "mozilla/Attributes.h" + +class nsCString; +class mozIStorageConnection; + +namespace mozilla { +namespace downloads { + +/** + * SQL function to generate a GUID for a place or bookmark item. This is just + * a wrapper around GenerateGUID in SQLFunctions.cpp. + * + * @return a guid for the item. + * @see toolkit/components/places/SQLFunctions.h - keep this in sync + */ +class GenerateGUIDFunction final : public mozIStorageFunction +{ + ~GenerateGUIDFunction() {} +public: + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_MOZISTORAGEFUNCTION + + /** + * Registers the function with the specified database connection. + * + * @param aDBConn + * The database connection to register with. + */ + static nsresult create(mozIStorageConnection *aDBConn); +}; + +nsresult GenerateGUID(nsCString& _guid); + +} // namespace downloads +} // namespace mozilla + +#endif diff --git a/toolkit/components/downloads/chromium/LICENSE b/toolkit/components/downloads/chromium/LICENSE new file mode 100644 index 000000000..a32e00ce6 --- /dev/null +++ b/toolkit/components/downloads/chromium/LICENSE @@ -0,0 +1,27 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.cc b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.cc new file mode 100644 index 000000000..d52b822c0 --- /dev/null +++ b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.cc @@ -0,0 +1,20037 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: chromium/chrome/common/safe_browsing/csd.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "chromium/chrome/common/safe_browsing/csd.pb.h" + +#include <algorithm> + +#include <google/protobuf/stubs/common.h> +#include <google/protobuf/stubs/once.h> +#include <google/protobuf/io/coded_stream.h> +#include <google/protobuf/wire_format_lite_inl.h> +#include <google/protobuf/io/zero_copy_stream_impl_lite.h> +// @@protoc_insertion_point(includes) + +namespace safe_browsing { + +void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto() { + delete ChromeUserPopulation::default_instance_; + delete ClientPhishingRequest::default_instance_; + delete ClientPhishingRequest_Feature::default_instance_; + delete ClientPhishingResponse::default_instance_; + delete ClientMalwareRequest::default_instance_; + delete ClientMalwareRequest_UrlInfo::default_instance_; + delete ClientMalwareResponse::default_instance_; + delete ClientDownloadRequest::default_instance_; + delete ClientDownloadRequest_Digests::default_instance_; + delete ClientDownloadRequest_Resource::default_instance_; + delete ClientDownloadRequest_CertificateChain::default_instance_; + delete ClientDownloadRequest_CertificateChain_Element::default_instance_; + delete ClientDownloadRequest_ExtendedAttr::default_instance_; + delete ClientDownloadRequest_SignatureInfo::default_instance_; + delete ClientDownloadRequest_PEImageHeaders::default_instance_; + delete ClientDownloadRequest_PEImageHeaders_DebugData::default_instance_; + delete ClientDownloadRequest_MachOHeaders::default_instance_; + delete ClientDownloadRequest_MachOHeaders_LoadCommand::default_instance_; + delete ClientDownloadRequest_ImageHeaders::default_instance_; + delete ClientDownloadRequest_ArchivedBinary::default_instance_; + delete ClientDownloadRequest_URLChainEntry::default_instance_; + delete ClientDownloadResponse::default_instance_; + delete ClientDownloadResponse_MoreInfo::default_instance_; + delete ClientDownloadReport::default_instance_; + delete ClientDownloadReport_UserInformation::default_instance_; + delete ClientUploadResponse::default_instance_; + delete ClientIncidentReport::default_instance_; + delete ClientIncidentReport_IncidentData::default_instance_; + delete ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance_; + delete ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance_; + delete ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::default_instance_; + delete ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance_; + delete ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance_; + delete ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance_; + delete ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance_; + delete ClientIncidentReport_DownloadDetails::default_instance_; + delete ClientIncidentReport_EnvironmentData::default_instance_; + delete ClientIncidentReport_EnvironmentData_OS::default_instance_; + delete ClientIncidentReport_EnvironmentData_OS_RegistryValue::default_instance_; + delete ClientIncidentReport_EnvironmentData_OS_RegistryKey::default_instance_; + delete ClientIncidentReport_EnvironmentData_Machine::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process_Patch::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process_NetworkProvider::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process_Dll::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process_ModuleState::default_instance_; + delete ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::default_instance_; + delete ClientIncidentReport_ExtensionData::default_instance_; + delete ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance_; + delete ClientIncidentReport_NonBinaryDownloadDetails::default_instance_; + delete ClientIncidentResponse::default_instance_; + delete ClientIncidentResponse_EnvironmentRequest::default_instance_; + delete DownloadMetadata::default_instance_; + delete ClientSafeBrowsingReportRequest::default_instance_; + delete ClientSafeBrowsingReportRequest_HTTPHeader::default_instance_; + delete ClientSafeBrowsingReportRequest_HTTPRequest::default_instance_; + delete ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance_; + delete ClientSafeBrowsingReportRequest_HTTPResponse::default_instance_; + delete ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance_; + delete ClientSafeBrowsingReportRequest_Resource::default_instance_; +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#else +void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + +#endif + ChromeUserPopulation::default_instance_ = new ChromeUserPopulation(); + ClientPhishingRequest::default_instance_ = new ClientPhishingRequest(); + ClientPhishingRequest_Feature::default_instance_ = new ClientPhishingRequest_Feature(); + ClientPhishingResponse::default_instance_ = new ClientPhishingResponse(); + ClientMalwareRequest::default_instance_ = new ClientMalwareRequest(); + ClientMalwareRequest_UrlInfo::default_instance_ = new ClientMalwareRequest_UrlInfo(); + ClientMalwareResponse::default_instance_ = new ClientMalwareResponse(); + ClientDownloadRequest::default_instance_ = new ClientDownloadRequest(); + ClientDownloadRequest_Digests::default_instance_ = new ClientDownloadRequest_Digests(); + ClientDownloadRequest_Resource::default_instance_ = new ClientDownloadRequest_Resource(); + ClientDownloadRequest_CertificateChain::default_instance_ = new ClientDownloadRequest_CertificateChain(); + ClientDownloadRequest_CertificateChain_Element::default_instance_ = new ClientDownloadRequest_CertificateChain_Element(); + ClientDownloadRequest_ExtendedAttr::default_instance_ = new ClientDownloadRequest_ExtendedAttr(); + ClientDownloadRequest_SignatureInfo::default_instance_ = new ClientDownloadRequest_SignatureInfo(); + ClientDownloadRequest_PEImageHeaders::default_instance_ = new ClientDownloadRequest_PEImageHeaders(); + ClientDownloadRequest_PEImageHeaders_DebugData::default_instance_ = new ClientDownloadRequest_PEImageHeaders_DebugData(); + ClientDownloadRequest_MachOHeaders::default_instance_ = new ClientDownloadRequest_MachOHeaders(); + ClientDownloadRequest_MachOHeaders_LoadCommand::default_instance_ = new ClientDownloadRequest_MachOHeaders_LoadCommand(); + ClientDownloadRequest_ImageHeaders::default_instance_ = new ClientDownloadRequest_ImageHeaders(); + ClientDownloadRequest_ArchivedBinary::default_instance_ = new ClientDownloadRequest_ArchivedBinary(); + ClientDownloadRequest_URLChainEntry::default_instance_ = new ClientDownloadRequest_URLChainEntry(); + ClientDownloadResponse::default_instance_ = new ClientDownloadResponse(); + ClientDownloadResponse_MoreInfo::default_instance_ = new ClientDownloadResponse_MoreInfo(); + ClientDownloadReport::default_instance_ = new ClientDownloadReport(); + ClientDownloadReport_UserInformation::default_instance_ = new ClientDownloadReport_UserInformation(); + ClientUploadResponse::default_instance_ = new ClientUploadResponse(); + ClientIncidentReport::default_instance_ = new ClientIncidentReport(); + ClientIncidentReport_IncidentData::default_instance_ = new ClientIncidentReport_IncidentData(); + ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance_ = new ClientIncidentReport_IncidentData_TrackedPreferenceIncident(); + ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance_ = new ClientIncidentReport_IncidentData_BinaryIntegrityIncident(); + ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::default_instance_ = new ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile(); + ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance_ = new ClientIncidentReport_IncidentData_BlacklistLoadIncident(); + ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance_ = new ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident(); + ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance_ = new ClientIncidentReport_IncidentData_ResourceRequestIncident(); + ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance_ = new ClientIncidentReport_IncidentData_SuspiciousModuleIncident(); + ClientIncidentReport_DownloadDetails::default_instance_ = new ClientIncidentReport_DownloadDetails(); + ClientIncidentReport_EnvironmentData::default_instance_ = new ClientIncidentReport_EnvironmentData(); + ClientIncidentReport_EnvironmentData_OS::default_instance_ = new ClientIncidentReport_EnvironmentData_OS(); + ClientIncidentReport_EnvironmentData_OS_RegistryValue::default_instance_ = new ClientIncidentReport_EnvironmentData_OS_RegistryValue(); + ClientIncidentReport_EnvironmentData_OS_RegistryKey::default_instance_ = new ClientIncidentReport_EnvironmentData_OS_RegistryKey(); + ClientIncidentReport_EnvironmentData_Machine::default_instance_ = new ClientIncidentReport_EnvironmentData_Machine(); + ClientIncidentReport_EnvironmentData_Process::default_instance_ = new ClientIncidentReport_EnvironmentData_Process(); + ClientIncidentReport_EnvironmentData_Process_Patch::default_instance_ = new ClientIncidentReport_EnvironmentData_Process_Patch(); + ClientIncidentReport_EnvironmentData_Process_NetworkProvider::default_instance_ = new ClientIncidentReport_EnvironmentData_Process_NetworkProvider(); + ClientIncidentReport_EnvironmentData_Process_Dll::default_instance_ = new ClientIncidentReport_EnvironmentData_Process_Dll(); + ClientIncidentReport_EnvironmentData_Process_ModuleState::default_instance_ = new ClientIncidentReport_EnvironmentData_Process_ModuleState(); + ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::default_instance_ = new ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification(); + ClientIncidentReport_ExtensionData::default_instance_ = new ClientIncidentReport_ExtensionData(); + ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance_ = new ClientIncidentReport_ExtensionData_ExtensionInfo(); + ClientIncidentReport_NonBinaryDownloadDetails::default_instance_ = new ClientIncidentReport_NonBinaryDownloadDetails(); + ClientIncidentResponse::default_instance_ = new ClientIncidentResponse(); + ClientIncidentResponse_EnvironmentRequest::default_instance_ = new ClientIncidentResponse_EnvironmentRequest(); + DownloadMetadata::default_instance_ = new DownloadMetadata(); + ClientSafeBrowsingReportRequest::default_instance_ = new ClientSafeBrowsingReportRequest(); + ClientSafeBrowsingReportRequest_HTTPHeader::default_instance_ = new ClientSafeBrowsingReportRequest_HTTPHeader(); + ClientSafeBrowsingReportRequest_HTTPRequest::default_instance_ = new ClientSafeBrowsingReportRequest_HTTPRequest(); + ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance_ = new ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine(); + ClientSafeBrowsingReportRequest_HTTPResponse::default_instance_ = new ClientSafeBrowsingReportRequest_HTTPResponse(); + ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance_ = new ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine(); + ClientSafeBrowsingReportRequest_Resource::default_instance_ = new ClientSafeBrowsingReportRequest_Resource(); + ChromeUserPopulation::default_instance_->InitAsDefaultInstance(); + ClientPhishingRequest::default_instance_->InitAsDefaultInstance(); + ClientPhishingRequest_Feature::default_instance_->InitAsDefaultInstance(); + ClientPhishingResponse::default_instance_->InitAsDefaultInstance(); + ClientMalwareRequest::default_instance_->InitAsDefaultInstance(); + ClientMalwareRequest_UrlInfo::default_instance_->InitAsDefaultInstance(); + ClientMalwareResponse::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_Digests::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_Resource::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_CertificateChain::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_CertificateChain_Element::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_ExtendedAttr::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_SignatureInfo::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_PEImageHeaders::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_PEImageHeaders_DebugData::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_MachOHeaders::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_MachOHeaders_LoadCommand::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_ImageHeaders::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_ArchivedBinary::default_instance_->InitAsDefaultInstance(); + ClientDownloadRequest_URLChainEntry::default_instance_->InitAsDefaultInstance(); + ClientDownloadResponse::default_instance_->InitAsDefaultInstance(); + ClientDownloadResponse_MoreInfo::default_instance_->InitAsDefaultInstance(); + ClientDownloadReport::default_instance_->InitAsDefaultInstance(); + ClientDownloadReport_UserInformation::default_instance_->InitAsDefaultInstance(); + ClientUploadResponse::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_DownloadDetails::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_OS::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_OS_RegistryValue::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_OS_RegistryKey::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Machine::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process_Patch::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process_NetworkProvider::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process_Dll::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process_ModuleState::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_ExtensionData::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance_->InitAsDefaultInstance(); + ClientIncidentReport_NonBinaryDownloadDetails::default_instance_->InitAsDefaultInstance(); + ClientIncidentResponse::default_instance_->InitAsDefaultInstance(); + ClientIncidentResponse_EnvironmentRequest::default_instance_->InitAsDefaultInstance(); + DownloadMetadata::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_HTTPHeader::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_HTTPRequest::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_HTTPResponse::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance_->InitAsDefaultInstance(); + ClientSafeBrowsingReportRequest_Resource::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto); +} + +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_once_); +void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto() { + ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_once_, + &protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl); +} +#else +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto { + StaticDescriptorInitializer_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto() { + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + } +} static_descriptor_initializer_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_; +#endif + +// =================================================================== + +bool ChromeUserPopulation_UserPopulation_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ChromeUserPopulation_UserPopulation ChromeUserPopulation::UNKNOWN_USER_POPULATION; +const ChromeUserPopulation_UserPopulation ChromeUserPopulation::SAFE_BROWSING; +const ChromeUserPopulation_UserPopulation ChromeUserPopulation::EXTENDED_REPORTING; +const ChromeUserPopulation_UserPopulation ChromeUserPopulation::UserPopulation_MIN; +const ChromeUserPopulation_UserPopulation ChromeUserPopulation::UserPopulation_MAX; +const int ChromeUserPopulation::UserPopulation_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ChromeUserPopulation::kUserPopulationFieldNumber; +#endif // !_MSC_VER + +ChromeUserPopulation::ChromeUserPopulation() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ChromeUserPopulation) +} + +void ChromeUserPopulation::InitAsDefaultInstance() { +} + +ChromeUserPopulation::ChromeUserPopulation(const ChromeUserPopulation& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ChromeUserPopulation) +} + +void ChromeUserPopulation::SharedCtor() { + _cached_size_ = 0; + user_population_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ChromeUserPopulation::~ChromeUserPopulation() { + // @@protoc_insertion_point(destructor:safe_browsing.ChromeUserPopulation) + SharedDtor(); +} + +void ChromeUserPopulation::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ChromeUserPopulation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ChromeUserPopulation& ChromeUserPopulation::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ChromeUserPopulation* ChromeUserPopulation::default_instance_ = NULL; + +ChromeUserPopulation* ChromeUserPopulation::New() const { + return new ChromeUserPopulation; +} + +void ChromeUserPopulation::Clear() { + user_population_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ChromeUserPopulation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ChromeUserPopulation) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ChromeUserPopulation.UserPopulation user_population = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ChromeUserPopulation_UserPopulation_IsValid(value)) { + set_user_population(static_cast< ::safe_browsing::ChromeUserPopulation_UserPopulation >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ChromeUserPopulation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ChromeUserPopulation) + return false; +#undef DO_ +} + +void ChromeUserPopulation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ChromeUserPopulation) + // optional .safe_browsing.ChromeUserPopulation.UserPopulation user_population = 1; + if (has_user_population()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->user_population(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ChromeUserPopulation) +} + +int ChromeUserPopulation::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ChromeUserPopulation.UserPopulation user_population = 1; + if (has_user_population()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->user_population()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ChromeUserPopulation::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ChromeUserPopulation*>(&from)); +} + +void ChromeUserPopulation::MergeFrom(const ChromeUserPopulation& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_user_population()) { + set_user_population(from.user_population()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ChromeUserPopulation::CopyFrom(const ChromeUserPopulation& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ChromeUserPopulation::IsInitialized() const { + + return true; +} + +void ChromeUserPopulation::Swap(ChromeUserPopulation* other) { + if (other != this) { + std::swap(user_population_, other->user_population_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ChromeUserPopulation::GetTypeName() const { + return "safe_browsing.ChromeUserPopulation"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ClientPhishingRequest_Feature::kNameFieldNumber; +const int ClientPhishingRequest_Feature::kValueFieldNumber; +#endif // !_MSC_VER + +ClientPhishingRequest_Feature::ClientPhishingRequest_Feature() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientPhishingRequest.Feature) +} + +void ClientPhishingRequest_Feature::InitAsDefaultInstance() { +} + +ClientPhishingRequest_Feature::ClientPhishingRequest_Feature(const ClientPhishingRequest_Feature& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientPhishingRequest.Feature) +} + +void ClientPhishingRequest_Feature::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + value_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientPhishingRequest_Feature::~ClientPhishingRequest_Feature() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientPhishingRequest.Feature) + SharedDtor(); +} + +void ClientPhishingRequest_Feature::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientPhishingRequest_Feature::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientPhishingRequest_Feature& ClientPhishingRequest_Feature::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientPhishingRequest_Feature* ClientPhishingRequest_Feature::default_instance_ = NULL; + +ClientPhishingRequest_Feature* ClientPhishingRequest_Feature::New() const { + return new ClientPhishingRequest_Feature; +} + +void ClientPhishingRequest_Feature::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + value_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientPhishingRequest_Feature::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientPhishingRequest.Feature) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(17)) goto parse_value; + break; + } + + // required double value = 2; + case 2: { + if (tag == 17) { + parse_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &value_))); + set_has_value(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientPhishingRequest.Feature) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientPhishingRequest.Feature) + return false; +#undef DO_ +} + +void ClientPhishingRequest_Feature::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientPhishingRequest.Feature) + // required string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // required double value = 2; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientPhishingRequest.Feature) +} + +int ClientPhishingRequest_Feature::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // required double value = 2; + if (has_value()) { + total_size += 1 + 8; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientPhishingRequest_Feature::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientPhishingRequest_Feature*>(&from)); +} + +void ClientPhishingRequest_Feature::MergeFrom(const ClientPhishingRequest_Feature& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_value()) { + set_value(from.value()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientPhishingRequest_Feature::CopyFrom(const ClientPhishingRequest_Feature& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientPhishingRequest_Feature::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void ClientPhishingRequest_Feature::Swap(ClientPhishingRequest_Feature* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(value_, other->value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientPhishingRequest_Feature::GetTypeName() const { + return "safe_browsing.ClientPhishingRequest.Feature"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientPhishingRequest::kUrlFieldNumber; +const int ClientPhishingRequest::kOBSOLETEHashPrefixFieldNumber; +const int ClientPhishingRequest::kClientScoreFieldNumber; +const int ClientPhishingRequest::kIsPhishingFieldNumber; +const int ClientPhishingRequest::kFeatureMapFieldNumber; +const int ClientPhishingRequest::kModelVersionFieldNumber; +const int ClientPhishingRequest::kNonModelFeatureMapFieldNumber; +const int ClientPhishingRequest::kOBSOLETEReferrerUrlFieldNumber; +const int ClientPhishingRequest::kShingleHashesFieldNumber; +const int ClientPhishingRequest::kModelFilenameFieldNumber; +const int ClientPhishingRequest::kPopulationFieldNumber; +#endif // !_MSC_VER + +ClientPhishingRequest::ClientPhishingRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientPhishingRequest) +} + +void ClientPhishingRequest::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>( + ::safe_browsing::ChromeUserPopulation::internal_default_instance()); +#else + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>(&::safe_browsing::ChromeUserPopulation::default_instance()); +#endif +} + +ClientPhishingRequest::ClientPhishingRequest(const ClientPhishingRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientPhishingRequest) +} + +void ClientPhishingRequest::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + client_score_ = 0; + is_phishing_ = false; + model_version_ = 0; + obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + model_filename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + population_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientPhishingRequest::~ClientPhishingRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientPhishingRequest) + SharedDtor(); +} + +void ClientPhishingRequest::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (obsolete_hash_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete obsolete_hash_prefix_; + } + if (obsolete_referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete obsolete_referrer_url_; + } + if (model_filename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete model_filename_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete population_; + } +} + +void ClientPhishingRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientPhishingRequest& ClientPhishingRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientPhishingRequest* ClientPhishingRequest::default_instance_ = NULL; + +ClientPhishingRequest* ClientPhishingRequest::New() const { + return new ClientPhishingRequest; +} + +void ClientPhishingRequest::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientPhishingRequest*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 175) { + ZR_(client_score_, is_phishing_); + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_obsolete_hash_prefix()) { + if (obsolete_hash_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_->clear(); + } + } + model_version_ = 0; + if (has_obsolete_referrer_url()) { + if (obsolete_referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_->clear(); + } + } + } + if (_has_bits_[8 / 32] & 1536) { + if (has_model_filename()) { + if (model_filename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_->clear(); + } + } + if (has_population()) { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + feature_map_.Clear(); + non_model_feature_map_.Clear(); + shingle_hashes_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientPhishingRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientPhishingRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(21)) goto parse_client_score; + break; + } + + // required float client_score = 2; + case 2: { + if (tag == 21) { + parse_client_score: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( + input, &client_score_))); + set_has_client_score(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_is_phishing; + break; + } + + // optional bool is_phishing = 4; + case 4: { + if (tag == 32) { + parse_is_phishing: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_phishing_))); + set_has_is_phishing(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_feature_map; + break; + } + + // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5; + case 5: { + if (tag == 42) { + parse_feature_map: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_feature_map())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_feature_map; + if (input->ExpectTag(48)) goto parse_model_version; + break; + } + + // optional int32 model_version = 6; + case 6: { + if (tag == 48) { + parse_model_version: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &model_version_))); + set_has_model_version(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_non_model_feature_map; + break; + } + + // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8; + case 8: { + if (tag == 66) { + parse_non_model_feature_map: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_non_model_feature_map())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_non_model_feature_map; + if (input->ExpectTag(74)) goto parse_OBSOLETE_referrer_url; + break; + } + + // optional string OBSOLETE_referrer_url = 9; + case 9: { + if (tag == 74) { + parse_OBSOLETE_referrer_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_obsolete_referrer_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_OBSOLETE_hash_prefix; + break; + } + + // optional bytes OBSOLETE_hash_prefix = 10; + case 10: { + if (tag == 82) { + parse_OBSOLETE_hash_prefix: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_obsolete_hash_prefix())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(98)) goto parse_shingle_hashes; + break; + } + + // repeated uint32 shingle_hashes = 12 [packed = true]; + case 12: { + if (tag == 98) { + parse_shingle_hashes: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_shingle_hashes()))); + } else if (tag == 96) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 98, input, this->mutable_shingle_hashes()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(106)) goto parse_model_filename; + break; + } + + // optional string model_filename = 13; + case 13: { + if (tag == 106) { + parse_model_filename: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_model_filename())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(114)) goto parse_population; + break; + } + + // optional .safe_browsing.ChromeUserPopulation population = 14; + case 14: { + if (tag == 114) { + parse_population: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_population())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientPhishingRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientPhishingRequest) + return false; +#undef DO_ +} + +void ClientPhishingRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientPhishingRequest) + // optional string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // required float client_score = 2; + if (has_client_score()) { + ::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->client_score(), output); + } + + // optional bool is_phishing = 4; + if (has_is_phishing()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->is_phishing(), output); + } + + // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5; + for (int i = 0; i < this->feature_map_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->feature_map(i), output); + } + + // optional int32 model_version = 6; + if (has_model_version()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->model_version(), output); + } + + // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8; + for (int i = 0; i < this->non_model_feature_map_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->non_model_feature_map(i), output); + } + + // optional string OBSOLETE_referrer_url = 9; + if (has_obsolete_referrer_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->obsolete_referrer_url(), output); + } + + // optional bytes OBSOLETE_hash_prefix = 10; + if (has_obsolete_hash_prefix()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 10, this->obsolete_hash_prefix(), output); + } + + // repeated uint32 shingle_hashes = 12 [packed = true]; + if (this->shingle_hashes_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(12, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_shingle_hashes_cached_byte_size_); + } + for (int i = 0; i < this->shingle_hashes_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->shingle_hashes(i), output); + } + + // optional string model_filename = 13; + if (has_model_filename()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 13, this->model_filename(), output); + } + + // optional .safe_browsing.ChromeUserPopulation population = 14; + if (has_population()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 14, this->population(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientPhishingRequest) +} + +int ClientPhishingRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional bytes OBSOLETE_hash_prefix = 10; + if (has_obsolete_hash_prefix()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->obsolete_hash_prefix()); + } + + // required float client_score = 2; + if (has_client_score()) { + total_size += 1 + 4; + } + + // optional bool is_phishing = 4; + if (has_is_phishing()) { + total_size += 1 + 1; + } + + // optional int32 model_version = 6; + if (has_model_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->model_version()); + } + + // optional string OBSOLETE_referrer_url = 9; + if (has_obsolete_referrer_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->obsolete_referrer_url()); + } + + } + if (_has_bits_[9 / 32] & (0xffu << (9 % 32))) { + // optional string model_filename = 13; + if (has_model_filename()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->model_filename()); + } + + // optional .safe_browsing.ChromeUserPopulation population = 14; + if (has_population()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->population()); + } + + } + // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5; + total_size += 1 * this->feature_map_size(); + for (int i = 0; i < this->feature_map_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->feature_map(i)); + } + + // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8; + total_size += 1 * this->non_model_feature_map_size(); + for (int i = 0; i < this->non_model_feature_map_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->non_model_feature_map(i)); + } + + // repeated uint32 shingle_hashes = 12 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->shingle_hashes_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->shingle_hashes(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _shingle_hashes_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientPhishingRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientPhishingRequest*>(&from)); +} + +void ClientPhishingRequest::MergeFrom(const ClientPhishingRequest& from) { + GOOGLE_CHECK_NE(&from, this); + feature_map_.MergeFrom(from.feature_map_); + non_model_feature_map_.MergeFrom(from.non_model_feature_map_); + shingle_hashes_.MergeFrom(from.shingle_hashes_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_obsolete_hash_prefix()) { + set_obsolete_hash_prefix(from.obsolete_hash_prefix()); + } + if (from.has_client_score()) { + set_client_score(from.client_score()); + } + if (from.has_is_phishing()) { + set_is_phishing(from.is_phishing()); + } + if (from.has_model_version()) { + set_model_version(from.model_version()); + } + if (from.has_obsolete_referrer_url()) { + set_obsolete_referrer_url(from.obsolete_referrer_url()); + } + } + if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { + if (from.has_model_filename()) { + set_model_filename(from.model_filename()); + } + if (from.has_population()) { + mutable_population()->::safe_browsing::ChromeUserPopulation::MergeFrom(from.population()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientPhishingRequest::CopyFrom(const ClientPhishingRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientPhishingRequest::IsInitialized() const { + if ((_has_bits_[0] & 0x00000004) != 0x00000004) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->feature_map())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->non_model_feature_map())) return false; + return true; +} + +void ClientPhishingRequest::Swap(ClientPhishingRequest* other) { + if (other != this) { + std::swap(url_, other->url_); + std::swap(obsolete_hash_prefix_, other->obsolete_hash_prefix_); + std::swap(client_score_, other->client_score_); + std::swap(is_phishing_, other->is_phishing_); + feature_map_.Swap(&other->feature_map_); + std::swap(model_version_, other->model_version_); + non_model_feature_map_.Swap(&other->non_model_feature_map_); + std::swap(obsolete_referrer_url_, other->obsolete_referrer_url_); + shingle_hashes_.Swap(&other->shingle_hashes_); + std::swap(model_filename_, other->model_filename_); + std::swap(population_, other->population_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientPhishingRequest::GetTypeName() const { + return "safe_browsing.ClientPhishingRequest"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ClientPhishingResponse::kPhishyFieldNumber; +const int ClientPhishingResponse::kOBSOLETEWhitelistExpressionFieldNumber; +#endif // !_MSC_VER + +ClientPhishingResponse::ClientPhishingResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientPhishingResponse) +} + +void ClientPhishingResponse::InitAsDefaultInstance() { +} + +ClientPhishingResponse::ClientPhishingResponse(const ClientPhishingResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientPhishingResponse) +} + +void ClientPhishingResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + phishy_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientPhishingResponse::~ClientPhishingResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientPhishingResponse) + SharedDtor(); +} + +void ClientPhishingResponse::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientPhishingResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientPhishingResponse& ClientPhishingResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientPhishingResponse* ClientPhishingResponse::default_instance_ = NULL; + +ClientPhishingResponse* ClientPhishingResponse::New() const { + return new ClientPhishingResponse; +} + +void ClientPhishingResponse::Clear() { + phishy_ = false; + obsolete_whitelist_expression_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientPhishingResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientPhishingResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required bool phishy = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &phishy_))); + set_has_phishy(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression; + break; + } + + // repeated string OBSOLETE_whitelist_expression = 2; + case 2: { + if (tag == 18) { + parse_OBSOLETE_whitelist_expression: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_obsolete_whitelist_expression())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientPhishingResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientPhishingResponse) + return false; +#undef DO_ +} + +void ClientPhishingResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientPhishingResponse) + // required bool phishy = 1; + if (has_phishy()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->phishy(), output); + } + + // repeated string OBSOLETE_whitelist_expression = 2; + for (int i = 0; i < this->obsolete_whitelist_expression_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->obsolete_whitelist_expression(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientPhishingResponse) +} + +int ClientPhishingResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required bool phishy = 1; + if (has_phishy()) { + total_size += 1 + 1; + } + + } + // repeated string OBSOLETE_whitelist_expression = 2; + total_size += 1 * this->obsolete_whitelist_expression_size(); + for (int i = 0; i < this->obsolete_whitelist_expression_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->obsolete_whitelist_expression(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientPhishingResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientPhishingResponse*>(&from)); +} + +void ClientPhishingResponse::MergeFrom(const ClientPhishingResponse& from) { + GOOGLE_CHECK_NE(&from, this); + obsolete_whitelist_expression_.MergeFrom(from.obsolete_whitelist_expression_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_phishy()) { + set_phishy(from.phishy()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientPhishingResponse::CopyFrom(const ClientPhishingResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientPhishingResponse::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void ClientPhishingResponse::Swap(ClientPhishingResponse* other) { + if (other != this) { + std::swap(phishy_, other->phishy_); + obsolete_whitelist_expression_.Swap(&other->obsolete_whitelist_expression_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientPhishingResponse::GetTypeName() const { + return "safe_browsing.ClientPhishingResponse"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ClientMalwareRequest_UrlInfo::kIpFieldNumber; +const int ClientMalwareRequest_UrlInfo::kUrlFieldNumber; +const int ClientMalwareRequest_UrlInfo::kMethodFieldNumber; +const int ClientMalwareRequest_UrlInfo::kReferrerFieldNumber; +const int ClientMalwareRequest_UrlInfo::kResourceTypeFieldNumber; +#endif // !_MSC_VER + +ClientMalwareRequest_UrlInfo::ClientMalwareRequest_UrlInfo() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientMalwareRequest.UrlInfo) +} + +void ClientMalwareRequest_UrlInfo::InitAsDefaultInstance() { +} + +ClientMalwareRequest_UrlInfo::ClientMalwareRequest_UrlInfo(const ClientMalwareRequest_UrlInfo& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientMalwareRequest.UrlInfo) +} + +void ClientMalwareRequest_UrlInfo::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + method_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + resource_type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientMalwareRequest_UrlInfo::~ClientMalwareRequest_UrlInfo() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientMalwareRequest.UrlInfo) + SharedDtor(); +} + +void ClientMalwareRequest_UrlInfo::SharedDtor() { + if (ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete ip_; + } + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (method_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete method_; + } + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientMalwareRequest_UrlInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientMalwareRequest_UrlInfo& ClientMalwareRequest_UrlInfo::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientMalwareRequest_UrlInfo* ClientMalwareRequest_UrlInfo::default_instance_ = NULL; + +ClientMalwareRequest_UrlInfo* ClientMalwareRequest_UrlInfo::New() const { + return new ClientMalwareRequest_UrlInfo; +} + +void ClientMalwareRequest_UrlInfo::Clear() { + if (_has_bits_[0 / 32] & 31) { + if (has_ip()) { + if (ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_->clear(); + } + } + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_method()) { + if (method_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_->clear(); + } + } + if (has_referrer()) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + } + resource_type_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientMalwareRequest_UrlInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientMalwareRequest.UrlInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string ip = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_ip())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_url; + break; + } + + // required string url = 2; + case 2: { + if (tag == 18) { + parse_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_method; + break; + } + + // optional string method = 3; + case 3: { + if (tag == 26) { + parse_method: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_method())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_referrer; + break; + } + + // optional string referrer = 4; + case 4: { + if (tag == 34) { + parse_referrer: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_referrer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_resource_type; + break; + } + + // optional int32 resource_type = 5; + case 5: { + if (tag == 40) { + parse_resource_type: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &resource_type_))); + set_has_resource_type(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientMalwareRequest.UrlInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientMalwareRequest.UrlInfo) + return false; +#undef DO_ +} + +void ClientMalwareRequest_UrlInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientMalwareRequest.UrlInfo) + // required string ip = 1; + if (has_ip()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->ip(), output); + } + + // required string url = 2; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->url(), output); + } + + // optional string method = 3; + if (has_method()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->method(), output); + } + + // optional string referrer = 4; + if (has_referrer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->referrer(), output); + } + + // optional int32 resource_type = 5; + if (has_resource_type()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->resource_type(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientMalwareRequest.UrlInfo) +} + +int ClientMalwareRequest_UrlInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string ip = 1; + if (has_ip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->ip()); + } + + // required string url = 2; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional string method = 3; + if (has_method()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->method()); + } + + // optional string referrer = 4; + if (has_referrer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->referrer()); + } + + // optional int32 resource_type = 5; + if (has_resource_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->resource_type()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientMalwareRequest_UrlInfo::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientMalwareRequest_UrlInfo*>(&from)); +} + +void ClientMalwareRequest_UrlInfo::MergeFrom(const ClientMalwareRequest_UrlInfo& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_ip()) { + set_ip(from.ip()); + } + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_method()) { + set_method(from.method()); + } + if (from.has_referrer()) { + set_referrer(from.referrer()); + } + if (from.has_resource_type()) { + set_resource_type(from.resource_type()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientMalwareRequest_UrlInfo::CopyFrom(const ClientMalwareRequest_UrlInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientMalwareRequest_UrlInfo::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void ClientMalwareRequest_UrlInfo::Swap(ClientMalwareRequest_UrlInfo* other) { + if (other != this) { + std::swap(ip_, other->ip_); + std::swap(url_, other->url_); + std::swap(method_, other->method_); + std::swap(referrer_, other->referrer_); + std::swap(resource_type_, other->resource_type_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientMalwareRequest_UrlInfo::GetTypeName() const { + return "safe_browsing.ClientMalwareRequest.UrlInfo"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientMalwareRequest::kUrlFieldNumber; +const int ClientMalwareRequest::kReferrerUrlFieldNumber; +const int ClientMalwareRequest::kBadIpUrlInfoFieldNumber; +const int ClientMalwareRequest::kPopulationFieldNumber; +#endif // !_MSC_VER + +ClientMalwareRequest::ClientMalwareRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientMalwareRequest) +} + +void ClientMalwareRequest::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>( + ::safe_browsing::ChromeUserPopulation::internal_default_instance()); +#else + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>(&::safe_browsing::ChromeUserPopulation::default_instance()); +#endif +} + +ClientMalwareRequest::ClientMalwareRequest(const ClientMalwareRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientMalwareRequest) +} + +void ClientMalwareRequest::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + population_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientMalwareRequest::~ClientMalwareRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientMalwareRequest) + SharedDtor(); +} + +void ClientMalwareRequest::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_url_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete population_; + } +} + +void ClientMalwareRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientMalwareRequest& ClientMalwareRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientMalwareRequest* ClientMalwareRequest::default_instance_ = NULL; + +ClientMalwareRequest* ClientMalwareRequest::New() const { + return new ClientMalwareRequest; +} + +void ClientMalwareRequest::Clear() { + if (_has_bits_[0 / 32] & 11) { + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_referrer_url()) { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_->clear(); + } + } + if (has_population()) { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + } + } + bad_ip_url_info_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientMalwareRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientMalwareRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_referrer_url; + break; + } + + // optional string referrer_url = 4; + case 4: { + if (tag == 34) { + parse_referrer_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_referrer_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_bad_ip_url_info; + break; + } + + // repeated .safe_browsing.ClientMalwareRequest.UrlInfo bad_ip_url_info = 7; + case 7: { + if (tag == 58) { + parse_bad_ip_url_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_bad_ip_url_info())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_bad_ip_url_info; + if (input->ExpectTag(74)) goto parse_population; + break; + } + + // optional .safe_browsing.ChromeUserPopulation population = 9; + case 9: { + if (tag == 74) { + parse_population: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_population())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientMalwareRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientMalwareRequest) + return false; +#undef DO_ +} + +void ClientMalwareRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientMalwareRequest) + // required string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // optional string referrer_url = 4; + if (has_referrer_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->referrer_url(), output); + } + + // repeated .safe_browsing.ClientMalwareRequest.UrlInfo bad_ip_url_info = 7; + for (int i = 0; i < this->bad_ip_url_info_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->bad_ip_url_info(i), output); + } + + // optional .safe_browsing.ChromeUserPopulation population = 9; + if (has_population()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->population(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientMalwareRequest) +} + +int ClientMalwareRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional string referrer_url = 4; + if (has_referrer_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->referrer_url()); + } + + // optional .safe_browsing.ChromeUserPopulation population = 9; + if (has_population()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->population()); + } + + } + // repeated .safe_browsing.ClientMalwareRequest.UrlInfo bad_ip_url_info = 7; + total_size += 1 * this->bad_ip_url_info_size(); + for (int i = 0; i < this->bad_ip_url_info_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bad_ip_url_info(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientMalwareRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientMalwareRequest*>(&from)); +} + +void ClientMalwareRequest::MergeFrom(const ClientMalwareRequest& from) { + GOOGLE_CHECK_NE(&from, this); + bad_ip_url_info_.MergeFrom(from.bad_ip_url_info_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_referrer_url()) { + set_referrer_url(from.referrer_url()); + } + if (from.has_population()) { + mutable_population()->::safe_browsing::ChromeUserPopulation::MergeFrom(from.population()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientMalwareRequest::CopyFrom(const ClientMalwareRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientMalwareRequest::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->bad_ip_url_info())) return false; + return true; +} + +void ClientMalwareRequest::Swap(ClientMalwareRequest* other) { + if (other != this) { + std::swap(url_, other->url_); + std::swap(referrer_url_, other->referrer_url_); + bad_ip_url_info_.Swap(&other->bad_ip_url_info_); + std::swap(population_, other->population_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientMalwareRequest::GetTypeName() const { + return "safe_browsing.ClientMalwareRequest"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ClientMalwareResponse::kBlacklistFieldNumber; +const int ClientMalwareResponse::kBadIpFieldNumber; +const int ClientMalwareResponse::kBadUrlFieldNumber; +#endif // !_MSC_VER + +ClientMalwareResponse::ClientMalwareResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientMalwareResponse) +} + +void ClientMalwareResponse::InitAsDefaultInstance() { +} + +ClientMalwareResponse::ClientMalwareResponse(const ClientMalwareResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientMalwareResponse) +} + +void ClientMalwareResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + blacklist_ = false; + bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bad_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientMalwareResponse::~ClientMalwareResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientMalwareResponse) + SharedDtor(); +} + +void ClientMalwareResponse::SharedDtor() { + if (bad_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bad_ip_; + } + if (bad_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bad_url_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientMalwareResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientMalwareResponse& ClientMalwareResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientMalwareResponse* ClientMalwareResponse::default_instance_ = NULL; + +ClientMalwareResponse* ClientMalwareResponse::New() const { + return new ClientMalwareResponse; +} + +void ClientMalwareResponse::Clear() { + if (_has_bits_[0 / 32] & 7) { + blacklist_ = false; + if (has_bad_ip()) { + if (bad_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_->clear(); + } + } + if (has_bad_url()) { + if (bad_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientMalwareResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientMalwareResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required bool blacklist = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &blacklist_))); + set_has_blacklist(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_bad_ip; + break; + } + + // optional string bad_ip = 2; + case 2: { + if (tag == 18) { + parse_bad_ip: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_bad_ip())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_bad_url; + break; + } + + // optional string bad_url = 3; + case 3: { + if (tag == 26) { + parse_bad_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_bad_url())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientMalwareResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientMalwareResponse) + return false; +#undef DO_ +} + +void ClientMalwareResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientMalwareResponse) + // required bool blacklist = 1; + if (has_blacklist()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->blacklist(), output); + } + + // optional string bad_ip = 2; + if (has_bad_ip()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->bad_ip(), output); + } + + // optional string bad_url = 3; + if (has_bad_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->bad_url(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientMalwareResponse) +} + +int ClientMalwareResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required bool blacklist = 1; + if (has_blacklist()) { + total_size += 1 + 1; + } + + // optional string bad_ip = 2; + if (has_bad_ip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->bad_ip()); + } + + // optional string bad_url = 3; + if (has_bad_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->bad_url()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientMalwareResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientMalwareResponse*>(&from)); +} + +void ClientMalwareResponse::MergeFrom(const ClientMalwareResponse& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_blacklist()) { + set_blacklist(from.blacklist()); + } + if (from.has_bad_ip()) { + set_bad_ip(from.bad_ip()); + } + if (from.has_bad_url()) { + set_bad_url(from.bad_url()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientMalwareResponse::CopyFrom(const ClientMalwareResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientMalwareResponse::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void ClientMalwareResponse::Swap(ClientMalwareResponse* other) { + if (other != this) { + std::swap(blacklist_, other->blacklist_); + std::swap(bad_ip_, other->bad_ip_); + std::swap(bad_url_, other->bad_url_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientMalwareResponse::GetTypeName() const { + return "safe_browsing.ClientMalwareResponse"; +} + + +// =================================================================== + +bool ClientDownloadRequest_ResourceType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientDownloadRequest_ResourceType ClientDownloadRequest::DOWNLOAD_URL; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::DOWNLOAD_REDIRECT; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::TAB_URL; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::TAB_REDIRECT; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::PPAPI_DOCUMENT; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::PPAPI_PLUGIN; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::ResourceType_MIN; +const ClientDownloadRequest_ResourceType ClientDownloadRequest::ResourceType_MAX; +const int ClientDownloadRequest::ResourceType_ARRAYSIZE; +#endif // _MSC_VER +bool ClientDownloadRequest_DownloadType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientDownloadRequest_DownloadType ClientDownloadRequest::WIN_EXECUTABLE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::CHROME_EXTENSION; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::ANDROID_APK; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::ZIPPED_EXECUTABLE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::MAC_EXECUTABLE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::ZIPPED_ARCHIVE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::ARCHIVE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::INVALID_ZIP; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::INVALID_MAC_ARCHIVE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::PPAPI_SAVE_REQUEST; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::SAMPLED_UNSUPPORTED_FILE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::DownloadType_MIN; +const ClientDownloadRequest_DownloadType ClientDownloadRequest::DownloadType_MAX; +const int ClientDownloadRequest::DownloadType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientDownloadRequest_Digests::kSha256FieldNumber; +const int ClientDownloadRequest_Digests::kSha1FieldNumber; +const int ClientDownloadRequest_Digests::kMd5FieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_Digests::ClientDownloadRequest_Digests() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.Digests) +} + +void ClientDownloadRequest_Digests::InitAsDefaultInstance() { +} + +ClientDownloadRequest_Digests::ClientDownloadRequest_Digests(const ClientDownloadRequest_Digests& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.Digests) +} + +void ClientDownloadRequest_Digests::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_Digests::~ClientDownloadRequest_Digests() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.Digests) + SharedDtor(); +} + +void ClientDownloadRequest_Digests::SharedDtor() { + if (sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete sha256_; + } + if (sha1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete sha1_; + } + if (md5_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete md5_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_Digests::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_Digests& ClientDownloadRequest_Digests::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_Digests* ClientDownloadRequest_Digests::default_instance_ = NULL; + +ClientDownloadRequest_Digests* ClientDownloadRequest_Digests::New() const { + return new ClientDownloadRequest_Digests; +} + +void ClientDownloadRequest_Digests::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_sha256()) { + if (sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_->clear(); + } + } + if (has_sha1()) { + if (sha1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_->clear(); + } + } + if (has_md5()) { + if (md5_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_Digests::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.Digests) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes sha256 = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_sha256())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_sha1; + break; + } + + // optional bytes sha1 = 2; + case 2: { + if (tag == 18) { + parse_sha1: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_sha1())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_md5; + break; + } + + // optional bytes md5 = 3; + case 3: { + if (tag == 26) { + parse_md5: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_md5())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.Digests) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.Digests) + return false; +#undef DO_ +} + +void ClientDownloadRequest_Digests::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.Digests) + // optional bytes sha256 = 1; + if (has_sha256()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->sha256(), output); + } + + // optional bytes sha1 = 2; + if (has_sha1()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->sha1(), output); + } + + // optional bytes md5 = 3; + if (has_md5()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->md5(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.Digests) +} + +int ClientDownloadRequest_Digests::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes sha256 = 1; + if (has_sha256()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->sha256()); + } + + // optional bytes sha1 = 2; + if (has_sha1()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->sha1()); + } + + // optional bytes md5 = 3; + if (has_md5()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->md5()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_Digests::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_Digests*>(&from)); +} + +void ClientDownloadRequest_Digests::MergeFrom(const ClientDownloadRequest_Digests& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_sha256()) { + set_sha256(from.sha256()); + } + if (from.has_sha1()) { + set_sha1(from.sha1()); + } + if (from.has_md5()) { + set_md5(from.md5()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_Digests::CopyFrom(const ClientDownloadRequest_Digests& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_Digests::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_Digests::Swap(ClientDownloadRequest_Digests* other) { + if (other != this) { + std::swap(sha256_, other->sha256_); + std::swap(sha1_, other->sha1_); + std::swap(md5_, other->md5_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_Digests::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.Digests"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_Resource::kUrlFieldNumber; +const int ClientDownloadRequest_Resource::kTypeFieldNumber; +const int ClientDownloadRequest_Resource::kRemoteIpFieldNumber; +const int ClientDownloadRequest_Resource::kReferrerFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_Resource::ClientDownloadRequest_Resource() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.Resource) +} + +void ClientDownloadRequest_Resource::InitAsDefaultInstance() { +} + +ClientDownloadRequest_Resource::ClientDownloadRequest_Resource(const ClientDownloadRequest_Resource& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.Resource) +} + +void ClientDownloadRequest_Resource::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_Resource::~ClientDownloadRequest_Resource() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.Resource) + SharedDtor(); +} + +void ClientDownloadRequest_Resource::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete remote_ip_; + } + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_Resource::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_Resource& ClientDownloadRequest_Resource::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_Resource* ClientDownloadRequest_Resource::default_instance_ = NULL; + +ClientDownloadRequest_Resource* ClientDownloadRequest_Resource::New() const { + return new ClientDownloadRequest_Resource; +} + +void ClientDownloadRequest_Resource::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + type_ = 0; + if (has_remote_ip()) { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_->clear(); + } + } + if (has_referrer()) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_Resource::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.Resource) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_type; + break; + } + + // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2; + case 2: { + if (tag == 16) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadRequest_ResourceType_IsValid(value)) { + set_type(static_cast< ::safe_browsing::ClientDownloadRequest_ResourceType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_remote_ip; + break; + } + + // optional bytes remote_ip = 3; + case 3: { + if (tag == 26) { + parse_remote_ip: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_remote_ip())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_referrer; + break; + } + + // optional string referrer = 4; + case 4: { + if (tag == 34) { + parse_referrer: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_referrer())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.Resource) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.Resource) + return false; +#undef DO_ +} + +void ClientDownloadRequest_Resource::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.Resource) + // required string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + // optional bytes remote_ip = 3; + if (has_remote_ip()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->remote_ip(), output); + } + + // optional string referrer = 4; + if (has_referrer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->referrer(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.Resource) +} + +int ClientDownloadRequest_Resource::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional bytes remote_ip = 3; + if (has_remote_ip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->remote_ip()); + } + + // optional string referrer = 4; + if (has_referrer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->referrer()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_Resource::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_Resource*>(&from)); +} + +void ClientDownloadRequest_Resource::MergeFrom(const ClientDownloadRequest_Resource& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_remote_ip()) { + set_remote_ip(from.remote_ip()); + } + if (from.has_referrer()) { + set_referrer(from.referrer()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_Resource::CopyFrom(const ClientDownloadRequest_Resource& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_Resource::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void ClientDownloadRequest_Resource::Swap(ClientDownloadRequest_Resource* other) { + if (other != this) { + std::swap(url_, other->url_); + std::swap(type_, other->type_); + std::swap(remote_ip_, other->remote_ip_); + std::swap(referrer_, other->referrer_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_Resource::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.Resource"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_CertificateChain_Element::kCertificateFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_CertificateChain_Element::ClientDownloadRequest_CertificateChain_Element() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.CertificateChain.Element) +} + +void ClientDownloadRequest_CertificateChain_Element::InitAsDefaultInstance() { +} + +ClientDownloadRequest_CertificateChain_Element::ClientDownloadRequest_CertificateChain_Element(const ClientDownloadRequest_CertificateChain_Element& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.CertificateChain.Element) +} + +void ClientDownloadRequest_CertificateChain_Element::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_CertificateChain_Element::~ClientDownloadRequest_CertificateChain_Element() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + SharedDtor(); +} + +void ClientDownloadRequest_CertificateChain_Element::SharedDtor() { + if (certificate_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete certificate_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_CertificateChain_Element::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_CertificateChain_Element& ClientDownloadRequest_CertificateChain_Element::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain_Element::default_instance_ = NULL; + +ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain_Element::New() const { + return new ClientDownloadRequest_CertificateChain_Element; +} + +void ClientDownloadRequest_CertificateChain_Element::Clear() { + if (has_certificate()) { + if (certificate_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_CertificateChain_Element::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes certificate = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_certificate())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + return false; +#undef DO_ +} + +void ClientDownloadRequest_CertificateChain_Element::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + // optional bytes certificate = 1; + if (has_certificate()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->certificate(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.CertificateChain.Element) +} + +int ClientDownloadRequest_CertificateChain_Element::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes certificate = 1; + if (has_certificate()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->certificate()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_CertificateChain_Element::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_CertificateChain_Element*>(&from)); +} + +void ClientDownloadRequest_CertificateChain_Element::MergeFrom(const ClientDownloadRequest_CertificateChain_Element& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_certificate()) { + set_certificate(from.certificate()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_CertificateChain_Element::CopyFrom(const ClientDownloadRequest_CertificateChain_Element& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_CertificateChain_Element::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_CertificateChain_Element::Swap(ClientDownloadRequest_CertificateChain_Element* other) { + if (other != this) { + std::swap(certificate_, other->certificate_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_CertificateChain_Element::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.CertificateChain.Element"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_CertificateChain::kElementFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_CertificateChain::ClientDownloadRequest_CertificateChain() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.CertificateChain) +} + +void ClientDownloadRequest_CertificateChain::InitAsDefaultInstance() { +} + +ClientDownloadRequest_CertificateChain::ClientDownloadRequest_CertificateChain(const ClientDownloadRequest_CertificateChain& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.CertificateChain) +} + +void ClientDownloadRequest_CertificateChain::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_CertificateChain::~ClientDownloadRequest_CertificateChain() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.CertificateChain) + SharedDtor(); +} + +void ClientDownloadRequest_CertificateChain::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_CertificateChain::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_CertificateChain& ClientDownloadRequest_CertificateChain::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_CertificateChain* ClientDownloadRequest_CertificateChain::default_instance_ = NULL; + +ClientDownloadRequest_CertificateChain* ClientDownloadRequest_CertificateChain::New() const { + return new ClientDownloadRequest_CertificateChain; +} + +void ClientDownloadRequest_CertificateChain::Clear() { + element_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_CertificateChain::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.CertificateChain) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1; + case 1: { + if (tag == 10) { + parse_element: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_element())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_element; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.CertificateChain) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.CertificateChain) + return false; +#undef DO_ +} + +void ClientDownloadRequest_CertificateChain::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.CertificateChain) + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1; + for (int i = 0; i < this->element_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->element(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.CertificateChain) +} + +int ClientDownloadRequest_CertificateChain::ByteSize() const { + int total_size = 0; + + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1; + total_size += 1 * this->element_size(); + for (int i = 0; i < this->element_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->element(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_CertificateChain::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_CertificateChain*>(&from)); +} + +void ClientDownloadRequest_CertificateChain::MergeFrom(const ClientDownloadRequest_CertificateChain& from) { + GOOGLE_CHECK_NE(&from, this); + element_.MergeFrom(from.element_); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_CertificateChain::CopyFrom(const ClientDownloadRequest_CertificateChain& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_CertificateChain::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_CertificateChain::Swap(ClientDownloadRequest_CertificateChain* other) { + if (other != this) { + element_.Swap(&other->element_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_CertificateChain::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.CertificateChain"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_ExtendedAttr::kKeyFieldNumber; +const int ClientDownloadRequest_ExtendedAttr::kValueFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_ExtendedAttr::ClientDownloadRequest_ExtendedAttr() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.ExtendedAttr) +} + +void ClientDownloadRequest_ExtendedAttr::InitAsDefaultInstance() { +} + +ClientDownloadRequest_ExtendedAttr::ClientDownloadRequest_ExtendedAttr(const ClientDownloadRequest_ExtendedAttr& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.ExtendedAttr) +} + +void ClientDownloadRequest_ExtendedAttr::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_ExtendedAttr::~ClientDownloadRequest_ExtendedAttr() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.ExtendedAttr) + SharedDtor(); +} + +void ClientDownloadRequest_ExtendedAttr::SharedDtor() { + if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete key_; + } + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete value_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_ExtendedAttr::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_ExtendedAttr& ClientDownloadRequest_ExtendedAttr::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_ExtendedAttr* ClientDownloadRequest_ExtendedAttr::default_instance_ = NULL; + +ClientDownloadRequest_ExtendedAttr* ClientDownloadRequest_ExtendedAttr::New() const { + return new ClientDownloadRequest_ExtendedAttr; +} + +void ClientDownloadRequest_ExtendedAttr::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_key()) { + if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_->clear(); + } + } + if (has_value()) { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_ExtendedAttr::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.ExtendedAttr) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string key = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_key())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_value; + break; + } + + // optional bytes value = 2; + case 2: { + if (tag == 18) { + parse_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_value())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.ExtendedAttr) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.ExtendedAttr) + return false; +#undef DO_ +} + +void ClientDownloadRequest_ExtendedAttr::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.ExtendedAttr) + // required string key = 1; + if (has_key()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->key(), output); + } + + // optional bytes value = 2; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->value(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.ExtendedAttr) +} + +int ClientDownloadRequest_ExtendedAttr::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string key = 1; + if (has_key()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->key()); + } + + // optional bytes value = 2; + if (has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->value()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_ExtendedAttr::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_ExtendedAttr*>(&from)); +} + +void ClientDownloadRequest_ExtendedAttr::MergeFrom(const ClientDownloadRequest_ExtendedAttr& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_key()) { + set_key(from.key()); + } + if (from.has_value()) { + set_value(from.value()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_ExtendedAttr::CopyFrom(const ClientDownloadRequest_ExtendedAttr& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_ExtendedAttr::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void ClientDownloadRequest_ExtendedAttr::Swap(ClientDownloadRequest_ExtendedAttr* other) { + if (other != this) { + std::swap(key_, other->key_); + std::swap(value_, other->value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_ExtendedAttr::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.ExtendedAttr"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_SignatureInfo::kCertificateChainFieldNumber; +const int ClientDownloadRequest_SignatureInfo::kTrustedFieldNumber; +const int ClientDownloadRequest_SignatureInfo::kSignedDataFieldNumber; +const int ClientDownloadRequest_SignatureInfo::kXattrFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.SignatureInfo) +} + +void ClientDownloadRequest_SignatureInfo::InitAsDefaultInstance() { +} + +ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo(const ClientDownloadRequest_SignatureInfo& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.SignatureInfo) +} + +void ClientDownloadRequest_SignatureInfo::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + trusted_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_SignatureInfo::~ClientDownloadRequest_SignatureInfo() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.SignatureInfo) + SharedDtor(); +} + +void ClientDownloadRequest_SignatureInfo::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_SignatureInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_SignatureInfo& ClientDownloadRequest_SignatureInfo::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::default_instance_ = NULL; + +ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::New() const { + return new ClientDownloadRequest_SignatureInfo; +} + +void ClientDownloadRequest_SignatureInfo::Clear() { + trusted_ = false; + certificate_chain_.Clear(); + signed_data_.Clear(); + xattr_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_SignatureInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.SignatureInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1; + case 1: { + if (tag == 10) { + parse_certificate_chain: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_certificate_chain())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_certificate_chain; + if (input->ExpectTag(16)) goto parse_trusted; + break; + } + + // optional bool trusted = 2; + case 2: { + if (tag == 16) { + parse_trusted: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &trusted_))); + set_has_trusted(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_signed_data; + break; + } + + // repeated bytes signed_data = 3; + case 3: { + if (tag == 26) { + parse_signed_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_signed_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_signed_data; + if (input->ExpectTag(34)) goto parse_xattr; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.ExtendedAttr xattr = 4; + case 4: { + if (tag == 34) { + parse_xattr: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_xattr())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_xattr; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.SignatureInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.SignatureInfo) + return false; +#undef DO_ +} + +void ClientDownloadRequest_SignatureInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.SignatureInfo) + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1; + for (int i = 0; i < this->certificate_chain_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->certificate_chain(i), output); + } + + // optional bool trusted = 2; + if (has_trusted()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->trusted(), output); + } + + // repeated bytes signed_data = 3; + for (int i = 0; i < this->signed_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 3, this->signed_data(i), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.ExtendedAttr xattr = 4; + for (int i = 0; i < this->xattr_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->xattr(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.SignatureInfo) +} + +int ClientDownloadRequest_SignatureInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + // optional bool trusted = 2; + if (has_trusted()) { + total_size += 1 + 1; + } + + } + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1; + total_size += 1 * this->certificate_chain_size(); + for (int i = 0; i < this->certificate_chain_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->certificate_chain(i)); + } + + // repeated bytes signed_data = 3; + total_size += 1 * this->signed_data_size(); + for (int i = 0; i < this->signed_data_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->signed_data(i)); + } + + // repeated .safe_browsing.ClientDownloadRequest.ExtendedAttr xattr = 4; + total_size += 1 * this->xattr_size(); + for (int i = 0; i < this->xattr_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->xattr(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_SignatureInfo::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_SignatureInfo*>(&from)); +} + +void ClientDownloadRequest_SignatureInfo::MergeFrom(const ClientDownloadRequest_SignatureInfo& from) { + GOOGLE_CHECK_NE(&from, this); + certificate_chain_.MergeFrom(from.certificate_chain_); + signed_data_.MergeFrom(from.signed_data_); + xattr_.MergeFrom(from.xattr_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from.has_trusted()) { + set_trusted(from.trusted()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_SignatureInfo::CopyFrom(const ClientDownloadRequest_SignatureInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_SignatureInfo::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->xattr())) return false; + return true; +} + +void ClientDownloadRequest_SignatureInfo::Swap(ClientDownloadRequest_SignatureInfo* other) { + if (other != this) { + certificate_chain_.Swap(&other->certificate_chain_); + std::swap(trusted_, other->trusted_); + signed_data_.Swap(&other->signed_data_); + xattr_.Swap(&other->xattr_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_SignatureInfo::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.SignatureInfo"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_PEImageHeaders_DebugData::kDirectoryEntryFieldNumber; +const int ClientDownloadRequest_PEImageHeaders_DebugData::kRawDataFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_PEImageHeaders_DebugData::ClientDownloadRequest_PEImageHeaders_DebugData() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::InitAsDefaultInstance() { +} + +ClientDownloadRequest_PEImageHeaders_DebugData::ClientDownloadRequest_PEImageHeaders_DebugData(const ClientDownloadRequest_PEImageHeaders_DebugData& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + directory_entry_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + raw_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_PEImageHeaders_DebugData::~ClientDownloadRequest_PEImageHeaders_DebugData() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + SharedDtor(); +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::SharedDtor() { + if (directory_entry_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete directory_entry_; + } + if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete raw_data_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_PEImageHeaders_DebugData& ClientDownloadRequest_PEImageHeaders_DebugData::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_PEImageHeaders_DebugData* ClientDownloadRequest_PEImageHeaders_DebugData::default_instance_ = NULL; + +ClientDownloadRequest_PEImageHeaders_DebugData* ClientDownloadRequest_PEImageHeaders_DebugData::New() const { + return new ClientDownloadRequest_PEImageHeaders_DebugData; +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_directory_entry()) { + if (directory_entry_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_->clear(); + } + } + if (has_raw_data()) { + if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_PEImageHeaders_DebugData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes directory_entry = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_directory_entry())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_raw_data; + break; + } + + // optional bytes raw_data = 2; + case 2: { + if (tag == 18) { + parse_raw_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_raw_data())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + return false; +#undef DO_ +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + // optional bytes directory_entry = 1; + if (has_directory_entry()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->directory_entry(), output); + } + + // optional bytes raw_data = 2; + if (has_raw_data()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->raw_data(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) +} + +int ClientDownloadRequest_PEImageHeaders_DebugData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes directory_entry = 1; + if (has_directory_entry()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->directory_entry()); + } + + // optional bytes raw_data = 2; + if (has_raw_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->raw_data()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_PEImageHeaders_DebugData*>(&from)); +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::MergeFrom(const ClientDownloadRequest_PEImageHeaders_DebugData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_directory_entry()) { + set_directory_entry(from.directory_entry()); + } + if (from.has_raw_data()) { + set_raw_data(from.raw_data()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::CopyFrom(const ClientDownloadRequest_PEImageHeaders_DebugData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_PEImageHeaders_DebugData::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_PEImageHeaders_DebugData::Swap(ClientDownloadRequest_PEImageHeaders_DebugData* other) { + if (other != this) { + std::swap(directory_entry_, other->directory_entry_); + std::swap(raw_data_, other->raw_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_PEImageHeaders_DebugData::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_PEImageHeaders::kDosHeaderFieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kFileHeaderFieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kOptionalHeaders32FieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kOptionalHeaders64FieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kSectionHeaderFieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kExportSectionDataFieldNumber; +const int ClientDownloadRequest_PEImageHeaders::kDebugDataFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_PEImageHeaders::ClientDownloadRequest_PEImageHeaders() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.PEImageHeaders) +} + +void ClientDownloadRequest_PEImageHeaders::InitAsDefaultInstance() { +} + +ClientDownloadRequest_PEImageHeaders::ClientDownloadRequest_PEImageHeaders(const ClientDownloadRequest_PEImageHeaders& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.PEImageHeaders) +} + +void ClientDownloadRequest_PEImageHeaders::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + dos_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + file_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + optional_headers32_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + optional_headers64_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + export_section_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_PEImageHeaders::~ClientDownloadRequest_PEImageHeaders() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.PEImageHeaders) + SharedDtor(); +} + +void ClientDownloadRequest_PEImageHeaders::SharedDtor() { + if (dos_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete dos_header_; + } + if (file_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_header_; + } + if (optional_headers32_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete optional_headers32_; + } + if (optional_headers64_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete optional_headers64_; + } + if (export_section_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete export_section_data_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_PEImageHeaders::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_PEImageHeaders& ClientDownloadRequest_PEImageHeaders::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_PEImageHeaders* ClientDownloadRequest_PEImageHeaders::default_instance_ = NULL; + +ClientDownloadRequest_PEImageHeaders* ClientDownloadRequest_PEImageHeaders::New() const { + return new ClientDownloadRequest_PEImageHeaders; +} + +void ClientDownloadRequest_PEImageHeaders::Clear() { + if (_has_bits_[0 / 32] & 47) { + if (has_dos_header()) { + if (dos_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_->clear(); + } + } + if (has_file_header()) { + if (file_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_->clear(); + } + } + if (has_optional_headers32()) { + if (optional_headers32_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_->clear(); + } + } + if (has_optional_headers64()) { + if (optional_headers64_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_->clear(); + } + } + if (has_export_section_data()) { + if (export_section_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_->clear(); + } + } + } + section_header_.Clear(); + debug_data_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_PEImageHeaders::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.PEImageHeaders) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes dos_header = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_dos_header())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_file_header; + break; + } + + // optional bytes file_header = 2; + case 2: { + if (tag == 18) { + parse_file_header: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_file_header())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_optional_headers32; + break; + } + + // optional bytes optional_headers32 = 3; + case 3: { + if (tag == 26) { + parse_optional_headers32: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_optional_headers32())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_optional_headers64; + break; + } + + // optional bytes optional_headers64 = 4; + case 4: { + if (tag == 34) { + parse_optional_headers64: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_optional_headers64())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_section_header; + break; + } + + // repeated bytes section_header = 5; + case 5: { + if (tag == 42) { + parse_section_header: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_section_header())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_section_header; + if (input->ExpectTag(50)) goto parse_export_section_data; + break; + } + + // optional bytes export_section_data = 6; + case 6: { + if (tag == 50) { + parse_export_section_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_export_section_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_debug_data; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData debug_data = 7; + case 7: { + if (tag == 58) { + parse_debug_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_debug_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_debug_data; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.PEImageHeaders) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.PEImageHeaders) + return false; +#undef DO_ +} + +void ClientDownloadRequest_PEImageHeaders::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.PEImageHeaders) + // optional bytes dos_header = 1; + if (has_dos_header()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->dos_header(), output); + } + + // optional bytes file_header = 2; + if (has_file_header()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->file_header(), output); + } + + // optional bytes optional_headers32 = 3; + if (has_optional_headers32()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->optional_headers32(), output); + } + + // optional bytes optional_headers64 = 4; + if (has_optional_headers64()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->optional_headers64(), output); + } + + // repeated bytes section_header = 5; + for (int i = 0; i < this->section_header_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 5, this->section_header(i), output); + } + + // optional bytes export_section_data = 6; + if (has_export_section_data()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 6, this->export_section_data(), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData debug_data = 7; + for (int i = 0; i < this->debug_data_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->debug_data(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.PEImageHeaders) +} + +int ClientDownloadRequest_PEImageHeaders::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes dos_header = 1; + if (has_dos_header()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->dos_header()); + } + + // optional bytes file_header = 2; + if (has_file_header()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->file_header()); + } + + // optional bytes optional_headers32 = 3; + if (has_optional_headers32()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->optional_headers32()); + } + + // optional bytes optional_headers64 = 4; + if (has_optional_headers64()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->optional_headers64()); + } + + // optional bytes export_section_data = 6; + if (has_export_section_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->export_section_data()); + } + + } + // repeated bytes section_header = 5; + total_size += 1 * this->section_header_size(); + for (int i = 0; i < this->section_header_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->section_header(i)); + } + + // repeated .safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData debug_data = 7; + total_size += 1 * this->debug_data_size(); + for (int i = 0; i < this->debug_data_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->debug_data(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_PEImageHeaders::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_PEImageHeaders*>(&from)); +} + +void ClientDownloadRequest_PEImageHeaders::MergeFrom(const ClientDownloadRequest_PEImageHeaders& from) { + GOOGLE_CHECK_NE(&from, this); + section_header_.MergeFrom(from.section_header_); + debug_data_.MergeFrom(from.debug_data_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dos_header()) { + set_dos_header(from.dos_header()); + } + if (from.has_file_header()) { + set_file_header(from.file_header()); + } + if (from.has_optional_headers32()) { + set_optional_headers32(from.optional_headers32()); + } + if (from.has_optional_headers64()) { + set_optional_headers64(from.optional_headers64()); + } + if (from.has_export_section_data()) { + set_export_section_data(from.export_section_data()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_PEImageHeaders::CopyFrom(const ClientDownloadRequest_PEImageHeaders& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_PEImageHeaders::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_PEImageHeaders::Swap(ClientDownloadRequest_PEImageHeaders* other) { + if (other != this) { + std::swap(dos_header_, other->dos_header_); + std::swap(file_header_, other->file_header_); + std::swap(optional_headers32_, other->optional_headers32_); + std::swap(optional_headers64_, other->optional_headers64_); + section_header_.Swap(&other->section_header_); + std::swap(export_section_data_, other->export_section_data_); + debug_data_.Swap(&other->debug_data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_PEImageHeaders::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.PEImageHeaders"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_MachOHeaders_LoadCommand::kCommandIdFieldNumber; +const int ClientDownloadRequest_MachOHeaders_LoadCommand::kCommandFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_MachOHeaders_LoadCommand::ClientDownloadRequest_MachOHeaders_LoadCommand() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::InitAsDefaultInstance() { +} + +ClientDownloadRequest_MachOHeaders_LoadCommand::ClientDownloadRequest_MachOHeaders_LoadCommand(const ClientDownloadRequest_MachOHeaders_LoadCommand& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + command_id_ = 0u; + command_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_MachOHeaders_LoadCommand::~ClientDownloadRequest_MachOHeaders_LoadCommand() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + SharedDtor(); +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::SharedDtor() { + if (command_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete command_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_MachOHeaders_LoadCommand& ClientDownloadRequest_MachOHeaders_LoadCommand::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_MachOHeaders_LoadCommand* ClientDownloadRequest_MachOHeaders_LoadCommand::default_instance_ = NULL; + +ClientDownloadRequest_MachOHeaders_LoadCommand* ClientDownloadRequest_MachOHeaders_LoadCommand::New() const { + return new ClientDownloadRequest_MachOHeaders_LoadCommand; +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::Clear() { + if (_has_bits_[0 / 32] & 3) { + command_id_ = 0u; + if (has_command()) { + if (command_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_MachOHeaders_LoadCommand::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required uint32 command_id = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &command_id_))); + set_has_command_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_command; + break; + } + + // required bytes command = 2; + case 2: { + if (tag == 18) { + parse_command: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_command())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + return false; +#undef DO_ +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + // required uint32 command_id = 1; + if (has_command_id()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->command_id(), output); + } + + // required bytes command = 2; + if (has_command()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->command(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) +} + +int ClientDownloadRequest_MachOHeaders_LoadCommand::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required uint32 command_id = 1; + if (has_command_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->command_id()); + } + + // required bytes command = 2; + if (has_command()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->command()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_MachOHeaders_LoadCommand*>(&from)); +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::MergeFrom(const ClientDownloadRequest_MachOHeaders_LoadCommand& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_command_id()) { + set_command_id(from.command_id()); + } + if (from.has_command()) { + set_command(from.command()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::CopyFrom(const ClientDownloadRequest_MachOHeaders_LoadCommand& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_MachOHeaders_LoadCommand::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void ClientDownloadRequest_MachOHeaders_LoadCommand::Swap(ClientDownloadRequest_MachOHeaders_LoadCommand* other) { + if (other != this) { + std::swap(command_id_, other->command_id_); + std::swap(command_, other->command_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_MachOHeaders_LoadCommand::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_MachOHeaders::kMachHeaderFieldNumber; +const int ClientDownloadRequest_MachOHeaders::kLoadCommandsFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_MachOHeaders::ClientDownloadRequest_MachOHeaders() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.MachOHeaders) +} + +void ClientDownloadRequest_MachOHeaders::InitAsDefaultInstance() { +} + +ClientDownloadRequest_MachOHeaders::ClientDownloadRequest_MachOHeaders(const ClientDownloadRequest_MachOHeaders& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.MachOHeaders) +} + +void ClientDownloadRequest_MachOHeaders::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + mach_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_MachOHeaders::~ClientDownloadRequest_MachOHeaders() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.MachOHeaders) + SharedDtor(); +} + +void ClientDownloadRequest_MachOHeaders::SharedDtor() { + if (mach_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mach_header_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_MachOHeaders::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_MachOHeaders& ClientDownloadRequest_MachOHeaders::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_MachOHeaders* ClientDownloadRequest_MachOHeaders::default_instance_ = NULL; + +ClientDownloadRequest_MachOHeaders* ClientDownloadRequest_MachOHeaders::New() const { + return new ClientDownloadRequest_MachOHeaders; +} + +void ClientDownloadRequest_MachOHeaders::Clear() { + if (has_mach_header()) { + if (mach_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_->clear(); + } + } + load_commands_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_MachOHeaders::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.MachOHeaders) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required bytes mach_header = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_mach_header())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_load_commands; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand load_commands = 2; + case 2: { + if (tag == 18) { + parse_load_commands: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_load_commands())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_load_commands; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.MachOHeaders) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.MachOHeaders) + return false; +#undef DO_ +} + +void ClientDownloadRequest_MachOHeaders::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.MachOHeaders) + // required bytes mach_header = 1; + if (has_mach_header()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->mach_header(), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand load_commands = 2; + for (int i = 0; i < this->load_commands_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->load_commands(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.MachOHeaders) +} + +int ClientDownloadRequest_MachOHeaders::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required bytes mach_header = 1; + if (has_mach_header()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->mach_header()); + } + + } + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand load_commands = 2; + total_size += 1 * this->load_commands_size(); + for (int i = 0; i < this->load_commands_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->load_commands(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_MachOHeaders::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_MachOHeaders*>(&from)); +} + +void ClientDownloadRequest_MachOHeaders::MergeFrom(const ClientDownloadRequest_MachOHeaders& from) { + GOOGLE_CHECK_NE(&from, this); + load_commands_.MergeFrom(from.load_commands_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_mach_header()) { + set_mach_header(from.mach_header()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_MachOHeaders::CopyFrom(const ClientDownloadRequest_MachOHeaders& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_MachOHeaders::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->load_commands())) return false; + return true; +} + +void ClientDownloadRequest_MachOHeaders::Swap(ClientDownloadRequest_MachOHeaders* other) { + if (other != this) { + std::swap(mach_header_, other->mach_header_); + load_commands_.Swap(&other->load_commands_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_MachOHeaders::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.MachOHeaders"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_ImageHeaders::kPeHeadersFieldNumber; +const int ClientDownloadRequest_ImageHeaders::kMachOHeadersFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_ImageHeaders::ClientDownloadRequest_ImageHeaders() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.ImageHeaders) +} + +void ClientDownloadRequest_ImageHeaders::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + pe_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_PEImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_PEImageHeaders::internal_default_instance()); +#else + pe_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_PEImageHeaders*>(&::safe_browsing::ClientDownloadRequest_PEImageHeaders::default_instance()); +#endif +} + +ClientDownloadRequest_ImageHeaders::ClientDownloadRequest_ImageHeaders(const ClientDownloadRequest_ImageHeaders& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.ImageHeaders) +} + +void ClientDownloadRequest_ImageHeaders::SharedCtor() { + _cached_size_ = 0; + pe_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_ImageHeaders::~ClientDownloadRequest_ImageHeaders() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.ImageHeaders) + SharedDtor(); +} + +void ClientDownloadRequest_ImageHeaders::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete pe_headers_; + } +} + +void ClientDownloadRequest_ImageHeaders::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_ImageHeaders& ClientDownloadRequest_ImageHeaders::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_ImageHeaders* ClientDownloadRequest_ImageHeaders::default_instance_ = NULL; + +ClientDownloadRequest_ImageHeaders* ClientDownloadRequest_ImageHeaders::New() const { + return new ClientDownloadRequest_ImageHeaders; +} + +void ClientDownloadRequest_ImageHeaders::Clear() { + if (has_pe_headers()) { + if (pe_headers_ != NULL) pe_headers_->::safe_browsing::ClientDownloadRequest_PEImageHeaders::Clear(); + } + mach_o_headers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_ImageHeaders::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.ImageHeaders) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientDownloadRequest.PEImageHeaders pe_headers = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_pe_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_mach_o_headers; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders mach_o_headers = 2; + case 2: { + if (tag == 18) { + parse_mach_o_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_mach_o_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_mach_o_headers; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.ImageHeaders) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.ImageHeaders) + return false; +#undef DO_ +} + +void ClientDownloadRequest_ImageHeaders::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.ImageHeaders) + // optional .safe_browsing.ClientDownloadRequest.PEImageHeaders pe_headers = 1; + if (has_pe_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->pe_headers(), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders mach_o_headers = 2; + for (int i = 0; i < this->mach_o_headers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->mach_o_headers(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.ImageHeaders) +} + +int ClientDownloadRequest_ImageHeaders::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientDownloadRequest.PEImageHeaders pe_headers = 1; + if (has_pe_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->pe_headers()); + } + + } + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders mach_o_headers = 2; + total_size += 1 * this->mach_o_headers_size(); + for (int i = 0; i < this->mach_o_headers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->mach_o_headers(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_ImageHeaders::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_ImageHeaders*>(&from)); +} + +void ClientDownloadRequest_ImageHeaders::MergeFrom(const ClientDownloadRequest_ImageHeaders& from) { + GOOGLE_CHECK_NE(&from, this); + mach_o_headers_.MergeFrom(from.mach_o_headers_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_pe_headers()) { + mutable_pe_headers()->::safe_browsing::ClientDownloadRequest_PEImageHeaders::MergeFrom(from.pe_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_ImageHeaders::CopyFrom(const ClientDownloadRequest_ImageHeaders& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_ImageHeaders::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->mach_o_headers())) return false; + return true; +} + +void ClientDownloadRequest_ImageHeaders::Swap(ClientDownloadRequest_ImageHeaders* other) { + if (other != this) { + std::swap(pe_headers_, other->pe_headers_); + mach_o_headers_.Swap(&other->mach_o_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_ImageHeaders::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.ImageHeaders"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest_ArchivedBinary::kFileBasenameFieldNumber; +const int ClientDownloadRequest_ArchivedBinary::kDownloadTypeFieldNumber; +const int ClientDownloadRequest_ArchivedBinary::kDigestsFieldNumber; +const int ClientDownloadRequest_ArchivedBinary::kLengthFieldNumber; +const int ClientDownloadRequest_ArchivedBinary::kSignatureFieldNumber; +const int ClientDownloadRequest_ArchivedBinary::kImageHeadersFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_ArchivedBinary::ClientDownloadRequest_ArchivedBinary() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.ArchivedBinary) +} + +void ClientDownloadRequest_ArchivedBinary::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>( + ::safe_browsing::ClientDownloadRequest_Digests::internal_default_instance()); +#else + digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientDownloadRequest_ArchivedBinary::ClientDownloadRequest_ArchivedBinary(const ClientDownloadRequest_ArchivedBinary& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.ArchivedBinary) +} + +void ClientDownloadRequest_ArchivedBinary::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + download_type_ = 0; + digests_ = NULL; + length_ = GOOGLE_LONGLONG(0); + signature_ = NULL; + image_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_ArchivedBinary::~ClientDownloadRequest_ArchivedBinary() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.ArchivedBinary) + SharedDtor(); +} + +void ClientDownloadRequest_ArchivedBinary::SharedDtor() { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete digests_; + delete signature_; + delete image_headers_; + } +} + +void ClientDownloadRequest_ArchivedBinary::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_ArchivedBinary& ClientDownloadRequest_ArchivedBinary::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_ArchivedBinary* ClientDownloadRequest_ArchivedBinary::default_instance_ = NULL; + +ClientDownloadRequest_ArchivedBinary* ClientDownloadRequest_ArchivedBinary::New() const { + return new ClientDownloadRequest_ArchivedBinary; +} + +void ClientDownloadRequest_ArchivedBinary::Clear() { + if (_has_bits_[0 / 32] & 63) { + if (has_file_basename()) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + } + download_type_ = 0; + if (has_digests()) { + if (digests_ != NULL) digests_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + } + length_ = GOOGLE_LONGLONG(0); + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_ArchivedBinary::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.ArchivedBinary) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string file_basename = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_basename())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_download_type; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 2; + case 2: { + if (tag == 16) { + parse_download_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)) { + set_download_type(static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_digests; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digests = 3; + case 3: { + if (tag == 26) { + parse_digests: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_digests())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_length; + break; + } + + // optional int64 length = 4; + case 4: { + if (tag == 32) { + parse_length: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &length_))); + set_has_length(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + case 5: { + if (tag == 42) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + case 6: { + if (tag == 50) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.ArchivedBinary) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.ArchivedBinary) + return false; +#undef DO_ +} + +void ClientDownloadRequest_ArchivedBinary::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.ArchivedBinary) + // optional string file_basename = 1; + if (has_file_basename()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_basename(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 2; + if (has_download_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->download_type(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digests = 3; + if (has_digests()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->digests(), output); + } + + // optional int64 length = 4; + if (has_length()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->length(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->signature(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->image_headers(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.ArchivedBinary) +} + +int ClientDownloadRequest_ArchivedBinary::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string file_basename = 1; + if (has_file_basename()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_basename()); + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 2; + if (has_download_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->download_type()); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digests = 3; + if (has_digests()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->digests()); + } + + // optional int64 length = 4; + if (has_length()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->length()); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_ArchivedBinary::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_ArchivedBinary*>(&from)); +} + +void ClientDownloadRequest_ArchivedBinary::MergeFrom(const ClientDownloadRequest_ArchivedBinary& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_basename()) { + set_file_basename(from.file_basename()); + } + if (from.has_download_type()) { + set_download_type(from.download_type()); + } + if (from.has_digests()) { + mutable_digests()->::safe_browsing::ClientDownloadRequest_Digests::MergeFrom(from.digests()); + } + if (from.has_length()) { + set_length(from.length()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_ArchivedBinary::CopyFrom(const ClientDownloadRequest_ArchivedBinary& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_ArchivedBinary::IsInitialized() const { + + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + return true; +} + +void ClientDownloadRequest_ArchivedBinary::Swap(ClientDownloadRequest_ArchivedBinary* other) { + if (other != this) { + std::swap(file_basename_, other->file_basename_); + std::swap(download_type_, other->download_type_); + std::swap(digests_, other->digests_); + std::swap(length_, other->length_); + std::swap(signature_, other->signature_); + std::swap(image_headers_, other->image_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_ArchivedBinary::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.ArchivedBinary"; +} + + +// ------------------------------------------------------------------- + +bool ClientDownloadRequest_URLChainEntry_URLType_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::DOWNLOAD_URL; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::DOWNLOAD_REFERRER; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::LANDING_PAGE; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::LANDING_REFERRER; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::CLIENT_REDIRECT; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::SERVER_REDIRECT; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::URLType_MIN; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::URLType_MAX; +const int ClientDownloadRequest_URLChainEntry::URLType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientDownloadRequest_URLChainEntry::kUrlFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kTypeFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kIpAddressFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kReferrerFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kMainFrameReferrerFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kIsRetargetingFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kIsUserInitiatedFieldNumber; +const int ClientDownloadRequest_URLChainEntry::kTimestampInMillisecFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest_URLChainEntry::ClientDownloadRequest_URLChainEntry() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest.URLChainEntry) +} + +void ClientDownloadRequest_URLChainEntry::InitAsDefaultInstance() { +} + +ClientDownloadRequest_URLChainEntry::ClientDownloadRequest_URLChainEntry(const ClientDownloadRequest_URLChainEntry& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest.URLChainEntry) +} + +void ClientDownloadRequest_URLChainEntry::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 1; + ip_address_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + main_frame_referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + is_retargeting_ = false; + is_user_initiated_ = false; + timestamp_in_millisec_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest_URLChainEntry::~ClientDownloadRequest_URLChainEntry() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest.URLChainEntry) + SharedDtor(); +} + +void ClientDownloadRequest_URLChainEntry::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (ip_address_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete ip_address_; + } + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + if (main_frame_referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete main_frame_referrer_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadRequest_URLChainEntry::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest_URLChainEntry& ClientDownloadRequest_URLChainEntry::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest_URLChainEntry* ClientDownloadRequest_URLChainEntry::default_instance_ = NULL; + +ClientDownloadRequest_URLChainEntry* ClientDownloadRequest_URLChainEntry::New() const { + return new ClientDownloadRequest_URLChainEntry; +} + +void ClientDownloadRequest_URLChainEntry::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientDownloadRequest_URLChainEntry*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(is_retargeting_, timestamp_in_millisec_); + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + type_ = 1; + if (has_ip_address()) { + if (ip_address_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_->clear(); + } + } + if (has_referrer()) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + } + if (has_main_frame_referrer()) { + if (main_frame_referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest_URLChainEntry::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest.URLChainEntry) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_type; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.URLChainEntry.URLType type = 2; + case 2: { + if (tag == 16) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType_IsValid(value)) { + set_type(static_cast< ::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_ip_address; + break; + } + + // optional string ip_address = 3; + case 3: { + if (tag == 26) { + parse_ip_address: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_ip_address())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_referrer; + break; + } + + // optional string referrer = 4; + case 4: { + if (tag == 34) { + parse_referrer: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_referrer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_main_frame_referrer; + break; + } + + // optional string main_frame_referrer = 5; + case 5: { + if (tag == 42) { + parse_main_frame_referrer: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_main_frame_referrer())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_is_retargeting; + break; + } + + // optional bool is_retargeting = 6; + case 6: { + if (tag == 48) { + parse_is_retargeting: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_retargeting_))); + set_has_is_retargeting(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_is_user_initiated; + break; + } + + // optional bool is_user_initiated = 7; + case 7: { + if (tag == 56) { + parse_is_user_initiated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_user_initiated_))); + set_has_is_user_initiated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(65)) goto parse_timestamp_in_millisec; + break; + } + + // optional double timestamp_in_millisec = 8; + case 8: { + if (tag == 65) { + parse_timestamp_in_millisec: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, ×tamp_in_millisec_))); + set_has_timestamp_in_millisec(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest.URLChainEntry) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest.URLChainEntry) + return false; +#undef DO_ +} + +void ClientDownloadRequest_URLChainEntry::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest.URLChainEntry) + // optional string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.URLChainEntry.URLType type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->type(), output); + } + + // optional string ip_address = 3; + if (has_ip_address()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->ip_address(), output); + } + + // optional string referrer = 4; + if (has_referrer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->referrer(), output); + } + + // optional string main_frame_referrer = 5; + if (has_main_frame_referrer()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 5, this->main_frame_referrer(), output); + } + + // optional bool is_retargeting = 6; + if (has_is_retargeting()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->is_retargeting(), output); + } + + // optional bool is_user_initiated = 7; + if (has_is_user_initiated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->is_user_initiated(), output); + } + + // optional double timestamp_in_millisec = 8; + if (has_timestamp_in_millisec()) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(8, this->timestamp_in_millisec(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest.URLChainEntry) +} + +int ClientDownloadRequest_URLChainEntry::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional .safe_browsing.ClientDownloadRequest.URLChainEntry.URLType type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional string ip_address = 3; + if (has_ip_address()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->ip_address()); + } + + // optional string referrer = 4; + if (has_referrer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->referrer()); + } + + // optional string main_frame_referrer = 5; + if (has_main_frame_referrer()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->main_frame_referrer()); + } + + // optional bool is_retargeting = 6; + if (has_is_retargeting()) { + total_size += 1 + 1; + } + + // optional bool is_user_initiated = 7; + if (has_is_user_initiated()) { + total_size += 1 + 1; + } + + // optional double timestamp_in_millisec = 8; + if (has_timestamp_in_millisec()) { + total_size += 1 + 8; + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest_URLChainEntry::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest_URLChainEntry*>(&from)); +} + +void ClientDownloadRequest_URLChainEntry::MergeFrom(const ClientDownloadRequest_URLChainEntry& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_ip_address()) { + set_ip_address(from.ip_address()); + } + if (from.has_referrer()) { + set_referrer(from.referrer()); + } + if (from.has_main_frame_referrer()) { + set_main_frame_referrer(from.main_frame_referrer()); + } + if (from.has_is_retargeting()) { + set_is_retargeting(from.is_retargeting()); + } + if (from.has_is_user_initiated()) { + set_is_user_initiated(from.is_user_initiated()); + } + if (from.has_timestamp_in_millisec()) { + set_timestamp_in_millisec(from.timestamp_in_millisec()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest_URLChainEntry::CopyFrom(const ClientDownloadRequest_URLChainEntry& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest_URLChainEntry::IsInitialized() const { + + return true; +} + +void ClientDownloadRequest_URLChainEntry::Swap(ClientDownloadRequest_URLChainEntry* other) { + if (other != this) { + std::swap(url_, other->url_); + std::swap(type_, other->type_); + std::swap(ip_address_, other->ip_address_); + std::swap(referrer_, other->referrer_); + std::swap(main_frame_referrer_, other->main_frame_referrer_); + std::swap(is_retargeting_, other->is_retargeting_); + std::swap(is_user_initiated_, other->is_user_initiated_); + std::swap(timestamp_in_millisec_, other->timestamp_in_millisec_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest_URLChainEntry::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest.URLChainEntry"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadRequest::kUrlFieldNumber; +const int ClientDownloadRequest::kDigestsFieldNumber; +const int ClientDownloadRequest::kLengthFieldNumber; +const int ClientDownloadRequest::kResourcesFieldNumber; +const int ClientDownloadRequest::kSignatureFieldNumber; +const int ClientDownloadRequest::kUserInitiatedFieldNumber; +const int ClientDownloadRequest::kFileBasenameFieldNumber; +const int ClientDownloadRequest::kDownloadTypeFieldNumber; +const int ClientDownloadRequest::kLocaleFieldNumber; +const int ClientDownloadRequest::kImageHeadersFieldNumber; +const int ClientDownloadRequest::kArchivedBinaryFieldNumber; +const int ClientDownloadRequest::kPopulationFieldNumber; +const int ClientDownloadRequest::kArchiveValidFieldNumber; +const int ClientDownloadRequest::kSkippedUrlWhitelistFieldNumber; +const int ClientDownloadRequest::kSkippedCertificateWhitelistFieldNumber; +const int ClientDownloadRequest::kAlternateExtensionsFieldNumber; +const int ClientDownloadRequest::kUrlChainFieldNumber; +#endif // !_MSC_VER + +ClientDownloadRequest::ClientDownloadRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadRequest) +} + +void ClientDownloadRequest::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>( + ::safe_browsing::ClientDownloadRequest_Digests::internal_default_instance()); +#else + digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>( + ::safe_browsing::ChromeUserPopulation::internal_default_instance()); +#else + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>(&::safe_browsing::ChromeUserPopulation::default_instance()); +#endif +} + +ClientDownloadRequest::ClientDownloadRequest(const ClientDownloadRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadRequest) +} + +void ClientDownloadRequest::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + digests_ = NULL; + length_ = GOOGLE_LONGLONG(0); + signature_ = NULL; + user_initiated_ = false; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + download_type_ = 0; + locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + image_headers_ = NULL; + population_ = NULL; + archive_valid_ = false; + skipped_url_whitelist_ = false; + skipped_certificate_whitelist_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadRequest::~ClientDownloadRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadRequest) + SharedDtor(); +} + +void ClientDownloadRequest::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + if (locale_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete locale_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete digests_; + delete signature_; + delete image_headers_; + delete population_; + } +} + +void ClientDownloadRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadRequest& ClientDownloadRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadRequest* ClientDownloadRequest::default_instance_ = NULL; + +ClientDownloadRequest* ClientDownloadRequest::New() const { + return new ClientDownloadRequest; +} + +void ClientDownloadRequest::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientDownloadRequest*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 247) { + ZR_(download_type_, user_initiated_); + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_digests()) { + if (digests_ != NULL) digests_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + } + length_ = GOOGLE_LONGLONG(0); + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_file_basename()) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + } + } + if (_has_bits_[8 / 32] & 31488) { + ZR_(archive_valid_, skipped_certificate_whitelist_); + if (has_locale()) { + if (locale_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_->clear(); + } + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + if (has_population()) { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + resources_.Clear(); + archived_binary_.Clear(); + alternate_extensions_.Clear(); + url_chain_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_digests; + break; + } + + // required .safe_browsing.ClientDownloadRequest.Digests digests = 2; + case 2: { + if (tag == 18) { + parse_digests: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_digests())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_length; + break; + } + + // required int64 length = 3; + case 3: { + if (tag == 24) { + parse_length: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &length_))); + set_has_length(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_resources; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4; + case 4: { + if (tag == 34) { + parse_resources: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_resources())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_resources; + if (input->ExpectTag(42)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + case 5: { + if (tag == 42) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_user_initiated; + break; + } + + // optional bool user_initiated = 6; + case 6: { + if (tag == 48) { + parse_user_initiated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &user_initiated_))); + set_has_user_initiated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_file_basename; + break; + } + + // optional string file_basename = 9; + case 9: { + if (tag == 74) { + parse_file_basename: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_basename())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_download_type; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE]; + case 10: { + if (tag == 80) { + parse_download_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)) { + set_download_type(static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_locale; + break; + } + + // optional string locale = 11; + case 11: { + if (tag == 90) { + parse_locale: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_locale())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(146)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 18; + case 18: { + if (tag == 146) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_archived_binary; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.ArchivedBinary archived_binary = 22; + case 22: { + if (tag == 178) { + parse_archived_binary: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_archived_binary())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(178)) goto parse_archived_binary; + if (input->ExpectTag(194)) goto parse_population; + break; + } + + // optional .safe_browsing.ChromeUserPopulation population = 24; + case 24: { + if (tag == 194) { + parse_population: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_population())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(208)) goto parse_archive_valid; + break; + } + + // optional bool archive_valid = 26; + case 26: { + if (tag == 208) { + parse_archive_valid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &archive_valid_))); + set_has_archive_valid(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(224)) goto parse_skipped_url_whitelist; + break; + } + + // optional bool skipped_url_whitelist = 28; + case 28: { + if (tag == 224) { + parse_skipped_url_whitelist: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &skipped_url_whitelist_))); + set_has_skipped_url_whitelist(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(248)) goto parse_skipped_certificate_whitelist; + break; + } + + // optional bool skipped_certificate_whitelist = 31; + case 31: { + if (tag == 248) { + parse_skipped_certificate_whitelist: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &skipped_certificate_whitelist_))); + set_has_skipped_certificate_whitelist(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(282)) goto parse_alternate_extensions; + break; + } + + // repeated string alternate_extensions = 35; + case 35: { + if (tag == 282) { + parse_alternate_extensions: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_alternate_extensions())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(282)) goto parse_alternate_extensions; + if (input->ExpectTag(290)) goto parse_url_chain; + break; + } + + // repeated .safe_browsing.ClientDownloadRequest.URLChainEntry url_chain = 36; + case 36: { + if (tag == 290) { + parse_url_chain: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_url_chain())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(290)) goto parse_url_chain; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadRequest) + return false; +#undef DO_ +} + +void ClientDownloadRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadRequest) + // required string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // required .safe_browsing.ClientDownloadRequest.Digests digests = 2; + if (has_digests()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->digests(), output); + } + + // required int64 length = 3; + if (has_length()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->length(), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4; + for (int i = 0; i < this->resources_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->resources(i), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->signature(), output); + } + + // optional bool user_initiated = 6; + if (has_user_initiated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->user_initiated(), output); + } + + // optional string file_basename = 9; + if (has_file_basename()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 9, this->file_basename(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE]; + if (has_download_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 10, this->download_type(), output); + } + + // optional string locale = 11; + if (has_locale()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->locale(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 18; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 18, this->image_headers(), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.ArchivedBinary archived_binary = 22; + for (int i = 0; i < this->archived_binary_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 22, this->archived_binary(i), output); + } + + // optional .safe_browsing.ChromeUserPopulation population = 24; + if (has_population()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 24, this->population(), output); + } + + // optional bool archive_valid = 26; + if (has_archive_valid()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(26, this->archive_valid(), output); + } + + // optional bool skipped_url_whitelist = 28; + if (has_skipped_url_whitelist()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(28, this->skipped_url_whitelist(), output); + } + + // optional bool skipped_certificate_whitelist = 31; + if (has_skipped_certificate_whitelist()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(31, this->skipped_certificate_whitelist(), output); + } + + // repeated string alternate_extensions = 35; + for (int i = 0; i < this->alternate_extensions_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 35, this->alternate_extensions(i), output); + } + + // repeated .safe_browsing.ClientDownloadRequest.URLChainEntry url_chain = 36; + for (int i = 0; i < this->url_chain_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 36, this->url_chain(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadRequest) +} + +int ClientDownloadRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // required .safe_browsing.ClientDownloadRequest.Digests digests = 2; + if (has_digests()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->digests()); + } + + // required int64 length = 3; + if (has_length()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->length()); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional bool user_initiated = 6; + if (has_user_initiated()) { + total_size += 1 + 1; + } + + // optional string file_basename = 9; + if (has_file_basename()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_basename()); + } + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE]; + if (has_download_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->download_type()); + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // optional string locale = 11; + if (has_locale()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->locale()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 18; + if (has_image_headers()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + // optional .safe_browsing.ChromeUserPopulation population = 24; + if (has_population()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->population()); + } + + // optional bool archive_valid = 26; + if (has_archive_valid()) { + total_size += 2 + 1; + } + + // optional bool skipped_url_whitelist = 28; + if (has_skipped_url_whitelist()) { + total_size += 2 + 1; + } + + // optional bool skipped_certificate_whitelist = 31; + if (has_skipped_certificate_whitelist()) { + total_size += 2 + 1; + } + + } + // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4; + total_size += 1 * this->resources_size(); + for (int i = 0; i < this->resources_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->resources(i)); + } + + // repeated .safe_browsing.ClientDownloadRequest.ArchivedBinary archived_binary = 22; + total_size += 2 * this->archived_binary_size(); + for (int i = 0; i < this->archived_binary_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->archived_binary(i)); + } + + // repeated string alternate_extensions = 35; + total_size += 2 * this->alternate_extensions_size(); + for (int i = 0; i < this->alternate_extensions_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->alternate_extensions(i)); + } + + // repeated .safe_browsing.ClientDownloadRequest.URLChainEntry url_chain = 36; + total_size += 2 * this->url_chain_size(); + for (int i = 0; i < this->url_chain_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->url_chain(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadRequest*>(&from)); +} + +void ClientDownloadRequest::MergeFrom(const ClientDownloadRequest& from) { + GOOGLE_CHECK_NE(&from, this); + resources_.MergeFrom(from.resources_); + archived_binary_.MergeFrom(from.archived_binary_); + alternate_extensions_.MergeFrom(from.alternate_extensions_); + url_chain_.MergeFrom(from.url_chain_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_digests()) { + mutable_digests()->::safe_browsing::ClientDownloadRequest_Digests::MergeFrom(from.digests()); + } + if (from.has_length()) { + set_length(from.length()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_user_initiated()) { + set_user_initiated(from.user_initiated()); + } + if (from.has_file_basename()) { + set_file_basename(from.file_basename()); + } + if (from.has_download_type()) { + set_download_type(from.download_type()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_locale()) { + set_locale(from.locale()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + if (from.has_population()) { + mutable_population()->::safe_browsing::ChromeUserPopulation::MergeFrom(from.population()); + } + if (from.has_archive_valid()) { + set_archive_valid(from.archive_valid()); + } + if (from.has_skipped_url_whitelist()) { + set_skipped_url_whitelist(from.skipped_url_whitelist()); + } + if (from.has_skipped_certificate_whitelist()) { + set_skipped_certificate_whitelist(from.skipped_certificate_whitelist()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadRequest::CopyFrom(const ClientDownloadRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadRequest::IsInitialized() const { + if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false; + + if (!::google::protobuf::internal::AllAreInitialized(this->resources())) return false; + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + if (!::google::protobuf::internal::AllAreInitialized(this->archived_binary())) return false; + return true; +} + +void ClientDownloadRequest::Swap(ClientDownloadRequest* other) { + if (other != this) { + std::swap(url_, other->url_); + std::swap(digests_, other->digests_); + std::swap(length_, other->length_); + resources_.Swap(&other->resources_); + std::swap(signature_, other->signature_); + std::swap(user_initiated_, other->user_initiated_); + std::swap(file_basename_, other->file_basename_); + std::swap(download_type_, other->download_type_); + std::swap(locale_, other->locale_); + std::swap(image_headers_, other->image_headers_); + archived_binary_.Swap(&other->archived_binary_); + std::swap(population_, other->population_); + std::swap(archive_valid_, other->archive_valid_); + std::swap(skipped_url_whitelist_, other->skipped_url_whitelist_); + std::swap(skipped_certificate_whitelist_, other->skipped_certificate_whitelist_); + alternate_extensions_.Swap(&other->alternate_extensions_); + url_chain_.Swap(&other->url_chain_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadRequest::GetTypeName() const { + return "safe_browsing.ClientDownloadRequest"; +} + + +// =================================================================== + +bool ClientDownloadResponse_Verdict_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientDownloadResponse_Verdict ClientDownloadResponse::SAFE; +const ClientDownloadResponse_Verdict ClientDownloadResponse::DANGEROUS; +const ClientDownloadResponse_Verdict ClientDownloadResponse::UNCOMMON; +const ClientDownloadResponse_Verdict ClientDownloadResponse::POTENTIALLY_UNWANTED; +const ClientDownloadResponse_Verdict ClientDownloadResponse::DANGEROUS_HOST; +const ClientDownloadResponse_Verdict ClientDownloadResponse::UNKNOWN; +const ClientDownloadResponse_Verdict ClientDownloadResponse::Verdict_MIN; +const ClientDownloadResponse_Verdict ClientDownloadResponse::Verdict_MAX; +const int ClientDownloadResponse::Verdict_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientDownloadResponse_MoreInfo::kDescriptionFieldNumber; +const int ClientDownloadResponse_MoreInfo::kUrlFieldNumber; +#endif // !_MSC_VER + +ClientDownloadResponse_MoreInfo::ClientDownloadResponse_MoreInfo() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadResponse.MoreInfo) +} + +void ClientDownloadResponse_MoreInfo::InitAsDefaultInstance() { +} + +ClientDownloadResponse_MoreInfo::ClientDownloadResponse_MoreInfo(const ClientDownloadResponse_MoreInfo& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadResponse.MoreInfo) +} + +void ClientDownloadResponse_MoreInfo::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadResponse_MoreInfo::~ClientDownloadResponse_MoreInfo() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadResponse.MoreInfo) + SharedDtor(); +} + +void ClientDownloadResponse_MoreInfo::SharedDtor() { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete description_; + } + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadResponse_MoreInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadResponse_MoreInfo& ClientDownloadResponse_MoreInfo::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadResponse_MoreInfo* ClientDownloadResponse_MoreInfo::default_instance_ = NULL; + +ClientDownloadResponse_MoreInfo* ClientDownloadResponse_MoreInfo::New() const { + return new ClientDownloadResponse_MoreInfo; +} + +void ClientDownloadResponse_MoreInfo::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_description()) { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_->clear(); + } + } + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadResponse_MoreInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadResponse.MoreInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string description = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_url; + break; + } + + // optional string url = 2; + case 2: { + if (tag == 18) { + parse_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadResponse.MoreInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadResponse.MoreInfo) + return false; +#undef DO_ +} + +void ClientDownloadResponse_MoreInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadResponse.MoreInfo) + // optional string description = 1; + if (has_description()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->description(), output); + } + + // optional string url = 2; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->url(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadResponse.MoreInfo) +} + +int ClientDownloadResponse_MoreInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string description = 1; + if (has_description()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // optional string url = 2; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadResponse_MoreInfo::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadResponse_MoreInfo*>(&from)); +} + +void ClientDownloadResponse_MoreInfo::MergeFrom(const ClientDownloadResponse_MoreInfo& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_description()) { + set_description(from.description()); + } + if (from.has_url()) { + set_url(from.url()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadResponse_MoreInfo::CopyFrom(const ClientDownloadResponse_MoreInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadResponse_MoreInfo::IsInitialized() const { + + return true; +} + +void ClientDownloadResponse_MoreInfo::Swap(ClientDownloadResponse_MoreInfo* other) { + if (other != this) { + std::swap(description_, other->description_); + std::swap(url_, other->url_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadResponse_MoreInfo::GetTypeName() const { + return "safe_browsing.ClientDownloadResponse.MoreInfo"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadResponse::kVerdictFieldNumber; +const int ClientDownloadResponse::kMoreInfoFieldNumber; +const int ClientDownloadResponse::kTokenFieldNumber; +#endif // !_MSC_VER + +ClientDownloadResponse::ClientDownloadResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadResponse) +} + +void ClientDownloadResponse::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + more_info_ = const_cast< ::safe_browsing::ClientDownloadResponse_MoreInfo*>( + ::safe_browsing::ClientDownloadResponse_MoreInfo::internal_default_instance()); +#else + more_info_ = const_cast< ::safe_browsing::ClientDownloadResponse_MoreInfo*>(&::safe_browsing::ClientDownloadResponse_MoreInfo::default_instance()); +#endif +} + +ClientDownloadResponse::ClientDownloadResponse(const ClientDownloadResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadResponse) +} + +void ClientDownloadResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + verdict_ = 0; + more_info_ = NULL; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadResponse::~ClientDownloadResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadResponse) + SharedDtor(); +} + +void ClientDownloadResponse::SharedDtor() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete more_info_; + } +} + +void ClientDownloadResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadResponse& ClientDownloadResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadResponse* ClientDownloadResponse::default_instance_ = NULL; + +ClientDownloadResponse* ClientDownloadResponse::New() const { + return new ClientDownloadResponse; +} + +void ClientDownloadResponse::Clear() { + if (_has_bits_[0 / 32] & 7) { + verdict_ = 0; + if (has_more_info()) { + if (more_info_ != NULL) more_info_->::safe_browsing::ClientDownloadResponse_MoreInfo::Clear(); + } + if (has_token()) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientDownloadResponse.Verdict verdict = 1 [default = SAFE]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value)) { + set_verdict(static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_more_info; + break; + } + + // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2; + case 2: { + if (tag == 18) { + parse_more_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_more_info())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_token; + break; + } + + // optional bytes token = 3; + case 3: { + if (tag == 26) { + parse_token: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_token())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadResponse) + return false; +#undef DO_ +} + +void ClientDownloadResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadResponse) + // optional .safe_browsing.ClientDownloadResponse.Verdict verdict = 1 [default = SAFE]; + if (has_verdict()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->verdict(), output); + } + + // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2; + if (has_more_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->more_info(), output); + } + + // optional bytes token = 3; + if (has_token()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->token(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadResponse) +} + +int ClientDownloadResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientDownloadResponse.Verdict verdict = 1 [default = SAFE]; + if (has_verdict()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->verdict()); + } + + // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2; + if (has_more_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->more_info()); + } + + // optional bytes token = 3; + if (has_token()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->token()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadResponse*>(&from)); +} + +void ClientDownloadResponse::MergeFrom(const ClientDownloadResponse& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_verdict()) { + set_verdict(from.verdict()); + } + if (from.has_more_info()) { + mutable_more_info()->::safe_browsing::ClientDownloadResponse_MoreInfo::MergeFrom(from.more_info()); + } + if (from.has_token()) { + set_token(from.token()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadResponse::CopyFrom(const ClientDownloadResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadResponse::IsInitialized() const { + + return true; +} + +void ClientDownloadResponse::Swap(ClientDownloadResponse* other) { + if (other != this) { + std::swap(verdict_, other->verdict_); + std::swap(more_info_, other->more_info_); + std::swap(token_, other->token_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadResponse::GetTypeName() const { + return "safe_browsing.ClientDownloadResponse"; +} + + +// =================================================================== + +bool ClientDownloadReport_Reason_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientDownloadReport_Reason ClientDownloadReport::SHARE; +const ClientDownloadReport_Reason ClientDownloadReport::FALSE_POSITIVE; +const ClientDownloadReport_Reason ClientDownloadReport::APPEAL; +const ClientDownloadReport_Reason ClientDownloadReport::Reason_MIN; +const ClientDownloadReport_Reason ClientDownloadReport::Reason_MAX; +const int ClientDownloadReport::Reason_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientDownloadReport_UserInformation::kEmailFieldNumber; +#endif // !_MSC_VER + +ClientDownloadReport_UserInformation::ClientDownloadReport_UserInformation() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadReport.UserInformation) +} + +void ClientDownloadReport_UserInformation::InitAsDefaultInstance() { +} + +ClientDownloadReport_UserInformation::ClientDownloadReport_UserInformation(const ClientDownloadReport_UserInformation& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadReport.UserInformation) +} + +void ClientDownloadReport_UserInformation::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadReport_UserInformation::~ClientDownloadReport_UserInformation() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadReport.UserInformation) + SharedDtor(); +} + +void ClientDownloadReport_UserInformation::SharedDtor() { + if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete email_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientDownloadReport_UserInformation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadReport_UserInformation& ClientDownloadReport_UserInformation::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadReport_UserInformation* ClientDownloadReport_UserInformation::default_instance_ = NULL; + +ClientDownloadReport_UserInformation* ClientDownloadReport_UserInformation::New() const { + return new ClientDownloadReport_UserInformation; +} + +void ClientDownloadReport_UserInformation::Clear() { + if (has_email()) { + if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadReport_UserInformation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadReport.UserInformation) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string email = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_email())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadReport.UserInformation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadReport.UserInformation) + return false; +#undef DO_ +} + +void ClientDownloadReport_UserInformation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadReport.UserInformation) + // optional string email = 1; + if (has_email()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->email(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadReport.UserInformation) +} + +int ClientDownloadReport_UserInformation::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string email = 1; + if (has_email()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->email()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadReport_UserInformation::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadReport_UserInformation*>(&from)); +} + +void ClientDownloadReport_UserInformation::MergeFrom(const ClientDownloadReport_UserInformation& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_email()) { + set_email(from.email()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadReport_UserInformation::CopyFrom(const ClientDownloadReport_UserInformation& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadReport_UserInformation::IsInitialized() const { + + return true; +} + +void ClientDownloadReport_UserInformation::Swap(ClientDownloadReport_UserInformation* other) { + if (other != this) { + std::swap(email_, other->email_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadReport_UserInformation::GetTypeName() const { + return "safe_browsing.ClientDownloadReport.UserInformation"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientDownloadReport::kReasonFieldNumber; +const int ClientDownloadReport::kDownloadRequestFieldNumber; +const int ClientDownloadReport::kUserInformationFieldNumber; +const int ClientDownloadReport::kCommentFieldNumber; +const int ClientDownloadReport::kDownloadResponseFieldNumber; +#endif // !_MSC_VER + +ClientDownloadReport::ClientDownloadReport() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientDownloadReport) +} + +void ClientDownloadReport::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + download_request_ = const_cast< ::safe_browsing::ClientDownloadRequest*>( + ::safe_browsing::ClientDownloadRequest::internal_default_instance()); +#else + download_request_ = const_cast< ::safe_browsing::ClientDownloadRequest*>(&::safe_browsing::ClientDownloadRequest::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + user_information_ = const_cast< ::safe_browsing::ClientDownloadReport_UserInformation*>( + ::safe_browsing::ClientDownloadReport_UserInformation::internal_default_instance()); +#else + user_information_ = const_cast< ::safe_browsing::ClientDownloadReport_UserInformation*>(&::safe_browsing::ClientDownloadReport_UserInformation::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + download_response_ = const_cast< ::safe_browsing::ClientDownloadResponse*>( + ::safe_browsing::ClientDownloadResponse::internal_default_instance()); +#else + download_response_ = const_cast< ::safe_browsing::ClientDownloadResponse*>(&::safe_browsing::ClientDownloadResponse::default_instance()); +#endif +} + +ClientDownloadReport::ClientDownloadReport(const ClientDownloadReport& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientDownloadReport) +} + +void ClientDownloadReport::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + reason_ = 0; + download_request_ = NULL; + user_information_ = NULL; + comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + download_response_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientDownloadReport::~ClientDownloadReport() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientDownloadReport) + SharedDtor(); +} + +void ClientDownloadReport::SharedDtor() { + if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete comment_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete download_request_; + delete user_information_; + delete download_response_; + } +} + +void ClientDownloadReport::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientDownloadReport& ClientDownloadReport::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientDownloadReport* ClientDownloadReport::default_instance_ = NULL; + +ClientDownloadReport* ClientDownloadReport::New() const { + return new ClientDownloadReport; +} + +void ClientDownloadReport::Clear() { + if (_has_bits_[0 / 32] & 31) { + reason_ = 0; + if (has_download_request()) { + if (download_request_ != NULL) download_request_->::safe_browsing::ClientDownloadRequest::Clear(); + } + if (has_user_information()) { + if (user_information_ != NULL) user_information_->::safe_browsing::ClientDownloadReport_UserInformation::Clear(); + } + if (has_comment()) { + if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_->clear(); + } + } + if (has_download_response()) { + if (download_response_ != NULL) download_response_->::safe_browsing::ClientDownloadResponse::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientDownloadReport::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientDownloadReport) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientDownloadReport.Reason reason = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadReport_Reason_IsValid(value)) { + set_reason(static_cast< ::safe_browsing::ClientDownloadReport_Reason >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_download_request; + break; + } + + // optional .safe_browsing.ClientDownloadRequest download_request = 2; + case 2: { + if (tag == 18) { + parse_download_request: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_download_request())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_user_information; + break; + } + + // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3; + case 3: { + if (tag == 26) { + parse_user_information: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_user_information())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_comment; + break; + } + + // optional bytes comment = 4; + case 4: { + if (tag == 34) { + parse_comment: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_comment())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_download_response; + break; + } + + // optional .safe_browsing.ClientDownloadResponse download_response = 5; + case 5: { + if (tag == 42) { + parse_download_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_download_response())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientDownloadReport) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientDownloadReport) + return false; +#undef DO_ +} + +void ClientDownloadReport::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientDownloadReport) + // optional .safe_browsing.ClientDownloadReport.Reason reason = 1; + if (has_reason()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->reason(), output); + } + + // optional .safe_browsing.ClientDownloadRequest download_request = 2; + if (has_download_request()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->download_request(), output); + } + + // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3; + if (has_user_information()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->user_information(), output); + } + + // optional bytes comment = 4; + if (has_comment()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->comment(), output); + } + + // optional .safe_browsing.ClientDownloadResponse download_response = 5; + if (has_download_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->download_response(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientDownloadReport) +} + +int ClientDownloadReport::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientDownloadReport.Reason reason = 1; + if (has_reason()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->reason()); + } + + // optional .safe_browsing.ClientDownloadRequest download_request = 2; + if (has_download_request()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->download_request()); + } + + // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3; + if (has_user_information()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->user_information()); + } + + // optional bytes comment = 4; + if (has_comment()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->comment()); + } + + // optional .safe_browsing.ClientDownloadResponse download_response = 5; + if (has_download_response()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->download_response()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientDownloadReport::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientDownloadReport*>(&from)); +} + +void ClientDownloadReport::MergeFrom(const ClientDownloadReport& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_reason()) { + set_reason(from.reason()); + } + if (from.has_download_request()) { + mutable_download_request()->::safe_browsing::ClientDownloadRequest::MergeFrom(from.download_request()); + } + if (from.has_user_information()) { + mutable_user_information()->::safe_browsing::ClientDownloadReport_UserInformation::MergeFrom(from.user_information()); + } + if (from.has_comment()) { + set_comment(from.comment()); + } + if (from.has_download_response()) { + mutable_download_response()->::safe_browsing::ClientDownloadResponse::MergeFrom(from.download_response()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientDownloadReport::CopyFrom(const ClientDownloadReport& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientDownloadReport::IsInitialized() const { + + if (has_download_request()) { + if (!this->download_request().IsInitialized()) return false; + } + return true; +} + +void ClientDownloadReport::Swap(ClientDownloadReport* other) { + if (other != this) { + std::swap(reason_, other->reason_); + std::swap(download_request_, other->download_request_); + std::swap(user_information_, other->user_information_); + std::swap(comment_, other->comment_); + std::swap(download_response_, other->download_response_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientDownloadReport::GetTypeName() const { + return "safe_browsing.ClientDownloadReport"; +} + + +// =================================================================== + +bool ClientUploadResponse_UploadStatus_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientUploadResponse_UploadStatus ClientUploadResponse::SUCCESS; +const ClientUploadResponse_UploadStatus ClientUploadResponse::UPLOAD_FAILURE; +const ClientUploadResponse_UploadStatus ClientUploadResponse::UploadStatus_MIN; +const ClientUploadResponse_UploadStatus ClientUploadResponse::UploadStatus_MAX; +const int ClientUploadResponse::UploadStatus_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientUploadResponse::kStatusFieldNumber; +const int ClientUploadResponse::kPermalinkFieldNumber; +#endif // !_MSC_VER + +ClientUploadResponse::ClientUploadResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientUploadResponse) +} + +void ClientUploadResponse::InitAsDefaultInstance() { +} + +ClientUploadResponse::ClientUploadResponse(const ClientUploadResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientUploadResponse) +} + +void ClientUploadResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + status_ = 0; + permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientUploadResponse::~ClientUploadResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientUploadResponse) + SharedDtor(); +} + +void ClientUploadResponse::SharedDtor() { + if (permalink_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete permalink_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientUploadResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientUploadResponse& ClientUploadResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientUploadResponse* ClientUploadResponse::default_instance_ = NULL; + +ClientUploadResponse* ClientUploadResponse::New() const { + return new ClientUploadResponse; +} + +void ClientUploadResponse::Clear() { + if (_has_bits_[0 / 32] & 3) { + status_ = 0; + if (has_permalink()) { + if (permalink_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientUploadResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientUploadResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientUploadResponse_UploadStatus_IsValid(value)) { + set_status(static_cast< ::safe_browsing::ClientUploadResponse_UploadStatus >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_permalink; + break; + } + + // optional string permalink = 2; + case 2: { + if (tag == 18) { + parse_permalink: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_permalink())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientUploadResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientUploadResponse) + return false; +#undef DO_ +} + +void ClientUploadResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientUploadResponse) + // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1; + if (has_status()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->status(), output); + } + + // optional string permalink = 2; + if (has_permalink()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->permalink(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientUploadResponse) +} + +int ClientUploadResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1; + if (has_status()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->status()); + } + + // optional string permalink = 2; + if (has_permalink()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->permalink()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientUploadResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientUploadResponse*>(&from)); +} + +void ClientUploadResponse::MergeFrom(const ClientUploadResponse& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_status()) { + set_status(from.status()); + } + if (from.has_permalink()) { + set_permalink(from.permalink()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientUploadResponse::CopyFrom(const ClientUploadResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientUploadResponse::IsInitialized() const { + + return true; +} + +void ClientUploadResponse::Swap(ClientUploadResponse* other) { + if (other != this) { + std::swap(status_, other->status_); + std::swap(permalink_, other->permalink_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientUploadResponse::GetTypeName() const { + return "safe_browsing.ClientUploadResponse"; +} + + +// =================================================================== + +bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::UNKNOWN; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CLEARED; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::WEAK_LEGACY_OBSOLETE; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CHANGED; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::UNTRUSTED_UNKNOWN_VALUE; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ValueState_MIN; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ValueState_MAX; +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ValueState_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::kPathFieldNumber; +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::kAtomicValueFieldNumber; +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::kSplitKeyFieldNumber; +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::kValueStateFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ClientIncidentReport_IncidentData_TrackedPreferenceIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::InitAsDefaultInstance() { +} + +ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ClientIncidentReport_IncidentData_TrackedPreferenceIncident(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + atomic_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + value_state_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_TrackedPreferenceIncident::~ClientIncidentReport_IncidentData_TrackedPreferenceIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::SharedDtor() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (atomic_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete atomic_value_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_TrackedPreferenceIncident* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_TrackedPreferenceIncident* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::New() const { + return new ClientIncidentReport_IncidentData_TrackedPreferenceIncident; +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::Clear() { + if (_has_bits_[0 / 32] & 11) { + if (has_path()) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + } + if (has_atomic_value()) { + if (atomic_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_->clear(); + } + } + value_state_ = 0; + } + split_key_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string path = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_path())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_atomic_value; + break; + } + + // optional string atomic_value = 2; + case 2: { + if (tag == 18) { + parse_atomic_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_atomic_value())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_split_key; + break; + } + + // repeated string split_key = 3; + case 3: { + if (tag == 26) { + parse_split_key: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_split_key())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_split_key; + if (input->ExpectTag(32)) goto parse_value_state; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.ValueState value_state = 4; + case 4: { + if (tag == 32) { + parse_value_state: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_IsValid(value)) { + set_value_state(static_cast< ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + // optional string path = 1; + if (has_path()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->path(), output); + } + + // optional string atomic_value = 2; + if (has_atomic_value()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->atomic_value(), output); + } + + // repeated string split_key = 3; + for (int i = 0; i < this->split_key_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->split_key(i), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.ValueState value_state = 4; + if (has_value_state()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->value_state(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) +} + +int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string path = 1; + if (has_path()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->path()); + } + + // optional string atomic_value = 2; + if (has_atomic_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->atomic_value()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.ValueState value_state = 4; + if (has_value_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->value_state()); + } + + } + // repeated string split_key = 3; + total_size += 1 * this->split_key_size(); + for (int i = 0; i < this->split_key_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->split_key(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_TrackedPreferenceIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::MergeFrom(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from) { + GOOGLE_CHECK_NE(&from, this); + split_key_.MergeFrom(from.split_key_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_path()) { + set_path(from.path()); + } + if (from.has_atomic_value()) { + set_atomic_value(from.atomic_value()); + } + if (from.has_value_state()) { + set_value_state(from.value_state()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::CopyFrom(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::Swap(ClientIncidentReport_IncidentData_TrackedPreferenceIncident* other) { + if (other != this) { + std::swap(path_, other->path_); + std::swap(atomic_value_, other->atomic_value_); + split_key_.Swap(&other->split_key_); + std::swap(value_state_, other->value_state_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_TrackedPreferenceIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::kRelativePathFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::kSignatureFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::kImageHeadersFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + relative_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + signature_ = NULL; + image_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::~ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::SharedDtor() { + if (relative_path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete relative_path_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete signature_; + delete image_headers_; + } +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::New() const { + return new ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_relative_path()) { + if (relative_path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_->clear(); + } + } + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string relative_path = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_relative_path())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + case 2: { + if (tag == 18) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + case 3: { + if (tag == 26) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + // optional string relative_path = 1; + if (has_relative_path()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->relative_path(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->signature(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->image_headers(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) +} + +int ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string relative_path = 1; + if (has_relative_path()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->relative_path()); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile*>(&from)); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::MergeFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_relative_path()) { + set_relative_path(from.relative_path()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::CopyFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::IsInitialized() const { + + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::Swap(ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* other) { + if (other != this) { + std::swap(relative_path_, other->relative_path_); + std::swap(signature_, other->signature_); + std::swap(image_headers_, other->image_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::kFileBasenameFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::kSignatureFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::kImageHeadersFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::kSecErrorFieldNumber; +const int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::kContainedFileFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident::ClientIncidentReport_IncidentData_BinaryIntegrityIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident::ClientIncidentReport_IncidentData_BinaryIntegrityIncident(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + signature_ = NULL; + image_headers_ = NULL; + sec_error_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident::~ClientIncidentReport_IncidentData_BinaryIntegrityIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::SharedDtor() { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete signature_; + delete image_headers_; + } +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_BinaryIntegrityIncident* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::New() const { + return new ClientIncidentReport_IncidentData_BinaryIntegrityIncident; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_file_basename()) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + } + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + sec_error_ = 0; + } + contained_file_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string file_basename = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_basename())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + case 2: { + if (tag == 18) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + case 3: { + if (tag == 26) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_sec_error; + break; + } + + // optional int32 sec_error = 4; + case 4: { + if (tag == 32) { + parse_sec_error: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &sec_error_))); + set_has_sec_error(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_contained_file; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile contained_file = 5; + case 5: { + if (tag == 42) { + parse_contained_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_contained_file())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_contained_file; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + // optional string file_basename = 1; + if (has_file_basename()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_basename(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->signature(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->image_headers(), output); + } + + // optional int32 sec_error = 4; + if (has_sec_error()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->sec_error(), output); + } + + // repeated .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile contained_file = 5; + for (int i = 0; i < this->contained_file_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->contained_file(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) +} + +int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string file_basename = 1; + if (has_file_basename()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_basename()); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + // optional int32 sec_error = 4; + if (has_sec_error()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->sec_error()); + } + + } + // repeated .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile contained_file = 5; + total_size += 1 * this->contained_file_size(); + for (int i = 0; i < this->contained_file_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->contained_file(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_BinaryIntegrityIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::MergeFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from) { + GOOGLE_CHECK_NE(&from, this); + contained_file_.MergeFrom(from.contained_file_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_basename()) { + set_file_basename(from.file_basename()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + if (from.has_sec_error()) { + set_sec_error(from.sec_error()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::CopyFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::IsInitialized() const { + + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + if (!::google::protobuf::internal::AllAreInitialized(this->contained_file())) return false; + return true; +} + +void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::Swap(ClientIncidentReport_IncidentData_BinaryIntegrityIncident* other) { + if (other != this) { + std::swap(file_basename_, other->file_basename_); + std::swap(signature_, other->signature_); + std::swap(image_headers_, other->image_headers_); + std::swap(sec_error_, other->sec_error_); + contained_file_.Swap(&other->contained_file_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_BinaryIntegrityIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kPathFieldNumber; +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kDigestFieldNumber; +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kVersionFieldNumber; +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kBlacklistInitializedFieldNumber; +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kSignatureFieldNumber; +const int ClientIncidentReport_IncidentData_BlacklistLoadIncident::kImageHeadersFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_BlacklistLoadIncident::ClientIncidentReport_IncidentData_BlacklistLoadIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + digest_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>( + ::safe_browsing::ClientDownloadRequest_Digests::internal_default_instance()); +#else + digest_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientIncidentReport_IncidentData_BlacklistLoadIncident::ClientIncidentReport_IncidentData_BlacklistLoadIncident(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + digest_ = NULL; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + blacklist_initialized_ = false; + signature_ = NULL; + image_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_BlacklistLoadIncident::~ClientIncidentReport_IncidentData_BlacklistLoadIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::SharedDtor() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete digest_; + delete signature_; + delete image_headers_; + } +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_BlacklistLoadIncident& ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_BlacklistLoadIncident* ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_BlacklistLoadIncident* ClientIncidentReport_IncidentData_BlacklistLoadIncident::New() const { + return new ClientIncidentReport_IncidentData_BlacklistLoadIncident; +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::Clear() { + if (_has_bits_[0 / 32] & 63) { + if (has_path()) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + } + if (has_digest()) { + if (digest_ != NULL) digest_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + } + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + blacklist_initialized_ = false; + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string path = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_path())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_digest; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + case 2: { + if (tag == 18) { + parse_digest: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_digest())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_version; + break; + } + + // optional string version = 3; + case 3: { + if (tag == 26) { + parse_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_blacklist_initialized; + break; + } + + // optional bool blacklist_initialized = 4; + case 4: { + if (tag == 32) { + parse_blacklist_initialized: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &blacklist_initialized_))); + set_has_blacklist_initialized(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + case 5: { + if (tag == 42) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + case 6: { + if (tag == 50) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + // optional string path = 1; + if (has_path()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->path(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + if (has_digest()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->digest(), output); + } + + // optional string version = 3; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->version(), output); + } + + // optional bool blacklist_initialized = 4; + if (has_blacklist_initialized()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->blacklist_initialized(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->signature(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->image_headers(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) +} + +int ClientIncidentReport_IncidentData_BlacklistLoadIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string path = 1; + if (has_path()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->path()); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + if (has_digest()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->digest()); + } + + // optional string version = 3; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->version()); + } + + // optional bool blacklist_initialized = 4; + if (has_blacklist_initialized()) { + total_size += 1 + 1; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_BlacklistLoadIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::MergeFrom(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_path()) { + set_path(from.path()); + } + if (from.has_digest()) { + mutable_digest()->::safe_browsing::ClientDownloadRequest_Digests::MergeFrom(from.digest()); + } + if (from.has_version()) { + set_version(from.version()); + } + if (from.has_blacklist_initialized()) { + set_blacklist_initialized(from.blacklist_initialized()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::CopyFrom(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::IsInitialized() const { + + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_IncidentData_BlacklistLoadIncident::Swap(ClientIncidentReport_IncidentData_BlacklistLoadIncident* other) { + if (other != this) { + std::swap(path_, other->path_); + std::swap(digest_, other->digest_); + std::swap(version_, other->version_); + std::swap(blacklist_initialized_, other->blacklist_initialized_); + std::swap(signature_, other->signature_); + std::swap(image_headers_, other->image_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_BlacklistLoadIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::kVariationsSeedSignatureFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::InitAsDefaultInstance() { +} + +ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + variations_seed_signature_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::~ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::SharedDtor() { + if (variations_seed_signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete variations_seed_signature_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::New() const { + return new ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident; +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::Clear() { + if (has_variations_seed_signature()) { + if (variations_seed_signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_->clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string variations_seed_signature = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_variations_seed_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + // optional string variations_seed_signature = 1; + if (has_variations_seed_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->variations_seed_signature(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) +} + +int ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string variations_seed_signature = 1; + if (has_variations_seed_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->variations_seed_signature()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::MergeFrom(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_variations_seed_signature()) { + set_variations_seed_signature(from.variations_seed_signature()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::CopyFrom(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::Swap(ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* other) { + if (other != this) { + std::swap(variations_seed_signature_, other->variations_seed_signature_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident"; +} + + +// ------------------------------------------------------------------- + +bool ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_IsValid(int value) { + switch(value) { + case 0: + case 3: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident::UNKNOWN; +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident::TYPE_PATTERN; +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident::Type_MIN; +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident::Type_MAX; +const int ClientIncidentReport_IncidentData_ResourceRequestIncident::Type_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_ResourceRequestIncident::kDigestFieldNumber; +const int ClientIncidentReport_IncidentData_ResourceRequestIncident::kOriginFieldNumber; +const int ClientIncidentReport_IncidentData_ResourceRequestIncident::kTypeFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_ResourceRequestIncident::ClientIncidentReport_IncidentData_ResourceRequestIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::InitAsDefaultInstance() { +} + +ClientIncidentReport_IncidentData_ResourceRequestIncident::ClientIncidentReport_IncidentData_ResourceRequestIncident(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + digest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + origin_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_ResourceRequestIncident::~ClientIncidentReport_IncidentData_ResourceRequestIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::SharedDtor() { + if (digest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete digest_; + } + if (origin_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete origin_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_ResourceRequestIncident& ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_ResourceRequestIncident* ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_ResourceRequestIncident* ClientIncidentReport_IncidentData_ResourceRequestIncident::New() const { + return new ClientIncidentReport_IncidentData_ResourceRequestIncident; +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_digest()) { + if (digest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_->clear(); + } + } + if (has_origin()) { + if (origin_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_->clear(); + } + } + type_ = 0; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_ResourceRequestIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes digest = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_digest())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_origin; + break; + } + + // optional string origin = 2; + case 2: { + if (tag == 18) { + parse_origin: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_origin())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_type; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.Type type = 3 [default = UNKNOWN]; + case 3: { + if (tag == 24) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_IsValid(value)) { + set_type(static_cast< ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + // optional bytes digest = 1; + if (has_digest()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->digest(), output); + } + + // optional string origin = 2; + if (has_origin()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->origin(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.Type type = 3 [default = UNKNOWN]; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 3, this->type(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) +} + +int ClientIncidentReport_IncidentData_ResourceRequestIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes digest = 1; + if (has_digest()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->digest()); + } + + // optional string origin = 2; + if (has_origin()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->origin()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.Type type = 3 [default = UNKNOWN]; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_ResourceRequestIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::MergeFrom(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_digest()) { + set_digest(from.digest()); + } + if (from.has_origin()) { + set_origin(from.origin()); + } + if (from.has_type()) { + set_type(from.type()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::CopyFrom(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_ResourceRequestIncident::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_IncidentData_ResourceRequestIncident::Swap(ClientIncidentReport_IncidentData_ResourceRequestIncident* other) { + if (other != this) { + std::swap(digest_, other->digest_); + std::swap(origin_, other->origin_); + std::swap(type_, other->type_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_ResourceRequestIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::kPathFieldNumber; +const int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::kDigestFieldNumber; +const int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::kVersionFieldNumber; +const int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::kSignatureFieldNumber; +const int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::kImageHeadersFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData_SuspiciousModuleIncident::ClientIncidentReport_IncidentData_SuspiciousModuleIncident() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + digest_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>( + ::safe_browsing::ClientDownloadRequest_Digests::internal_default_instance()); +#else + digest_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>( + ::safe_browsing::ClientDownloadRequest_SignatureInfo::internal_default_instance()); +#else + signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientIncidentReport_IncidentData_SuspiciousModuleIncident::ClientIncidentReport_IncidentData_SuspiciousModuleIncident(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + digest_ = NULL; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + signature_ = NULL; + image_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData_SuspiciousModuleIncident::~ClientIncidentReport_IncidentData_SuspiciousModuleIncident() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::SharedDtor() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete digest_; + delete signature_; + delete image_headers_; + } +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData_SuspiciousModuleIncident* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance_ = NULL; + +ClientIncidentReport_IncidentData_SuspiciousModuleIncident* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::New() const { + return new ClientIncidentReport_IncidentData_SuspiciousModuleIncident; +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::Clear() { + if (_has_bits_[0 / 32] & 31) { + if (has_path()) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + } + if (has_digest()) { + if (digest_ != NULL) digest_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + } + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + if (has_signature()) { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + } + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string path = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_path())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_digest; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + case 2: { + if (tag == 18) { + parse_digest: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_digest())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_version; + break; + } + + // optional string version = 3; + case 3: { + if (tag == 26) { + parse_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_signature; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 4; + case 4: { + if (tag == 34) { + parse_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + case 5: { + if (tag == 42) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + // optional string path = 1; + if (has_path()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->path(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + if (has_digest()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->digest(), output); + } + + // optional string version = 3; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->version(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 4; + if (has_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->signature(), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->image_headers(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) +} + +int ClientIncidentReport_IncidentData_SuspiciousModuleIncident::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string path = 1; + if (has_path()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->path()); + } + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + if (has_digest()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->digest()); + } + + // optional string version = 3; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->version()); + } + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 4; + if (has_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->signature()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData_SuspiciousModuleIncident*>(&from)); +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::MergeFrom(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_path()) { + set_path(from.path()); + } + if (from.has_digest()) { + mutable_digest()->::safe_browsing::ClientDownloadRequest_Digests::MergeFrom(from.digest()); + } + if (from.has_version()) { + set_version(from.version()); + } + if (from.has_signature()) { + mutable_signature()->::safe_browsing::ClientDownloadRequest_SignatureInfo::MergeFrom(from.signature()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::CopyFrom(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::IsInitialized() const { + + if (has_signature()) { + if (!this->signature().IsInitialized()) return false; + } + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::Swap(ClientIncidentReport_IncidentData_SuspiciousModuleIncident* other) { + if (other != this) { + std::swap(path_, other->path_); + std::swap(digest_, other->digest_); + std::swap(version_, other->version_); + std::swap(signature_, other->signature_); + std::swap(image_headers_, other->image_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData_SuspiciousModuleIncident::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_IncidentData::kIncidentTimeMsecFieldNumber; +const int ClientIncidentReport_IncidentData::kTrackedPreferenceFieldNumber; +const int ClientIncidentReport_IncidentData::kBinaryIntegrityFieldNumber; +const int ClientIncidentReport_IncidentData::kBlacklistLoadFieldNumber; +const int ClientIncidentReport_IncidentData::kVariationsSeedSignatureFieldNumber; +const int ClientIncidentReport_IncidentData::kResourceRequestFieldNumber; +const int ClientIncidentReport_IncidentData::kSuspiciousModuleFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_IncidentData::ClientIncidentReport_IncidentData() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.IncidentData) +} + +void ClientIncidentReport_IncidentData::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + tracked_preference_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident::internal_default_instance()); +#else + tracked_preference_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + binary_integrity_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident::internal_default_instance()); +#else + binary_integrity_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + blacklist_load_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident::internal_default_instance()); +#else + blacklist_load_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + variations_seed_signature_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::internal_default_instance()); +#else + variations_seed_signature_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + resource_request_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident::internal_default_instance()); +#else + resource_request_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + suspicious_module_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident*>( + ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident::internal_default_instance()); +#else + suspicious_module_ = const_cast< ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident*>(&::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident::default_instance()); +#endif +} + +ClientIncidentReport_IncidentData::ClientIncidentReport_IncidentData(const ClientIncidentReport_IncidentData& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.IncidentData) +} + +void ClientIncidentReport_IncidentData::SharedCtor() { + _cached_size_ = 0; + incident_time_msec_ = GOOGLE_LONGLONG(0); + tracked_preference_ = NULL; + binary_integrity_ = NULL; + blacklist_load_ = NULL; + variations_seed_signature_ = NULL; + resource_request_ = NULL; + suspicious_module_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_IncidentData::~ClientIncidentReport_IncidentData() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.IncidentData) + SharedDtor(); +} + +void ClientIncidentReport_IncidentData::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete tracked_preference_; + delete binary_integrity_; + delete blacklist_load_; + delete variations_seed_signature_; + delete resource_request_; + delete suspicious_module_; + } +} + +void ClientIncidentReport_IncidentData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_IncidentData& ClientIncidentReport_IncidentData::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_IncidentData* ClientIncidentReport_IncidentData::default_instance_ = NULL; + +ClientIncidentReport_IncidentData* ClientIncidentReport_IncidentData::New() const { + return new ClientIncidentReport_IncidentData; +} + +void ClientIncidentReport_IncidentData::Clear() { + if (_has_bits_[0 / 32] & 127) { + incident_time_msec_ = GOOGLE_LONGLONG(0); + if (has_tracked_preference()) { + if (tracked_preference_ != NULL) tracked_preference_->::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident::Clear(); + } + if (has_binary_integrity()) { + if (binary_integrity_ != NULL) binary_integrity_->::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident::Clear(); + } + if (has_blacklist_load()) { + if (blacklist_load_ != NULL) blacklist_load_->::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident::Clear(); + } + if (has_variations_seed_signature()) { + if (variations_seed_signature_ != NULL) variations_seed_signature_->::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::Clear(); + } + if (has_resource_request()) { + if (resource_request_ != NULL) resource_request_->::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident::Clear(); + } + if (has_suspicious_module()) { + if (suspicious_module_ != NULL) suspicious_module_->::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_IncidentData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.IncidentData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int64 incident_time_msec = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &incident_time_msec_))); + set_has_incident_time_msec(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_tracked_preference; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident tracked_preference = 2; + case 2: { + if (tag == 18) { + parse_tracked_preference: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_tracked_preference())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_binary_integrity; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident binary_integrity = 3; + case 3: { + if (tag == 26) { + parse_binary_integrity: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_binary_integrity())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_blacklist_load; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident blacklist_load = 4; + case 4: { + if (tag == 34) { + parse_blacklist_load: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_blacklist_load())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_variations_seed_signature; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident variations_seed_signature = 6; + case 6: { + if (tag == 50) { + parse_variations_seed_signature: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_variations_seed_signature())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_resource_request; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident resource_request = 7; + case 7: { + if (tag == 58) { + parse_resource_request: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_resource_request())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_suspicious_module; + break; + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident suspicious_module = 8; + case 8: { + if (tag == 66) { + parse_suspicious_module: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_suspicious_module())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.IncidentData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.IncidentData) + return false; +#undef DO_ +} + +void ClientIncidentReport_IncidentData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.IncidentData) + // optional int64 incident_time_msec = 1; + if (has_incident_time_msec()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->incident_time_msec(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident tracked_preference = 2; + if (has_tracked_preference()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->tracked_preference(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident binary_integrity = 3; + if (has_binary_integrity()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->binary_integrity(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident blacklist_load = 4; + if (has_blacklist_load()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->blacklist_load(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident variations_seed_signature = 6; + if (has_variations_seed_signature()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 6, this->variations_seed_signature(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident resource_request = 7; + if (has_resource_request()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->resource_request(), output); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident suspicious_module = 8; + if (has_suspicious_module()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->suspicious_module(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.IncidentData) +} + +int ClientIncidentReport_IncidentData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int64 incident_time_msec = 1; + if (has_incident_time_msec()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->incident_time_msec()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident tracked_preference = 2; + if (has_tracked_preference()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->tracked_preference()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident binary_integrity = 3; + if (has_binary_integrity()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->binary_integrity()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident blacklist_load = 4; + if (has_blacklist_load()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->blacklist_load()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident variations_seed_signature = 6; + if (has_variations_seed_signature()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->variations_seed_signature()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident resource_request = 7; + if (has_resource_request()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->resource_request()); + } + + // optional .safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident suspicious_module = 8; + if (has_suspicious_module()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->suspicious_module()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_IncidentData::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_IncidentData*>(&from)); +} + +void ClientIncidentReport_IncidentData::MergeFrom(const ClientIncidentReport_IncidentData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_incident_time_msec()) { + set_incident_time_msec(from.incident_time_msec()); + } + if (from.has_tracked_preference()) { + mutable_tracked_preference()->::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident::MergeFrom(from.tracked_preference()); + } + if (from.has_binary_integrity()) { + mutable_binary_integrity()->::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident::MergeFrom(from.binary_integrity()); + } + if (from.has_blacklist_load()) { + mutable_blacklist_load()->::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident::MergeFrom(from.blacklist_load()); + } + if (from.has_variations_seed_signature()) { + mutable_variations_seed_signature()->::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::MergeFrom(from.variations_seed_signature()); + } + if (from.has_resource_request()) { + mutable_resource_request()->::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident::MergeFrom(from.resource_request()); + } + if (from.has_suspicious_module()) { + mutable_suspicious_module()->::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident::MergeFrom(from.suspicious_module()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_IncidentData::CopyFrom(const ClientIncidentReport_IncidentData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_IncidentData::IsInitialized() const { + + if (has_binary_integrity()) { + if (!this->binary_integrity().IsInitialized()) return false; + } + if (has_blacklist_load()) { + if (!this->blacklist_load().IsInitialized()) return false; + } + if (has_suspicious_module()) { + if (!this->suspicious_module().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_IncidentData::Swap(ClientIncidentReport_IncidentData* other) { + if (other != this) { + std::swap(incident_time_msec_, other->incident_time_msec_); + std::swap(tracked_preference_, other->tracked_preference_); + std::swap(binary_integrity_, other->binary_integrity_); + std::swap(blacklist_load_, other->blacklist_load_); + std::swap(variations_seed_signature_, other->variations_seed_signature_); + std::swap(resource_request_, other->resource_request_); + std::swap(suspicious_module_, other->suspicious_module_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_IncidentData::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.IncidentData"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_DownloadDetails::kTokenFieldNumber; +const int ClientIncidentReport_DownloadDetails::kDownloadFieldNumber; +const int ClientIncidentReport_DownloadDetails::kDownloadTimeMsecFieldNumber; +const int ClientIncidentReport_DownloadDetails::kOpenTimeMsecFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_DownloadDetails::ClientIncidentReport_DownloadDetails() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.DownloadDetails) +} + +void ClientIncidentReport_DownloadDetails::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + download_ = const_cast< ::safe_browsing::ClientDownloadRequest*>( + ::safe_browsing::ClientDownloadRequest::internal_default_instance()); +#else + download_ = const_cast< ::safe_browsing::ClientDownloadRequest*>(&::safe_browsing::ClientDownloadRequest::default_instance()); +#endif +} + +ClientIncidentReport_DownloadDetails::ClientIncidentReport_DownloadDetails(const ClientIncidentReport_DownloadDetails& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.DownloadDetails) +} + +void ClientIncidentReport_DownloadDetails::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + download_ = NULL; + download_time_msec_ = GOOGLE_LONGLONG(0); + open_time_msec_ = GOOGLE_LONGLONG(0); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_DownloadDetails::~ClientIncidentReport_DownloadDetails() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.DownloadDetails) + SharedDtor(); +} + +void ClientIncidentReport_DownloadDetails::SharedDtor() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete download_; + } +} + +void ClientIncidentReport_DownloadDetails::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_DownloadDetails& ClientIncidentReport_DownloadDetails::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_DownloadDetails* ClientIncidentReport_DownloadDetails::default_instance_ = NULL; + +ClientIncidentReport_DownloadDetails* ClientIncidentReport_DownloadDetails::New() const { + return new ClientIncidentReport_DownloadDetails; +} + +void ClientIncidentReport_DownloadDetails::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientIncidentReport_DownloadDetails*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 15) { + ZR_(download_time_msec_, open_time_msec_); + if (has_token()) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + } + if (has_download()) { + if (download_ != NULL) download_->::safe_browsing::ClientDownloadRequest::Clear(); + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_DownloadDetails::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.DownloadDetails) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes token = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_token())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_download; + break; + } + + // optional .safe_browsing.ClientDownloadRequest download = 2; + case 2: { + if (tag == 18) { + parse_download: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_download())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_download_time_msec; + break; + } + + // optional int64 download_time_msec = 3; + case 3: { + if (tag == 24) { + parse_download_time_msec: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &download_time_msec_))); + set_has_download_time_msec(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_open_time_msec; + break; + } + + // optional int64 open_time_msec = 4; + case 4: { + if (tag == 32) { + parse_open_time_msec: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &open_time_msec_))); + set_has_open_time_msec(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.DownloadDetails) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.DownloadDetails) + return false; +#undef DO_ +} + +void ClientIncidentReport_DownloadDetails::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.DownloadDetails) + // optional bytes token = 1; + if (has_token()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->token(), output); + } + + // optional .safe_browsing.ClientDownloadRequest download = 2; + if (has_download()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->download(), output); + } + + // optional int64 download_time_msec = 3; + if (has_download_time_msec()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->download_time_msec(), output); + } + + // optional int64 open_time_msec = 4; + if (has_open_time_msec()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->open_time_msec(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.DownloadDetails) +} + +int ClientIncidentReport_DownloadDetails::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes token = 1; + if (has_token()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->token()); + } + + // optional .safe_browsing.ClientDownloadRequest download = 2; + if (has_download()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->download()); + } + + // optional int64 download_time_msec = 3; + if (has_download_time_msec()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->download_time_msec()); + } + + // optional int64 open_time_msec = 4; + if (has_open_time_msec()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->open_time_msec()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_DownloadDetails::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_DownloadDetails*>(&from)); +} + +void ClientIncidentReport_DownloadDetails::MergeFrom(const ClientIncidentReport_DownloadDetails& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_token()) { + set_token(from.token()); + } + if (from.has_download()) { + mutable_download()->::safe_browsing::ClientDownloadRequest::MergeFrom(from.download()); + } + if (from.has_download_time_msec()) { + set_download_time_msec(from.download_time_msec()); + } + if (from.has_open_time_msec()) { + set_open_time_msec(from.open_time_msec()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_DownloadDetails::CopyFrom(const ClientIncidentReport_DownloadDetails& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_DownloadDetails::IsInitialized() const { + + if (has_download()) { + if (!this->download().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_DownloadDetails::Swap(ClientIncidentReport_DownloadDetails* other) { + if (other != this) { + std::swap(token_, other->token_); + std::swap(download_, other->download_); + std::swap(download_time_msec_, other->download_time_msec_); + std::swap(open_time_msec_, other->open_time_msec_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_DownloadDetails::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.DownloadDetails"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_OS_RegistryValue::kNameFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS_RegistryValue::kTypeFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS_RegistryValue::kDataFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_OS_RegistryValue::ClientIncidentReport_EnvironmentData_OS_RegistryValue() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_OS_RegistryValue::ClientIncidentReport_EnvironmentData_OS_RegistryValue(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_ = 0u; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_OS_RegistryValue::~ClientIncidentReport_EnvironmentData_OS_RegistryValue() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_OS_RegistryValue& ClientIncidentReport_EnvironmentData_OS_RegistryValue::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_OS_RegistryValue* ClientIncidentReport_EnvironmentData_OS_RegistryValue::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_OS_RegistryValue* ClientIncidentReport_EnvironmentData_OS_RegistryValue::New() const { + return new ClientIncidentReport_EnvironmentData_OS_RegistryValue; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + type_ = 0u; + if (has_data()) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_OS_RegistryValue::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_type; + break; + } + + // optional uint32 type = 2; + case 2: { + if (tag == 16) { + parse_type: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &type_))); + set_has_type(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_data; + break; + } + + // optional bytes data = 3; + case 3: { + if (tag == 26) { + parse_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_data())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional uint32 type = 2; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->type(), output); + } + + // optional bytes data = 3; + if (has_data()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->data(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) +} + +int ClientIncidentReport_EnvironmentData_OS_RegistryValue::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional uint32 type = 2; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->type()); + } + + // optional bytes data = 3; + if (has_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->data()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_OS_RegistryValue*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::MergeFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_data()) { + set_data(from.data()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::CopyFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_OS_RegistryValue::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryValue::Swap(ClientIncidentReport_EnvironmentData_OS_RegistryValue* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(type_, other->type_); + std::swap(data_, other->data_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_OS_RegistryValue::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_OS_RegistryKey::kNameFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS_RegistryKey::kValueFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS_RegistryKey::kKeyFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_OS_RegistryKey::ClientIncidentReport_EnvironmentData_OS_RegistryKey() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_OS_RegistryKey::ClientIncidentReport_EnvironmentData_OS_RegistryKey(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_OS_RegistryKey::~ClientIncidentReport_EnvironmentData_OS_RegistryKey() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_OS_RegistryKey& ClientIncidentReport_EnvironmentData_OS_RegistryKey::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS_RegistryKey::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS_RegistryKey::New() const { + return new ClientIncidentReport_EnvironmentData_OS_RegistryKey; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::Clear() { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + value_.Clear(); + key_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_OS_RegistryKey::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_value; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue value = 2; + case 2: { + if (tag == 18) { + parse_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_value())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_value; + if (input->ExpectTag(26)) goto parse_key; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey key = 3; + case 3: { + if (tag == 26) { + parse_key: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_key())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_key; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue value = 2; + for (int i = 0; i < this->value_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->value(i), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey key = 3; + for (int i = 0; i < this->key_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->key(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) +} + +int ClientIncidentReport_EnvironmentData_OS_RegistryKey::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + } + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue value = 2; + total_size += 1 * this->value_size(); + for (int i = 0; i < this->value_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->value(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey key = 3; + total_size += 1 * this->key_size(); + for (int i = 0; i < this->key_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->key(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_OS_RegistryKey*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::MergeFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from) { + GOOGLE_CHECK_NE(&from, this); + value_.MergeFrom(from.value_); + key_.MergeFrom(from.key_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::CopyFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_OS_RegistryKey::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_OS_RegistryKey::Swap(ClientIncidentReport_EnvironmentData_OS_RegistryKey* other) { + if (other != this) { + std::swap(name_, other->name_); + value_.Swap(&other->value_); + key_.Swap(&other->key_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_OS_RegistryKey::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_OS::kOsNameFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS::kOsVersionFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS::kRegistryKeyFieldNumber; +const int ClientIncidentReport_EnvironmentData_OS::kIsEnrolledToDomainFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_OS::ClientIncidentReport_EnvironmentData_OS() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS) +} + +void ClientIncidentReport_EnvironmentData_OS::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_OS::ClientIncidentReport_EnvironmentData_OS(const ClientIncidentReport_EnvironmentData_OS& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS) +} + +void ClientIncidentReport_EnvironmentData_OS::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + os_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + os_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + is_enrolled_to_domain_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_OS::~ClientIncidentReport_EnvironmentData_OS() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_OS::SharedDtor() { + if (os_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete os_name_; + } + if (os_version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete os_version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_OS::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_OS& ClientIncidentReport_EnvironmentData_OS::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_OS* ClientIncidentReport_EnvironmentData_OS::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_OS* ClientIncidentReport_EnvironmentData_OS::New() const { + return new ClientIncidentReport_EnvironmentData_OS; +} + +void ClientIncidentReport_EnvironmentData_OS::Clear() { + if (_has_bits_[0 / 32] & 11) { + if (has_os_name()) { + if (os_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_->clear(); + } + } + if (has_os_version()) { + if (os_version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_->clear(); + } + } + is_enrolled_to_domain_ = false; + } + registry_key_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_OS::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string os_name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_os_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_os_version; + break; + } + + // optional string os_version = 2; + case 2: { + if (tag == 18) { + parse_os_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_os_version())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_registry_key; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey registry_key = 3; + case 3: { + if (tag == 26) { + parse_registry_key: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_registry_key())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_registry_key; + if (input->ExpectTag(32)) goto parse_is_enrolled_to_domain; + break; + } + + // optional bool is_enrolled_to_domain = 4; + case 4: { + if (tag == 32) { + parse_is_enrolled_to_domain: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_enrolled_to_domain_))); + set_has_is_enrolled_to_domain(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_OS::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + // optional string os_name = 1; + if (has_os_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->os_name(), output); + } + + // optional string os_version = 2; + if (has_os_version()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->os_version(), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey registry_key = 3; + for (int i = 0; i < this->registry_key_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->registry_key(i), output); + } + + // optional bool is_enrolled_to_domain = 4; + if (has_is_enrolled_to_domain()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->is_enrolled_to_domain(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.OS) +} + +int ClientIncidentReport_EnvironmentData_OS::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string os_name = 1; + if (has_os_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->os_name()); + } + + // optional string os_version = 2; + if (has_os_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->os_version()); + } + + // optional bool is_enrolled_to_domain = 4; + if (has_is_enrolled_to_domain()) { + total_size += 1 + 1; + } + + } + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey registry_key = 3; + total_size += 1 * this->registry_key_size(); + for (int i = 0; i < this->registry_key_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->registry_key(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_OS::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_OS*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_OS::MergeFrom(const ClientIncidentReport_EnvironmentData_OS& from) { + GOOGLE_CHECK_NE(&from, this); + registry_key_.MergeFrom(from.registry_key_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_os_name()) { + set_os_name(from.os_name()); + } + if (from.has_os_version()) { + set_os_version(from.os_version()); + } + if (from.has_is_enrolled_to_domain()) { + set_is_enrolled_to_domain(from.is_enrolled_to_domain()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_OS::CopyFrom(const ClientIncidentReport_EnvironmentData_OS& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_OS::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_OS::Swap(ClientIncidentReport_EnvironmentData_OS* other) { + if (other != this) { + std::swap(os_name_, other->os_name_); + std::swap(os_version_, other->os_version_); + registry_key_.Swap(&other->registry_key_); + std::swap(is_enrolled_to_domain_, other->is_enrolled_to_domain_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_OS::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.OS"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Machine::kCpuArchitectureFieldNumber; +const int ClientIncidentReport_EnvironmentData_Machine::kCpuVendorFieldNumber; +const int ClientIncidentReport_EnvironmentData_Machine::kCpuidFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Machine::ClientIncidentReport_EnvironmentData_Machine() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) +} + +void ClientIncidentReport_EnvironmentData_Machine::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Machine::ClientIncidentReport_EnvironmentData_Machine(const ClientIncidentReport_EnvironmentData_Machine& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) +} + +void ClientIncidentReport_EnvironmentData_Machine::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + cpu_architecture_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + cpu_vendor_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + cpuid_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Machine::~ClientIncidentReport_EnvironmentData_Machine() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Machine::SharedDtor() { + if (cpu_architecture_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete cpu_architecture_; + } + if (cpu_vendor_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete cpu_vendor_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Machine::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Machine& ClientIncidentReport_EnvironmentData_Machine::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Machine* ClientIncidentReport_EnvironmentData_Machine::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Machine* ClientIncidentReport_EnvironmentData_Machine::New() const { + return new ClientIncidentReport_EnvironmentData_Machine; +} + +void ClientIncidentReport_EnvironmentData_Machine::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_cpu_architecture()) { + if (cpu_architecture_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_->clear(); + } + } + if (has_cpu_vendor()) { + if (cpu_vendor_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_->clear(); + } + } + cpuid_ = 0u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Machine::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string cpu_architecture = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_cpu_architecture())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_cpu_vendor; + break; + } + + // optional string cpu_vendor = 2; + case 2: { + if (tag == 18) { + parse_cpu_vendor: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_cpu_vendor())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_cpuid; + break; + } + + // optional uint32 cpuid = 3; + case 3: { + if (tag == 24) { + parse_cpuid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &cpuid_))); + set_has_cpuid(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Machine::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + // optional string cpu_architecture = 1; + if (has_cpu_architecture()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->cpu_architecture(), output); + } + + // optional string cpu_vendor = 2; + if (has_cpu_vendor()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->cpu_vendor(), output); + } + + // optional uint32 cpuid = 3; + if (has_cpuid()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->cpuid(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) +} + +int ClientIncidentReport_EnvironmentData_Machine::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string cpu_architecture = 1; + if (has_cpu_architecture()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->cpu_architecture()); + } + + // optional string cpu_vendor = 2; + if (has_cpu_vendor()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->cpu_vendor()); + } + + // optional uint32 cpuid = 3; + if (has_cpuid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->cpuid()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Machine::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Machine*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Machine::MergeFrom(const ClientIncidentReport_EnvironmentData_Machine& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_cpu_architecture()) { + set_cpu_architecture(from.cpu_architecture()); + } + if (from.has_cpu_vendor()) { + set_cpu_vendor(from.cpu_vendor()); + } + if (from.has_cpuid()) { + set_cpuid(from.cpuid()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Machine::CopyFrom(const ClientIncidentReport_EnvironmentData_Machine& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Machine::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_Machine::Swap(ClientIncidentReport_EnvironmentData_Machine* other) { + if (other != this) { + std::swap(cpu_architecture_, other->cpu_architecture_); + std::swap(cpu_vendor_, other->cpu_vendor_); + std::swap(cpuid_, other->cpuid_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Machine::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Machine"; +} + + +// ------------------------------------------------------------------- + +bool ClientIncidentReport_EnvironmentData_Process_Channel_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::CHANNEL_UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::CHANNEL_CANARY; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::CHANNEL_DEV; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::CHANNEL_BETA; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::CHANNEL_STABLE; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::Channel_MIN; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::Channel_MAX; +const int ClientIncidentReport_EnvironmentData_Process::Channel_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Process_Patch::kFunctionFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_Patch::kTargetDllFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process_Patch::ClientIncidentReport_EnvironmentData_Process_Patch() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Process_Patch::ClientIncidentReport_EnvironmentData_Process_Patch(const ClientIncidentReport_EnvironmentData_Process_Patch& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + function_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + target_dll_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process_Patch::~ClientIncidentReport_EnvironmentData_Process_Patch() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::SharedDtor() { + if (function_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete function_; + } + if (target_dll_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete target_dll_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process_Patch& ClientIncidentReport_EnvironmentData_Process_Patch::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process_Patch* ClientIncidentReport_EnvironmentData_Process_Patch::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process_Patch* ClientIncidentReport_EnvironmentData_Process_Patch::New() const { + return new ClientIncidentReport_EnvironmentData_Process_Patch; +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_function()) { + if (function_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_->clear(); + } + } + if (has_target_dll()) { + if (target_dll_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process_Patch::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string function = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_function())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_target_dll; + break; + } + + // optional string target_dll = 2; + case 2: { + if (tag == 18) { + parse_target_dll: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_target_dll())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + // optional string function = 1; + if (has_function()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->function(), output); + } + + // optional string target_dll = 2; + if (has_target_dll()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->target_dll(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) +} + +int ClientIncidentReport_EnvironmentData_Process_Patch::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string function = 1; + if (has_function()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->function()); + } + + // optional string target_dll = 2; + if (has_target_dll()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->target_dll()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process_Patch*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::MergeFrom(const ClientIncidentReport_EnvironmentData_Process_Patch& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_function()) { + set_function(from.function()); + } + if (from.has_target_dll()) { + set_target_dll(from.target_dll()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::CopyFrom(const ClientIncidentReport_EnvironmentData_Process_Patch& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process_Patch::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_Process_Patch::Swap(ClientIncidentReport_EnvironmentData_Process_Patch* other) { + if (other != this) { + std::swap(function_, other->function_); + std::swap(target_dll_, other->target_dll_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process_Patch::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process_NetworkProvider::ClientIncidentReport_EnvironmentData_Process_NetworkProvider() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Process_NetworkProvider::ClientIncidentReport_EnvironmentData_Process_NetworkProvider(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process_NetworkProvider::~ClientIncidentReport_EnvironmentData_Process_NetworkProvider() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& ClientIncidentReport_EnvironmentData_Process_NetworkProvider::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process_NetworkProvider* ClientIncidentReport_EnvironmentData_Process_NetworkProvider::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process_NetworkProvider* ClientIncidentReport_EnvironmentData_Process_NetworkProvider::New() const { + return new ClientIncidentReport_EnvironmentData_Process_NetworkProvider; +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::Clear() { + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process_NetworkProvider::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) +} + +int ClientIncidentReport_EnvironmentData_Process_NetworkProvider::ByteSize() const { + int total_size = 0; + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process_NetworkProvider*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::MergeFrom(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from) { + GOOGLE_CHECK_NE(&from, this); + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::CopyFrom(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process_NetworkProvider::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_Process_NetworkProvider::Swap(ClientIncidentReport_EnvironmentData_Process_NetworkProvider* other) { + if (other != this) { + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process_NetworkProvider::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider"; +} + + +// ------------------------------------------------------------------- + +bool ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(int value) { + switch(value) { + case 0: + case 1: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll::UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll::LSP; +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll::Feature_MIN; +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll::Feature_MAX; +const int ClientIncidentReport_EnvironmentData_Process_Dll::Feature_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Process_Dll::kPathFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_Dll::kBaseAddressFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_Dll::kLengthFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_Dll::kFeatureFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_Dll::kImageHeadersFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process_Dll::ClientIncidentReport_EnvironmentData_Process_Dll() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>( + ::safe_browsing::ClientDownloadRequest_ImageHeaders::internal_default_instance()); +#else + image_headers_ = const_cast< ::safe_browsing::ClientDownloadRequest_ImageHeaders*>(&::safe_browsing::ClientDownloadRequest_ImageHeaders::default_instance()); +#endif +} + +ClientIncidentReport_EnvironmentData_Process_Dll::ClientIncidentReport_EnvironmentData_Process_Dll(const ClientIncidentReport_EnvironmentData_Process_Dll& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + base_address_ = GOOGLE_ULONGLONG(0); + length_ = 0u; + image_headers_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process_Dll::~ClientIncidentReport_EnvironmentData_Process_Dll() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::SharedDtor() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete image_headers_; + } +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process_Dll& ClientIncidentReport_EnvironmentData_Process_Dll::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process_Dll* ClientIncidentReport_EnvironmentData_Process_Dll::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process_Dll* ClientIncidentReport_EnvironmentData_Process_Dll::New() const { + return new ClientIncidentReport_EnvironmentData_Process_Dll; +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::Clear() { + if (_has_bits_[0 / 32] & 23) { + if (has_path()) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + } + base_address_ = GOOGLE_ULONGLONG(0); + length_ = 0u; + if (has_image_headers()) { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + } + } + feature_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process_Dll::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string path = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_path())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_base_address; + break; + } + + // optional uint64 base_address = 2; + case 2: { + if (tag == 16) { + parse_base_address: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &base_address_))); + set_has_base_address(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_length; + break; + } + + // optional uint32 length = 3; + case 3: { + if (tag == 24) { + parse_length: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &length_))); + set_has_length(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_feature; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.Feature feature = 4; + case 4: { + if (tag == 32) { + parse_feature: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(value)) { + add_feature(static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else if (tag == 34) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumNoInline( + input, + &::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid, + this->mutable_feature()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_feature; + if (input->ExpectTag(42)) goto parse_image_headers; + break; + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + case 5: { + if (tag == 42) { + parse_image_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_image_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + // optional string path = 1; + if (has_path()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->path(), output); + } + + // optional uint64 base_address = 2; + if (has_base_address()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->base_address(), output); + } + + // optional uint32 length = 3; + if (has_length()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->length(), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.Feature feature = 4; + for (int i = 0; i < this->feature_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->feature(i), output); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + if (has_image_headers()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 5, this->image_headers(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) +} + +int ClientIncidentReport_EnvironmentData_Process_Dll::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string path = 1; + if (has_path()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->path()); + } + + // optional uint64 base_address = 2; + if (has_base_address()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->base_address()); + } + + // optional uint32 length = 3; + if (has_length()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->length()); + } + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + if (has_image_headers()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->image_headers()); + } + + } + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.Feature feature = 4; + { + int data_size = 0; + for (int i = 0; i < this->feature_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->feature(i)); + } + total_size += 1 * this->feature_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process_Dll*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::MergeFrom(const ClientIncidentReport_EnvironmentData_Process_Dll& from) { + GOOGLE_CHECK_NE(&from, this); + feature_.MergeFrom(from.feature_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_path()) { + set_path(from.path()); + } + if (from.has_base_address()) { + set_base_address(from.base_address()); + } + if (from.has_length()) { + set_length(from.length()); + } + if (from.has_image_headers()) { + mutable_image_headers()->::safe_browsing::ClientDownloadRequest_ImageHeaders::MergeFrom(from.image_headers()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::CopyFrom(const ClientIncidentReport_EnvironmentData_Process_Dll& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process_Dll::IsInitialized() const { + + if (has_image_headers()) { + if (!this->image_headers().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_EnvironmentData_Process_Dll::Swap(ClientIncidentReport_EnvironmentData_Process_Dll* other) { + if (other != this) { + std::swap(path_, other->path_); + std::swap(base_address_, other->base_address_); + std::swap(length_, other->length_); + feature_.Swap(&other->feature_); + std::swap(image_headers_, other->image_headers_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process_Dll::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll"; +} + + +// ------------------------------------------------------------------- + +bool ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::MODULE_STATE_UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::MODULE_STATE_UNMODIFIED; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::MODULE_STATE_MODIFIED; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::ModifiedState_MIN; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::ModifiedState_MAX; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState::ModifiedState_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::kFileOffsetFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::kByteCountFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::kModifiedBytesFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::kExportNameFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_offset_ = 0u; + byte_count_ = 0; + modified_bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + export_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::~ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::SharedDtor() { + if (modified_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete modified_bytes_; + } + if (export_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete export_name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::New() const { + return new ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 15) { + ZR_(file_offset_, byte_count_); + if (has_modified_bytes()) { + if (modified_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_->clear(); + } + } + if (has_export_name()) { + if (export_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 file_offset = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &file_offset_))); + set_has_file_offset(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_byte_count; + break; + } + + // optional int32 byte_count = 2; + case 2: { + if (tag == 16) { + parse_byte_count: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &byte_count_))); + set_has_byte_count(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_modified_bytes; + break; + } + + // optional bytes modified_bytes = 3; + case 3: { + if (tag == 26) { + parse_modified_bytes: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_modified_bytes())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_export_name; + break; + } + + // optional string export_name = 4; + case 4: { + if (tag == 34) { + parse_export_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_export_name())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + // optional uint32 file_offset = 1; + if (has_file_offset()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->file_offset(), output); + } + + // optional int32 byte_count = 2; + if (has_byte_count()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->byte_count(), output); + } + + // optional bytes modified_bytes = 3; + if (has_modified_bytes()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->modified_bytes(), output); + } + + // optional string export_name = 4; + if (has_export_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->export_name(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) +} + +int ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 file_offset = 1; + if (has_file_offset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->file_offset()); + } + + // optional int32 byte_count = 2; + if (has_byte_count()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->byte_count()); + } + + // optional bytes modified_bytes = 3; + if (has_modified_bytes()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->modified_bytes()); + } + + // optional string export_name = 4; + if (has_export_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->export_name()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::MergeFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_offset()) { + set_file_offset(from.file_offset()); + } + if (from.has_byte_count()) { + set_byte_count(from.byte_count()); + } + if (from.has_modified_bytes()) { + set_modified_bytes(from.modified_bytes()); + } + if (from.has_export_name()) { + set_export_name(from.export_name()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::CopyFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::Swap(ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* other) { + if (other != this) { + std::swap(file_offset_, other->file_offset_); + std::swap(byte_count_, other->byte_count_); + std::swap(modified_bytes_, other->modified_bytes_); + std::swap(export_name_, other->export_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Process_ModuleState::kNameFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState::kModifiedStateFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState::kOBSOLETEModifiedExportFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState::kModificationFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process_ModuleState::ClientIncidentReport_EnvironmentData_Process_ModuleState() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState::ClientIncidentReport_EnvironmentData_Process_ModuleState(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + modified_state_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState::~ClientIncidentReport_EnvironmentData_Process_ModuleState() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process_ModuleState& ClientIncidentReport_EnvironmentData_Process_ModuleState::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process_ModuleState* ClientIncidentReport_EnvironmentData_Process_ModuleState::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process_ModuleState* ClientIncidentReport_EnvironmentData_Process_ModuleState::New() const { + return new ClientIncidentReport_EnvironmentData_Process_ModuleState; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + modified_state_ = 0; + } + obsolete_modified_export_.Clear(); + modification_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process_ModuleState::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_modified_state; + break; + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.ModifiedState modified_state = 2; + case 2: { + if (tag == 16) { + parse_modified_state: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_IsValid(value)) { + set_modified_state(static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_OBSOLETE_modified_export; + break; + } + + // repeated string OBSOLETE_modified_export = 3; + case 3: { + if (tag == 26) { + parse_OBSOLETE_modified_export: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_obsolete_modified_export())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_OBSOLETE_modified_export; + if (input->ExpectTag(34)) goto parse_modification; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification modification = 4; + case 4: { + if (tag == 34) { + parse_modification: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_modification())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_modification; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.ModifiedState modified_state = 2; + if (has_modified_state()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 2, this->modified_state(), output); + } + + // repeated string OBSOLETE_modified_export = 3; + for (int i = 0; i < this->obsolete_modified_export_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->obsolete_modified_export(i), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification modification = 4; + for (int i = 0; i < this->modification_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->modification(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) +} + +int ClientIncidentReport_EnvironmentData_Process_ModuleState::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.ModifiedState modified_state = 2; + if (has_modified_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->modified_state()); + } + + } + // repeated string OBSOLETE_modified_export = 3; + total_size += 1 * this->obsolete_modified_export_size(); + for (int i = 0; i < this->obsolete_modified_export_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->obsolete_modified_export(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification modification = 4; + total_size += 1 * this->modification_size(); + for (int i = 0; i < this->modification_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->modification(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process_ModuleState*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::MergeFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from) { + GOOGLE_CHECK_NE(&from, this); + obsolete_modified_export_.MergeFrom(from.obsolete_modified_export_); + modification_.MergeFrom(from.modification_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_modified_state()) { + set_modified_state(from.modified_state()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::CopyFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process_ModuleState::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_EnvironmentData_Process_ModuleState::Swap(ClientIncidentReport_EnvironmentData_Process_ModuleState* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(modified_state_, other->modified_state_); + obsolete_modified_export_.Swap(&other->obsolete_modified_export_); + modification_.Swap(&other->modification_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process_ModuleState::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData_Process::kVersionFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kOBSOLETEDllsFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kPatchesFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kNetworkProvidersFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kChromeUpdateChannelFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kUptimeMsecFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kMetricsConsentFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kExtendedConsentFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kDllFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kBlacklistedDllFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kModuleStateFieldNumber; +const int ClientIncidentReport_EnvironmentData_Process::kFieldTrialParticipantFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData_Process::ClientIncidentReport_EnvironmentData_Process() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process) +} + +void ClientIncidentReport_EnvironmentData_Process::InitAsDefaultInstance() { +} + +ClientIncidentReport_EnvironmentData_Process::ClientIncidentReport_EnvironmentData_Process(const ClientIncidentReport_EnvironmentData_Process& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process) +} + +void ClientIncidentReport_EnvironmentData_Process::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + chrome_update_channel_ = 0; + uptime_msec_ = GOOGLE_LONGLONG(0); + metrics_consent_ = false; + extended_consent_ = false; + field_trial_participant_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData_Process::~ClientIncidentReport_EnvironmentData_Process() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData_Process::SharedDtor() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_EnvironmentData_Process::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData_Process& ClientIncidentReport_EnvironmentData_Process::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData_Process* ClientIncidentReport_EnvironmentData_Process::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData_Process* ClientIncidentReport_EnvironmentData_Process::New() const { + return new ClientIncidentReport_EnvironmentData_Process; +} + +void ClientIncidentReport_EnvironmentData_Process::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientIncidentReport_EnvironmentData_Process*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 241) { + ZR_(uptime_msec_, extended_consent_); + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + } + field_trial_participant_ = false; + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + obsolete_dlls_.Clear(); + patches_.Clear(); + network_providers_.Clear(); + dll_.Clear(); + blacklisted_dll_.Clear(); + module_state_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData_Process::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string version = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_OBSOLETE_dlls; + break; + } + + // repeated string OBSOLETE_dlls = 2; + case 2: { + if (tag == 18) { + parse_OBSOLETE_dlls: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_obsolete_dlls())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_OBSOLETE_dlls; + if (input->ExpectTag(26)) goto parse_patches; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch patches = 3; + case 3: { + if (tag == 26) { + parse_patches: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_patches())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_patches; + if (input->ExpectTag(34)) goto parse_network_providers; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider network_providers = 4; + case 4: { + if (tag == 34) { + parse_network_providers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_network_providers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_network_providers; + if (input->ExpectTag(40)) goto parse_chrome_update_channel; + break; + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Channel chrome_update_channel = 5; + case 5: { + if (tag == 40) { + parse_chrome_update_channel: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel_IsValid(value)) { + set_chrome_update_channel(static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_uptime_msec; + break; + } + + // optional int64 uptime_msec = 6; + case 6: { + if (tag == 48) { + parse_uptime_msec: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &uptime_msec_))); + set_has_uptime_msec(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_metrics_consent; + break; + } + + // optional bool metrics_consent = 7; + case 7: { + if (tag == 56) { + parse_metrics_consent: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &metrics_consent_))); + set_has_metrics_consent(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_extended_consent; + break; + } + + // optional bool extended_consent = 8; + case 8: { + if (tag == 64) { + parse_extended_consent: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &extended_consent_))); + set_has_extended_consent(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_dll; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll dll = 9; + case 9: { + if (tag == 74) { + parse_dll: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_dll())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_dll; + if (input->ExpectTag(82)) goto parse_blacklisted_dll; + break; + } + + // repeated string blacklisted_dll = 10; + case 10: { + if (tag == 82) { + parse_blacklisted_dll: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_blacklisted_dll())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_blacklisted_dll; + if (input->ExpectTag(90)) goto parse_module_state; + break; + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState module_state = 11; + case 11: { + if (tag == 90) { + parse_module_state: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_module_state())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_module_state; + if (input->ExpectTag(96)) goto parse_field_trial_participant; + break; + } + + // optional bool field_trial_participant = 12; + case 12: { + if (tag == 96) { + parse_field_trial_participant: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &field_trial_participant_))); + set_has_field_trial_participant(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData_Process::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + // optional string version = 1; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->version(), output); + } + + // repeated string OBSOLETE_dlls = 2; + for (int i = 0; i < this->obsolete_dlls_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 2, this->obsolete_dlls(i), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch patches = 3; + for (int i = 0; i < this->patches_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->patches(i), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider network_providers = 4; + for (int i = 0; i < this->network_providers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->network_providers(i), output); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Channel chrome_update_channel = 5; + if (has_chrome_update_channel()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->chrome_update_channel(), output); + } + + // optional int64 uptime_msec = 6; + if (has_uptime_msec()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(6, this->uptime_msec(), output); + } + + // optional bool metrics_consent = 7; + if (has_metrics_consent()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->metrics_consent(), output); + } + + // optional bool extended_consent = 8; + if (has_extended_consent()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->extended_consent(), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll dll = 9; + for (int i = 0; i < this->dll_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->dll(i), output); + } + + // repeated string blacklisted_dll = 10; + for (int i = 0; i < this->blacklisted_dll_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 10, this->blacklisted_dll(i), output); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState module_state = 11; + for (int i = 0; i < this->module_state_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 11, this->module_state(i), output); + } + + // optional bool field_trial_participant = 12; + if (has_field_trial_participant()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->field_trial_participant(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData.Process) +} + +int ClientIncidentReport_EnvironmentData_Process::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string version = 1; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->version()); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Channel chrome_update_channel = 5; + if (has_chrome_update_channel()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->chrome_update_channel()); + } + + // optional int64 uptime_msec = 6; + if (has_uptime_msec()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->uptime_msec()); + } + + // optional bool metrics_consent = 7; + if (has_metrics_consent()) { + total_size += 1 + 1; + } + + // optional bool extended_consent = 8; + if (has_extended_consent()) { + total_size += 1 + 1; + } + + } + if (_has_bits_[11 / 32] & (0xffu << (11 % 32))) { + // optional bool field_trial_participant = 12; + if (has_field_trial_participant()) { + total_size += 1 + 1; + } + + } + // repeated string OBSOLETE_dlls = 2; + total_size += 1 * this->obsolete_dlls_size(); + for (int i = 0; i < this->obsolete_dlls_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->obsolete_dlls(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch patches = 3; + total_size += 1 * this->patches_size(); + for (int i = 0; i < this->patches_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->patches(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider network_providers = 4; + total_size += 1 * this->network_providers_size(); + for (int i = 0; i < this->network_providers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->network_providers(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll dll = 9; + total_size += 1 * this->dll_size(); + for (int i = 0; i < this->dll_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dll(i)); + } + + // repeated string blacklisted_dll = 10; + total_size += 1 * this->blacklisted_dll_size(); + for (int i = 0; i < this->blacklisted_dll_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->blacklisted_dll(i)); + } + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState module_state = 11; + total_size += 1 * this->module_state_size(); + for (int i = 0; i < this->module_state_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->module_state(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData_Process::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData_Process*>(&from)); +} + +void ClientIncidentReport_EnvironmentData_Process::MergeFrom(const ClientIncidentReport_EnvironmentData_Process& from) { + GOOGLE_CHECK_NE(&from, this); + obsolete_dlls_.MergeFrom(from.obsolete_dlls_); + patches_.MergeFrom(from.patches_); + network_providers_.MergeFrom(from.network_providers_); + dll_.MergeFrom(from.dll_); + blacklisted_dll_.MergeFrom(from.blacklisted_dll_); + module_state_.MergeFrom(from.module_state_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_version()) { + set_version(from.version()); + } + if (from.has_chrome_update_channel()) { + set_chrome_update_channel(from.chrome_update_channel()); + } + if (from.has_uptime_msec()) { + set_uptime_msec(from.uptime_msec()); + } + if (from.has_metrics_consent()) { + set_metrics_consent(from.metrics_consent()); + } + if (from.has_extended_consent()) { + set_extended_consent(from.extended_consent()); + } + } + if (from._has_bits_[11 / 32] & (0xffu << (11 % 32))) { + if (from.has_field_trial_participant()) { + set_field_trial_participant(from.field_trial_participant()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData_Process::CopyFrom(const ClientIncidentReport_EnvironmentData_Process& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData_Process::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->dll())) return false; + return true; +} + +void ClientIncidentReport_EnvironmentData_Process::Swap(ClientIncidentReport_EnvironmentData_Process* other) { + if (other != this) { + std::swap(version_, other->version_); + obsolete_dlls_.Swap(&other->obsolete_dlls_); + patches_.Swap(&other->patches_); + network_providers_.Swap(&other->network_providers_); + std::swap(chrome_update_channel_, other->chrome_update_channel_); + std::swap(uptime_msec_, other->uptime_msec_); + std::swap(metrics_consent_, other->metrics_consent_); + std::swap(extended_consent_, other->extended_consent_); + dll_.Swap(&other->dll_); + blacklisted_dll_.Swap(&other->blacklisted_dll_); + module_state_.Swap(&other->module_state_); + std::swap(field_trial_participant_, other->field_trial_participant_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData_Process::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData.Process"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_EnvironmentData::kOsFieldNumber; +const int ClientIncidentReport_EnvironmentData::kMachineFieldNumber; +const int ClientIncidentReport_EnvironmentData::kProcessFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_EnvironmentData::ClientIncidentReport_EnvironmentData() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.EnvironmentData) +} + +void ClientIncidentReport_EnvironmentData::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + os_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS*>( + ::safe_browsing::ClientIncidentReport_EnvironmentData_OS::internal_default_instance()); +#else + os_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS*>(&::safe_browsing::ClientIncidentReport_EnvironmentData_OS::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + machine_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine*>( + ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine::internal_default_instance()); +#else + machine_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine*>(&::safe_browsing::ClientIncidentReport_EnvironmentData_Machine::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + process_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process*>( + ::safe_browsing::ClientIncidentReport_EnvironmentData_Process::internal_default_instance()); +#else + process_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process*>(&::safe_browsing::ClientIncidentReport_EnvironmentData_Process::default_instance()); +#endif +} + +ClientIncidentReport_EnvironmentData::ClientIncidentReport_EnvironmentData(const ClientIncidentReport_EnvironmentData& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.EnvironmentData) +} + +void ClientIncidentReport_EnvironmentData::SharedCtor() { + _cached_size_ = 0; + os_ = NULL; + machine_ = NULL; + process_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_EnvironmentData::~ClientIncidentReport_EnvironmentData() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.EnvironmentData) + SharedDtor(); +} + +void ClientIncidentReport_EnvironmentData::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete os_; + delete machine_; + delete process_; + } +} + +void ClientIncidentReport_EnvironmentData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_EnvironmentData& ClientIncidentReport_EnvironmentData::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_EnvironmentData* ClientIncidentReport_EnvironmentData::default_instance_ = NULL; + +ClientIncidentReport_EnvironmentData* ClientIncidentReport_EnvironmentData::New() const { + return new ClientIncidentReport_EnvironmentData; +} + +void ClientIncidentReport_EnvironmentData::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_os()) { + if (os_ != NULL) os_->::safe_browsing::ClientIncidentReport_EnvironmentData_OS::Clear(); + } + if (has_machine()) { + if (machine_ != NULL) machine_->::safe_browsing::ClientIncidentReport_EnvironmentData_Machine::Clear(); + } + if (has_process()) { + if (process_ != NULL) process_->::safe_browsing::ClientIncidentReport_EnvironmentData_Process::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_EnvironmentData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.EnvironmentData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.OS os = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_os())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_machine; + break; + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Machine machine = 2; + case 2: { + if (tag == 18) { + parse_machine: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_machine())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_process; + break; + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process process = 3; + case 3: { + if (tag == 26) { + parse_process: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_process())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.EnvironmentData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.EnvironmentData) + return false; +#undef DO_ +} + +void ClientIncidentReport_EnvironmentData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.EnvironmentData) + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.OS os = 1; + if (has_os()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->os(), output); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Machine machine = 2; + if (has_machine()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->machine(), output); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process process = 3; + if (has_process()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->process(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.EnvironmentData) +} + +int ClientIncidentReport_EnvironmentData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.OS os = 1; + if (has_os()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->os()); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Machine machine = 2; + if (has_machine()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->machine()); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process process = 3; + if (has_process()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->process()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_EnvironmentData::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_EnvironmentData*>(&from)); +} + +void ClientIncidentReport_EnvironmentData::MergeFrom(const ClientIncidentReport_EnvironmentData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_os()) { + mutable_os()->::safe_browsing::ClientIncidentReport_EnvironmentData_OS::MergeFrom(from.os()); + } + if (from.has_machine()) { + mutable_machine()->::safe_browsing::ClientIncidentReport_EnvironmentData_Machine::MergeFrom(from.machine()); + } + if (from.has_process()) { + mutable_process()->::safe_browsing::ClientIncidentReport_EnvironmentData_Process::MergeFrom(from.process()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_EnvironmentData::CopyFrom(const ClientIncidentReport_EnvironmentData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_EnvironmentData::IsInitialized() const { + + if (has_process()) { + if (!this->process().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport_EnvironmentData::Swap(ClientIncidentReport_EnvironmentData* other) { + if (other != this) { + std::swap(os_, other->os_); + std::swap(machine_, other->machine_); + std::swap(process_, other->process_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_EnvironmentData::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.EnvironmentData"; +} + + +// ------------------------------------------------------------------- + +bool ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_UNKNOWN; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_ENABLED; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_DISABLED; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_BLACKLISTED; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_BLOCKED; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::STATE_TERMINATED; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::ExtensionState_MIN; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::ExtensionState_MAX; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::ExtensionState_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kIdFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kVersionFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kNameFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kDescriptionFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kStateFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kTypeFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kUpdateUrlFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kHasSignatureValidationFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kSignatureIsValidFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kInstalledByCustodianFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kInstalledByDefaultFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kInstalledByOemFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kFromBookmarkFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kFromWebstoreFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kConvertedFromUserScriptFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kMayBeUntrustedFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kInstallTimeMsecFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kManifestLocationTypeFieldNumber; +const int ClientIncidentReport_ExtensionData_ExtensionInfo::kManifestFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_ExtensionData_ExtensionInfo::ClientIncidentReport_ExtensionData_ExtensionInfo() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::InitAsDefaultInstance() { +} + +ClientIncidentReport_ExtensionData_ExtensionInfo::ClientIncidentReport_ExtensionData_ExtensionInfo(const ClientIncidentReport_ExtensionData_ExtensionInfo& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + state_ = 0; + type_ = 0; + update_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + has_signature_validation_ = false; + signature_is_valid_ = false; + installed_by_custodian_ = false; + installed_by_default_ = false; + installed_by_oem_ = false; + from_bookmark_ = false; + from_webstore_ = false; + converted_from_user_script_ = false; + may_be_untrusted_ = false; + install_time_msec_ = GOOGLE_LONGLONG(0); + manifest_location_type_ = 0; + manifest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_ExtensionData_ExtensionInfo::~ClientIncidentReport_ExtensionData_ExtensionInfo() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + SharedDtor(); +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::SharedDtor() { + if (id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete id_; + } + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete description_; + } + if (update_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete update_url_; + } + if (manifest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete manifest_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_ExtensionData_ExtensionInfo& ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_ExtensionData_ExtensionInfo* ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance_ = NULL; + +ClientIncidentReport_ExtensionData_ExtensionInfo* ClientIncidentReport_ExtensionData_ExtensionInfo::New() const { + return new ClientIncidentReport_ExtensionData_ExtensionInfo; +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientIncidentReport_ExtensionData_ExtensionInfo*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 255) { + ZR_(state_, type_); + if (has_id()) { + if (id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_->clear(); + } + } + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_description()) { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_->clear(); + } + } + if (has_update_url()) { + if (update_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_->clear(); + } + } + has_signature_validation_ = false; + } + if (_has_bits_[8 / 32] & 65280) { + ZR_(signature_is_valid_, converted_from_user_script_); + may_be_untrusted_ = false; + } + if (_has_bits_[16 / 32] & 458752) { + install_time_msec_ = GOOGLE_LONGLONG(0); + manifest_location_type_ = 0; + if (has_manifest()) { + if (manifest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_ExtensionData_ExtensionInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string id = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_id())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_version; + break; + } + + // optional string version = 2; + case 2: { + if (tag == 18) { + parse_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_name; + break; + } + + // optional string name = 3; + case 3: { + if (tag == 26) { + parse_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_description; + break; + } + + // optional string description = 4; + case 4: { + if (tag == 34) { + parse_description: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_description())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_state; + break; + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.ExtensionState state = 5 [default = STATE_UNKNOWN]; + case 5: { + if (tag == 40) { + parse_state: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_IsValid(value)) { + set_state(static_cast< ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_type; + break; + } + + // optional int32 type = 6; + case 6: { + if (tag == 48) { + parse_type: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &type_))); + set_has_type(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_update_url; + break; + } + + // optional string update_url = 7; + case 7: { + if (tag == 58) { + parse_update_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_update_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_has_signature_validation; + break; + } + + // optional bool has_signature_validation = 8; + case 8: { + if (tag == 64) { + parse_has_signature_validation: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &has_signature_validation_))); + set_has_has_signature_validation(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_signature_is_valid; + break; + } + + // optional bool signature_is_valid = 9; + case 9: { + if (tag == 72) { + parse_signature_is_valid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &signature_is_valid_))); + set_has_signature_is_valid(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_installed_by_custodian; + break; + } + + // optional bool installed_by_custodian = 10; + case 10: { + if (tag == 80) { + parse_installed_by_custodian: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &installed_by_custodian_))); + set_has_installed_by_custodian(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_installed_by_default; + break; + } + + // optional bool installed_by_default = 11; + case 11: { + if (tag == 88) { + parse_installed_by_default: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &installed_by_default_))); + set_has_installed_by_default(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(96)) goto parse_installed_by_oem; + break; + } + + // optional bool installed_by_oem = 12; + case 12: { + if (tag == 96) { + parse_installed_by_oem: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &installed_by_oem_))); + set_has_installed_by_oem(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(104)) goto parse_from_bookmark; + break; + } + + // optional bool from_bookmark = 13; + case 13: { + if (tag == 104) { + parse_from_bookmark: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &from_bookmark_))); + set_has_from_bookmark(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(112)) goto parse_from_webstore; + break; + } + + // optional bool from_webstore = 14; + case 14: { + if (tag == 112) { + parse_from_webstore: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &from_webstore_))); + set_has_from_webstore(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(120)) goto parse_converted_from_user_script; + break; + } + + // optional bool converted_from_user_script = 15; + case 15: { + if (tag == 120) { + parse_converted_from_user_script: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &converted_from_user_script_))); + set_has_converted_from_user_script(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_may_be_untrusted; + break; + } + + // optional bool may_be_untrusted = 16; + case 16: { + if (tag == 128) { + parse_may_be_untrusted: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &may_be_untrusted_))); + set_has_may_be_untrusted(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_install_time_msec; + break; + } + + // optional int64 install_time_msec = 17; + case 17: { + if (tag == 136) { + parse_install_time_msec: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &install_time_msec_))); + set_has_install_time_msec(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_manifest_location_type; + break; + } + + // optional int32 manifest_location_type = 18; + case 18: { + if (tag == 144) { + parse_manifest_location_type: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &manifest_location_type_))); + set_has_manifest_location_type(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(154)) goto parse_manifest; + break; + } + + // optional string manifest = 19; + case 19: { + if (tag == 154) { + parse_manifest: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_manifest())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + return false; +#undef DO_ +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + // optional string id = 1; + if (has_id()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->id(), output); + } + + // optional string version = 2; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->version(), output); + } + + // optional string name = 3; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->name(), output); + } + + // optional string description = 4; + if (has_description()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->description(), output); + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.ExtensionState state = 5 [default = STATE_UNKNOWN]; + if (has_state()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->state(), output); + } + + // optional int32 type = 6; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->type(), output); + } + + // optional string update_url = 7; + if (has_update_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->update_url(), output); + } + + // optional bool has_signature_validation = 8; + if (has_has_signature_validation()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->has_signature_validation(), output); + } + + // optional bool signature_is_valid = 9; + if (has_signature_is_valid()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->signature_is_valid(), output); + } + + // optional bool installed_by_custodian = 10; + if (has_installed_by_custodian()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->installed_by_custodian(), output); + } + + // optional bool installed_by_default = 11; + if (has_installed_by_default()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(11, this->installed_by_default(), output); + } + + // optional bool installed_by_oem = 12; + if (has_installed_by_oem()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(12, this->installed_by_oem(), output); + } + + // optional bool from_bookmark = 13; + if (has_from_bookmark()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->from_bookmark(), output); + } + + // optional bool from_webstore = 14; + if (has_from_webstore()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(14, this->from_webstore(), output); + } + + // optional bool converted_from_user_script = 15; + if (has_converted_from_user_script()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(15, this->converted_from_user_script(), output); + } + + // optional bool may_be_untrusted = 16; + if (has_may_be_untrusted()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->may_be_untrusted(), output); + } + + // optional int64 install_time_msec = 17; + if (has_install_time_msec()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(17, this->install_time_msec(), output); + } + + // optional int32 manifest_location_type = 18; + if (has_manifest_location_type()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->manifest_location_type(), output); + } + + // optional string manifest = 19; + if (has_manifest()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 19, this->manifest(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) +} + +int ClientIncidentReport_ExtensionData_ExtensionInfo::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->id()); + } + + // optional string version = 2; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->version()); + } + + // optional string name = 3; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string description = 4; + if (has_description()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->description()); + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.ExtensionState state = 5 [default = STATE_UNKNOWN]; + if (has_state()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->state()); + } + + // optional int32 type = 6; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->type()); + } + + // optional string update_url = 7; + if (has_update_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->update_url()); + } + + // optional bool has_signature_validation = 8; + if (has_has_signature_validation()) { + total_size += 1 + 1; + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // optional bool signature_is_valid = 9; + if (has_signature_is_valid()) { + total_size += 1 + 1; + } + + // optional bool installed_by_custodian = 10; + if (has_installed_by_custodian()) { + total_size += 1 + 1; + } + + // optional bool installed_by_default = 11; + if (has_installed_by_default()) { + total_size += 1 + 1; + } + + // optional bool installed_by_oem = 12; + if (has_installed_by_oem()) { + total_size += 1 + 1; + } + + // optional bool from_bookmark = 13; + if (has_from_bookmark()) { + total_size += 1 + 1; + } + + // optional bool from_webstore = 14; + if (has_from_webstore()) { + total_size += 1 + 1; + } + + // optional bool converted_from_user_script = 15; + if (has_converted_from_user_script()) { + total_size += 1 + 1; + } + + // optional bool may_be_untrusted = 16; + if (has_may_be_untrusted()) { + total_size += 2 + 1; + } + + } + if (_has_bits_[16 / 32] & (0xffu << (16 % 32))) { + // optional int64 install_time_msec = 17; + if (has_install_time_msec()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->install_time_msec()); + } + + // optional int32 manifest_location_type = 18; + if (has_manifest_location_type()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->manifest_location_type()); + } + + // optional string manifest = 19; + if (has_manifest()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->manifest()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_ExtensionData_ExtensionInfo*>(&from)); +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::MergeFrom(const ClientIncidentReport_ExtensionData_ExtensionInfo& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_id()) { + set_id(from.id()); + } + if (from.has_version()) { + set_version(from.version()); + } + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_description()) { + set_description(from.description()); + } + if (from.has_state()) { + set_state(from.state()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_update_url()) { + set_update_url(from.update_url()); + } + if (from.has_has_signature_validation()) { + set_has_signature_validation(from.has_signature_validation()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_signature_is_valid()) { + set_signature_is_valid(from.signature_is_valid()); + } + if (from.has_installed_by_custodian()) { + set_installed_by_custodian(from.installed_by_custodian()); + } + if (from.has_installed_by_default()) { + set_installed_by_default(from.installed_by_default()); + } + if (from.has_installed_by_oem()) { + set_installed_by_oem(from.installed_by_oem()); + } + if (from.has_from_bookmark()) { + set_from_bookmark(from.from_bookmark()); + } + if (from.has_from_webstore()) { + set_from_webstore(from.from_webstore()); + } + if (from.has_converted_from_user_script()) { + set_converted_from_user_script(from.converted_from_user_script()); + } + if (from.has_may_be_untrusted()) { + set_may_be_untrusted(from.may_be_untrusted()); + } + } + if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) { + if (from.has_install_time_msec()) { + set_install_time_msec(from.install_time_msec()); + } + if (from.has_manifest_location_type()) { + set_manifest_location_type(from.manifest_location_type()); + } + if (from.has_manifest()) { + set_manifest(from.manifest()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::CopyFrom(const ClientIncidentReport_ExtensionData_ExtensionInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_ExtensionData_ExtensionInfo::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_ExtensionData_ExtensionInfo::Swap(ClientIncidentReport_ExtensionData_ExtensionInfo* other) { + if (other != this) { + std::swap(id_, other->id_); + std::swap(version_, other->version_); + std::swap(name_, other->name_); + std::swap(description_, other->description_); + std::swap(state_, other->state_); + std::swap(type_, other->type_); + std::swap(update_url_, other->update_url_); + std::swap(has_signature_validation_, other->has_signature_validation_); + std::swap(signature_is_valid_, other->signature_is_valid_); + std::swap(installed_by_custodian_, other->installed_by_custodian_); + std::swap(installed_by_default_, other->installed_by_default_); + std::swap(installed_by_oem_, other->installed_by_oem_); + std::swap(from_bookmark_, other->from_bookmark_); + std::swap(from_webstore_, other->from_webstore_); + std::swap(converted_from_user_script_, other->converted_from_user_script_); + std::swap(may_be_untrusted_, other->may_be_untrusted_); + std::swap(install_time_msec_, other->install_time_msec_); + std::swap(manifest_location_type_, other->manifest_location_type_); + std::swap(manifest_, other->manifest_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_ExtensionData_ExtensionInfo::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_ExtensionData::kLastInstalledExtensionFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_ExtensionData::ClientIncidentReport_ExtensionData() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.ExtensionData) +} + +void ClientIncidentReport_ExtensionData::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + last_installed_extension_ = const_cast< ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo*>( + ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo::internal_default_instance()); +#else + last_installed_extension_ = const_cast< ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo*>(&::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo::default_instance()); +#endif +} + +ClientIncidentReport_ExtensionData::ClientIncidentReport_ExtensionData(const ClientIncidentReport_ExtensionData& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.ExtensionData) +} + +void ClientIncidentReport_ExtensionData::SharedCtor() { + _cached_size_ = 0; + last_installed_extension_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_ExtensionData::~ClientIncidentReport_ExtensionData() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.ExtensionData) + SharedDtor(); +} + +void ClientIncidentReport_ExtensionData::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete last_installed_extension_; + } +} + +void ClientIncidentReport_ExtensionData::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_ExtensionData& ClientIncidentReport_ExtensionData::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_ExtensionData* ClientIncidentReport_ExtensionData::default_instance_ = NULL; + +ClientIncidentReport_ExtensionData* ClientIncidentReport_ExtensionData::New() const { + return new ClientIncidentReport_ExtensionData; +} + +void ClientIncidentReport_ExtensionData::Clear() { + if (has_last_installed_extension()) { + if (last_installed_extension_ != NULL) last_installed_extension_->::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo::Clear(); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_ExtensionData::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.ExtensionData) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo last_installed_extension = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_last_installed_extension())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.ExtensionData) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.ExtensionData) + return false; +#undef DO_ +} + +void ClientIncidentReport_ExtensionData::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.ExtensionData) + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo last_installed_extension = 1; + if (has_last_installed_extension()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->last_installed_extension(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.ExtensionData) +} + +int ClientIncidentReport_ExtensionData::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo last_installed_extension = 1; + if (has_last_installed_extension()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->last_installed_extension()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_ExtensionData::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_ExtensionData*>(&from)); +} + +void ClientIncidentReport_ExtensionData::MergeFrom(const ClientIncidentReport_ExtensionData& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_last_installed_extension()) { + mutable_last_installed_extension()->::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo::MergeFrom(from.last_installed_extension()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_ExtensionData::CopyFrom(const ClientIncidentReport_ExtensionData& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_ExtensionData::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_ExtensionData::Swap(ClientIncidentReport_ExtensionData* other) { + if (other != this) { + std::swap(last_installed_extension_, other->last_installed_extension_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_ExtensionData::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.ExtensionData"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport_NonBinaryDownloadDetails::kFileTypeFieldNumber; +const int ClientIncidentReport_NonBinaryDownloadDetails::kUrlSpecSha256FieldNumber; +const int ClientIncidentReport_NonBinaryDownloadDetails::kHostFieldNumber; +const int ClientIncidentReport_NonBinaryDownloadDetails::kLengthFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport_NonBinaryDownloadDetails::ClientIncidentReport_NonBinaryDownloadDetails() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) +} + +void ClientIncidentReport_NonBinaryDownloadDetails::InitAsDefaultInstance() { +} + +ClientIncidentReport_NonBinaryDownloadDetails::ClientIncidentReport_NonBinaryDownloadDetails(const ClientIncidentReport_NonBinaryDownloadDetails& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) +} + +void ClientIncidentReport_NonBinaryDownloadDetails::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + file_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + url_spec_sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + host_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + length_ = GOOGLE_LONGLONG(0); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport_NonBinaryDownloadDetails::~ClientIncidentReport_NonBinaryDownloadDetails() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + SharedDtor(); +} + +void ClientIncidentReport_NonBinaryDownloadDetails::SharedDtor() { + if (file_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_type_; + } + if (url_spec_sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_spec_sha256_; + } + if (host_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete host_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentReport_NonBinaryDownloadDetails::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport_NonBinaryDownloadDetails& ClientIncidentReport_NonBinaryDownloadDetails::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport_NonBinaryDownloadDetails* ClientIncidentReport_NonBinaryDownloadDetails::default_instance_ = NULL; + +ClientIncidentReport_NonBinaryDownloadDetails* ClientIncidentReport_NonBinaryDownloadDetails::New() const { + return new ClientIncidentReport_NonBinaryDownloadDetails; +} + +void ClientIncidentReport_NonBinaryDownloadDetails::Clear() { + if (_has_bits_[0 / 32] & 15) { + if (has_file_type()) { + if (file_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_->clear(); + } + } + if (has_url_spec_sha256()) { + if (url_spec_sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_->clear(); + } + } + if (has_host()) { + if (host_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_->clear(); + } + } + length_ = GOOGLE_LONGLONG(0); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport_NonBinaryDownloadDetails::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string file_type = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_type())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_url_spec_sha256; + break; + } + + // optional bytes url_spec_sha256 = 2; + case 2: { + if (tag == 18) { + parse_url_spec_sha256: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_url_spec_sha256())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_host; + break; + } + + // optional string host = 3; + case 3: { + if (tag == 26) { + parse_host: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_length; + break; + } + + // optional int64 length = 4; + case 4: { + if (tag == 32) { + parse_length: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &length_))); + set_has_length(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + return false; +#undef DO_ +} + +void ClientIncidentReport_NonBinaryDownloadDetails::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + // optional string file_type = 1; + if (has_file_type()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->file_type(), output); + } + + // optional bytes url_spec_sha256 = 2; + if (has_url_spec_sha256()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->url_spec_sha256(), output); + } + + // optional string host = 3; + if (has_host()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->host(), output); + } + + // optional int64 length = 4; + if (has_length()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->length(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) +} + +int ClientIncidentReport_NonBinaryDownloadDetails::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional string file_type = 1; + if (has_file_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_type()); + } + + // optional bytes url_spec_sha256 = 2; + if (has_url_spec_sha256()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->url_spec_sha256()); + } + + // optional string host = 3; + if (has_host()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host()); + } + + // optional int64 length = 4; + if (has_length()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->length()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport_NonBinaryDownloadDetails::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport_NonBinaryDownloadDetails*>(&from)); +} + +void ClientIncidentReport_NonBinaryDownloadDetails::MergeFrom(const ClientIncidentReport_NonBinaryDownloadDetails& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_file_type()) { + set_file_type(from.file_type()); + } + if (from.has_url_spec_sha256()) { + set_url_spec_sha256(from.url_spec_sha256()); + } + if (from.has_host()) { + set_host(from.host()); + } + if (from.has_length()) { + set_length(from.length()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport_NonBinaryDownloadDetails::CopyFrom(const ClientIncidentReport_NonBinaryDownloadDetails& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport_NonBinaryDownloadDetails::IsInitialized() const { + + return true; +} + +void ClientIncidentReport_NonBinaryDownloadDetails::Swap(ClientIncidentReport_NonBinaryDownloadDetails* other) { + if (other != this) { + std::swap(file_type_, other->file_type_); + std::swap(url_spec_sha256_, other->url_spec_sha256_); + std::swap(host_, other->host_); + std::swap(length_, other->length_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport_NonBinaryDownloadDetails::GetTypeName() const { + return "safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentReport::kIncidentFieldNumber; +const int ClientIncidentReport::kDownloadFieldNumber; +const int ClientIncidentReport::kEnvironmentFieldNumber; +const int ClientIncidentReport::kPopulationFieldNumber; +const int ClientIncidentReport::kExtensionDataFieldNumber; +const int ClientIncidentReport::kNonBinaryDownloadFieldNumber; +#endif // !_MSC_VER + +ClientIncidentReport::ClientIncidentReport() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentReport) +} + +void ClientIncidentReport::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + download_ = const_cast< ::safe_browsing::ClientIncidentReport_DownloadDetails*>( + ::safe_browsing::ClientIncidentReport_DownloadDetails::internal_default_instance()); +#else + download_ = const_cast< ::safe_browsing::ClientIncidentReport_DownloadDetails*>(&::safe_browsing::ClientIncidentReport_DownloadDetails::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + environment_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData*>( + ::safe_browsing::ClientIncidentReport_EnvironmentData::internal_default_instance()); +#else + environment_ = const_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData*>(&::safe_browsing::ClientIncidentReport_EnvironmentData::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>( + ::safe_browsing::ChromeUserPopulation::internal_default_instance()); +#else + population_ = const_cast< ::safe_browsing::ChromeUserPopulation*>(&::safe_browsing::ChromeUserPopulation::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + extension_data_ = const_cast< ::safe_browsing::ClientIncidentReport_ExtensionData*>( + ::safe_browsing::ClientIncidentReport_ExtensionData::internal_default_instance()); +#else + extension_data_ = const_cast< ::safe_browsing::ClientIncidentReport_ExtensionData*>(&::safe_browsing::ClientIncidentReport_ExtensionData::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + non_binary_download_ = const_cast< ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails*>( + ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails::internal_default_instance()); +#else + non_binary_download_ = const_cast< ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails*>(&::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails::default_instance()); +#endif +} + +ClientIncidentReport::ClientIncidentReport(const ClientIncidentReport& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentReport) +} + +void ClientIncidentReport::SharedCtor() { + _cached_size_ = 0; + download_ = NULL; + environment_ = NULL; + population_ = NULL; + extension_data_ = NULL; + non_binary_download_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentReport::~ClientIncidentReport() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentReport) + SharedDtor(); +} + +void ClientIncidentReport::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete download_; + delete environment_; + delete population_; + delete extension_data_; + delete non_binary_download_; + } +} + +void ClientIncidentReport::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentReport& ClientIncidentReport::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentReport* ClientIncidentReport::default_instance_ = NULL; + +ClientIncidentReport* ClientIncidentReport::New() const { + return new ClientIncidentReport; +} + +void ClientIncidentReport::Clear() { + if (_has_bits_[0 / 32] & 62) { + if (has_download()) { + if (download_ != NULL) download_->::safe_browsing::ClientIncidentReport_DownloadDetails::Clear(); + } + if (has_environment()) { + if (environment_ != NULL) environment_->::safe_browsing::ClientIncidentReport_EnvironmentData::Clear(); + } + if (has_population()) { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + } + if (has_extension_data()) { + if (extension_data_ != NULL) extension_data_->::safe_browsing::ClientIncidentReport_ExtensionData::Clear(); + } + if (has_non_binary_download()) { + if (non_binary_download_ != NULL) non_binary_download_->::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails::Clear(); + } + } + incident_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentReport::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentReport) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .safe_browsing.ClientIncidentReport.IncidentData incident = 1; + case 1: { + if (tag == 10) { + parse_incident: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_incident())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_incident; + if (input->ExpectTag(18)) goto parse_download; + break; + } + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + case 2: { + if (tag == 18) { + parse_download: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_download())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_environment; + break; + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData environment = 3; + case 3: { + if (tag == 26) { + parse_environment: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_environment())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_population; + break; + } + + // optional .safe_browsing.ChromeUserPopulation population = 7; + case 7: { + if (tag == 58) { + parse_population: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_population())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_extension_data; + break; + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData extension_data = 8; + case 8: { + if (tag == 66) { + parse_extension_data: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_extension_data())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_non_binary_download; + break; + } + + // optional .safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails non_binary_download = 9; + case 9: { + if (tag == 74) { + parse_non_binary_download: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_non_binary_download())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentReport) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentReport) + return false; +#undef DO_ +} + +void ClientIncidentReport::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentReport) + // repeated .safe_browsing.ClientIncidentReport.IncidentData incident = 1; + for (int i = 0; i < this->incident_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->incident(i), output); + } + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + if (has_download()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->download(), output); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData environment = 3; + if (has_environment()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->environment(), output); + } + + // optional .safe_browsing.ChromeUserPopulation population = 7; + if (has_population()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 7, this->population(), output); + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData extension_data = 8; + if (has_extension_data()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 8, this->extension_data(), output); + } + + // optional .safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails non_binary_download = 9; + if (has_non_binary_download()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 9, this->non_binary_download(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentReport) +} + +int ClientIncidentReport::ByteSize() const { + int total_size = 0; + + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + if (has_download()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->download()); + } + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData environment = 3; + if (has_environment()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->environment()); + } + + // optional .safe_browsing.ChromeUserPopulation population = 7; + if (has_population()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->population()); + } + + // optional .safe_browsing.ClientIncidentReport.ExtensionData extension_data = 8; + if (has_extension_data()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension_data()); + } + + // optional .safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails non_binary_download = 9; + if (has_non_binary_download()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->non_binary_download()); + } + + } + // repeated .safe_browsing.ClientIncidentReport.IncidentData incident = 1; + total_size += 1 * this->incident_size(); + for (int i = 0; i < this->incident_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->incident(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentReport::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentReport*>(&from)); +} + +void ClientIncidentReport::MergeFrom(const ClientIncidentReport& from) { + GOOGLE_CHECK_NE(&from, this); + incident_.MergeFrom(from.incident_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from.has_download()) { + mutable_download()->::safe_browsing::ClientIncidentReport_DownloadDetails::MergeFrom(from.download()); + } + if (from.has_environment()) { + mutable_environment()->::safe_browsing::ClientIncidentReport_EnvironmentData::MergeFrom(from.environment()); + } + if (from.has_population()) { + mutable_population()->::safe_browsing::ChromeUserPopulation::MergeFrom(from.population()); + } + if (from.has_extension_data()) { + mutable_extension_data()->::safe_browsing::ClientIncidentReport_ExtensionData::MergeFrom(from.extension_data()); + } + if (from.has_non_binary_download()) { + mutable_non_binary_download()->::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails::MergeFrom(from.non_binary_download()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentReport::CopyFrom(const ClientIncidentReport& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentReport::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->incident())) return false; + if (has_download()) { + if (!this->download().IsInitialized()) return false; + } + if (has_environment()) { + if (!this->environment().IsInitialized()) return false; + } + return true; +} + +void ClientIncidentReport::Swap(ClientIncidentReport* other) { + if (other != this) { + incident_.Swap(&other->incident_); + std::swap(download_, other->download_); + std::swap(environment_, other->environment_); + std::swap(population_, other->population_); + std::swap(extension_data_, other->extension_data_); + std::swap(non_binary_download_, other->non_binary_download_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentReport::GetTypeName() const { + return "safe_browsing.ClientIncidentReport"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ClientIncidentResponse_EnvironmentRequest::kDllIndexFieldNumber; +#endif // !_MSC_VER + +ClientIncidentResponse_EnvironmentRequest::ClientIncidentResponse_EnvironmentRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentResponse.EnvironmentRequest) +} + +void ClientIncidentResponse_EnvironmentRequest::InitAsDefaultInstance() { +} + +ClientIncidentResponse_EnvironmentRequest::ClientIncidentResponse_EnvironmentRequest(const ClientIncidentResponse_EnvironmentRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentResponse.EnvironmentRequest) +} + +void ClientIncidentResponse_EnvironmentRequest::SharedCtor() { + _cached_size_ = 0; + dll_index_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentResponse_EnvironmentRequest::~ClientIncidentResponse_EnvironmentRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + SharedDtor(); +} + +void ClientIncidentResponse_EnvironmentRequest::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentResponse_EnvironmentRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentResponse_EnvironmentRequest& ClientIncidentResponse_EnvironmentRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentResponse_EnvironmentRequest* ClientIncidentResponse_EnvironmentRequest::default_instance_ = NULL; + +ClientIncidentResponse_EnvironmentRequest* ClientIncidentResponse_EnvironmentRequest::New() const { + return new ClientIncidentResponse_EnvironmentRequest; +} + +void ClientIncidentResponse_EnvironmentRequest::Clear() { + dll_index_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentResponse_EnvironmentRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 dll_index = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &dll_index_))); + set_has_dll_index(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + return false; +#undef DO_ +} + +void ClientIncidentResponse_EnvironmentRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + // optional int32 dll_index = 1; + if (has_dll_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->dll_index(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentResponse.EnvironmentRequest) +} + +int ClientIncidentResponse_EnvironmentRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 dll_index = 1; + if (has_dll_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->dll_index()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentResponse_EnvironmentRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentResponse_EnvironmentRequest*>(&from)); +} + +void ClientIncidentResponse_EnvironmentRequest::MergeFrom(const ClientIncidentResponse_EnvironmentRequest& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_dll_index()) { + set_dll_index(from.dll_index()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentResponse_EnvironmentRequest::CopyFrom(const ClientIncidentResponse_EnvironmentRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentResponse_EnvironmentRequest::IsInitialized() const { + + return true; +} + +void ClientIncidentResponse_EnvironmentRequest::Swap(ClientIncidentResponse_EnvironmentRequest* other) { + if (other != this) { + std::swap(dll_index_, other->dll_index_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentResponse_EnvironmentRequest::GetTypeName() const { + return "safe_browsing.ClientIncidentResponse.EnvironmentRequest"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientIncidentResponse::kTokenFieldNumber; +const int ClientIncidentResponse::kDownloadRequestedFieldNumber; +const int ClientIncidentResponse::kEnvironmentRequestsFieldNumber; +#endif // !_MSC_VER + +ClientIncidentResponse::ClientIncidentResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientIncidentResponse) +} + +void ClientIncidentResponse::InitAsDefaultInstance() { +} + +ClientIncidentResponse::ClientIncidentResponse(const ClientIncidentResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientIncidentResponse) +} + +void ClientIncidentResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + download_requested_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientIncidentResponse::~ClientIncidentResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientIncidentResponse) + SharedDtor(); +} + +void ClientIncidentResponse::SharedDtor() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientIncidentResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientIncidentResponse& ClientIncidentResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientIncidentResponse* ClientIncidentResponse::default_instance_ = NULL; + +ClientIncidentResponse* ClientIncidentResponse::New() const { + return new ClientIncidentResponse; +} + +void ClientIncidentResponse::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_token()) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + } + download_requested_ = false; + } + environment_requests_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientIncidentResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientIncidentResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes token = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_token())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_download_requested; + break; + } + + // optional bool download_requested = 2; + case 2: { + if (tag == 16) { + parse_download_requested: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &download_requested_))); + set_has_download_requested(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_environment_requests; + break; + } + + // repeated .safe_browsing.ClientIncidentResponse.EnvironmentRequest environment_requests = 3; + case 3: { + if (tag == 26) { + parse_environment_requests: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_environment_requests())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_environment_requests; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientIncidentResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientIncidentResponse) + return false; +#undef DO_ +} + +void ClientIncidentResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientIncidentResponse) + // optional bytes token = 1; + if (has_token()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->token(), output); + } + + // optional bool download_requested = 2; + if (has_download_requested()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->download_requested(), output); + } + + // repeated .safe_browsing.ClientIncidentResponse.EnvironmentRequest environment_requests = 3; + for (int i = 0; i < this->environment_requests_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->environment_requests(i), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientIncidentResponse) +} + +int ClientIncidentResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes token = 1; + if (has_token()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->token()); + } + + // optional bool download_requested = 2; + if (has_download_requested()) { + total_size += 1 + 1; + } + + } + // repeated .safe_browsing.ClientIncidentResponse.EnvironmentRequest environment_requests = 3; + total_size += 1 * this->environment_requests_size(); + for (int i = 0; i < this->environment_requests_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->environment_requests(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientIncidentResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientIncidentResponse*>(&from)); +} + +void ClientIncidentResponse::MergeFrom(const ClientIncidentResponse& from) { + GOOGLE_CHECK_NE(&from, this); + environment_requests_.MergeFrom(from.environment_requests_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_token()) { + set_token(from.token()); + } + if (from.has_download_requested()) { + set_download_requested(from.download_requested()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientIncidentResponse::CopyFrom(const ClientIncidentResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientIncidentResponse::IsInitialized() const { + + return true; +} + +void ClientIncidentResponse::Swap(ClientIncidentResponse* other) { + if (other != this) { + std::swap(token_, other->token_); + std::swap(download_requested_, other->download_requested_); + environment_requests_.Swap(&other->environment_requests_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientIncidentResponse::GetTypeName() const { + return "safe_browsing.ClientIncidentResponse"; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DownloadMetadata::kDownloadIdFieldNumber; +const int DownloadMetadata::kDownloadFieldNumber; +#endif // !_MSC_VER + +DownloadMetadata::DownloadMetadata() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.DownloadMetadata) +} + +void DownloadMetadata::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + download_ = const_cast< ::safe_browsing::ClientIncidentReport_DownloadDetails*>( + ::safe_browsing::ClientIncidentReport_DownloadDetails::internal_default_instance()); +#else + download_ = const_cast< ::safe_browsing::ClientIncidentReport_DownloadDetails*>(&::safe_browsing::ClientIncidentReport_DownloadDetails::default_instance()); +#endif +} + +DownloadMetadata::DownloadMetadata(const DownloadMetadata& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.DownloadMetadata) +} + +void DownloadMetadata::SharedCtor() { + _cached_size_ = 0; + download_id_ = 0u; + download_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DownloadMetadata::~DownloadMetadata() { + // @@protoc_insertion_point(destructor:safe_browsing.DownloadMetadata) + SharedDtor(); +} + +void DownloadMetadata::SharedDtor() { + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete download_; + } +} + +void DownloadMetadata::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const DownloadMetadata& DownloadMetadata::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +DownloadMetadata* DownloadMetadata::default_instance_ = NULL; + +DownloadMetadata* DownloadMetadata::New() const { + return new DownloadMetadata; +} + +void DownloadMetadata::Clear() { + if (_has_bits_[0 / 32] & 3) { + download_id_ = 0u; + if (has_download()) { + if (download_ != NULL) download_->::safe_browsing::ClientIncidentReport_DownloadDetails::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool DownloadMetadata::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.DownloadMetadata) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional uint32 download_id = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &download_id_))); + set_has_download_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_download; + break; + } + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + case 2: { + if (tag == 18) { + parse_download: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_download())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.DownloadMetadata) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.DownloadMetadata) + return false; +#undef DO_ +} + +void DownloadMetadata::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.DownloadMetadata) + // optional uint32 download_id = 1; + if (has_download_id()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->download_id(), output); + } + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + if (has_download()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->download(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.DownloadMetadata) +} + +int DownloadMetadata::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional uint32 download_id = 1; + if (has_download_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->download_id()); + } + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + if (has_download()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->download()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DownloadMetadata::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const DownloadMetadata*>(&from)); +} + +void DownloadMetadata::MergeFrom(const DownloadMetadata& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_download_id()) { + set_download_id(from.download_id()); + } + if (from.has_download()) { + mutable_download()->::safe_browsing::ClientIncidentReport_DownloadDetails::MergeFrom(from.download()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void DownloadMetadata::CopyFrom(const DownloadMetadata& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DownloadMetadata::IsInitialized() const { + + if (has_download()) { + if (!this->download().IsInitialized()) return false; + } + return true; +} + +void DownloadMetadata::Swap(DownloadMetadata* other) { + if (other != this) { + std::swap(download_id_, other->download_id_); + std::swap(download_, other->download_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string DownloadMetadata::GetTypeName() const { + return "safe_browsing.DownloadMetadata"; +} + + +// =================================================================== + +bool ClientSafeBrowsingReportRequest_ReportType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 10: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::UNKNOWN; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::URL_PHISHING; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::URL_MALWARE; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::URL_UNWANTED; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::CLIENT_SIDE_PHISHING_URL; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::CLIENT_SIDE_MALWARE_URL; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::DANGEROUS_DOWNLOAD_RECOVERY; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::DANGEROUS_DOWNLOAD_WARNING; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::DANGEROUS_DOWNLOAD_BY_API; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::ReportType_MIN; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::ReportType_MAX; +const int ClientSafeBrowsingReportRequest::ReportType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_HTTPHeader::kNameFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPHeader::kValueFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_HTTPHeader::ClientSafeBrowsingReportRequest_HTTPHeader() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::InitAsDefaultInstance() { +} + +ClientSafeBrowsingReportRequest_HTTPHeader::ClientSafeBrowsingReportRequest_HTTPHeader(const ClientSafeBrowsingReportRequest_HTTPHeader& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_HTTPHeader::~ClientSafeBrowsingReportRequest_HTTPHeader() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::SharedDtor() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete value_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_HTTPHeader& ClientSafeBrowsingReportRequest_HTTPHeader::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPHeader::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPHeader::New() const { + return new ClientSafeBrowsingReportRequest_HTTPHeader; +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::Clear() { + if (_has_bits_[0 / 32] & 3) { + if (has_name()) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + } + if (has_value()) { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_HTTPHeader::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required bytes name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_value; + break; + } + + // optional bytes value = 2; + case 2: { + if (tag == 18) { + parse_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_value())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + // required bytes name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->name(), output); + } + + // optional bytes value = 2; + if (has_value()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->value(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) +} + +int ClientSafeBrowsingReportRequest_HTTPHeader::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required bytes name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->name()); + } + + // optional bytes value = 2; + if (has_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->value()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_HTTPHeader*>(&from)); +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::MergeFrom(const ClientSafeBrowsingReportRequest_HTTPHeader& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_name(from.name()); + } + if (from.has_value()) { + set_value(from.value()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::CopyFrom(const ClientSafeBrowsingReportRequest_HTTPHeader& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_HTTPHeader::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void ClientSafeBrowsingReportRequest_HTTPHeader::Swap(ClientSafeBrowsingReportRequest_HTTPHeader* other) { + if (other != this) { + std::swap(name_, other->name_); + std::swap(value_, other->value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_HTTPHeader::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::kVerbFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::kUriFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::kVersionFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::InitAsDefaultInstance() { +} + +ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + verb_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + uri_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::~ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::SharedDtor() { + if (verb_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete verb_; + } + if (uri_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete uri_; + } + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::New() const { + return new ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::Clear() { + if (_has_bits_[0 / 32] & 7) { + if (has_verb()) { + if (verb_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_->clear(); + } + } + if (has_uri()) { + if (uri_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_->clear(); + } + } + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bytes verb = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_verb())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_uri; + break; + } + + // optional bytes uri = 2; + case 2: { + if (tag == 18) { + parse_uri: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_uri())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_version; + break; + } + + // optional bytes version = 3; + case 3: { + if (tag == 26) { + parse_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + // optional bytes verb = 1; + if (has_verb()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 1, this->verb(), output); + } + + // optional bytes uri = 2; + if (has_uri()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->uri(), output); + } + + // optional bytes version = 3; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->version(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) +} + +int ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional bytes verb = 1; + if (has_verb()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->verb()); + } + + // optional bytes uri = 2; + if (has_uri()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->uri()); + } + + // optional bytes version = 3; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->version()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine*>(&from)); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::MergeFrom(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_verb()) { + set_verb(from.verb()); + } + if (from.has_uri()) { + set_uri(from.uri()); + } + if (from.has_version()) { + set_version(from.version()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::CopyFrom(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::IsInitialized() const { + + return true; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::Swap(ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* other) { + if (other != this) { + std::swap(verb_, other->verb_); + std::swap(uri_, other->uri_); + std::swap(version_, other->version_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_HTTPRequest::kFirstlineFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest::kHeadersFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest::kBodyFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest::kBodydigestFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPRequest::kBodylengthFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_HTTPRequest::ClientSafeBrowsingReportRequest_HTTPRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + firstline_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine*>( + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::internal_default_instance()); +#else + firstline_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine*>(&::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::default_instance()); +#endif +} + +ClientSafeBrowsingReportRequest_HTTPRequest::ClientSafeBrowsingReportRequest_HTTPRequest(const ClientSafeBrowsingReportRequest_HTTPRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + firstline_ = NULL; + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bodylength_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_HTTPRequest::~ClientSafeBrowsingReportRequest_HTTPRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::SharedDtor() { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete body_; + } + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bodydigest_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete firstline_; + } +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_HTTPRequest& ClientSafeBrowsingReportRequest_HTTPRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_HTTPRequest* ClientSafeBrowsingReportRequest_HTTPRequest::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_HTTPRequest* ClientSafeBrowsingReportRequest_HTTPRequest::New() const { + return new ClientSafeBrowsingReportRequest_HTTPRequest; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::Clear() { + if (_has_bits_[0 / 32] & 29) { + if (has_firstline()) { + if (firstline_ != NULL) firstline_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::Clear(); + } + if (has_body()) { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_->clear(); + } + } + if (has_bodydigest()) { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_->clear(); + } + } + bodylength_ = 0; + } + headers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_HTTPRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine firstline = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_firstline())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_headers; + break; + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + case 2: { + if (tag == 18) { + parse_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_headers; + if (input->ExpectTag(26)) goto parse_body; + break; + } + + // optional bytes body = 3; + case 3: { + if (tag == 26) { + parse_body: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_body())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_bodydigest; + break; + } + + // optional bytes bodydigest = 4; + case 4: { + if (tag == 34) { + parse_bodydigest: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_bodydigest())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_bodylength; + break; + } + + // optional int32 bodylength = 5; + case 5: { + if (tag == 40) { + parse_bodylength: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &bodylength_))); + set_has_bodylength(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine firstline = 1; + if (has_firstline()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->firstline(), output); + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + for (int i = 0; i < this->headers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->headers(i), output); + } + + // optional bytes body = 3; + if (has_body()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->body(), output); + } + + // optional bytes bodydigest = 4; + if (has_bodydigest()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->bodydigest(), output); + } + + // optional int32 bodylength = 5; + if (has_bodylength()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->bodylength(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) +} + +int ClientSafeBrowsingReportRequest_HTTPRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine firstline = 1; + if (has_firstline()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->firstline()); + } + + // optional bytes body = 3; + if (has_body()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->body()); + } + + // optional bytes bodydigest = 4; + if (has_bodydigest()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->bodydigest()); + } + + // optional int32 bodylength = 5; + if (has_bodylength()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->bodylength()); + } + + } + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + total_size += 1 * this->headers_size(); + for (int i = 0; i < this->headers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->headers(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_HTTPRequest*>(&from)); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::MergeFrom(const ClientSafeBrowsingReportRequest_HTTPRequest& from) { + GOOGLE_CHECK_NE(&from, this); + headers_.MergeFrom(from.headers_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_firstline()) { + mutable_firstline()->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::MergeFrom(from.firstline()); + } + if (from.has_body()) { + set_body(from.body()); + } + if (from.has_bodydigest()) { + set_bodydigest(from.bodydigest()); + } + if (from.has_bodylength()) { + set_bodylength(from.bodylength()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::CopyFrom(const ClientSafeBrowsingReportRequest_HTTPRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_HTTPRequest::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->headers())) return false; + return true; +} + +void ClientSafeBrowsingReportRequest_HTTPRequest::Swap(ClientSafeBrowsingReportRequest_HTTPRequest* other) { + if (other != this) { + std::swap(firstline_, other->firstline_); + headers_.Swap(&other->headers_); + std::swap(body_, other->body_); + std::swap(bodydigest_, other->bodydigest_); + std::swap(bodylength_, other->bodylength_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_HTTPRequest::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::kCodeFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::kReasonFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::kVersionFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::InitAsDefaultInstance() { +} + +ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + code_ = 0; + reason_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::~ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::SharedDtor() { + if (reason_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete reason_; + } + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::New() const { + return new ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::Clear() { + if (_has_bits_[0 / 32] & 7) { + code_ = 0; + if (has_reason()) { + if (reason_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_->clear(); + } + } + if (has_version()) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 code = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &code_))); + set_has_code(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_reason; + break; + } + + // optional bytes reason = 2; + case 2: { + if (tag == 18) { + parse_reason: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_reason())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_version; + break; + } + + // optional bytes version = 3; + case 3: { + if (tag == 26) { + parse_version: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_version())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + // optional int32 code = 1; + if (has_code()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->code(), output); + } + + // optional bytes reason = 2; + if (has_reason()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 2, this->reason(), output); + } + + // optional bytes version = 3; + if (has_version()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->version(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) +} + +int ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 code = 1; + if (has_code()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->code()); + } + + // optional bytes reason = 2; + if (has_reason()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->reason()); + } + + // optional bytes version = 3; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->version()); + } + + } + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine*>(&from)); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::MergeFrom(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_code()) { + set_code(from.code()); + } + if (from.has_reason()) { + set_reason(from.reason()); + } + if (from.has_version()) { + set_version(from.version()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::CopyFrom(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::IsInitialized() const { + + return true; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::Swap(ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* other) { + if (other != this) { + std::swap(code_, other->code_); + std::swap(reason_, other->reason_); + std::swap(version_, other->version_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_HTTPResponse::kFirstlineFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse::kHeadersFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse::kBodyFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse::kBodydigestFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse::kBodylengthFieldNumber; +const int ClientSafeBrowsingReportRequest_HTTPResponse::kRemoteIpFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_HTTPResponse::ClientSafeBrowsingReportRequest_HTTPResponse() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + firstline_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine*>( + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::internal_default_instance()); +#else + firstline_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine*>(&::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::default_instance()); +#endif +} + +ClientSafeBrowsingReportRequest_HTTPResponse::ClientSafeBrowsingReportRequest_HTTPResponse(const ClientSafeBrowsingReportRequest_HTTPResponse& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + firstline_ = NULL; + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + bodylength_ = 0; + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_HTTPResponse::~ClientSafeBrowsingReportRequest_HTTPResponse() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::SharedDtor() { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete body_; + } + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bodydigest_; + } + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete remote_ip_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete firstline_; + } +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_HTTPResponse& ClientSafeBrowsingReportRequest_HTTPResponse::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_HTTPResponse* ClientSafeBrowsingReportRequest_HTTPResponse::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_HTTPResponse* ClientSafeBrowsingReportRequest_HTTPResponse::New() const { + return new ClientSafeBrowsingReportRequest_HTTPResponse; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::Clear() { + if (_has_bits_[0 / 32] & 61) { + if (has_firstline()) { + if (firstline_ != NULL) firstline_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::Clear(); + } + if (has_body()) { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_->clear(); + } + } + if (has_bodydigest()) { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_->clear(); + } + } + bodylength_ = 0; + if (has_remote_ip()) { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_->clear(); + } + } + } + headers_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_HTTPResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine firstline = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_firstline())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_headers; + break; + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + case 2: { + if (tag == 18) { + parse_headers: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_headers())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_headers; + if (input->ExpectTag(26)) goto parse_body; + break; + } + + // optional bytes body = 3; + case 3: { + if (tag == 26) { + parse_body: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_body())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_bodydigest; + break; + } + + // optional bytes bodydigest = 4; + case 4: { + if (tag == 34) { + parse_bodydigest: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_bodydigest())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_bodylength; + break; + } + + // optional int32 bodylength = 5; + case 5: { + if (tag == 40) { + parse_bodylength: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &bodylength_))); + set_has_bodylength(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_remote_ip; + break; + } + + // optional bytes remote_ip = 6; + case 6: { + if (tag == 50) { + parse_remote_ip: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_remote_ip())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine firstline = 1; + if (has_firstline()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 1, this->firstline(), output); + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + for (int i = 0; i < this->headers_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 2, this->headers(i), output); + } + + // optional bytes body = 3; + if (has_body()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 3, this->body(), output); + } + + // optional bytes bodydigest = 4; + if (has_bodydigest()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 4, this->bodydigest(), output); + } + + // optional int32 bodylength = 5; + if (has_bodylength()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->bodylength(), output); + } + + // optional bytes remote_ip = 6; + if (has_remote_ip()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 6, this->remote_ip(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) +} + +int ClientSafeBrowsingReportRequest_HTTPResponse::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine firstline = 1; + if (has_firstline()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->firstline()); + } + + // optional bytes body = 3; + if (has_body()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->body()); + } + + // optional bytes bodydigest = 4; + if (has_bodydigest()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->bodydigest()); + } + + // optional int32 bodylength = 5; + if (has_bodylength()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->bodylength()); + } + + // optional bytes remote_ip = 6; + if (has_remote_ip()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->remote_ip()); + } + + } + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + total_size += 1 * this->headers_size(); + for (int i = 0; i < this->headers_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->headers(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_HTTPResponse*>(&from)); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::MergeFrom(const ClientSafeBrowsingReportRequest_HTTPResponse& from) { + GOOGLE_CHECK_NE(&from, this); + headers_.MergeFrom(from.headers_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_firstline()) { + mutable_firstline()->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::MergeFrom(from.firstline()); + } + if (from.has_body()) { + set_body(from.body()); + } + if (from.has_bodydigest()) { + set_bodydigest(from.bodydigest()); + } + if (from.has_bodylength()) { + set_bodylength(from.bodylength()); + } + if (from.has_remote_ip()) { + set_remote_ip(from.remote_ip()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::CopyFrom(const ClientSafeBrowsingReportRequest_HTTPResponse& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_HTTPResponse::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->headers())) return false; + return true; +} + +void ClientSafeBrowsingReportRequest_HTTPResponse::Swap(ClientSafeBrowsingReportRequest_HTTPResponse* other) { + if (other != this) { + std::swap(firstline_, other->firstline_); + headers_.Swap(&other->headers_); + std::swap(body_, other->body_); + std::swap(bodydigest_, other->bodydigest_); + std::swap(bodylength_, other->bodylength_); + std::swap(remote_ip_, other->remote_ip_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_HTTPResponse::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest_Resource::kIdFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kUrlFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kRequestFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kResponseFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kParentIdFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kChildIdsFieldNumber; +const int ClientSafeBrowsingReportRequest_Resource::kTagNameFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest_Resource::ClientSafeBrowsingReportRequest_Resource() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest.Resource) +} + +void ClientSafeBrowsingReportRequest_Resource::InitAsDefaultInstance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + request_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest*>( + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest::internal_default_instance()); +#else + request_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest*>(&::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest::default_instance()); +#endif +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + response_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse*>( + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse::internal_default_instance()); +#else + response_ = const_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse*>(&::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse::default_instance()); +#endif +} + +ClientSafeBrowsingReportRequest_Resource::ClientSafeBrowsingReportRequest_Resource(const ClientSafeBrowsingReportRequest_Resource& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest.Resource) +} + +void ClientSafeBrowsingReportRequest_Resource::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + id_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + request_ = NULL; + response_ = NULL; + parent_id_ = 0; + tag_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest_Resource::~ClientSafeBrowsingReportRequest_Resource() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest_Resource::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (tag_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete tag_name_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + delete request_; + delete response_; + } +} + +void ClientSafeBrowsingReportRequest_Resource::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest_Resource& ClientSafeBrowsingReportRequest_Resource::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest_Resource* ClientSafeBrowsingReportRequest_Resource::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest_Resource* ClientSafeBrowsingReportRequest_Resource::New() const { + return new ClientSafeBrowsingReportRequest_Resource; +} + +void ClientSafeBrowsingReportRequest_Resource::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientSafeBrowsingReportRequest_Resource*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 95) { + ZR_(id_, parent_id_); + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_request()) { + if (request_ != NULL) request_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest::Clear(); + } + if (has_response()) { + if (response_ != NULL) response_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse::Clear(); + } + if (has_tag_name()) { + if (tag_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + child_ids_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest_Resource::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required int32 id = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &id_))); + set_has_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_url; + break; + } + + // optional string url = 2; + case 2: { + if (tag == 18) { + parse_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_request; + break; + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest request = 3; + case 3: { + if (tag == 26) { + parse_request: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_request())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_response; + break; + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse response = 4; + case 4: { + if (tag == 34) { + parse_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_response())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_parent_id; + break; + } + + // optional int32 parent_id = 5; + case 5: { + if (tag == 40) { + parse_parent_id: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &parent_id_))); + set_has_parent_id(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_child_ids; + break; + } + + // repeated int32 child_ids = 6; + case 6: { + if (tag == 48) { + parse_child_ids: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 48, input, this->mutable_child_ids()))); + } else if (tag == 50) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_child_ids()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_child_ids; + if (input->ExpectTag(58)) goto parse_tag_name; + break; + } + + // optional string tag_name = 7; + case 7: { + if (tag == 58) { + parse_tag_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_tag_name())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest_Resource::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + // required int32 id = 1; + if (has_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output); + } + + // optional string url = 2; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->url(), output); + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest request = 3; + if (has_request()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 3, this->request(), output); + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse response = 4; + if (has_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->response(), output); + } + + // optional int32 parent_id = 5; + if (has_parent_id()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->parent_id(), output); + } + + // repeated int32 child_ids = 6; + for (int i = 0; i < this->child_ids_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 6, this->child_ids(i), output); + } + + // optional string tag_name = 7; + if (has_tag_name()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->tag_name(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest.Resource) +} + +int ClientSafeBrowsingReportRequest_Resource::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int32 id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->id()); + } + + // optional string url = 2; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest request = 3; + if (has_request()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->request()); + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse response = 4; + if (has_response()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->response()); + } + + // optional int32 parent_id = 5; + if (has_parent_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->parent_id()); + } + + // optional string tag_name = 7; + if (has_tag_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->tag_name()); + } + + } + // repeated int32 child_ids = 6; + { + int data_size = 0; + for (int i = 0; i < this->child_ids_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->child_ids(i)); + } + total_size += 1 * this->child_ids_size() + data_size; + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest_Resource::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest_Resource*>(&from)); +} + +void ClientSafeBrowsingReportRequest_Resource::MergeFrom(const ClientSafeBrowsingReportRequest_Resource& from) { + GOOGLE_CHECK_NE(&from, this); + child_ids_.MergeFrom(from.child_ids_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_id()) { + set_id(from.id()); + } + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_request()) { + mutable_request()->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest::MergeFrom(from.request()); + } + if (from.has_response()) { + mutable_response()->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse::MergeFrom(from.response()); + } + if (from.has_parent_id()) { + set_parent_id(from.parent_id()); + } + if (from.has_tag_name()) { + set_tag_name(from.tag_name()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest_Resource::CopyFrom(const ClientSafeBrowsingReportRequest_Resource& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest_Resource::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + if (has_request()) { + if (!this->request().IsInitialized()) return false; + } + if (has_response()) { + if (!this->response().IsInitialized()) return false; + } + return true; +} + +void ClientSafeBrowsingReportRequest_Resource::Swap(ClientSafeBrowsingReportRequest_Resource* other) { + if (other != this) { + std::swap(id_, other->id_); + std::swap(url_, other->url_); + std::swap(request_, other->request_); + std::swap(response_, other->response_); + std::swap(parent_id_, other->parent_id_); + child_ids_.Swap(&other->child_ids_); + std::swap(tag_name_, other->tag_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest_Resource::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest.Resource"; +} + + +// ------------------------------------------------------------------- + +#ifndef _MSC_VER +const int ClientSafeBrowsingReportRequest::kTypeFieldNumber; +const int ClientSafeBrowsingReportRequest::kDownloadVerdictFieldNumber; +const int ClientSafeBrowsingReportRequest::kUrlFieldNumber; +const int ClientSafeBrowsingReportRequest::kPageUrlFieldNumber; +const int ClientSafeBrowsingReportRequest::kReferrerUrlFieldNumber; +const int ClientSafeBrowsingReportRequest::kResourcesFieldNumber; +const int ClientSafeBrowsingReportRequest::kCompleteFieldNumber; +const int ClientSafeBrowsingReportRequest::kClientAsnFieldNumber; +const int ClientSafeBrowsingReportRequest::kClientCountryFieldNumber; +const int ClientSafeBrowsingReportRequest::kDidProceedFieldNumber; +const int ClientSafeBrowsingReportRequest::kRepeatVisitFieldNumber; +const int ClientSafeBrowsingReportRequest::kTokenFieldNumber; +#endif // !_MSC_VER + +ClientSafeBrowsingReportRequest::ClientSafeBrowsingReportRequest() + : ::google::protobuf::MessageLite() { + SharedCtor(); + // @@protoc_insertion_point(constructor:safe_browsing.ClientSafeBrowsingReportRequest) +} + +void ClientSafeBrowsingReportRequest::InitAsDefaultInstance() { +} + +ClientSafeBrowsingReportRequest::ClientSafeBrowsingReportRequest(const ClientSafeBrowsingReportRequest& from) + : ::google::protobuf::MessageLite() { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:safe_browsing.ClientSafeBrowsingReportRequest) +} + +void ClientSafeBrowsingReportRequest::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + type_ = 0; + download_verdict_ = 0; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + page_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + complete_ = false; + client_country_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + did_proceed_ = false; + repeat_visit_ = false; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ClientSafeBrowsingReportRequest::~ClientSafeBrowsingReportRequest() { + // @@protoc_insertion_point(destructor:safe_browsing.ClientSafeBrowsingReportRequest) + SharedDtor(); +} + +void ClientSafeBrowsingReportRequest::SharedDtor() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (page_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete page_url_; + } + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_url_; + } + if (client_country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete client_country_; + } + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + if (this != &default_instance()) { + #else + if (this != default_instance_) { + #endif + } +} + +void ClientSafeBrowsingReportRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ClientSafeBrowsingReportRequest& ClientSafeBrowsingReportRequest::default_instance() { +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#else + if (default_instance_ == NULL) protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +#endif + return *default_instance_; +} + +ClientSafeBrowsingReportRequest* ClientSafeBrowsingReportRequest::default_instance_ = NULL; + +ClientSafeBrowsingReportRequest* ClientSafeBrowsingReportRequest::New() const { + return new ClientSafeBrowsingReportRequest; +} + +void ClientSafeBrowsingReportRequest::Clear() { +#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>( \ + &reinterpret_cast<ClientSafeBrowsingReportRequest*>(16)->f) - \ + reinterpret_cast<char*>(16)) + +#define ZR_(first, last) do { \ + size_t f = OFFSET_OF_FIELD_(first); \ + size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last); \ + ::memset(&first, 0, n); \ + } while (0) + + if (_has_bits_[0 / 32] & 95) { + ZR_(type_, download_verdict_); + if (has_url()) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + } + if (has_page_url()) { + if (page_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_->clear(); + } + } + if (has_referrer_url()) { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_->clear(); + } + } + complete_ = false; + } + if (_has_bits_[8 / 32] & 3840) { + ZR_(did_proceed_, repeat_visit_); + if (has_client_country()) { + if (client_country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_->clear(); + } + } + if (has_token()) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + } + } + +#undef OFFSET_OF_FIELD_ +#undef ZR_ + + resources_.Clear(); + client_asn_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->clear(); +} + +bool ClientSafeBrowsingReportRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + ::google::protobuf::io::StringOutputStream unknown_fields_string( + mutable_unknown_fields()); + ::google::protobuf::io::CodedOutputStream unknown_fields_stream( + &unknown_fields_string); + // @@protoc_insertion_point(parse_start:safe_browsing.ClientSafeBrowsingReportRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string url = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_page_url; + break; + } + + // optional string page_url = 2; + case 2: { + if (tag == 18) { + parse_page_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_page_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_referrer_url; + break; + } + + // optional string referrer_url = 3; + case 3: { + if (tag == 26) { + parse_referrer_url: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_referrer_url())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_resources; + break; + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.Resource resources = 4; + case 4: { + if (tag == 34) { + parse_resources: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_resources())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_resources; + if (input->ExpectTag(40)) goto parse_complete; + break; + } + + // optional bool complete = 5; + case 5: { + if (tag == 40) { + parse_complete: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &complete_))); + set_has_complete(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_client_asn; + break; + } + + // repeated string client_asn = 6; + case 6: { + if (tag == 50) { + parse_client_asn: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_client_asn())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_client_asn; + if (input->ExpectTag(58)) goto parse_client_country; + break; + } + + // optional string client_country = 7; + case 7: { + if (tag == 58) { + parse_client_country: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_client_country())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(64)) goto parse_did_proceed; + break; + } + + // optional bool did_proceed = 8; + case 8: { + if (tag == 64) { + parse_did_proceed: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &did_proceed_))); + set_has_did_proceed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_repeat_visit; + break; + } + + // optional bool repeat_visit = 9; + case 9: { + if (tag == 72) { + parse_repeat_visit: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &repeat_visit_))); + set_has_repeat_visit(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_type; + break; + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.ReportType type = 10; + case 10: { + if (tag == 80) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientSafeBrowsingReportRequest_ReportType_IsValid(value)) { + set_type(static_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_ReportType >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_download_verdict; + break; + } + + // optional .safe_browsing.ClientDownloadResponse.Verdict download_verdict = 11; + case 11: { + if (tag == 88) { + parse_download_verdict: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value)) { + set_download_verdict(static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(value)); + } else { + unknown_fields_stream.WriteVarint32(tag); + unknown_fields_stream.WriteVarint32(value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(122)) goto parse_token; + break; + } + + // optional bytes token = 15; + case 15: { + if (tag == 122) { + parse_token: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_token())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField( + input, tag, &unknown_fields_stream)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:safe_browsing.ClientSafeBrowsingReportRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:safe_browsing.ClientSafeBrowsingReportRequest) + return false; +#undef DO_ +} + +void ClientSafeBrowsingReportRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:safe_browsing.ClientSafeBrowsingReportRequest) + // optional string url = 1; + if (has_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->url(), output); + } + + // optional string page_url = 2; + if (has_page_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->page_url(), output); + } + + // optional string referrer_url = 3; + if (has_referrer_url()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->referrer_url(), output); + } + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.Resource resources = 4; + for (int i = 0; i < this->resources_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessage( + 4, this->resources(i), output); + } + + // optional bool complete = 5; + if (has_complete()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->complete(), output); + } + + // repeated string client_asn = 6; + for (int i = 0; i < this->client_asn_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteString( + 6, this->client_asn(i), output); + } + + // optional string client_country = 7; + if (has_client_country()) { + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->client_country(), output); + } + + // optional bool did_proceed = 8; + if (has_did_proceed()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(8, this->did_proceed(), output); + } + + // optional bool repeat_visit = 9; + if (has_repeat_visit()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(9, this->repeat_visit(), output); + } + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.ReportType type = 10; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 10, this->type(), output); + } + + // optional .safe_browsing.ClientDownloadResponse.Verdict download_verdict = 11; + if (has_download_verdict()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 11, this->download_verdict(), output); + } + + // optional bytes token = 15; + if (has_token()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 15, this->token(), output); + } + + output->WriteRaw(unknown_fields().data(), + unknown_fields().size()); + // @@protoc_insertion_point(serialize_end:safe_browsing.ClientSafeBrowsingReportRequest) +} + +int ClientSafeBrowsingReportRequest::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .safe_browsing.ClientSafeBrowsingReportRequest.ReportType type = 10; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional .safe_browsing.ClientDownloadResponse.Verdict download_verdict = 11; + if (has_download_verdict()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->download_verdict()); + } + + // optional string url = 1; + if (has_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->url()); + } + + // optional string page_url = 2; + if (has_page_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->page_url()); + } + + // optional string referrer_url = 3; + if (has_referrer_url()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->referrer_url()); + } + + // optional bool complete = 5; + if (has_complete()) { + total_size += 1 + 1; + } + + } + if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) { + // optional string client_country = 7; + if (has_client_country()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->client_country()); + } + + // optional bool did_proceed = 8; + if (has_did_proceed()) { + total_size += 1 + 1; + } + + // optional bool repeat_visit = 9; + if (has_repeat_visit()) { + total_size += 1 + 1; + } + + // optional bytes token = 15; + if (has_token()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->token()); + } + + } + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.Resource resources = 4; + total_size += 1 * this->resources_size(); + for (int i = 0; i < this->resources_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->resources(i)); + } + + // repeated string client_asn = 6; + total_size += 1 * this->client_asn_size(); + for (int i = 0; i < this->client_asn_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->client_asn(i)); + } + + total_size += unknown_fields().size(); + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ClientSafeBrowsingReportRequest::CheckTypeAndMergeFrom( + const ::google::protobuf::MessageLite& from) { + MergeFrom(*::google::protobuf::down_cast<const ClientSafeBrowsingReportRequest*>(&from)); +} + +void ClientSafeBrowsingReportRequest::MergeFrom(const ClientSafeBrowsingReportRequest& from) { + GOOGLE_CHECK_NE(&from, this); + resources_.MergeFrom(from.resources_); + client_asn_.MergeFrom(from.client_asn_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_download_verdict()) { + set_download_verdict(from.download_verdict()); + } + if (from.has_url()) { + set_url(from.url()); + } + if (from.has_page_url()) { + set_page_url(from.page_url()); + } + if (from.has_referrer_url()) { + set_referrer_url(from.referrer_url()); + } + if (from.has_complete()) { + set_complete(from.complete()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_client_country()) { + set_client_country(from.client_country()); + } + if (from.has_did_proceed()) { + set_did_proceed(from.did_proceed()); + } + if (from.has_repeat_visit()) { + set_repeat_visit(from.repeat_visit()); + } + if (from.has_token()) { + set_token(from.token()); + } + } + mutable_unknown_fields()->append(from.unknown_fields()); +} + +void ClientSafeBrowsingReportRequest::CopyFrom(const ClientSafeBrowsingReportRequest& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ClientSafeBrowsingReportRequest::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->resources())) return false; + return true; +} + +void ClientSafeBrowsingReportRequest::Swap(ClientSafeBrowsingReportRequest* other) { + if (other != this) { + std::swap(type_, other->type_); + std::swap(download_verdict_, other->download_verdict_); + std::swap(url_, other->url_); + std::swap(page_url_, other->page_url_); + std::swap(referrer_url_, other->referrer_url_); + resources_.Swap(&other->resources_); + std::swap(complete_, other->complete_); + client_asn_.Swap(&other->client_asn_); + std::swap(client_country_, other->client_country_); + std::swap(did_proceed_, other->did_proceed_); + std::swap(repeat_visit_, other->repeat_visit_); + std::swap(token_, other->token_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.swap(other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::std::string ClientSafeBrowsingReportRequest::GetTypeName() const { + return "safe_browsing.ClientSafeBrowsingReportRequest"; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace safe_browsing + +// @@protoc_insertion_point(global_scope) diff --git a/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.h b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.h new file mode 100644 index 000000000..0ec320b66 --- /dev/null +++ b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.pb.h @@ -0,0 +1,21771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: chromium/chrome/common/safe_browsing/csd.proto + +#ifndef PROTOBUF_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto__INCLUDED +#define PROTOBUF_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto__INCLUDED + +#include <string> + +#include <google/protobuf/stubs/common.h> + +#if GOOGLE_PROTOBUF_VERSION < 2006000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include <google/protobuf/generated_message_util.h> +#include <google/protobuf/message_lite.h> +#include <google/protobuf/repeated_field.h> +#include <google/protobuf/extension_set.h> +// @@protoc_insertion_point(includes) + +namespace safe_browsing { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); +void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + +class ChromeUserPopulation; +class ClientPhishingRequest; +class ClientPhishingRequest_Feature; +class ClientPhishingResponse; +class ClientMalwareRequest; +class ClientMalwareRequest_UrlInfo; +class ClientMalwareResponse; +class ClientDownloadRequest; +class ClientDownloadRequest_Digests; +class ClientDownloadRequest_Resource; +class ClientDownloadRequest_CertificateChain; +class ClientDownloadRequest_CertificateChain_Element; +class ClientDownloadRequest_ExtendedAttr; +class ClientDownloadRequest_SignatureInfo; +class ClientDownloadRequest_PEImageHeaders; +class ClientDownloadRequest_PEImageHeaders_DebugData; +class ClientDownloadRequest_MachOHeaders; +class ClientDownloadRequest_MachOHeaders_LoadCommand; +class ClientDownloadRequest_ImageHeaders; +class ClientDownloadRequest_ArchivedBinary; +class ClientDownloadRequest_URLChainEntry; +class ClientDownloadResponse; +class ClientDownloadResponse_MoreInfo; +class ClientDownloadReport; +class ClientDownloadReport_UserInformation; +class ClientUploadResponse; +class ClientIncidentReport; +class ClientIncidentReport_IncidentData; +class ClientIncidentReport_IncidentData_TrackedPreferenceIncident; +class ClientIncidentReport_IncidentData_BinaryIntegrityIncident; +class ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile; +class ClientIncidentReport_IncidentData_BlacklistLoadIncident; +class ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident; +class ClientIncidentReport_IncidentData_ResourceRequestIncident; +class ClientIncidentReport_IncidentData_SuspiciousModuleIncident; +class ClientIncidentReport_DownloadDetails; +class ClientIncidentReport_EnvironmentData; +class ClientIncidentReport_EnvironmentData_OS; +class ClientIncidentReport_EnvironmentData_OS_RegistryValue; +class ClientIncidentReport_EnvironmentData_OS_RegistryKey; +class ClientIncidentReport_EnvironmentData_Machine; +class ClientIncidentReport_EnvironmentData_Process; +class ClientIncidentReport_EnvironmentData_Process_Patch; +class ClientIncidentReport_EnvironmentData_Process_NetworkProvider; +class ClientIncidentReport_EnvironmentData_Process_Dll; +class ClientIncidentReport_EnvironmentData_Process_ModuleState; +class ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification; +class ClientIncidentReport_ExtensionData; +class ClientIncidentReport_ExtensionData_ExtensionInfo; +class ClientIncidentReport_NonBinaryDownloadDetails; +class ClientIncidentResponse; +class ClientIncidentResponse_EnvironmentRequest; +class DownloadMetadata; +class ClientSafeBrowsingReportRequest; +class ClientSafeBrowsingReportRequest_HTTPHeader; +class ClientSafeBrowsingReportRequest_HTTPRequest; +class ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine; +class ClientSafeBrowsingReportRequest_HTTPResponse; +class ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine; +class ClientSafeBrowsingReportRequest_Resource; + +enum ChromeUserPopulation_UserPopulation { + ChromeUserPopulation_UserPopulation_UNKNOWN_USER_POPULATION = 0, + ChromeUserPopulation_UserPopulation_SAFE_BROWSING = 1, + ChromeUserPopulation_UserPopulation_EXTENDED_REPORTING = 2 +}; +bool ChromeUserPopulation_UserPopulation_IsValid(int value); +const ChromeUserPopulation_UserPopulation ChromeUserPopulation_UserPopulation_UserPopulation_MIN = ChromeUserPopulation_UserPopulation_UNKNOWN_USER_POPULATION; +const ChromeUserPopulation_UserPopulation ChromeUserPopulation_UserPopulation_UserPopulation_MAX = ChromeUserPopulation_UserPopulation_EXTENDED_REPORTING; +const int ChromeUserPopulation_UserPopulation_UserPopulation_ARRAYSIZE = ChromeUserPopulation_UserPopulation_UserPopulation_MAX + 1; + +enum ClientDownloadRequest_URLChainEntry_URLType { + ClientDownloadRequest_URLChainEntry_URLType_DOWNLOAD_URL = 1, + ClientDownloadRequest_URLChainEntry_URLType_DOWNLOAD_REFERRER = 2, + ClientDownloadRequest_URLChainEntry_URLType_LANDING_PAGE = 3, + ClientDownloadRequest_URLChainEntry_URLType_LANDING_REFERRER = 4, + ClientDownloadRequest_URLChainEntry_URLType_CLIENT_REDIRECT = 5, + ClientDownloadRequest_URLChainEntry_URLType_SERVER_REDIRECT = 6 +}; +bool ClientDownloadRequest_URLChainEntry_URLType_IsValid(int value); +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry_URLType_URLType_MIN = ClientDownloadRequest_URLChainEntry_URLType_DOWNLOAD_URL; +const ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry_URLType_URLType_MAX = ClientDownloadRequest_URLChainEntry_URLType_SERVER_REDIRECT; +const int ClientDownloadRequest_URLChainEntry_URLType_URLType_ARRAYSIZE = ClientDownloadRequest_URLChainEntry_URLType_URLType_MAX + 1; + +enum ClientDownloadRequest_ResourceType { + ClientDownloadRequest_ResourceType_DOWNLOAD_URL = 0, + ClientDownloadRequest_ResourceType_DOWNLOAD_REDIRECT = 1, + ClientDownloadRequest_ResourceType_TAB_URL = 2, + ClientDownloadRequest_ResourceType_TAB_REDIRECT = 3, + ClientDownloadRequest_ResourceType_PPAPI_DOCUMENT = 4, + ClientDownloadRequest_ResourceType_PPAPI_PLUGIN = 5 +}; +bool ClientDownloadRequest_ResourceType_IsValid(int value); +const ClientDownloadRequest_ResourceType ClientDownloadRequest_ResourceType_ResourceType_MIN = ClientDownloadRequest_ResourceType_DOWNLOAD_URL; +const ClientDownloadRequest_ResourceType ClientDownloadRequest_ResourceType_ResourceType_MAX = ClientDownloadRequest_ResourceType_PPAPI_PLUGIN; +const int ClientDownloadRequest_ResourceType_ResourceType_ARRAYSIZE = ClientDownloadRequest_ResourceType_ResourceType_MAX + 1; + +enum ClientDownloadRequest_DownloadType { + ClientDownloadRequest_DownloadType_WIN_EXECUTABLE = 0, + ClientDownloadRequest_DownloadType_CHROME_EXTENSION = 1, + ClientDownloadRequest_DownloadType_ANDROID_APK = 2, + ClientDownloadRequest_DownloadType_ZIPPED_EXECUTABLE = 3, + ClientDownloadRequest_DownloadType_MAC_EXECUTABLE = 4, + ClientDownloadRequest_DownloadType_ZIPPED_ARCHIVE = 5, + ClientDownloadRequest_DownloadType_ARCHIVE = 6, + ClientDownloadRequest_DownloadType_INVALID_ZIP = 7, + ClientDownloadRequest_DownloadType_INVALID_MAC_ARCHIVE = 8, + ClientDownloadRequest_DownloadType_PPAPI_SAVE_REQUEST = 9, + ClientDownloadRequest_DownloadType_SAMPLED_UNSUPPORTED_FILE = 10 +}; +bool ClientDownloadRequest_DownloadType_IsValid(int value); +const ClientDownloadRequest_DownloadType ClientDownloadRequest_DownloadType_DownloadType_MIN = ClientDownloadRequest_DownloadType_WIN_EXECUTABLE; +const ClientDownloadRequest_DownloadType ClientDownloadRequest_DownloadType_DownloadType_MAX = ClientDownloadRequest_DownloadType_SAMPLED_UNSUPPORTED_FILE; +const int ClientDownloadRequest_DownloadType_DownloadType_ARRAYSIZE = ClientDownloadRequest_DownloadType_DownloadType_MAX + 1; + +enum ClientDownloadResponse_Verdict { + ClientDownloadResponse_Verdict_SAFE = 0, + ClientDownloadResponse_Verdict_DANGEROUS = 1, + ClientDownloadResponse_Verdict_UNCOMMON = 2, + ClientDownloadResponse_Verdict_POTENTIALLY_UNWANTED = 3, + ClientDownloadResponse_Verdict_DANGEROUS_HOST = 4, + ClientDownloadResponse_Verdict_UNKNOWN = 5 +}; +bool ClientDownloadResponse_Verdict_IsValid(int value); +const ClientDownloadResponse_Verdict ClientDownloadResponse_Verdict_Verdict_MIN = ClientDownloadResponse_Verdict_SAFE; +const ClientDownloadResponse_Verdict ClientDownloadResponse_Verdict_Verdict_MAX = ClientDownloadResponse_Verdict_UNKNOWN; +const int ClientDownloadResponse_Verdict_Verdict_ARRAYSIZE = ClientDownloadResponse_Verdict_Verdict_MAX + 1; + +enum ClientDownloadReport_Reason { + ClientDownloadReport_Reason_SHARE = 0, + ClientDownloadReport_Reason_FALSE_POSITIVE = 1, + ClientDownloadReport_Reason_APPEAL = 2 +}; +bool ClientDownloadReport_Reason_IsValid(int value); +const ClientDownloadReport_Reason ClientDownloadReport_Reason_Reason_MIN = ClientDownloadReport_Reason_SHARE; +const ClientDownloadReport_Reason ClientDownloadReport_Reason_Reason_MAX = ClientDownloadReport_Reason_APPEAL; +const int ClientDownloadReport_Reason_Reason_ARRAYSIZE = ClientDownloadReport_Reason_Reason_MAX + 1; + +enum ClientUploadResponse_UploadStatus { + ClientUploadResponse_UploadStatus_SUCCESS = 0, + ClientUploadResponse_UploadStatus_UPLOAD_FAILURE = 1 +}; +bool ClientUploadResponse_UploadStatus_IsValid(int value); +const ClientUploadResponse_UploadStatus ClientUploadResponse_UploadStatus_UploadStatus_MIN = ClientUploadResponse_UploadStatus_SUCCESS; +const ClientUploadResponse_UploadStatus ClientUploadResponse_UploadStatus_UploadStatus_MAX = ClientUploadResponse_UploadStatus_UPLOAD_FAILURE; +const int ClientUploadResponse_UploadStatus_UploadStatus_ARRAYSIZE = ClientUploadResponse_UploadStatus_UploadStatus_MAX + 1; + +enum ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState { + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNKNOWN = 0, + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CLEARED = 1, + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_WEAK_LEGACY_OBSOLETE = 2, + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CHANGED = 3, + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNTRUSTED_UNKNOWN_VALUE = 4 +}; +bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_IsValid(int value); +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_MIN = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNKNOWN; +const ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_MAX = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNTRUSTED_UNKNOWN_VALUE; +const int ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_ARRAYSIZE = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_MAX + 1; + +enum ClientIncidentReport_IncidentData_ResourceRequestIncident_Type { + ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_UNKNOWN = 0, + ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_TYPE_PATTERN = 3 +}; +bool ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_IsValid(int value); +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_MIN = ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_UNKNOWN; +const ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_MAX = ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_TYPE_PATTERN; +const int ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_ARRAYSIZE = ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_MAX + 1; + +enum ClientIncidentReport_EnvironmentData_Process_Dll_Feature { + ClientIncidentReport_EnvironmentData_Process_Dll_Feature_UNKNOWN = 0, + ClientIncidentReport_EnvironmentData_Process_Dll_Feature_LSP = 1 +}; +bool ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(int value); +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_MIN = ClientIncidentReport_EnvironmentData_Process_Dll_Feature_UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_MAX = ClientIncidentReport_EnvironmentData_Process_Dll_Feature_LSP; +const int ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_ARRAYSIZE = ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_MAX + 1; + +enum ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState { + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_UNKNOWN = 0, + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_UNKNOWN = 1, + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_UNMODIFIED = 2, + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_MODIFIED = 3 +}; +bool ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_IsValid(int value); +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_MIN = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_MAX = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_MODIFIED; +const int ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_ARRAYSIZE = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_MAX + 1; + +enum ClientIncidentReport_EnvironmentData_Process_Channel { + ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_UNKNOWN = 0, + ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_CANARY = 1, + ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_DEV = 2, + ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_BETA = 3, + ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_STABLE = 4 +}; +bool ClientIncidentReport_EnvironmentData_Process_Channel_IsValid(int value); +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process_Channel_Channel_MIN = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_UNKNOWN; +const ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process_Channel_Channel_MAX = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_STABLE; +const int ClientIncidentReport_EnvironmentData_Process_Channel_Channel_ARRAYSIZE = ClientIncidentReport_EnvironmentData_Process_Channel_Channel_MAX + 1; + +enum ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState { + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_UNKNOWN = 0, + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_ENABLED = 1, + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_DISABLED = 2, + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_BLACKLISTED = 3, + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_BLOCKED = 4, + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_TERMINATED = 5 +}; +bool ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_IsValid(int value); +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_MIN = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_UNKNOWN; +const ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_MAX = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_TERMINATED; +const int ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_ARRAYSIZE = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_MAX + 1; + +enum ClientSafeBrowsingReportRequest_ReportType { + ClientSafeBrowsingReportRequest_ReportType_UNKNOWN = 0, + ClientSafeBrowsingReportRequest_ReportType_URL_PHISHING = 1, + ClientSafeBrowsingReportRequest_ReportType_URL_MALWARE = 2, + ClientSafeBrowsingReportRequest_ReportType_URL_UNWANTED = 3, + ClientSafeBrowsingReportRequest_ReportType_CLIENT_SIDE_PHISHING_URL = 4, + ClientSafeBrowsingReportRequest_ReportType_CLIENT_SIDE_MALWARE_URL = 5, + ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_RECOVERY = 6, + ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_WARNING = 7, + ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_BY_API = 10 +}; +bool ClientSafeBrowsingReportRequest_ReportType_IsValid(int value); +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest_ReportType_ReportType_MIN = ClientSafeBrowsingReportRequest_ReportType_UNKNOWN; +const ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest_ReportType_ReportType_MAX = ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_BY_API; +const int ClientSafeBrowsingReportRequest_ReportType_ReportType_ARRAYSIZE = ClientSafeBrowsingReportRequest_ReportType_ReportType_MAX + 1; + +// =================================================================== + +class ChromeUserPopulation : public ::google::protobuf::MessageLite { + public: + ChromeUserPopulation(); + virtual ~ChromeUserPopulation(); + + ChromeUserPopulation(const ChromeUserPopulation& from); + + inline ChromeUserPopulation& operator=(const ChromeUserPopulation& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ChromeUserPopulation& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ChromeUserPopulation* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ChromeUserPopulation* other); + + // implements Message ---------------------------------------------- + + ChromeUserPopulation* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ChromeUserPopulation& from); + void MergeFrom(const ChromeUserPopulation& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ChromeUserPopulation_UserPopulation UserPopulation; + static const UserPopulation UNKNOWN_USER_POPULATION = ChromeUserPopulation_UserPopulation_UNKNOWN_USER_POPULATION; + static const UserPopulation SAFE_BROWSING = ChromeUserPopulation_UserPopulation_SAFE_BROWSING; + static const UserPopulation EXTENDED_REPORTING = ChromeUserPopulation_UserPopulation_EXTENDED_REPORTING; + static inline bool UserPopulation_IsValid(int value) { + return ChromeUserPopulation_UserPopulation_IsValid(value); + } + static const UserPopulation UserPopulation_MIN = + ChromeUserPopulation_UserPopulation_UserPopulation_MIN; + static const UserPopulation UserPopulation_MAX = + ChromeUserPopulation_UserPopulation_UserPopulation_MAX; + static const int UserPopulation_ARRAYSIZE = + ChromeUserPopulation_UserPopulation_UserPopulation_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ChromeUserPopulation.UserPopulation user_population = 1; + inline bool has_user_population() const; + inline void clear_user_population(); + static const int kUserPopulationFieldNumber = 1; + inline ::safe_browsing::ChromeUserPopulation_UserPopulation user_population() const; + inline void set_user_population(::safe_browsing::ChromeUserPopulation_UserPopulation value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ChromeUserPopulation) + private: + inline void set_has_user_population(); + inline void clear_has_user_population(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int user_population_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ChromeUserPopulation* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientPhishingRequest_Feature : public ::google::protobuf::MessageLite { + public: + ClientPhishingRequest_Feature(); + virtual ~ClientPhishingRequest_Feature(); + + ClientPhishingRequest_Feature(const ClientPhishingRequest_Feature& from); + + inline ClientPhishingRequest_Feature& operator=(const ClientPhishingRequest_Feature& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientPhishingRequest_Feature& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientPhishingRequest_Feature* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientPhishingRequest_Feature* other); + + // implements Message ---------------------------------------------- + + ClientPhishingRequest_Feature* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientPhishingRequest_Feature& from); + void MergeFrom(const ClientPhishingRequest_Feature& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // required double value = 2; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline double value() const; + inline void set_value(double value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientPhishingRequest.Feature) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_value(); + inline void clear_has_value(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + double value_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientPhishingRequest_Feature* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientPhishingRequest : public ::google::protobuf::MessageLite { + public: + ClientPhishingRequest(); + virtual ~ClientPhishingRequest(); + + ClientPhishingRequest(const ClientPhishingRequest& from); + + inline ClientPhishingRequest& operator=(const ClientPhishingRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientPhishingRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientPhishingRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientPhishingRequest* other); + + // implements Message ---------------------------------------------- + + ClientPhishingRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientPhishingRequest& from); + void MergeFrom(const ClientPhishingRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientPhishingRequest_Feature Feature; + + // accessors ------------------------------------------------------- + + // optional string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional bytes OBSOLETE_hash_prefix = 10; + inline bool has_obsolete_hash_prefix() const; + inline void clear_obsolete_hash_prefix(); + static const int kOBSOLETEHashPrefixFieldNumber = 10; + inline const ::std::string& obsolete_hash_prefix() const; + inline void set_obsolete_hash_prefix(const ::std::string& value); + inline void set_obsolete_hash_prefix(const char* value); + inline void set_obsolete_hash_prefix(const void* value, size_t size); + inline ::std::string* mutable_obsolete_hash_prefix(); + inline ::std::string* release_obsolete_hash_prefix(); + inline void set_allocated_obsolete_hash_prefix(::std::string* obsolete_hash_prefix); + + // required float client_score = 2; + inline bool has_client_score() const; + inline void clear_client_score(); + static const int kClientScoreFieldNumber = 2; + inline float client_score() const; + inline void set_client_score(float value); + + // optional bool is_phishing = 4; + inline bool has_is_phishing() const; + inline void clear_is_phishing(); + static const int kIsPhishingFieldNumber = 4; + inline bool is_phishing() const; + inline void set_is_phishing(bool value); + + // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5; + inline int feature_map_size() const; + inline void clear_feature_map(); + static const int kFeatureMapFieldNumber = 5; + inline const ::safe_browsing::ClientPhishingRequest_Feature& feature_map(int index) const; + inline ::safe_browsing::ClientPhishingRequest_Feature* mutable_feature_map(int index); + inline ::safe_browsing::ClientPhishingRequest_Feature* add_feature_map(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >& + feature_map() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >* + mutable_feature_map(); + + // optional int32 model_version = 6; + inline bool has_model_version() const; + inline void clear_model_version(); + static const int kModelVersionFieldNumber = 6; + inline ::google::protobuf::int32 model_version() const; + inline void set_model_version(::google::protobuf::int32 value); + + // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8; + inline int non_model_feature_map_size() const; + inline void clear_non_model_feature_map(); + static const int kNonModelFeatureMapFieldNumber = 8; + inline const ::safe_browsing::ClientPhishingRequest_Feature& non_model_feature_map(int index) const; + inline ::safe_browsing::ClientPhishingRequest_Feature* mutable_non_model_feature_map(int index); + inline ::safe_browsing::ClientPhishingRequest_Feature* add_non_model_feature_map(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >& + non_model_feature_map() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >* + mutable_non_model_feature_map(); + + // optional string OBSOLETE_referrer_url = 9; + inline bool has_obsolete_referrer_url() const; + inline void clear_obsolete_referrer_url(); + static const int kOBSOLETEReferrerUrlFieldNumber = 9; + inline const ::std::string& obsolete_referrer_url() const; + inline void set_obsolete_referrer_url(const ::std::string& value); + inline void set_obsolete_referrer_url(const char* value); + inline void set_obsolete_referrer_url(const char* value, size_t size); + inline ::std::string* mutable_obsolete_referrer_url(); + inline ::std::string* release_obsolete_referrer_url(); + inline void set_allocated_obsolete_referrer_url(::std::string* obsolete_referrer_url); + + // repeated uint32 shingle_hashes = 12 [packed = true]; + inline int shingle_hashes_size() const; + inline void clear_shingle_hashes(); + static const int kShingleHashesFieldNumber = 12; + inline ::google::protobuf::uint32 shingle_hashes(int index) const; + inline void set_shingle_hashes(int index, ::google::protobuf::uint32 value); + inline void add_shingle_hashes(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + shingle_hashes() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_shingle_hashes(); + + // optional string model_filename = 13; + inline bool has_model_filename() const; + inline void clear_model_filename(); + static const int kModelFilenameFieldNumber = 13; + inline const ::std::string& model_filename() const; + inline void set_model_filename(const ::std::string& value); + inline void set_model_filename(const char* value); + inline void set_model_filename(const char* value, size_t size); + inline ::std::string* mutable_model_filename(); + inline ::std::string* release_model_filename(); + inline void set_allocated_model_filename(::std::string* model_filename); + + // optional .safe_browsing.ChromeUserPopulation population = 14; + inline bool has_population() const; + inline void clear_population(); + static const int kPopulationFieldNumber = 14; + inline const ::safe_browsing::ChromeUserPopulation& population() const; + inline ::safe_browsing::ChromeUserPopulation* mutable_population(); + inline ::safe_browsing::ChromeUserPopulation* release_population(); + inline void set_allocated_population(::safe_browsing::ChromeUserPopulation* population); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientPhishingRequest) + private: + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_obsolete_hash_prefix(); + inline void clear_has_obsolete_hash_prefix(); + inline void set_has_client_score(); + inline void clear_has_client_score(); + inline void set_has_is_phishing(); + inline void clear_has_is_phishing(); + inline void set_has_model_version(); + inline void clear_has_model_version(); + inline void set_has_obsolete_referrer_url(); + inline void clear_has_obsolete_referrer_url(); + inline void set_has_model_filename(); + inline void clear_has_model_filename(); + inline void set_has_population(); + inline void clear_has_population(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::std::string* obsolete_hash_prefix_; + float client_score_; + bool is_phishing_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature > feature_map_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature > non_model_feature_map_; + ::std::string* obsolete_referrer_url_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > shingle_hashes_; + mutable int _shingle_hashes_cached_byte_size_; + ::std::string* model_filename_; + ::safe_browsing::ChromeUserPopulation* population_; + ::google::protobuf::int32 model_version_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientPhishingRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientPhishingResponse : public ::google::protobuf::MessageLite { + public: + ClientPhishingResponse(); + virtual ~ClientPhishingResponse(); + + ClientPhishingResponse(const ClientPhishingResponse& from); + + inline ClientPhishingResponse& operator=(const ClientPhishingResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientPhishingResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientPhishingResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientPhishingResponse* other); + + // implements Message ---------------------------------------------- + + ClientPhishingResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientPhishingResponse& from); + void MergeFrom(const ClientPhishingResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bool phishy = 1; + inline bool has_phishy() const; + inline void clear_phishy(); + static const int kPhishyFieldNumber = 1; + inline bool phishy() const; + inline void set_phishy(bool value); + + // repeated string OBSOLETE_whitelist_expression = 2; + inline int obsolete_whitelist_expression_size() const; + inline void clear_obsolete_whitelist_expression(); + static const int kOBSOLETEWhitelistExpressionFieldNumber = 2; + inline const ::std::string& obsolete_whitelist_expression(int index) const; + inline ::std::string* mutable_obsolete_whitelist_expression(int index); + inline void set_obsolete_whitelist_expression(int index, const ::std::string& value); + inline void set_obsolete_whitelist_expression(int index, const char* value); + inline void set_obsolete_whitelist_expression(int index, const char* value, size_t size); + inline ::std::string* add_obsolete_whitelist_expression(); + inline void add_obsolete_whitelist_expression(const ::std::string& value); + inline void add_obsolete_whitelist_expression(const char* value); + inline void add_obsolete_whitelist_expression(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& obsolete_whitelist_expression() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_obsolete_whitelist_expression(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientPhishingResponse) + private: + inline void set_has_phishy(); + inline void clear_has_phishy(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::std::string> obsolete_whitelist_expression_; + bool phishy_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientPhishingResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientMalwareRequest_UrlInfo : public ::google::protobuf::MessageLite { + public: + ClientMalwareRequest_UrlInfo(); + virtual ~ClientMalwareRequest_UrlInfo(); + + ClientMalwareRequest_UrlInfo(const ClientMalwareRequest_UrlInfo& from); + + inline ClientMalwareRequest_UrlInfo& operator=(const ClientMalwareRequest_UrlInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientMalwareRequest_UrlInfo& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientMalwareRequest_UrlInfo* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientMalwareRequest_UrlInfo* other); + + // implements Message ---------------------------------------------- + + ClientMalwareRequest_UrlInfo* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientMalwareRequest_UrlInfo& from); + void MergeFrom(const ClientMalwareRequest_UrlInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string ip = 1; + inline bool has_ip() const; + inline void clear_ip(); + static const int kIpFieldNumber = 1; + inline const ::std::string& ip() const; + inline void set_ip(const ::std::string& value); + inline void set_ip(const char* value); + inline void set_ip(const char* value, size_t size); + inline ::std::string* mutable_ip(); + inline ::std::string* release_ip(); + inline void set_allocated_ip(::std::string* ip); + + // required string url = 2; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 2; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional string method = 3; + inline bool has_method() const; + inline void clear_method(); + static const int kMethodFieldNumber = 3; + inline const ::std::string& method() const; + inline void set_method(const ::std::string& value); + inline void set_method(const char* value); + inline void set_method(const char* value, size_t size); + inline ::std::string* mutable_method(); + inline ::std::string* release_method(); + inline void set_allocated_method(::std::string* method); + + // optional string referrer = 4; + inline bool has_referrer() const; + inline void clear_referrer(); + static const int kReferrerFieldNumber = 4; + inline const ::std::string& referrer() const; + inline void set_referrer(const ::std::string& value); + inline void set_referrer(const char* value); + inline void set_referrer(const char* value, size_t size); + inline ::std::string* mutable_referrer(); + inline ::std::string* release_referrer(); + inline void set_allocated_referrer(::std::string* referrer); + + // optional int32 resource_type = 5; + inline bool has_resource_type() const; + inline void clear_resource_type(); + static const int kResourceTypeFieldNumber = 5; + inline ::google::protobuf::int32 resource_type() const; + inline void set_resource_type(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientMalwareRequest.UrlInfo) + private: + inline void set_has_ip(); + inline void clear_has_ip(); + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_method(); + inline void clear_has_method(); + inline void set_has_referrer(); + inline void clear_has_referrer(); + inline void set_has_resource_type(); + inline void clear_has_resource_type(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* ip_; + ::std::string* url_; + ::std::string* method_; + ::std::string* referrer_; + ::google::protobuf::int32 resource_type_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientMalwareRequest_UrlInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientMalwareRequest : public ::google::protobuf::MessageLite { + public: + ClientMalwareRequest(); + virtual ~ClientMalwareRequest(); + + ClientMalwareRequest(const ClientMalwareRequest& from); + + inline ClientMalwareRequest& operator=(const ClientMalwareRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientMalwareRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientMalwareRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientMalwareRequest* other); + + // implements Message ---------------------------------------------- + + ClientMalwareRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientMalwareRequest& from); + void MergeFrom(const ClientMalwareRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientMalwareRequest_UrlInfo UrlInfo; + + // accessors ------------------------------------------------------- + + // required string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional string referrer_url = 4; + inline bool has_referrer_url() const; + inline void clear_referrer_url(); + static const int kReferrerUrlFieldNumber = 4; + inline const ::std::string& referrer_url() const; + inline void set_referrer_url(const ::std::string& value); + inline void set_referrer_url(const char* value); + inline void set_referrer_url(const char* value, size_t size); + inline ::std::string* mutable_referrer_url(); + inline ::std::string* release_referrer_url(); + inline void set_allocated_referrer_url(::std::string* referrer_url); + + // repeated .safe_browsing.ClientMalwareRequest.UrlInfo bad_ip_url_info = 7; + inline int bad_ip_url_info_size() const; + inline void clear_bad_ip_url_info(); + static const int kBadIpUrlInfoFieldNumber = 7; + inline const ::safe_browsing::ClientMalwareRequest_UrlInfo& bad_ip_url_info(int index) const; + inline ::safe_browsing::ClientMalwareRequest_UrlInfo* mutable_bad_ip_url_info(int index); + inline ::safe_browsing::ClientMalwareRequest_UrlInfo* add_bad_ip_url_info(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_UrlInfo >& + bad_ip_url_info() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_UrlInfo >* + mutable_bad_ip_url_info(); + + // optional .safe_browsing.ChromeUserPopulation population = 9; + inline bool has_population() const; + inline void clear_population(); + static const int kPopulationFieldNumber = 9; + inline const ::safe_browsing::ChromeUserPopulation& population() const; + inline ::safe_browsing::ChromeUserPopulation* mutable_population(); + inline ::safe_browsing::ChromeUserPopulation* release_population(); + inline void set_allocated_population(::safe_browsing::ChromeUserPopulation* population); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientMalwareRequest) + private: + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_referrer_url(); + inline void clear_has_referrer_url(); + inline void set_has_population(); + inline void clear_has_population(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::std::string* referrer_url_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_UrlInfo > bad_ip_url_info_; + ::safe_browsing::ChromeUserPopulation* population_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientMalwareRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientMalwareResponse : public ::google::protobuf::MessageLite { + public: + ClientMalwareResponse(); + virtual ~ClientMalwareResponse(); + + ClientMalwareResponse(const ClientMalwareResponse& from); + + inline ClientMalwareResponse& operator=(const ClientMalwareResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientMalwareResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientMalwareResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientMalwareResponse* other); + + // implements Message ---------------------------------------------- + + ClientMalwareResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientMalwareResponse& from); + void MergeFrom(const ClientMalwareResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bool blacklist = 1; + inline bool has_blacklist() const; + inline void clear_blacklist(); + static const int kBlacklistFieldNumber = 1; + inline bool blacklist() const; + inline void set_blacklist(bool value); + + // optional string bad_ip = 2; + inline bool has_bad_ip() const; + inline void clear_bad_ip(); + static const int kBadIpFieldNumber = 2; + inline const ::std::string& bad_ip() const; + inline void set_bad_ip(const ::std::string& value); + inline void set_bad_ip(const char* value); + inline void set_bad_ip(const char* value, size_t size); + inline ::std::string* mutable_bad_ip(); + inline ::std::string* release_bad_ip(); + inline void set_allocated_bad_ip(::std::string* bad_ip); + + // optional string bad_url = 3; + inline bool has_bad_url() const; + inline void clear_bad_url(); + static const int kBadUrlFieldNumber = 3; + inline const ::std::string& bad_url() const; + inline void set_bad_url(const ::std::string& value); + inline void set_bad_url(const char* value); + inline void set_bad_url(const char* value, size_t size); + inline ::std::string* mutable_bad_url(); + inline ::std::string* release_bad_url(); + inline void set_allocated_bad_url(::std::string* bad_url); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientMalwareResponse) + private: + inline void set_has_blacklist(); + inline void clear_has_blacklist(); + inline void set_has_bad_ip(); + inline void clear_has_bad_ip(); + inline void set_has_bad_url(); + inline void clear_has_bad_url(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* bad_ip_; + ::std::string* bad_url_; + bool blacklist_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientMalwareResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_Digests : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_Digests(); + virtual ~ClientDownloadRequest_Digests(); + + ClientDownloadRequest_Digests(const ClientDownloadRequest_Digests& from); + + inline ClientDownloadRequest_Digests& operator=(const ClientDownloadRequest_Digests& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_Digests& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_Digests* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_Digests* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_Digests* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_Digests& from); + void MergeFrom(const ClientDownloadRequest_Digests& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bytes sha256 = 1; + inline bool has_sha256() const; + inline void clear_sha256(); + static const int kSha256FieldNumber = 1; + inline const ::std::string& sha256() const; + inline void set_sha256(const ::std::string& value); + inline void set_sha256(const char* value); + inline void set_sha256(const void* value, size_t size); + inline ::std::string* mutable_sha256(); + inline ::std::string* release_sha256(); + inline void set_allocated_sha256(::std::string* sha256); + + // optional bytes sha1 = 2; + inline bool has_sha1() const; + inline void clear_sha1(); + static const int kSha1FieldNumber = 2; + inline const ::std::string& sha1() const; + inline void set_sha1(const ::std::string& value); + inline void set_sha1(const char* value); + inline void set_sha1(const void* value, size_t size); + inline ::std::string* mutable_sha1(); + inline ::std::string* release_sha1(); + inline void set_allocated_sha1(::std::string* sha1); + + // optional bytes md5 = 3; + inline bool has_md5() const; + inline void clear_md5(); + static const int kMd5FieldNumber = 3; + inline const ::std::string& md5() const; + inline void set_md5(const ::std::string& value); + inline void set_md5(const char* value); + inline void set_md5(const void* value, size_t size); + inline ::std::string* mutable_md5(); + inline ::std::string* release_md5(); + inline void set_allocated_md5(::std::string* md5); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.Digests) + private: + inline void set_has_sha256(); + inline void clear_has_sha256(); + inline void set_has_sha1(); + inline void clear_has_sha1(); + inline void set_has_md5(); + inline void clear_has_md5(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* sha256_; + ::std::string* sha1_; + ::std::string* md5_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_Digests* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_Resource : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_Resource(); + virtual ~ClientDownloadRequest_Resource(); + + ClientDownloadRequest_Resource(const ClientDownloadRequest_Resource& from); + + inline ClientDownloadRequest_Resource& operator=(const ClientDownloadRequest_Resource& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_Resource& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_Resource* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_Resource* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_Resource* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_Resource& from); + void MergeFrom(const ClientDownloadRequest_Resource& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline ::safe_browsing::ClientDownloadRequest_ResourceType type() const; + inline void set_type(::safe_browsing::ClientDownloadRequest_ResourceType value); + + // optional bytes remote_ip = 3; + inline bool has_remote_ip() const; + inline void clear_remote_ip(); + static const int kRemoteIpFieldNumber = 3; + inline const ::std::string& remote_ip() const; + inline void set_remote_ip(const ::std::string& value); + inline void set_remote_ip(const char* value); + inline void set_remote_ip(const void* value, size_t size); + inline ::std::string* mutable_remote_ip(); + inline ::std::string* release_remote_ip(); + inline void set_allocated_remote_ip(::std::string* remote_ip); + + // optional string referrer = 4; + inline bool has_referrer() const; + inline void clear_referrer(); + static const int kReferrerFieldNumber = 4; + inline const ::std::string& referrer() const; + inline void set_referrer(const ::std::string& value); + inline void set_referrer(const char* value); + inline void set_referrer(const char* value, size_t size); + inline ::std::string* mutable_referrer(); + inline ::std::string* release_referrer(); + inline void set_allocated_referrer(::std::string* referrer); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.Resource) + private: + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_remote_ip(); + inline void clear_has_remote_ip(); + inline void set_has_referrer(); + inline void clear_has_referrer(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::std::string* remote_ip_; + ::std::string* referrer_; + int type_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_Resource* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_CertificateChain_Element : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_CertificateChain_Element(); + virtual ~ClientDownloadRequest_CertificateChain_Element(); + + ClientDownloadRequest_CertificateChain_Element(const ClientDownloadRequest_CertificateChain_Element& from); + + inline ClientDownloadRequest_CertificateChain_Element& operator=(const ClientDownloadRequest_CertificateChain_Element& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_CertificateChain_Element& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_CertificateChain_Element* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_CertificateChain_Element* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_CertificateChain_Element* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_CertificateChain_Element& from); + void MergeFrom(const ClientDownloadRequest_CertificateChain_Element& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bytes certificate = 1; + inline bool has_certificate() const; + inline void clear_certificate(); + static const int kCertificateFieldNumber = 1; + inline const ::std::string& certificate() const; + inline void set_certificate(const ::std::string& value); + inline void set_certificate(const char* value); + inline void set_certificate(const void* value, size_t size); + inline ::std::string* mutable_certificate(); + inline ::std::string* release_certificate(); + inline void set_allocated_certificate(::std::string* certificate); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.CertificateChain.Element) + private: + inline void set_has_certificate(); + inline void clear_has_certificate(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* certificate_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_CertificateChain_Element* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_CertificateChain : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_CertificateChain(); + virtual ~ClientDownloadRequest_CertificateChain(); + + ClientDownloadRequest_CertificateChain(const ClientDownloadRequest_CertificateChain& from); + + inline ClientDownloadRequest_CertificateChain& operator=(const ClientDownloadRequest_CertificateChain& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_CertificateChain& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_CertificateChain* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_CertificateChain* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_CertificateChain* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_CertificateChain& from); + void MergeFrom(const ClientDownloadRequest_CertificateChain& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadRequest_CertificateChain_Element Element; + + // accessors ------------------------------------------------------- + + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1; + inline int element_size() const; + inline void clear_element(); + static const int kElementFieldNumber = 1; + inline const ::safe_browsing::ClientDownloadRequest_CertificateChain_Element& element(int index) const; + inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* mutable_element(int index); + inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* add_element(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >& + element() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >* + mutable_element(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.CertificateChain) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element > element_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_CertificateChain* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_ExtendedAttr : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_ExtendedAttr(); + virtual ~ClientDownloadRequest_ExtendedAttr(); + + ClientDownloadRequest_ExtendedAttr(const ClientDownloadRequest_ExtendedAttr& from); + + inline ClientDownloadRequest_ExtendedAttr& operator=(const ClientDownloadRequest_ExtendedAttr& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_ExtendedAttr& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_ExtendedAttr* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_ExtendedAttr* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_ExtendedAttr* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_ExtendedAttr& from); + void MergeFrom(const ClientDownloadRequest_ExtendedAttr& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string key = 1; + inline bool has_key() const; + inline void clear_key(); + static const int kKeyFieldNumber = 1; + inline const ::std::string& key() const; + inline void set_key(const ::std::string& value); + inline void set_key(const char* value); + inline void set_key(const char* value, size_t size); + inline ::std::string* mutable_key(); + inline ::std::string* release_key(); + inline void set_allocated_key(::std::string* key); + + // optional bytes value = 2; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline const ::std::string& value() const; + inline void set_value(const ::std::string& value); + inline void set_value(const char* value); + inline void set_value(const void* value, size_t size); + inline ::std::string* mutable_value(); + inline ::std::string* release_value(); + inline void set_allocated_value(::std::string* value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.ExtendedAttr) + private: + inline void set_has_key(); + inline void clear_has_key(); + inline void set_has_value(); + inline void clear_has_value(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* key_; + ::std::string* value_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_ExtendedAttr* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_SignatureInfo : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_SignatureInfo(); + virtual ~ClientDownloadRequest_SignatureInfo(); + + ClientDownloadRequest_SignatureInfo(const ClientDownloadRequest_SignatureInfo& from); + + inline ClientDownloadRequest_SignatureInfo& operator=(const ClientDownloadRequest_SignatureInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_SignatureInfo& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_SignatureInfo* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_SignatureInfo* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_SignatureInfo* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_SignatureInfo& from); + void MergeFrom(const ClientDownloadRequest_SignatureInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1; + inline int certificate_chain_size() const; + inline void clear_certificate_chain(); + static const int kCertificateChainFieldNumber = 1; + inline const ::safe_browsing::ClientDownloadRequest_CertificateChain& certificate_chain(int index) const; + inline ::safe_browsing::ClientDownloadRequest_CertificateChain* mutable_certificate_chain(int index); + inline ::safe_browsing::ClientDownloadRequest_CertificateChain* add_certificate_chain(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >& + certificate_chain() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >* + mutable_certificate_chain(); + + // optional bool trusted = 2; + inline bool has_trusted() const; + inline void clear_trusted(); + static const int kTrustedFieldNumber = 2; + inline bool trusted() const; + inline void set_trusted(bool value); + + // repeated bytes signed_data = 3; + inline int signed_data_size() const; + inline void clear_signed_data(); + static const int kSignedDataFieldNumber = 3; + inline const ::std::string& signed_data(int index) const; + inline ::std::string* mutable_signed_data(int index); + inline void set_signed_data(int index, const ::std::string& value); + inline void set_signed_data(int index, const char* value); + inline void set_signed_data(int index, const void* value, size_t size); + inline ::std::string* add_signed_data(); + inline void add_signed_data(const ::std::string& value); + inline void add_signed_data(const char* value); + inline void add_signed_data(const void* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& signed_data() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_signed_data(); + + // repeated .safe_browsing.ClientDownloadRequest.ExtendedAttr xattr = 4; + inline int xattr_size() const; + inline void clear_xattr(); + static const int kXattrFieldNumber = 4; + inline const ::safe_browsing::ClientDownloadRequest_ExtendedAttr& xattr(int index) const; + inline ::safe_browsing::ClientDownloadRequest_ExtendedAttr* mutable_xattr(int index); + inline ::safe_browsing::ClientDownloadRequest_ExtendedAttr* add_xattr(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ExtendedAttr >& + xattr() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ExtendedAttr >* + mutable_xattr(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.SignatureInfo) + private: + inline void set_has_trusted(); + inline void clear_has_trusted(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain > certificate_chain_; + ::google::protobuf::RepeatedPtrField< ::std::string> signed_data_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ExtendedAttr > xattr_; + bool trusted_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_SignatureInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_PEImageHeaders_DebugData : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_PEImageHeaders_DebugData(); + virtual ~ClientDownloadRequest_PEImageHeaders_DebugData(); + + ClientDownloadRequest_PEImageHeaders_DebugData(const ClientDownloadRequest_PEImageHeaders_DebugData& from); + + inline ClientDownloadRequest_PEImageHeaders_DebugData& operator=(const ClientDownloadRequest_PEImageHeaders_DebugData& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_PEImageHeaders_DebugData& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_PEImageHeaders_DebugData* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_PEImageHeaders_DebugData* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_PEImageHeaders_DebugData* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_PEImageHeaders_DebugData& from); + void MergeFrom(const ClientDownloadRequest_PEImageHeaders_DebugData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bytes directory_entry = 1; + inline bool has_directory_entry() const; + inline void clear_directory_entry(); + static const int kDirectoryEntryFieldNumber = 1; + inline const ::std::string& directory_entry() const; + inline void set_directory_entry(const ::std::string& value); + inline void set_directory_entry(const char* value); + inline void set_directory_entry(const void* value, size_t size); + inline ::std::string* mutable_directory_entry(); + inline ::std::string* release_directory_entry(); + inline void set_allocated_directory_entry(::std::string* directory_entry); + + // optional bytes raw_data = 2; + inline bool has_raw_data() const; + inline void clear_raw_data(); + static const int kRawDataFieldNumber = 2; + inline const ::std::string& raw_data() const; + inline void set_raw_data(const ::std::string& value); + inline void set_raw_data(const char* value); + inline void set_raw_data(const void* value, size_t size); + inline ::std::string* mutable_raw_data(); + inline ::std::string* release_raw_data(); + inline void set_allocated_raw_data(::std::string* raw_data); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData) + private: + inline void set_has_directory_entry(); + inline void clear_has_directory_entry(); + inline void set_has_raw_data(); + inline void clear_has_raw_data(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* directory_entry_; + ::std::string* raw_data_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_PEImageHeaders_DebugData* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_PEImageHeaders : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_PEImageHeaders(); + virtual ~ClientDownloadRequest_PEImageHeaders(); + + ClientDownloadRequest_PEImageHeaders(const ClientDownloadRequest_PEImageHeaders& from); + + inline ClientDownloadRequest_PEImageHeaders& operator=(const ClientDownloadRequest_PEImageHeaders& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_PEImageHeaders& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_PEImageHeaders* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_PEImageHeaders* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_PEImageHeaders* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_PEImageHeaders& from); + void MergeFrom(const ClientDownloadRequest_PEImageHeaders& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadRequest_PEImageHeaders_DebugData DebugData; + + // accessors ------------------------------------------------------- + + // optional bytes dos_header = 1; + inline bool has_dos_header() const; + inline void clear_dos_header(); + static const int kDosHeaderFieldNumber = 1; + inline const ::std::string& dos_header() const; + inline void set_dos_header(const ::std::string& value); + inline void set_dos_header(const char* value); + inline void set_dos_header(const void* value, size_t size); + inline ::std::string* mutable_dos_header(); + inline ::std::string* release_dos_header(); + inline void set_allocated_dos_header(::std::string* dos_header); + + // optional bytes file_header = 2; + inline bool has_file_header() const; + inline void clear_file_header(); + static const int kFileHeaderFieldNumber = 2; + inline const ::std::string& file_header() const; + inline void set_file_header(const ::std::string& value); + inline void set_file_header(const char* value); + inline void set_file_header(const void* value, size_t size); + inline ::std::string* mutable_file_header(); + inline ::std::string* release_file_header(); + inline void set_allocated_file_header(::std::string* file_header); + + // optional bytes optional_headers32 = 3; + inline bool has_optional_headers32() const; + inline void clear_optional_headers32(); + static const int kOptionalHeaders32FieldNumber = 3; + inline const ::std::string& optional_headers32() const; + inline void set_optional_headers32(const ::std::string& value); + inline void set_optional_headers32(const char* value); + inline void set_optional_headers32(const void* value, size_t size); + inline ::std::string* mutable_optional_headers32(); + inline ::std::string* release_optional_headers32(); + inline void set_allocated_optional_headers32(::std::string* optional_headers32); + + // optional bytes optional_headers64 = 4; + inline bool has_optional_headers64() const; + inline void clear_optional_headers64(); + static const int kOptionalHeaders64FieldNumber = 4; + inline const ::std::string& optional_headers64() const; + inline void set_optional_headers64(const ::std::string& value); + inline void set_optional_headers64(const char* value); + inline void set_optional_headers64(const void* value, size_t size); + inline ::std::string* mutable_optional_headers64(); + inline ::std::string* release_optional_headers64(); + inline void set_allocated_optional_headers64(::std::string* optional_headers64); + + // repeated bytes section_header = 5; + inline int section_header_size() const; + inline void clear_section_header(); + static const int kSectionHeaderFieldNumber = 5; + inline const ::std::string& section_header(int index) const; + inline ::std::string* mutable_section_header(int index); + inline void set_section_header(int index, const ::std::string& value); + inline void set_section_header(int index, const char* value); + inline void set_section_header(int index, const void* value, size_t size); + inline ::std::string* add_section_header(); + inline void add_section_header(const ::std::string& value); + inline void add_section_header(const char* value); + inline void add_section_header(const void* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& section_header() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_section_header(); + + // optional bytes export_section_data = 6; + inline bool has_export_section_data() const; + inline void clear_export_section_data(); + static const int kExportSectionDataFieldNumber = 6; + inline const ::std::string& export_section_data() const; + inline void set_export_section_data(const ::std::string& value); + inline void set_export_section_data(const char* value); + inline void set_export_section_data(const void* value, size_t size); + inline ::std::string* mutable_export_section_data(); + inline ::std::string* release_export_section_data(); + inline void set_allocated_export_section_data(::std::string* export_section_data); + + // repeated .safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData debug_data = 7; + inline int debug_data_size() const; + inline void clear_debug_data(); + static const int kDebugDataFieldNumber = 7; + inline const ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData& debug_data(int index) const; + inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData* mutable_debug_data(int index); + inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData* add_debug_data(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData >& + debug_data() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData >* + mutable_debug_data(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.PEImageHeaders) + private: + inline void set_has_dos_header(); + inline void clear_has_dos_header(); + inline void set_has_file_header(); + inline void clear_has_file_header(); + inline void set_has_optional_headers32(); + inline void clear_has_optional_headers32(); + inline void set_has_optional_headers64(); + inline void clear_has_optional_headers64(); + inline void set_has_export_section_data(); + inline void clear_has_export_section_data(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* dos_header_; + ::std::string* file_header_; + ::std::string* optional_headers32_; + ::std::string* optional_headers64_; + ::google::protobuf::RepeatedPtrField< ::std::string> section_header_; + ::std::string* export_section_data_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData > debug_data_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_PEImageHeaders* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_MachOHeaders_LoadCommand : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_MachOHeaders_LoadCommand(); + virtual ~ClientDownloadRequest_MachOHeaders_LoadCommand(); + + ClientDownloadRequest_MachOHeaders_LoadCommand(const ClientDownloadRequest_MachOHeaders_LoadCommand& from); + + inline ClientDownloadRequest_MachOHeaders_LoadCommand& operator=(const ClientDownloadRequest_MachOHeaders_LoadCommand& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_MachOHeaders_LoadCommand& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_MachOHeaders_LoadCommand* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_MachOHeaders_LoadCommand* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_MachOHeaders_LoadCommand* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_MachOHeaders_LoadCommand& from); + void MergeFrom(const ClientDownloadRequest_MachOHeaders_LoadCommand& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 command_id = 1; + inline bool has_command_id() const; + inline void clear_command_id(); + static const int kCommandIdFieldNumber = 1; + inline ::google::protobuf::uint32 command_id() const; + inline void set_command_id(::google::protobuf::uint32 value); + + // required bytes command = 2; + inline bool has_command() const; + inline void clear_command(); + static const int kCommandFieldNumber = 2; + inline const ::std::string& command() const; + inline void set_command(const ::std::string& value); + inline void set_command(const char* value); + inline void set_command(const void* value, size_t size); + inline ::std::string* mutable_command(); + inline ::std::string* release_command(); + inline void set_allocated_command(::std::string* command); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand) + private: + inline void set_has_command_id(); + inline void clear_has_command_id(); + inline void set_has_command(); + inline void clear_has_command(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* command_; + ::google::protobuf::uint32 command_id_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_MachOHeaders_LoadCommand* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_MachOHeaders : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_MachOHeaders(); + virtual ~ClientDownloadRequest_MachOHeaders(); + + ClientDownloadRequest_MachOHeaders(const ClientDownloadRequest_MachOHeaders& from); + + inline ClientDownloadRequest_MachOHeaders& operator=(const ClientDownloadRequest_MachOHeaders& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_MachOHeaders& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_MachOHeaders* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_MachOHeaders* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_MachOHeaders* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_MachOHeaders& from); + void MergeFrom(const ClientDownloadRequest_MachOHeaders& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadRequest_MachOHeaders_LoadCommand LoadCommand; + + // accessors ------------------------------------------------------- + + // required bytes mach_header = 1; + inline bool has_mach_header() const; + inline void clear_mach_header(); + static const int kMachHeaderFieldNumber = 1; + inline const ::std::string& mach_header() const; + inline void set_mach_header(const ::std::string& value); + inline void set_mach_header(const char* value); + inline void set_mach_header(const void* value, size_t size); + inline ::std::string* mutable_mach_header(); + inline ::std::string* release_mach_header(); + inline void set_allocated_mach_header(::std::string* mach_header); + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand load_commands = 2; + inline int load_commands_size() const; + inline void clear_load_commands(); + static const int kLoadCommandsFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand& load_commands(int index) const; + inline ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand* mutable_load_commands(int index); + inline ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand* add_load_commands(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand >& + load_commands() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand >* + mutable_load_commands(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.MachOHeaders) + private: + inline void set_has_mach_header(); + inline void clear_has_mach_header(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* mach_header_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand > load_commands_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_MachOHeaders* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_ImageHeaders : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_ImageHeaders(); + virtual ~ClientDownloadRequest_ImageHeaders(); + + ClientDownloadRequest_ImageHeaders(const ClientDownloadRequest_ImageHeaders& from); + + inline ClientDownloadRequest_ImageHeaders& operator=(const ClientDownloadRequest_ImageHeaders& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_ImageHeaders& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_ImageHeaders* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_ImageHeaders* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_ImageHeaders* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_ImageHeaders& from); + void MergeFrom(const ClientDownloadRequest_ImageHeaders& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientDownloadRequest.PEImageHeaders pe_headers = 1; + inline bool has_pe_headers() const; + inline void clear_pe_headers(); + static const int kPeHeadersFieldNumber = 1; + inline const ::safe_browsing::ClientDownloadRequest_PEImageHeaders& pe_headers() const; + inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders* mutable_pe_headers(); + inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders* release_pe_headers(); + inline void set_allocated_pe_headers(::safe_browsing::ClientDownloadRequest_PEImageHeaders* pe_headers); + + // repeated .safe_browsing.ClientDownloadRequest.MachOHeaders mach_o_headers = 2; + inline int mach_o_headers_size() const; + inline void clear_mach_o_headers(); + static const int kMachOHeadersFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_MachOHeaders& mach_o_headers(int index) const; + inline ::safe_browsing::ClientDownloadRequest_MachOHeaders* mutable_mach_o_headers(int index); + inline ::safe_browsing::ClientDownloadRequest_MachOHeaders* add_mach_o_headers(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders >& + mach_o_headers() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders >* + mutable_mach_o_headers(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.ImageHeaders) + private: + inline void set_has_pe_headers(); + inline void clear_has_pe_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientDownloadRequest_PEImageHeaders* pe_headers_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders > mach_o_headers_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_ImageHeaders* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_ArchivedBinary : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_ArchivedBinary(); + virtual ~ClientDownloadRequest_ArchivedBinary(); + + ClientDownloadRequest_ArchivedBinary(const ClientDownloadRequest_ArchivedBinary& from); + + inline ClientDownloadRequest_ArchivedBinary& operator=(const ClientDownloadRequest_ArchivedBinary& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_ArchivedBinary& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_ArchivedBinary* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_ArchivedBinary* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_ArchivedBinary* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_ArchivedBinary& from); + void MergeFrom(const ClientDownloadRequest_ArchivedBinary& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string file_basename = 1; + inline bool has_file_basename() const; + inline void clear_file_basename(); + static const int kFileBasenameFieldNumber = 1; + inline const ::std::string& file_basename() const; + inline void set_file_basename(const ::std::string& value); + inline void set_file_basename(const char* value); + inline void set_file_basename(const char* value, size_t size); + inline ::std::string* mutable_file_basename(); + inline ::std::string* release_file_basename(); + inline void set_allocated_file_basename(::std::string* file_basename); + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 2; + inline bool has_download_type() const; + inline void clear_download_type(); + static const int kDownloadTypeFieldNumber = 2; + inline ::safe_browsing::ClientDownloadRequest_DownloadType download_type() const; + inline void set_download_type(::safe_browsing::ClientDownloadRequest_DownloadType value); + + // optional .safe_browsing.ClientDownloadRequest.Digests digests = 3; + inline bool has_digests() const; + inline void clear_digests(); + static const int kDigestsFieldNumber = 3; + inline const ::safe_browsing::ClientDownloadRequest_Digests& digests() const; + inline ::safe_browsing::ClientDownloadRequest_Digests* mutable_digests(); + inline ::safe_browsing::ClientDownloadRequest_Digests* release_digests(); + inline void set_allocated_digests(::safe_browsing::ClientDownloadRequest_Digests* digests); + + // optional int64 length = 4; + inline bool has_length() const; + inline void clear_length(); + static const int kLengthFieldNumber = 4; + inline ::google::protobuf::int64 length() const; + inline void set_length(::google::protobuf::int64 value); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 6; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.ArchivedBinary) + private: + inline void set_has_file_basename(); + inline void clear_has_file_basename(); + inline void set_has_download_type(); + inline void clear_has_download_type(); + inline void set_has_digests(); + inline void clear_has_digests(); + inline void set_has_length(); + inline void clear_has_length(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* file_basename_; + ::safe_browsing::ClientDownloadRequest_Digests* digests_; + ::google::protobuf::int64 length_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + int download_type_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_ArchivedBinary* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest_URLChainEntry : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest_URLChainEntry(); + virtual ~ClientDownloadRequest_URLChainEntry(); + + ClientDownloadRequest_URLChainEntry(const ClientDownloadRequest_URLChainEntry& from); + + inline ClientDownloadRequest_URLChainEntry& operator=(const ClientDownloadRequest_URLChainEntry& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest_URLChainEntry& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest_URLChainEntry* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest_URLChainEntry* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest_URLChainEntry* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest_URLChainEntry& from); + void MergeFrom(const ClientDownloadRequest_URLChainEntry& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadRequest_URLChainEntry_URLType URLType; + static const URLType DOWNLOAD_URL = ClientDownloadRequest_URLChainEntry_URLType_DOWNLOAD_URL; + static const URLType DOWNLOAD_REFERRER = ClientDownloadRequest_URLChainEntry_URLType_DOWNLOAD_REFERRER; + static const URLType LANDING_PAGE = ClientDownloadRequest_URLChainEntry_URLType_LANDING_PAGE; + static const URLType LANDING_REFERRER = ClientDownloadRequest_URLChainEntry_URLType_LANDING_REFERRER; + static const URLType CLIENT_REDIRECT = ClientDownloadRequest_URLChainEntry_URLType_CLIENT_REDIRECT; + static const URLType SERVER_REDIRECT = ClientDownloadRequest_URLChainEntry_URLType_SERVER_REDIRECT; + static inline bool URLType_IsValid(int value) { + return ClientDownloadRequest_URLChainEntry_URLType_IsValid(value); + } + static const URLType URLType_MIN = + ClientDownloadRequest_URLChainEntry_URLType_URLType_MIN; + static const URLType URLType_MAX = + ClientDownloadRequest_URLChainEntry_URLType_URLType_MAX; + static const int URLType_ARRAYSIZE = + ClientDownloadRequest_URLChainEntry_URLType_URLType_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional .safe_browsing.ClientDownloadRequest.URLChainEntry.URLType type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline ::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType type() const; + inline void set_type(::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType value); + + // optional string ip_address = 3; + inline bool has_ip_address() const; + inline void clear_ip_address(); + static const int kIpAddressFieldNumber = 3; + inline const ::std::string& ip_address() const; + inline void set_ip_address(const ::std::string& value); + inline void set_ip_address(const char* value); + inline void set_ip_address(const char* value, size_t size); + inline ::std::string* mutable_ip_address(); + inline ::std::string* release_ip_address(); + inline void set_allocated_ip_address(::std::string* ip_address); + + // optional string referrer = 4; + inline bool has_referrer() const; + inline void clear_referrer(); + static const int kReferrerFieldNumber = 4; + inline const ::std::string& referrer() const; + inline void set_referrer(const ::std::string& value); + inline void set_referrer(const char* value); + inline void set_referrer(const char* value, size_t size); + inline ::std::string* mutable_referrer(); + inline ::std::string* release_referrer(); + inline void set_allocated_referrer(::std::string* referrer); + + // optional string main_frame_referrer = 5; + inline bool has_main_frame_referrer() const; + inline void clear_main_frame_referrer(); + static const int kMainFrameReferrerFieldNumber = 5; + inline const ::std::string& main_frame_referrer() const; + inline void set_main_frame_referrer(const ::std::string& value); + inline void set_main_frame_referrer(const char* value); + inline void set_main_frame_referrer(const char* value, size_t size); + inline ::std::string* mutable_main_frame_referrer(); + inline ::std::string* release_main_frame_referrer(); + inline void set_allocated_main_frame_referrer(::std::string* main_frame_referrer); + + // optional bool is_retargeting = 6; + inline bool has_is_retargeting() const; + inline void clear_is_retargeting(); + static const int kIsRetargetingFieldNumber = 6; + inline bool is_retargeting() const; + inline void set_is_retargeting(bool value); + + // optional bool is_user_initiated = 7; + inline bool has_is_user_initiated() const; + inline void clear_is_user_initiated(); + static const int kIsUserInitiatedFieldNumber = 7; + inline bool is_user_initiated() const; + inline void set_is_user_initiated(bool value); + + // optional double timestamp_in_millisec = 8; + inline bool has_timestamp_in_millisec() const; + inline void clear_timestamp_in_millisec(); + static const int kTimestampInMillisecFieldNumber = 8; + inline double timestamp_in_millisec() const; + inline void set_timestamp_in_millisec(double value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.URLChainEntry) + private: + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_ip_address(); + inline void clear_has_ip_address(); + inline void set_has_referrer(); + inline void clear_has_referrer(); + inline void set_has_main_frame_referrer(); + inline void clear_has_main_frame_referrer(); + inline void set_has_is_retargeting(); + inline void clear_has_is_retargeting(); + inline void set_has_is_user_initiated(); + inline void clear_has_is_user_initiated(); + inline void set_has_timestamp_in_millisec(); + inline void clear_has_timestamp_in_millisec(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::std::string* ip_address_; + ::std::string* referrer_; + ::std::string* main_frame_referrer_; + int type_; + bool is_retargeting_; + bool is_user_initiated_; + double timestamp_in_millisec_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest_URLChainEntry* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadRequest : public ::google::protobuf::MessageLite { + public: + ClientDownloadRequest(); + virtual ~ClientDownloadRequest(); + + ClientDownloadRequest(const ClientDownloadRequest& from); + + inline ClientDownloadRequest& operator=(const ClientDownloadRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadRequest* other); + + // implements Message ---------------------------------------------- + + ClientDownloadRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadRequest& from); + void MergeFrom(const ClientDownloadRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadRequest_Digests Digests; + typedef ClientDownloadRequest_Resource Resource; + typedef ClientDownloadRequest_CertificateChain CertificateChain; + typedef ClientDownloadRequest_ExtendedAttr ExtendedAttr; + typedef ClientDownloadRequest_SignatureInfo SignatureInfo; + typedef ClientDownloadRequest_PEImageHeaders PEImageHeaders; + typedef ClientDownloadRequest_MachOHeaders MachOHeaders; + typedef ClientDownloadRequest_ImageHeaders ImageHeaders; + typedef ClientDownloadRequest_ArchivedBinary ArchivedBinary; + typedef ClientDownloadRequest_URLChainEntry URLChainEntry; + + typedef ClientDownloadRequest_ResourceType ResourceType; + static const ResourceType DOWNLOAD_URL = ClientDownloadRequest_ResourceType_DOWNLOAD_URL; + static const ResourceType DOWNLOAD_REDIRECT = ClientDownloadRequest_ResourceType_DOWNLOAD_REDIRECT; + static const ResourceType TAB_URL = ClientDownloadRequest_ResourceType_TAB_URL; + static const ResourceType TAB_REDIRECT = ClientDownloadRequest_ResourceType_TAB_REDIRECT; + static const ResourceType PPAPI_DOCUMENT = ClientDownloadRequest_ResourceType_PPAPI_DOCUMENT; + static const ResourceType PPAPI_PLUGIN = ClientDownloadRequest_ResourceType_PPAPI_PLUGIN; + static inline bool ResourceType_IsValid(int value) { + return ClientDownloadRequest_ResourceType_IsValid(value); + } + static const ResourceType ResourceType_MIN = + ClientDownloadRequest_ResourceType_ResourceType_MIN; + static const ResourceType ResourceType_MAX = + ClientDownloadRequest_ResourceType_ResourceType_MAX; + static const int ResourceType_ARRAYSIZE = + ClientDownloadRequest_ResourceType_ResourceType_ARRAYSIZE; + + typedef ClientDownloadRequest_DownloadType DownloadType; + static const DownloadType WIN_EXECUTABLE = ClientDownloadRequest_DownloadType_WIN_EXECUTABLE; + static const DownloadType CHROME_EXTENSION = ClientDownloadRequest_DownloadType_CHROME_EXTENSION; + static const DownloadType ANDROID_APK = ClientDownloadRequest_DownloadType_ANDROID_APK; + static const DownloadType ZIPPED_EXECUTABLE = ClientDownloadRequest_DownloadType_ZIPPED_EXECUTABLE; + static const DownloadType MAC_EXECUTABLE = ClientDownloadRequest_DownloadType_MAC_EXECUTABLE; + static const DownloadType ZIPPED_ARCHIVE = ClientDownloadRequest_DownloadType_ZIPPED_ARCHIVE; + static const DownloadType ARCHIVE = ClientDownloadRequest_DownloadType_ARCHIVE; + static const DownloadType INVALID_ZIP = ClientDownloadRequest_DownloadType_INVALID_ZIP; + static const DownloadType INVALID_MAC_ARCHIVE = ClientDownloadRequest_DownloadType_INVALID_MAC_ARCHIVE; + static const DownloadType PPAPI_SAVE_REQUEST = ClientDownloadRequest_DownloadType_PPAPI_SAVE_REQUEST; + static const DownloadType SAMPLED_UNSUPPORTED_FILE = ClientDownloadRequest_DownloadType_SAMPLED_UNSUPPORTED_FILE; + static inline bool DownloadType_IsValid(int value) { + return ClientDownloadRequest_DownloadType_IsValid(value); + } + static const DownloadType DownloadType_MIN = + ClientDownloadRequest_DownloadType_DownloadType_MIN; + static const DownloadType DownloadType_MAX = + ClientDownloadRequest_DownloadType_DownloadType_MAX; + static const int DownloadType_ARRAYSIZE = + ClientDownloadRequest_DownloadType_DownloadType_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // required string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // required .safe_browsing.ClientDownloadRequest.Digests digests = 2; + inline bool has_digests() const; + inline void clear_digests(); + static const int kDigestsFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_Digests& digests() const; + inline ::safe_browsing::ClientDownloadRequest_Digests* mutable_digests(); + inline ::safe_browsing::ClientDownloadRequest_Digests* release_digests(); + inline void set_allocated_digests(::safe_browsing::ClientDownloadRequest_Digests* digests); + + // required int64 length = 3; + inline bool has_length() const; + inline void clear_length(); + static const int kLengthFieldNumber = 3; + inline ::google::protobuf::int64 length() const; + inline void set_length(::google::protobuf::int64 value); + + // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4; + inline int resources_size() const; + inline void clear_resources(); + static const int kResourcesFieldNumber = 4; + inline const ::safe_browsing::ClientDownloadRequest_Resource& resources(int index) const; + inline ::safe_browsing::ClientDownloadRequest_Resource* mutable_resources(int index); + inline ::safe_browsing::ClientDownloadRequest_Resource* add_resources(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >& + resources() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >* + mutable_resources(); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional bool user_initiated = 6; + inline bool has_user_initiated() const; + inline void clear_user_initiated(); + static const int kUserInitiatedFieldNumber = 6; + inline bool user_initiated() const; + inline void set_user_initiated(bool value); + + // optional string file_basename = 9; + inline bool has_file_basename() const; + inline void clear_file_basename(); + static const int kFileBasenameFieldNumber = 9; + inline const ::std::string& file_basename() const; + inline void set_file_basename(const ::std::string& value); + inline void set_file_basename(const char* value); + inline void set_file_basename(const char* value, size_t size); + inline ::std::string* mutable_file_basename(); + inline ::std::string* release_file_basename(); + inline void set_allocated_file_basename(::std::string* file_basename); + + // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE]; + inline bool has_download_type() const; + inline void clear_download_type(); + static const int kDownloadTypeFieldNumber = 10; + inline ::safe_browsing::ClientDownloadRequest_DownloadType download_type() const; + inline void set_download_type(::safe_browsing::ClientDownloadRequest_DownloadType value); + + // optional string locale = 11; + inline bool has_locale() const; + inline void clear_locale(); + static const int kLocaleFieldNumber = 11; + inline const ::std::string& locale() const; + inline void set_locale(const ::std::string& value); + inline void set_locale(const char* value); + inline void set_locale(const char* value, size_t size); + inline ::std::string* mutable_locale(); + inline ::std::string* release_locale(); + inline void set_allocated_locale(::std::string* locale); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 18; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 18; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // repeated .safe_browsing.ClientDownloadRequest.ArchivedBinary archived_binary = 22; + inline int archived_binary_size() const; + inline void clear_archived_binary(); + static const int kArchivedBinaryFieldNumber = 22; + inline const ::safe_browsing::ClientDownloadRequest_ArchivedBinary& archived_binary(int index) const; + inline ::safe_browsing::ClientDownloadRequest_ArchivedBinary* mutable_archived_binary(int index); + inline ::safe_browsing::ClientDownloadRequest_ArchivedBinary* add_archived_binary(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ArchivedBinary >& + archived_binary() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ArchivedBinary >* + mutable_archived_binary(); + + // optional .safe_browsing.ChromeUserPopulation population = 24; + inline bool has_population() const; + inline void clear_population(); + static const int kPopulationFieldNumber = 24; + inline const ::safe_browsing::ChromeUserPopulation& population() const; + inline ::safe_browsing::ChromeUserPopulation* mutable_population(); + inline ::safe_browsing::ChromeUserPopulation* release_population(); + inline void set_allocated_population(::safe_browsing::ChromeUserPopulation* population); + + // optional bool archive_valid = 26; + inline bool has_archive_valid() const; + inline void clear_archive_valid(); + static const int kArchiveValidFieldNumber = 26; + inline bool archive_valid() const; + inline void set_archive_valid(bool value); + + // optional bool skipped_url_whitelist = 28; + inline bool has_skipped_url_whitelist() const; + inline void clear_skipped_url_whitelist(); + static const int kSkippedUrlWhitelistFieldNumber = 28; + inline bool skipped_url_whitelist() const; + inline void set_skipped_url_whitelist(bool value); + + // optional bool skipped_certificate_whitelist = 31; + inline bool has_skipped_certificate_whitelist() const; + inline void clear_skipped_certificate_whitelist(); + static const int kSkippedCertificateWhitelistFieldNumber = 31; + inline bool skipped_certificate_whitelist() const; + inline void set_skipped_certificate_whitelist(bool value); + + // repeated string alternate_extensions = 35; + inline int alternate_extensions_size() const; + inline void clear_alternate_extensions(); + static const int kAlternateExtensionsFieldNumber = 35; + inline const ::std::string& alternate_extensions(int index) const; + inline ::std::string* mutable_alternate_extensions(int index); + inline void set_alternate_extensions(int index, const ::std::string& value); + inline void set_alternate_extensions(int index, const char* value); + inline void set_alternate_extensions(int index, const char* value, size_t size); + inline ::std::string* add_alternate_extensions(); + inline void add_alternate_extensions(const ::std::string& value); + inline void add_alternate_extensions(const char* value); + inline void add_alternate_extensions(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& alternate_extensions() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_alternate_extensions(); + + // repeated .safe_browsing.ClientDownloadRequest.URLChainEntry url_chain = 36; + inline int url_chain_size() const; + inline void clear_url_chain(); + static const int kUrlChainFieldNumber = 36; + inline const ::safe_browsing::ClientDownloadRequest_URLChainEntry& url_chain(int index) const; + inline ::safe_browsing::ClientDownloadRequest_URLChainEntry* mutable_url_chain(int index); + inline ::safe_browsing::ClientDownloadRequest_URLChainEntry* add_url_chain(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_URLChainEntry >& + url_chain() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_URLChainEntry >* + mutable_url_chain(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest) + private: + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_digests(); + inline void clear_has_digests(); + inline void set_has_length(); + inline void clear_has_length(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_user_initiated(); + inline void clear_has_user_initiated(); + inline void set_has_file_basename(); + inline void clear_has_file_basename(); + inline void set_has_download_type(); + inline void clear_has_download_type(); + inline void set_has_locale(); + inline void clear_has_locale(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + inline void set_has_population(); + inline void clear_has_population(); + inline void set_has_archive_valid(); + inline void clear_has_archive_valid(); + inline void set_has_skipped_url_whitelist(); + inline void clear_has_skipped_url_whitelist(); + inline void set_has_skipped_certificate_whitelist(); + inline void clear_has_skipped_certificate_whitelist(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::safe_browsing::ClientDownloadRequest_Digests* digests_; + ::google::protobuf::int64 length_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource > resources_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::std::string* file_basename_; + ::std::string* locale_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ArchivedBinary > archived_binary_; + int download_type_; + bool user_initiated_; + bool archive_valid_; + bool skipped_url_whitelist_; + bool skipped_certificate_whitelist_; + ::safe_browsing::ChromeUserPopulation* population_; + ::google::protobuf::RepeatedPtrField< ::std::string> alternate_extensions_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_URLChainEntry > url_chain_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadResponse_MoreInfo : public ::google::protobuf::MessageLite { + public: + ClientDownloadResponse_MoreInfo(); + virtual ~ClientDownloadResponse_MoreInfo(); + + ClientDownloadResponse_MoreInfo(const ClientDownloadResponse_MoreInfo& from); + + inline ClientDownloadResponse_MoreInfo& operator=(const ClientDownloadResponse_MoreInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadResponse_MoreInfo& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadResponse_MoreInfo* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadResponse_MoreInfo* other); + + // implements Message ---------------------------------------------- + + ClientDownloadResponse_MoreInfo* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadResponse_MoreInfo& from); + void MergeFrom(const ClientDownloadResponse_MoreInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string description = 1; + inline bool has_description() const; + inline void clear_description(); + static const int kDescriptionFieldNumber = 1; + inline const ::std::string& description() const; + inline void set_description(const ::std::string& value); + inline void set_description(const char* value); + inline void set_description(const char* value, size_t size); + inline ::std::string* mutable_description(); + inline ::std::string* release_description(); + inline void set_allocated_description(::std::string* description); + + // optional string url = 2; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 2; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadResponse.MoreInfo) + private: + inline void set_has_description(); + inline void clear_has_description(); + inline void set_has_url(); + inline void clear_has_url(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* description_; + ::std::string* url_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadResponse_MoreInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadResponse : public ::google::protobuf::MessageLite { + public: + ClientDownloadResponse(); + virtual ~ClientDownloadResponse(); + + ClientDownloadResponse(const ClientDownloadResponse& from); + + inline ClientDownloadResponse& operator=(const ClientDownloadResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadResponse* other); + + // implements Message ---------------------------------------------- + + ClientDownloadResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadResponse& from); + void MergeFrom(const ClientDownloadResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadResponse_MoreInfo MoreInfo; + + typedef ClientDownloadResponse_Verdict Verdict; + static const Verdict SAFE = ClientDownloadResponse_Verdict_SAFE; + static const Verdict DANGEROUS = ClientDownloadResponse_Verdict_DANGEROUS; + static const Verdict UNCOMMON = ClientDownloadResponse_Verdict_UNCOMMON; + static const Verdict POTENTIALLY_UNWANTED = ClientDownloadResponse_Verdict_POTENTIALLY_UNWANTED; + static const Verdict DANGEROUS_HOST = ClientDownloadResponse_Verdict_DANGEROUS_HOST; + static const Verdict UNKNOWN = ClientDownloadResponse_Verdict_UNKNOWN; + static inline bool Verdict_IsValid(int value) { + return ClientDownloadResponse_Verdict_IsValid(value); + } + static const Verdict Verdict_MIN = + ClientDownloadResponse_Verdict_Verdict_MIN; + static const Verdict Verdict_MAX = + ClientDownloadResponse_Verdict_Verdict_MAX; + static const int Verdict_ARRAYSIZE = + ClientDownloadResponse_Verdict_Verdict_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientDownloadResponse.Verdict verdict = 1 [default = SAFE]; + inline bool has_verdict() const; + inline void clear_verdict(); + static const int kVerdictFieldNumber = 1; + inline ::safe_browsing::ClientDownloadResponse_Verdict verdict() const; + inline void set_verdict(::safe_browsing::ClientDownloadResponse_Verdict value); + + // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2; + inline bool has_more_info() const; + inline void clear_more_info(); + static const int kMoreInfoFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadResponse_MoreInfo& more_info() const; + inline ::safe_browsing::ClientDownloadResponse_MoreInfo* mutable_more_info(); + inline ::safe_browsing::ClientDownloadResponse_MoreInfo* release_more_info(); + inline void set_allocated_more_info(::safe_browsing::ClientDownloadResponse_MoreInfo* more_info); + + // optional bytes token = 3; + inline bool has_token() const; + inline void clear_token(); + static const int kTokenFieldNumber = 3; + inline const ::std::string& token() const; + inline void set_token(const ::std::string& value); + inline void set_token(const char* value); + inline void set_token(const void* value, size_t size); + inline ::std::string* mutable_token(); + inline ::std::string* release_token(); + inline void set_allocated_token(::std::string* token); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadResponse) + private: + inline void set_has_verdict(); + inline void clear_has_verdict(); + inline void set_has_more_info(); + inline void clear_has_more_info(); + inline void set_has_token(); + inline void clear_has_token(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientDownloadResponse_MoreInfo* more_info_; + ::std::string* token_; + int verdict_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadReport_UserInformation : public ::google::protobuf::MessageLite { + public: + ClientDownloadReport_UserInformation(); + virtual ~ClientDownloadReport_UserInformation(); + + ClientDownloadReport_UserInformation(const ClientDownloadReport_UserInformation& from); + + inline ClientDownloadReport_UserInformation& operator=(const ClientDownloadReport_UserInformation& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadReport_UserInformation& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadReport_UserInformation* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadReport_UserInformation* other); + + // implements Message ---------------------------------------------- + + ClientDownloadReport_UserInformation* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadReport_UserInformation& from); + void MergeFrom(const ClientDownloadReport_UserInformation& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string email = 1; + inline bool has_email() const; + inline void clear_email(); + static const int kEmailFieldNumber = 1; + inline const ::std::string& email() const; + inline void set_email(const ::std::string& value); + inline void set_email(const char* value); + inline void set_email(const char* value, size_t size); + inline ::std::string* mutable_email(); + inline ::std::string* release_email(); + inline void set_allocated_email(::std::string* email); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadReport.UserInformation) + private: + inline void set_has_email(); + inline void clear_has_email(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* email_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadReport_UserInformation* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientDownloadReport : public ::google::protobuf::MessageLite { + public: + ClientDownloadReport(); + virtual ~ClientDownloadReport(); + + ClientDownloadReport(const ClientDownloadReport& from); + + inline ClientDownloadReport& operator=(const ClientDownloadReport& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientDownloadReport& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientDownloadReport* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientDownloadReport* other); + + // implements Message ---------------------------------------------- + + ClientDownloadReport* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientDownloadReport& from); + void MergeFrom(const ClientDownloadReport& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientDownloadReport_UserInformation UserInformation; + + typedef ClientDownloadReport_Reason Reason; + static const Reason SHARE = ClientDownloadReport_Reason_SHARE; + static const Reason FALSE_POSITIVE = ClientDownloadReport_Reason_FALSE_POSITIVE; + static const Reason APPEAL = ClientDownloadReport_Reason_APPEAL; + static inline bool Reason_IsValid(int value) { + return ClientDownloadReport_Reason_IsValid(value); + } + static const Reason Reason_MIN = + ClientDownloadReport_Reason_Reason_MIN; + static const Reason Reason_MAX = + ClientDownloadReport_Reason_Reason_MAX; + static const int Reason_ARRAYSIZE = + ClientDownloadReport_Reason_Reason_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientDownloadReport.Reason reason = 1; + inline bool has_reason() const; + inline void clear_reason(); + static const int kReasonFieldNumber = 1; + inline ::safe_browsing::ClientDownloadReport_Reason reason() const; + inline void set_reason(::safe_browsing::ClientDownloadReport_Reason value); + + // optional .safe_browsing.ClientDownloadRequest download_request = 2; + inline bool has_download_request() const; + inline void clear_download_request(); + static const int kDownloadRequestFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest& download_request() const; + inline ::safe_browsing::ClientDownloadRequest* mutable_download_request(); + inline ::safe_browsing::ClientDownloadRequest* release_download_request(); + inline void set_allocated_download_request(::safe_browsing::ClientDownloadRequest* download_request); + + // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3; + inline bool has_user_information() const; + inline void clear_user_information(); + static const int kUserInformationFieldNumber = 3; + inline const ::safe_browsing::ClientDownloadReport_UserInformation& user_information() const; + inline ::safe_browsing::ClientDownloadReport_UserInformation* mutable_user_information(); + inline ::safe_browsing::ClientDownloadReport_UserInformation* release_user_information(); + inline void set_allocated_user_information(::safe_browsing::ClientDownloadReport_UserInformation* user_information); + + // optional bytes comment = 4; + inline bool has_comment() const; + inline void clear_comment(); + static const int kCommentFieldNumber = 4; + inline const ::std::string& comment() const; + inline void set_comment(const ::std::string& value); + inline void set_comment(const char* value); + inline void set_comment(const void* value, size_t size); + inline ::std::string* mutable_comment(); + inline ::std::string* release_comment(); + inline void set_allocated_comment(::std::string* comment); + + // optional .safe_browsing.ClientDownloadResponse download_response = 5; + inline bool has_download_response() const; + inline void clear_download_response(); + static const int kDownloadResponseFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadResponse& download_response() const; + inline ::safe_browsing::ClientDownloadResponse* mutable_download_response(); + inline ::safe_browsing::ClientDownloadResponse* release_download_response(); + inline void set_allocated_download_response(::safe_browsing::ClientDownloadResponse* download_response); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadReport) + private: + inline void set_has_reason(); + inline void clear_has_reason(); + inline void set_has_download_request(); + inline void clear_has_download_request(); + inline void set_has_user_information(); + inline void clear_has_user_information(); + inline void set_has_comment(); + inline void clear_has_comment(); + inline void set_has_download_response(); + inline void clear_has_download_response(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientDownloadRequest* download_request_; + ::safe_browsing::ClientDownloadReport_UserInformation* user_information_; + ::std::string* comment_; + ::safe_browsing::ClientDownloadResponse* download_response_; + int reason_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientDownloadReport* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientUploadResponse : public ::google::protobuf::MessageLite { + public: + ClientUploadResponse(); + virtual ~ClientUploadResponse(); + + ClientUploadResponse(const ClientUploadResponse& from); + + inline ClientUploadResponse& operator=(const ClientUploadResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientUploadResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientUploadResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientUploadResponse* other); + + // implements Message ---------------------------------------------- + + ClientUploadResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientUploadResponse& from); + void MergeFrom(const ClientUploadResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientUploadResponse_UploadStatus UploadStatus; + static const UploadStatus SUCCESS = ClientUploadResponse_UploadStatus_SUCCESS; + static const UploadStatus UPLOAD_FAILURE = ClientUploadResponse_UploadStatus_UPLOAD_FAILURE; + static inline bool UploadStatus_IsValid(int value) { + return ClientUploadResponse_UploadStatus_IsValid(value); + } + static const UploadStatus UploadStatus_MIN = + ClientUploadResponse_UploadStatus_UploadStatus_MIN; + static const UploadStatus UploadStatus_MAX = + ClientUploadResponse_UploadStatus_UploadStatus_MAX; + static const int UploadStatus_ARRAYSIZE = + ClientUploadResponse_UploadStatus_UploadStatus_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1; + inline bool has_status() const; + inline void clear_status(); + static const int kStatusFieldNumber = 1; + inline ::safe_browsing::ClientUploadResponse_UploadStatus status() const; + inline void set_status(::safe_browsing::ClientUploadResponse_UploadStatus value); + + // optional string permalink = 2; + inline bool has_permalink() const; + inline void clear_permalink(); + static const int kPermalinkFieldNumber = 2; + inline const ::std::string& permalink() const; + inline void set_permalink(const ::std::string& value); + inline void set_permalink(const char* value); + inline void set_permalink(const char* value, size_t size); + inline ::std::string* mutable_permalink(); + inline ::std::string* release_permalink(); + inline void set_allocated_permalink(::std::string* permalink); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientUploadResponse) + private: + inline void set_has_status(); + inline void clear_has_status(); + inline void set_has_permalink(); + inline void clear_has_permalink(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* permalink_; + int status_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientUploadResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_TrackedPreferenceIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_TrackedPreferenceIncident(); + virtual ~ClientIncidentReport_IncidentData_TrackedPreferenceIncident(); + + ClientIncidentReport_IncidentData_TrackedPreferenceIncident(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from); + + inline ClientIncidentReport_IncidentData_TrackedPreferenceIncident& operator=(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_TrackedPreferenceIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_TrackedPreferenceIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_TrackedPreferenceIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_TrackedPreferenceIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ValueState; + static const ValueState UNKNOWN = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNKNOWN; + static const ValueState CLEARED = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CLEARED; + static const ValueState WEAK_LEGACY_OBSOLETE = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_WEAK_LEGACY_OBSOLETE; + static const ValueState CHANGED = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_CHANGED; + static const ValueState UNTRUSTED_UNKNOWN_VALUE = ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_UNTRUSTED_UNKNOWN_VALUE; + static inline bool ValueState_IsValid(int value) { + return ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_IsValid(value); + } + static const ValueState ValueState_MIN = + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_MIN; + static const ValueState ValueState_MAX = + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_MAX; + static const int ValueState_ARRAYSIZE = + ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_ValueState_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string path = 1; + inline bool has_path() const; + inline void clear_path(); + static const int kPathFieldNumber = 1; + inline const ::std::string& path() const; + inline void set_path(const ::std::string& value); + inline void set_path(const char* value); + inline void set_path(const char* value, size_t size); + inline ::std::string* mutable_path(); + inline ::std::string* release_path(); + inline void set_allocated_path(::std::string* path); + + // optional string atomic_value = 2; + inline bool has_atomic_value() const; + inline void clear_atomic_value(); + static const int kAtomicValueFieldNumber = 2; + inline const ::std::string& atomic_value() const; + inline void set_atomic_value(const ::std::string& value); + inline void set_atomic_value(const char* value); + inline void set_atomic_value(const char* value, size_t size); + inline ::std::string* mutable_atomic_value(); + inline ::std::string* release_atomic_value(); + inline void set_allocated_atomic_value(::std::string* atomic_value); + + // repeated string split_key = 3; + inline int split_key_size() const; + inline void clear_split_key(); + static const int kSplitKeyFieldNumber = 3; + inline const ::std::string& split_key(int index) const; + inline ::std::string* mutable_split_key(int index); + inline void set_split_key(int index, const ::std::string& value); + inline void set_split_key(int index, const char* value); + inline void set_split_key(int index, const char* value, size_t size); + inline ::std::string* add_split_key(); + inline void add_split_key(const ::std::string& value); + inline void add_split_key(const char* value); + inline void add_split_key(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& split_key() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_split_key(); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.ValueState value_state = 4; + inline bool has_value_state() const; + inline void clear_value_state(); + static const int kValueStateFieldNumber = 4; + inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState value_state() const; + inline void set_value_state(::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident) + private: + inline void set_has_path(); + inline void clear_has_path(); + inline void set_has_atomic_value(); + inline void clear_has_atomic_value(); + inline void set_has_value_state(); + inline void clear_has_value_state(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* path_; + ::std::string* atomic_value_; + ::google::protobuf::RepeatedPtrField< ::std::string> split_key_; + int value_state_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_TrackedPreferenceIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile(); + virtual ~ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile(); + + ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from); + + inline ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& operator=(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from); + void MergeFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string relative_path = 1; + inline bool has_relative_path() const; + inline void clear_relative_path(); + static const int kRelativePathFieldNumber = 1; + inline const ::std::string& relative_path() const; + inline void set_relative_path(const ::std::string& value); + inline void set_relative_path(const char* value); + inline void set_relative_path(const char* value, size_t size); + inline ::std::string* mutable_relative_path(); + inline ::std::string* release_relative_path(); + inline void set_allocated_relative_path(::std::string* relative_path); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 3; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile) + private: + inline void set_has_relative_path(); + inline void clear_has_relative_path(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* relative_path_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_BinaryIntegrityIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_BinaryIntegrityIncident(); + virtual ~ClientIncidentReport_IncidentData_BinaryIntegrityIncident(); + + ClientIncidentReport_IncidentData_BinaryIntegrityIncident(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from); + + inline ClientIncidentReport_IncidentData_BinaryIntegrityIncident& operator=(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_BinaryIntegrityIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_BinaryIntegrityIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_BinaryIntegrityIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_BinaryIntegrityIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile ContainedFile; + + // accessors ------------------------------------------------------- + + // optional string file_basename = 1; + inline bool has_file_basename() const; + inline void clear_file_basename(); + static const int kFileBasenameFieldNumber = 1; + inline const ::std::string& file_basename() const; + inline void set_file_basename(const ::std::string& value); + inline void set_file_basename(const char* value); + inline void set_file_basename(const char* value, size_t size); + inline ::std::string* mutable_file_basename(); + inline ::std::string* release_file_basename(); + inline void set_allocated_file_basename(::std::string* file_basename); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 3; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // optional int32 sec_error = 4; + inline bool has_sec_error() const; + inline void clear_sec_error(); + static const int kSecErrorFieldNumber = 4; + inline ::google::protobuf::int32 sec_error() const; + inline void set_sec_error(::google::protobuf::int32 value); + + // repeated .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile contained_file = 5; + inline int contained_file_size() const; + inline void clear_contained_file(); + static const int kContainedFileFieldNumber = 5; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& contained_file(int index) const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* mutable_contained_file(int index); + inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* add_contained_file(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile >& + contained_file() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile >* + mutable_contained_file(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident) + private: + inline void set_has_file_basename(); + inline void clear_has_file_basename(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + inline void set_has_sec_error(); + inline void clear_has_sec_error(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* file_basename_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile > contained_file_; + ::google::protobuf::int32 sec_error_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_BinaryIntegrityIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_BlacklistLoadIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_BlacklistLoadIncident(); + virtual ~ClientIncidentReport_IncidentData_BlacklistLoadIncident(); + + ClientIncidentReport_IncidentData_BlacklistLoadIncident(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from); + + inline ClientIncidentReport_IncidentData_BlacklistLoadIncident& operator=(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_BlacklistLoadIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_BlacklistLoadIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_BlacklistLoadIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_BlacklistLoadIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_BlacklistLoadIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string path = 1; + inline bool has_path() const; + inline void clear_path(); + static const int kPathFieldNumber = 1; + inline const ::std::string& path() const; + inline void set_path(const ::std::string& value); + inline void set_path(const char* value); + inline void set_path(const char* value, size_t size); + inline ::std::string* mutable_path(); + inline ::std::string* release_path(); + inline void set_allocated_path(::std::string* path); + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + inline bool has_digest() const; + inline void clear_digest(); + static const int kDigestFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_Digests& digest() const; + inline ::safe_browsing::ClientDownloadRequest_Digests* mutable_digest(); + inline ::safe_browsing::ClientDownloadRequest_Digests* release_digest(); + inline void set_allocated_digest(::safe_browsing::ClientDownloadRequest_Digests* digest); + + // optional string version = 3; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 3; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const char* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // optional bool blacklist_initialized = 4; + inline bool has_blacklist_initialized() const; + inline void clear_blacklist_initialized(); + static const int kBlacklistInitializedFieldNumber = 4; + inline bool blacklist_initialized() const; + inline void set_blacklist_initialized(bool value); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 6; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident) + private: + inline void set_has_path(); + inline void clear_has_path(); + inline void set_has_digest(); + inline void clear_has_digest(); + inline void set_has_version(); + inline void clear_has_version(); + inline void set_has_blacklist_initialized(); + inline void clear_has_blacklist_initialized(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* path_; + ::safe_browsing::ClientDownloadRequest_Digests* digest_; + ::std::string* version_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + bool blacklist_initialized_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_BlacklistLoadIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident(); + virtual ~ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident(); + + ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from); + + inline ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& operator=(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string variations_seed_signature = 1; + inline bool has_variations_seed_signature() const; + inline void clear_variations_seed_signature(); + static const int kVariationsSeedSignatureFieldNumber = 1; + inline const ::std::string& variations_seed_signature() const; + inline void set_variations_seed_signature(const ::std::string& value); + inline void set_variations_seed_signature(const char* value); + inline void set_variations_seed_signature(const char* value, size_t size); + inline ::std::string* mutable_variations_seed_signature(); + inline ::std::string* release_variations_seed_signature(); + inline void set_allocated_variations_seed_signature(::std::string* variations_seed_signature); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident) + private: + inline void set_has_variations_seed_signature(); + inline void clear_has_variations_seed_signature(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* variations_seed_signature_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_ResourceRequestIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_ResourceRequestIncident(); + virtual ~ClientIncidentReport_IncidentData_ResourceRequestIncident(); + + ClientIncidentReport_IncidentData_ResourceRequestIncident(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from); + + inline ClientIncidentReport_IncidentData_ResourceRequestIncident& operator=(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_ResourceRequestIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_ResourceRequestIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_ResourceRequestIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_ResourceRequestIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_ResourceRequestIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_IncidentData_ResourceRequestIncident_Type Type; + static const Type UNKNOWN = ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_UNKNOWN; + static const Type TYPE_PATTERN = ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_TYPE_PATTERN; + static inline bool Type_IsValid(int value) { + return ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_IsValid(value); + } + static const Type Type_MIN = + ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_MIN; + static const Type Type_MAX = + ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_MAX; + static const int Type_ARRAYSIZE = + ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_Type_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional bytes digest = 1; + inline bool has_digest() const; + inline void clear_digest(); + static const int kDigestFieldNumber = 1; + inline const ::std::string& digest() const; + inline void set_digest(const ::std::string& value); + inline void set_digest(const char* value); + inline void set_digest(const void* value, size_t size); + inline ::std::string* mutable_digest(); + inline ::std::string* release_digest(); + inline void set_allocated_digest(::std::string* digest); + + // optional string origin = 2; + inline bool has_origin() const; + inline void clear_origin(); + static const int kOriginFieldNumber = 2; + inline const ::std::string& origin() const; + inline void set_origin(const ::std::string& value); + inline void set_origin(const char* value); + inline void set_origin(const char* value, size_t size); + inline ::std::string* mutable_origin(); + inline ::std::string* release_origin(); + inline void set_allocated_origin(::std::string* origin); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.Type type = 3 [default = UNKNOWN]; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 3; + inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type type() const; + inline void set_type(::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident) + private: + inline void set_has_digest(); + inline void clear_has_digest(); + inline void set_has_origin(); + inline void clear_has_origin(); + inline void set_has_type(); + inline void clear_has_type(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* digest_; + ::std::string* origin_; + int type_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_ResourceRequestIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData_SuspiciousModuleIncident : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData_SuspiciousModuleIncident(); + virtual ~ClientIncidentReport_IncidentData_SuspiciousModuleIncident(); + + ClientIncidentReport_IncidentData_SuspiciousModuleIncident(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from); + + inline ClientIncidentReport_IncidentData_SuspiciousModuleIncident& operator=(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData_SuspiciousModuleIncident* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData_SuspiciousModuleIncident* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData_SuspiciousModuleIncident* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from); + void MergeFrom(const ClientIncidentReport_IncidentData_SuspiciousModuleIncident& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string path = 1; + inline bool has_path() const; + inline void clear_path(); + static const int kPathFieldNumber = 1; + inline const ::std::string& path() const; + inline void set_path(const ::std::string& value); + inline void set_path(const char* value); + inline void set_path(const char* value, size_t size); + inline ::std::string* mutable_path(); + inline ::std::string* release_path(); + inline void set_allocated_path(::std::string* path); + + // optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; + inline bool has_digest() const; + inline void clear_digest(); + static const int kDigestFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest_Digests& digest() const; + inline ::safe_browsing::ClientDownloadRequest_Digests* mutable_digest(); + inline ::safe_browsing::ClientDownloadRequest_Digests* release_digest(); + inline void set_allocated_digest(::safe_browsing::ClientDownloadRequest_Digests* digest); + + // optional string version = 3; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 3; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const char* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 4; + inline bool has_signature() const; + inline void clear_signature(); + static const int kSignatureFieldNumber = 4; + inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& signature() const; + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* mutable_signature(); + inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* release_signature(); + inline void set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident) + private: + inline void set_has_path(); + inline void clear_has_path(); + inline void set_has_digest(); + inline void clear_has_digest(); + inline void set_has_version(); + inline void clear_has_version(); + inline void set_has_signature(); + inline void clear_has_signature(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* path_; + ::safe_browsing::ClientDownloadRequest_Digests* digest_; + ::std::string* version_; + ::safe_browsing::ClientDownloadRequest_SignatureInfo* signature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData_SuspiciousModuleIncident* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_IncidentData : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_IncidentData(); + virtual ~ClientIncidentReport_IncidentData(); + + ClientIncidentReport_IncidentData(const ClientIncidentReport_IncidentData& from); + + inline ClientIncidentReport_IncidentData& operator=(const ClientIncidentReport_IncidentData& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_IncidentData& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_IncidentData* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_IncidentData* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_IncidentData* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_IncidentData& from); + void MergeFrom(const ClientIncidentReport_IncidentData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_IncidentData_TrackedPreferenceIncident TrackedPreferenceIncident; + typedef ClientIncidentReport_IncidentData_BinaryIntegrityIncident BinaryIntegrityIncident; + typedef ClientIncidentReport_IncidentData_BlacklistLoadIncident BlacklistLoadIncident; + typedef ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident VariationsSeedSignatureIncident; + typedef ClientIncidentReport_IncidentData_ResourceRequestIncident ResourceRequestIncident; + typedef ClientIncidentReport_IncidentData_SuspiciousModuleIncident SuspiciousModuleIncident; + + // accessors ------------------------------------------------------- + + // optional int64 incident_time_msec = 1; + inline bool has_incident_time_msec() const; + inline void clear_incident_time_msec(); + static const int kIncidentTimeMsecFieldNumber = 1; + inline ::google::protobuf::int64 incident_time_msec() const; + inline void set_incident_time_msec(::google::protobuf::int64 value); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident tracked_preference = 2; + inline bool has_tracked_preference() const; + inline void clear_tracked_preference(); + static const int kTrackedPreferenceFieldNumber = 2; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident& tracked_preference() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* mutable_tracked_preference(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* release_tracked_preference(); + inline void set_allocated_tracked_preference(::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* tracked_preference); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident binary_integrity = 3; + inline bool has_binary_integrity() const; + inline void clear_binary_integrity(); + static const int kBinaryIntegrityFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident& binary_integrity() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* mutable_binary_integrity(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* release_binary_integrity(); + inline void set_allocated_binary_integrity(::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* binary_integrity); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident blacklist_load = 4; + inline bool has_blacklist_load() const; + inline void clear_blacklist_load(); + static const int kBlacklistLoadFieldNumber = 4; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident& blacklist_load() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* mutable_blacklist_load(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* release_blacklist_load(); + inline void set_allocated_blacklist_load(::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* blacklist_load); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident variations_seed_signature = 6; + inline bool has_variations_seed_signature() const; + inline void clear_variations_seed_signature(); + static const int kVariationsSeedSignatureFieldNumber = 6; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& variations_seed_signature() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* mutable_variations_seed_signature(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* release_variations_seed_signature(); + inline void set_allocated_variations_seed_signature(::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* variations_seed_signature); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident resource_request = 7; + inline bool has_resource_request() const; + inline void clear_resource_request(); + static const int kResourceRequestFieldNumber = 7; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident& resource_request() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* mutable_resource_request(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* release_resource_request(); + inline void set_allocated_resource_request(::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* resource_request); + + // optional .safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident suspicious_module = 8; + inline bool has_suspicious_module() const; + inline void clear_suspicious_module(); + static const int kSuspiciousModuleFieldNumber = 8; + inline const ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident& suspicious_module() const; + inline ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* mutable_suspicious_module(); + inline ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* release_suspicious_module(); + inline void set_allocated_suspicious_module(::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* suspicious_module); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.IncidentData) + private: + inline void set_has_incident_time_msec(); + inline void clear_has_incident_time_msec(); + inline void set_has_tracked_preference(); + inline void clear_has_tracked_preference(); + inline void set_has_binary_integrity(); + inline void clear_has_binary_integrity(); + inline void set_has_blacklist_load(); + inline void clear_has_blacklist_load(); + inline void set_has_variations_seed_signature(); + inline void clear_has_variations_seed_signature(); + inline void set_has_resource_request(); + inline void clear_has_resource_request(); + inline void set_has_suspicious_module(); + inline void clear_has_suspicious_module(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int64 incident_time_msec_; + ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* tracked_preference_; + ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* binary_integrity_; + ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* blacklist_load_; + ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* variations_seed_signature_; + ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* resource_request_; + ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* suspicious_module_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_IncidentData* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_DownloadDetails : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_DownloadDetails(); + virtual ~ClientIncidentReport_DownloadDetails(); + + ClientIncidentReport_DownloadDetails(const ClientIncidentReport_DownloadDetails& from); + + inline ClientIncidentReport_DownloadDetails& operator=(const ClientIncidentReport_DownloadDetails& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_DownloadDetails& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_DownloadDetails* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_DownloadDetails* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_DownloadDetails* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_DownloadDetails& from); + void MergeFrom(const ClientIncidentReport_DownloadDetails& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bytes token = 1; + inline bool has_token() const; + inline void clear_token(); + static const int kTokenFieldNumber = 1; + inline const ::std::string& token() const; + inline void set_token(const ::std::string& value); + inline void set_token(const char* value); + inline void set_token(const void* value, size_t size); + inline ::std::string* mutable_token(); + inline ::std::string* release_token(); + inline void set_allocated_token(::std::string* token); + + // optional .safe_browsing.ClientDownloadRequest download = 2; + inline bool has_download() const; + inline void clear_download(); + static const int kDownloadFieldNumber = 2; + inline const ::safe_browsing::ClientDownloadRequest& download() const; + inline ::safe_browsing::ClientDownloadRequest* mutable_download(); + inline ::safe_browsing::ClientDownloadRequest* release_download(); + inline void set_allocated_download(::safe_browsing::ClientDownloadRequest* download); + + // optional int64 download_time_msec = 3; + inline bool has_download_time_msec() const; + inline void clear_download_time_msec(); + static const int kDownloadTimeMsecFieldNumber = 3; + inline ::google::protobuf::int64 download_time_msec() const; + inline void set_download_time_msec(::google::protobuf::int64 value); + + // optional int64 open_time_msec = 4; + inline bool has_open_time_msec() const; + inline void clear_open_time_msec(); + static const int kOpenTimeMsecFieldNumber = 4; + inline ::google::protobuf::int64 open_time_msec() const; + inline void set_open_time_msec(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.DownloadDetails) + private: + inline void set_has_token(); + inline void clear_has_token(); + inline void set_has_download(); + inline void clear_has_download(); + inline void set_has_download_time_msec(); + inline void clear_has_download_time_msec(); + inline void set_has_open_time_msec(); + inline void clear_has_open_time_msec(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* token_; + ::safe_browsing::ClientDownloadRequest* download_; + ::google::protobuf::int64 download_time_msec_; + ::google::protobuf::int64 open_time_msec_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_DownloadDetails* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_OS_RegistryValue : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_OS_RegistryValue(); + virtual ~ClientIncidentReport_EnvironmentData_OS_RegistryValue(); + + ClientIncidentReport_EnvironmentData_OS_RegistryValue(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from); + + inline ClientIncidentReport_EnvironmentData_OS_RegistryValue& operator=(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_OS_RegistryValue& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_OS_RegistryValue* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_OS_RegistryValue* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_OS_RegistryValue* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryValue& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional uint32 type = 2; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 2; + inline ::google::protobuf::uint32 type() const; + inline void set_type(::google::protobuf::uint32 value); + + // optional bytes data = 3; + inline bool has_data() const; + inline void clear_data(); + static const int kDataFieldNumber = 3; + inline const ::std::string& data() const; + inline void set_data(const ::std::string& value); + inline void set_data(const char* value); + inline void set_data(const void* value, size_t size); + inline ::std::string* mutable_data(); + inline ::std::string* release_data(); + inline void set_allocated_data(::std::string* data); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_data(); + inline void clear_has_data(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::std::string* data_; + ::google::protobuf::uint32 type_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_OS_RegistryValue* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_OS_RegistryKey : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_OS_RegistryKey(); + virtual ~ClientIncidentReport_EnvironmentData_OS_RegistryKey(); + + ClientIncidentReport_EnvironmentData_OS_RegistryKey(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from); + + inline ClientIncidentReport_EnvironmentData_OS_RegistryKey& operator=(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_OS_RegistryKey& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_OS_RegistryKey* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_OS_RegistryKey* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_OS_RegistryKey* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_OS_RegistryKey& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue value = 2; + inline int value_size() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue& value(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue* mutable_value(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue* add_value(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue >& + value() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue >* + mutable_value(); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey key = 3; + inline int key_size() const; + inline void clear_key(); + static const int kKeyFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey& key(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* mutable_key(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* add_key(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >& + key() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >* + mutable_key(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey) + private: + inline void set_has_name(); + inline void clear_has_name(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue > value_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey > key_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_OS_RegistryKey* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_OS : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_OS(); + virtual ~ClientIncidentReport_EnvironmentData_OS(); + + ClientIncidentReport_EnvironmentData_OS(const ClientIncidentReport_EnvironmentData_OS& from); + + inline ClientIncidentReport_EnvironmentData_OS& operator=(const ClientIncidentReport_EnvironmentData_OS& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_OS& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_OS* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_OS* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_OS* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_OS& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_OS& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_EnvironmentData_OS_RegistryValue RegistryValue; + typedef ClientIncidentReport_EnvironmentData_OS_RegistryKey RegistryKey; + + // accessors ------------------------------------------------------- + + // optional string os_name = 1; + inline bool has_os_name() const; + inline void clear_os_name(); + static const int kOsNameFieldNumber = 1; + inline const ::std::string& os_name() const; + inline void set_os_name(const ::std::string& value); + inline void set_os_name(const char* value); + inline void set_os_name(const char* value, size_t size); + inline ::std::string* mutable_os_name(); + inline ::std::string* release_os_name(); + inline void set_allocated_os_name(::std::string* os_name); + + // optional string os_version = 2; + inline bool has_os_version() const; + inline void clear_os_version(); + static const int kOsVersionFieldNumber = 2; + inline const ::std::string& os_version() const; + inline void set_os_version(const ::std::string& value); + inline void set_os_version(const char* value); + inline void set_os_version(const char* value, size_t size); + inline ::std::string* mutable_os_version(); + inline ::std::string* release_os_version(); + inline void set_allocated_os_version(::std::string* os_version); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey registry_key = 3; + inline int registry_key_size() const; + inline void clear_registry_key(); + static const int kRegistryKeyFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey& registry_key(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* mutable_registry_key(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* add_registry_key(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >& + registry_key() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >* + mutable_registry_key(); + + // optional bool is_enrolled_to_domain = 4; + inline bool has_is_enrolled_to_domain() const; + inline void clear_is_enrolled_to_domain(); + static const int kIsEnrolledToDomainFieldNumber = 4; + inline bool is_enrolled_to_domain() const; + inline void set_is_enrolled_to_domain(bool value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.OS) + private: + inline void set_has_os_name(); + inline void clear_has_os_name(); + inline void set_has_os_version(); + inline void clear_has_os_version(); + inline void set_has_is_enrolled_to_domain(); + inline void clear_has_is_enrolled_to_domain(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* os_name_; + ::std::string* os_version_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey > registry_key_; + bool is_enrolled_to_domain_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_OS* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Machine : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Machine(); + virtual ~ClientIncidentReport_EnvironmentData_Machine(); + + ClientIncidentReport_EnvironmentData_Machine(const ClientIncidentReport_EnvironmentData_Machine& from); + + inline ClientIncidentReport_EnvironmentData_Machine& operator=(const ClientIncidentReport_EnvironmentData_Machine& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Machine& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Machine* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Machine* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Machine* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Machine& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Machine& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string cpu_architecture = 1; + inline bool has_cpu_architecture() const; + inline void clear_cpu_architecture(); + static const int kCpuArchitectureFieldNumber = 1; + inline const ::std::string& cpu_architecture() const; + inline void set_cpu_architecture(const ::std::string& value); + inline void set_cpu_architecture(const char* value); + inline void set_cpu_architecture(const char* value, size_t size); + inline ::std::string* mutable_cpu_architecture(); + inline ::std::string* release_cpu_architecture(); + inline void set_allocated_cpu_architecture(::std::string* cpu_architecture); + + // optional string cpu_vendor = 2; + inline bool has_cpu_vendor() const; + inline void clear_cpu_vendor(); + static const int kCpuVendorFieldNumber = 2; + inline const ::std::string& cpu_vendor() const; + inline void set_cpu_vendor(const ::std::string& value); + inline void set_cpu_vendor(const char* value); + inline void set_cpu_vendor(const char* value, size_t size); + inline ::std::string* mutable_cpu_vendor(); + inline ::std::string* release_cpu_vendor(); + inline void set_allocated_cpu_vendor(::std::string* cpu_vendor); + + // optional uint32 cpuid = 3; + inline bool has_cpuid() const; + inline void clear_cpuid(); + static const int kCpuidFieldNumber = 3; + inline ::google::protobuf::uint32 cpuid() const; + inline void set_cpuid(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Machine) + private: + inline void set_has_cpu_architecture(); + inline void clear_has_cpu_architecture(); + inline void set_has_cpu_vendor(); + inline void clear_has_cpu_vendor(); + inline void set_has_cpuid(); + inline void clear_has_cpuid(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* cpu_architecture_; + ::std::string* cpu_vendor_; + ::google::protobuf::uint32 cpuid_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Machine* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process_Patch : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process_Patch(); + virtual ~ClientIncidentReport_EnvironmentData_Process_Patch(); + + ClientIncidentReport_EnvironmentData_Process_Patch(const ClientIncidentReport_EnvironmentData_Process_Patch& from); + + inline ClientIncidentReport_EnvironmentData_Process_Patch& operator=(const ClientIncidentReport_EnvironmentData_Process_Patch& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process_Patch& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process_Patch* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process_Patch* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process_Patch* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process_Patch& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process_Patch& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string function = 1; + inline bool has_function() const; + inline void clear_function(); + static const int kFunctionFieldNumber = 1; + inline const ::std::string& function() const; + inline void set_function(const ::std::string& value); + inline void set_function(const char* value); + inline void set_function(const char* value, size_t size); + inline ::std::string* mutable_function(); + inline ::std::string* release_function(); + inline void set_allocated_function(::std::string* function); + + // optional string target_dll = 2; + inline bool has_target_dll() const; + inline void clear_target_dll(); + static const int kTargetDllFieldNumber = 2; + inline const ::std::string& target_dll() const; + inline void set_target_dll(const ::std::string& value); + inline void set_target_dll(const char* value); + inline void set_target_dll(const char* value, size_t size); + inline ::std::string* mutable_target_dll(); + inline ::std::string* release_target_dll(); + inline void set_allocated_target_dll(::std::string* target_dll); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch) + private: + inline void set_has_function(); + inline void clear_has_function(); + inline void set_has_target_dll(); + inline void clear_has_target_dll(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* function_; + ::std::string* target_dll_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process_Patch* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process_NetworkProvider : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process_NetworkProvider(); + virtual ~ClientIncidentReport_EnvironmentData_Process_NetworkProvider(); + + ClientIncidentReport_EnvironmentData_Process_NetworkProvider(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from); + + inline ClientIncidentReport_EnvironmentData_Process_NetworkProvider& operator=(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process_NetworkProvider* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process_NetworkProvider* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process_NetworkProvider* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process_NetworkProvider& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider) + private: + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process_NetworkProvider* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process_Dll : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process_Dll(); + virtual ~ClientIncidentReport_EnvironmentData_Process_Dll(); + + ClientIncidentReport_EnvironmentData_Process_Dll(const ClientIncidentReport_EnvironmentData_Process_Dll& from); + + inline ClientIncidentReport_EnvironmentData_Process_Dll& operator=(const ClientIncidentReport_EnvironmentData_Process_Dll& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process_Dll& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process_Dll* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process_Dll* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process_Dll* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process_Dll& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process_Dll& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_EnvironmentData_Process_Dll_Feature Feature; + static const Feature UNKNOWN = ClientIncidentReport_EnvironmentData_Process_Dll_Feature_UNKNOWN; + static const Feature LSP = ClientIncidentReport_EnvironmentData_Process_Dll_Feature_LSP; + static inline bool Feature_IsValid(int value) { + return ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(value); + } + static const Feature Feature_MIN = + ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_MIN; + static const Feature Feature_MAX = + ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_MAX; + static const int Feature_ARRAYSIZE = + ClientIncidentReport_EnvironmentData_Process_Dll_Feature_Feature_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string path = 1; + inline bool has_path() const; + inline void clear_path(); + static const int kPathFieldNumber = 1; + inline const ::std::string& path() const; + inline void set_path(const ::std::string& value); + inline void set_path(const char* value); + inline void set_path(const char* value, size_t size); + inline ::std::string* mutable_path(); + inline ::std::string* release_path(); + inline void set_allocated_path(::std::string* path); + + // optional uint64 base_address = 2; + inline bool has_base_address() const; + inline void clear_base_address(); + static const int kBaseAddressFieldNumber = 2; + inline ::google::protobuf::uint64 base_address() const; + inline void set_base_address(::google::protobuf::uint64 value); + + // optional uint32 length = 3; + inline bool has_length() const; + inline void clear_length(); + static const int kLengthFieldNumber = 3; + inline ::google::protobuf::uint32 length() const; + inline void set_length(::google::protobuf::uint32 value); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.Feature feature = 4; + inline int feature_size() const; + inline void clear_feature(); + static const int kFeatureFieldNumber = 4; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature feature(int index) const; + inline void set_feature(int index, ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature value); + inline void add_feature(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature value); + inline const ::google::protobuf::RepeatedField<int>& feature() const; + inline ::google::protobuf::RepeatedField<int>* mutable_feature(); + + // optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; + inline bool has_image_headers() const; + inline void clear_image_headers(); + static const int kImageHeadersFieldNumber = 5; + inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& image_headers() const; + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* mutable_image_headers(); + inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* release_image_headers(); + inline void set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll) + private: + inline void set_has_path(); + inline void clear_has_path(); + inline void set_has_base_address(); + inline void clear_has_base_address(); + inline void set_has_length(); + inline void clear_has_length(); + inline void set_has_image_headers(); + inline void clear_has_image_headers(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* path_; + ::google::protobuf::uint64 base_address_; + ::google::protobuf::RepeatedField<int> feature_; + ::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers_; + ::google::protobuf::uint32 length_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process_Dll* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification(); + virtual ~ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification(); + + ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from); + + inline ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& operator=(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 file_offset = 1; + inline bool has_file_offset() const; + inline void clear_file_offset(); + static const int kFileOffsetFieldNumber = 1; + inline ::google::protobuf::uint32 file_offset() const; + inline void set_file_offset(::google::protobuf::uint32 value); + + // optional int32 byte_count = 2; + inline bool has_byte_count() const; + inline void clear_byte_count(); + static const int kByteCountFieldNumber = 2; + inline ::google::protobuf::int32 byte_count() const; + inline void set_byte_count(::google::protobuf::int32 value); + + // optional bytes modified_bytes = 3; + inline bool has_modified_bytes() const; + inline void clear_modified_bytes(); + static const int kModifiedBytesFieldNumber = 3; + inline const ::std::string& modified_bytes() const; + inline void set_modified_bytes(const ::std::string& value); + inline void set_modified_bytes(const char* value); + inline void set_modified_bytes(const void* value, size_t size); + inline ::std::string* mutable_modified_bytes(); + inline ::std::string* release_modified_bytes(); + inline void set_allocated_modified_bytes(::std::string* modified_bytes); + + // optional string export_name = 4; + inline bool has_export_name() const; + inline void clear_export_name(); + static const int kExportNameFieldNumber = 4; + inline const ::std::string& export_name() const; + inline void set_export_name(const ::std::string& value); + inline void set_export_name(const char* value); + inline void set_export_name(const char* value, size_t size); + inline ::std::string* mutable_export_name(); + inline ::std::string* release_export_name(); + inline void set_allocated_export_name(::std::string* export_name); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification) + private: + inline void set_has_file_offset(); + inline void clear_has_file_offset(); + inline void set_has_byte_count(); + inline void clear_has_byte_count(); + inline void set_has_modified_bytes(); + inline void clear_has_modified_bytes(); + inline void set_has_export_name(); + inline void clear_has_export_name(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::uint32 file_offset_; + ::google::protobuf::int32 byte_count_; + ::std::string* modified_bytes_; + ::std::string* export_name_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process_ModuleState : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process_ModuleState(); + virtual ~ClientIncidentReport_EnvironmentData_Process_ModuleState(); + + ClientIncidentReport_EnvironmentData_Process_ModuleState(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from); + + inline ClientIncidentReport_EnvironmentData_Process_ModuleState& operator=(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process_ModuleState& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process_ModuleState* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process_ModuleState* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process_ModuleState* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process_ModuleState& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification Modification; + + typedef ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ModifiedState; + static const ModifiedState UNKNOWN = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_UNKNOWN; + static const ModifiedState MODULE_STATE_UNKNOWN = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_UNKNOWN; + static const ModifiedState MODULE_STATE_UNMODIFIED = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_UNMODIFIED; + static const ModifiedState MODULE_STATE_MODIFIED = ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_MODULE_STATE_MODIFIED; + static inline bool ModifiedState_IsValid(int value) { + return ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_IsValid(value); + } + static const ModifiedState ModifiedState_MIN = + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_MIN; + static const ModifiedState ModifiedState_MAX = + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_MAX; + static const int ModifiedState_ARRAYSIZE = + ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_ModifiedState_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.ModifiedState modified_state = 2; + inline bool has_modified_state() const; + inline void clear_modified_state(); + static const int kModifiedStateFieldNumber = 2; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState modified_state() const; + inline void set_modified_state(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState value); + + // repeated string OBSOLETE_modified_export = 3; + inline int obsolete_modified_export_size() const; + inline void clear_obsolete_modified_export(); + static const int kOBSOLETEModifiedExportFieldNumber = 3; + inline const ::std::string& obsolete_modified_export(int index) const; + inline ::std::string* mutable_obsolete_modified_export(int index); + inline void set_obsolete_modified_export(int index, const ::std::string& value); + inline void set_obsolete_modified_export(int index, const char* value); + inline void set_obsolete_modified_export(int index, const char* value, size_t size); + inline ::std::string* add_obsolete_modified_export(); + inline void add_obsolete_modified_export(const ::std::string& value); + inline void add_obsolete_modified_export(const char* value); + inline void add_obsolete_modified_export(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& obsolete_modified_export() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_obsolete_modified_export(); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification modification = 4; + inline int modification_size() const; + inline void clear_modification(); + static const int kModificationFieldNumber = 4; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& modification(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* mutable_modification(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* add_modification(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification >& + modification() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification >* + mutable_modification(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_modified_state(); + inline void clear_has_modified_state(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::google::protobuf::RepeatedPtrField< ::std::string> obsolete_modified_export_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification > modification_; + int modified_state_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process_ModuleState* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData_Process : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData_Process(); + virtual ~ClientIncidentReport_EnvironmentData_Process(); + + ClientIncidentReport_EnvironmentData_Process(const ClientIncidentReport_EnvironmentData_Process& from); + + inline ClientIncidentReport_EnvironmentData_Process& operator=(const ClientIncidentReport_EnvironmentData_Process& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData_Process& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData_Process* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData_Process* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData_Process* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData_Process& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData_Process& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_EnvironmentData_Process_Patch Patch; + typedef ClientIncidentReport_EnvironmentData_Process_NetworkProvider NetworkProvider; + typedef ClientIncidentReport_EnvironmentData_Process_Dll Dll; + typedef ClientIncidentReport_EnvironmentData_Process_ModuleState ModuleState; + + typedef ClientIncidentReport_EnvironmentData_Process_Channel Channel; + static const Channel CHANNEL_UNKNOWN = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_UNKNOWN; + static const Channel CHANNEL_CANARY = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_CANARY; + static const Channel CHANNEL_DEV = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_DEV; + static const Channel CHANNEL_BETA = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_BETA; + static const Channel CHANNEL_STABLE = ClientIncidentReport_EnvironmentData_Process_Channel_CHANNEL_STABLE; + static inline bool Channel_IsValid(int value) { + return ClientIncidentReport_EnvironmentData_Process_Channel_IsValid(value); + } + static const Channel Channel_MIN = + ClientIncidentReport_EnvironmentData_Process_Channel_Channel_MIN; + static const Channel Channel_MAX = + ClientIncidentReport_EnvironmentData_Process_Channel_Channel_MAX; + static const int Channel_ARRAYSIZE = + ClientIncidentReport_EnvironmentData_Process_Channel_Channel_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string version = 1; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 1; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const char* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // repeated string OBSOLETE_dlls = 2; + inline int obsolete_dlls_size() const; + inline void clear_obsolete_dlls(); + static const int kOBSOLETEDllsFieldNumber = 2; + inline const ::std::string& obsolete_dlls(int index) const; + inline ::std::string* mutable_obsolete_dlls(int index); + inline void set_obsolete_dlls(int index, const ::std::string& value); + inline void set_obsolete_dlls(int index, const char* value); + inline void set_obsolete_dlls(int index, const char* value, size_t size); + inline ::std::string* add_obsolete_dlls(); + inline void add_obsolete_dlls(const ::std::string& value); + inline void add_obsolete_dlls(const char* value); + inline void add_obsolete_dlls(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& obsolete_dlls() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_obsolete_dlls(); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch patches = 3; + inline int patches_size() const; + inline void clear_patches(); + static const int kPatchesFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch& patches(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch* mutable_patches(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch* add_patches(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch >& + patches() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch >* + mutable_patches(); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider network_providers = 4; + inline int network_providers_size() const; + inline void clear_network_providers(); + static const int kNetworkProvidersFieldNumber = 4; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider& network_providers(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider* mutable_network_providers(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider* add_network_providers(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider >& + network_providers() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider >* + mutable_network_providers(); + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Channel chrome_update_channel = 5; + inline bool has_chrome_update_channel() const; + inline void clear_chrome_update_channel(); + static const int kChromeUpdateChannelFieldNumber = 5; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel chrome_update_channel() const; + inline void set_chrome_update_channel(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel value); + + // optional int64 uptime_msec = 6; + inline bool has_uptime_msec() const; + inline void clear_uptime_msec(); + static const int kUptimeMsecFieldNumber = 6; + inline ::google::protobuf::int64 uptime_msec() const; + inline void set_uptime_msec(::google::protobuf::int64 value); + + // optional bool metrics_consent = 7; + inline bool has_metrics_consent() const; + inline void clear_metrics_consent(); + static const int kMetricsConsentFieldNumber = 7; + inline bool metrics_consent() const; + inline void set_metrics_consent(bool value); + + // optional bool extended_consent = 8; + inline bool has_extended_consent() const; + inline void clear_extended_consent(); + static const int kExtendedConsentFieldNumber = 8; + inline bool extended_consent() const; + inline void set_extended_consent(bool value); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll dll = 9; + inline int dll_size() const; + inline void clear_dll(); + static const int kDllFieldNumber = 9; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll& dll(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll* mutable_dll(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll* add_dll(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll >& + dll() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll >* + mutable_dll(); + + // repeated string blacklisted_dll = 10; + inline int blacklisted_dll_size() const; + inline void clear_blacklisted_dll(); + static const int kBlacklistedDllFieldNumber = 10; + inline const ::std::string& blacklisted_dll(int index) const; + inline ::std::string* mutable_blacklisted_dll(int index); + inline void set_blacklisted_dll(int index, const ::std::string& value); + inline void set_blacklisted_dll(int index, const char* value); + inline void set_blacklisted_dll(int index, const char* value, size_t size); + inline ::std::string* add_blacklisted_dll(); + inline void add_blacklisted_dll(const ::std::string& value); + inline void add_blacklisted_dll(const char* value); + inline void add_blacklisted_dll(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& blacklisted_dll() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_blacklisted_dll(); + + // repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState module_state = 11; + inline int module_state_size() const; + inline void clear_module_state(); + static const int kModuleStateFieldNumber = 11; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState& module_state(int index) const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState* mutable_module_state(int index); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState* add_module_state(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState >& + module_state() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState >* + mutable_module_state(); + + // optional bool field_trial_participant = 12; + inline bool has_field_trial_participant() const; + inline void clear_field_trial_participant(); + static const int kFieldTrialParticipantFieldNumber = 12; + inline bool field_trial_participant() const; + inline void set_field_trial_participant(bool value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData.Process) + private: + inline void set_has_version(); + inline void clear_has_version(); + inline void set_has_chrome_update_channel(); + inline void clear_has_chrome_update_channel(); + inline void set_has_uptime_msec(); + inline void clear_has_uptime_msec(); + inline void set_has_metrics_consent(); + inline void clear_has_metrics_consent(); + inline void set_has_extended_consent(); + inline void clear_has_extended_consent(); + inline void set_has_field_trial_participant(); + inline void clear_has_field_trial_participant(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* version_; + ::google::protobuf::RepeatedPtrField< ::std::string> obsolete_dlls_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch > patches_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider > network_providers_; + ::google::protobuf::int64 uptime_msec_; + int chrome_update_channel_; + bool metrics_consent_; + bool extended_consent_; + bool field_trial_participant_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll > dll_; + ::google::protobuf::RepeatedPtrField< ::std::string> blacklisted_dll_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState > module_state_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData_Process* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_EnvironmentData : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_EnvironmentData(); + virtual ~ClientIncidentReport_EnvironmentData(); + + ClientIncidentReport_EnvironmentData(const ClientIncidentReport_EnvironmentData& from); + + inline ClientIncidentReport_EnvironmentData& operator=(const ClientIncidentReport_EnvironmentData& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_EnvironmentData& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_EnvironmentData* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_EnvironmentData* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_EnvironmentData* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_EnvironmentData& from); + void MergeFrom(const ClientIncidentReport_EnvironmentData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_EnvironmentData_OS OS; + typedef ClientIncidentReport_EnvironmentData_Machine Machine; + typedef ClientIncidentReport_EnvironmentData_Process Process; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.OS os = 1; + inline bool has_os() const; + inline void clear_os(); + static const int kOsFieldNumber = 1; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS& os() const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* mutable_os(); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* release_os(); + inline void set_allocated_os(::safe_browsing::ClientIncidentReport_EnvironmentData_OS* os); + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Machine machine = 2; + inline bool has_machine() const; + inline void clear_machine(); + static const int kMachineFieldNumber = 2; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine& machine() const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* mutable_machine(); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* release_machine(); + inline void set_allocated_machine(::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* machine); + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process process = 3; + inline bool has_process() const; + inline void clear_process(); + static const int kProcessFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process& process() const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* mutable_process(); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* release_process(); + inline void set_allocated_process(::safe_browsing::ClientIncidentReport_EnvironmentData_Process* process); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.EnvironmentData) + private: + inline void set_has_os(); + inline void clear_has_os(); + inline void set_has_machine(); + inline void clear_has_machine(); + inline void set_has_process(); + inline void clear_has_process(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* os_; + ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* machine_; + ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* process_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_EnvironmentData* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_ExtensionData_ExtensionInfo : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_ExtensionData_ExtensionInfo(); + virtual ~ClientIncidentReport_ExtensionData_ExtensionInfo(); + + ClientIncidentReport_ExtensionData_ExtensionInfo(const ClientIncidentReport_ExtensionData_ExtensionInfo& from); + + inline ClientIncidentReport_ExtensionData_ExtensionInfo& operator=(const ClientIncidentReport_ExtensionData_ExtensionInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_ExtensionData_ExtensionInfo& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_ExtensionData_ExtensionInfo* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_ExtensionData_ExtensionInfo* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_ExtensionData_ExtensionInfo* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_ExtensionData_ExtensionInfo& from); + void MergeFrom(const ClientIncidentReport_ExtensionData_ExtensionInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ExtensionState; + static const ExtensionState STATE_UNKNOWN = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_UNKNOWN; + static const ExtensionState STATE_ENABLED = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_ENABLED; + static const ExtensionState STATE_DISABLED = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_DISABLED; + static const ExtensionState STATE_BLACKLISTED = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_BLACKLISTED; + static const ExtensionState STATE_BLOCKED = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_BLOCKED; + static const ExtensionState STATE_TERMINATED = ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_STATE_TERMINATED; + static inline bool ExtensionState_IsValid(int value) { + return ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_IsValid(value); + } + static const ExtensionState ExtensionState_MIN = + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_MIN; + static const ExtensionState ExtensionState_MAX = + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_MAX; + static const int ExtensionState_ARRAYSIZE = + ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_ExtensionState_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional string id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline const ::std::string& id() const; + inline void set_id(const ::std::string& value); + inline void set_id(const char* value); + inline void set_id(const char* value, size_t size); + inline ::std::string* mutable_id(); + inline ::std::string* release_id(); + inline void set_allocated_id(::std::string* id); + + // optional string version = 2; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 2; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const char* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // optional string name = 3; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 3; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const char* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional string description = 4; + inline bool has_description() const; + inline void clear_description(); + static const int kDescriptionFieldNumber = 4; + inline const ::std::string& description() const; + inline void set_description(const ::std::string& value); + inline void set_description(const char* value); + inline void set_description(const char* value, size_t size); + inline ::std::string* mutable_description(); + inline ::std::string* release_description(); + inline void set_allocated_description(::std::string* description); + + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.ExtensionState state = 5 [default = STATE_UNKNOWN]; + inline bool has_state() const; + inline void clear_state(); + static const int kStateFieldNumber = 5; + inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState state() const; + inline void set_state(::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState value); + + // optional int32 type = 6; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 6; + inline ::google::protobuf::int32 type() const; + inline void set_type(::google::protobuf::int32 value); + + // optional string update_url = 7; + inline bool has_update_url() const; + inline void clear_update_url(); + static const int kUpdateUrlFieldNumber = 7; + inline const ::std::string& update_url() const; + inline void set_update_url(const ::std::string& value); + inline void set_update_url(const char* value); + inline void set_update_url(const char* value, size_t size); + inline ::std::string* mutable_update_url(); + inline ::std::string* release_update_url(); + inline void set_allocated_update_url(::std::string* update_url); + + // optional bool has_signature_validation = 8; + inline bool has_has_signature_validation() const; + inline void clear_has_signature_validation(); + static const int kHasSignatureValidationFieldNumber = 8; + inline bool has_signature_validation() const; + inline void set_has_signature_validation(bool value); + + // optional bool signature_is_valid = 9; + inline bool has_signature_is_valid() const; + inline void clear_signature_is_valid(); + static const int kSignatureIsValidFieldNumber = 9; + inline bool signature_is_valid() const; + inline void set_signature_is_valid(bool value); + + // optional bool installed_by_custodian = 10; + inline bool has_installed_by_custodian() const; + inline void clear_installed_by_custodian(); + static const int kInstalledByCustodianFieldNumber = 10; + inline bool installed_by_custodian() const; + inline void set_installed_by_custodian(bool value); + + // optional bool installed_by_default = 11; + inline bool has_installed_by_default() const; + inline void clear_installed_by_default(); + static const int kInstalledByDefaultFieldNumber = 11; + inline bool installed_by_default() const; + inline void set_installed_by_default(bool value); + + // optional bool installed_by_oem = 12; + inline bool has_installed_by_oem() const; + inline void clear_installed_by_oem(); + static const int kInstalledByOemFieldNumber = 12; + inline bool installed_by_oem() const; + inline void set_installed_by_oem(bool value); + + // optional bool from_bookmark = 13; + inline bool has_from_bookmark() const; + inline void clear_from_bookmark(); + static const int kFromBookmarkFieldNumber = 13; + inline bool from_bookmark() const; + inline void set_from_bookmark(bool value); + + // optional bool from_webstore = 14; + inline bool has_from_webstore() const; + inline void clear_from_webstore(); + static const int kFromWebstoreFieldNumber = 14; + inline bool from_webstore() const; + inline void set_from_webstore(bool value); + + // optional bool converted_from_user_script = 15; + inline bool has_converted_from_user_script() const; + inline void clear_converted_from_user_script(); + static const int kConvertedFromUserScriptFieldNumber = 15; + inline bool converted_from_user_script() const; + inline void set_converted_from_user_script(bool value); + + // optional bool may_be_untrusted = 16; + inline bool has_may_be_untrusted() const; + inline void clear_may_be_untrusted(); + static const int kMayBeUntrustedFieldNumber = 16; + inline bool may_be_untrusted() const; + inline void set_may_be_untrusted(bool value); + + // optional int64 install_time_msec = 17; + inline bool has_install_time_msec() const; + inline void clear_install_time_msec(); + static const int kInstallTimeMsecFieldNumber = 17; + inline ::google::protobuf::int64 install_time_msec() const; + inline void set_install_time_msec(::google::protobuf::int64 value); + + // optional int32 manifest_location_type = 18; + inline bool has_manifest_location_type() const; + inline void clear_manifest_location_type(); + static const int kManifestLocationTypeFieldNumber = 18; + inline ::google::protobuf::int32 manifest_location_type() const; + inline void set_manifest_location_type(::google::protobuf::int32 value); + + // optional string manifest = 19; + inline bool has_manifest() const; + inline void clear_manifest(); + static const int kManifestFieldNumber = 19; + inline const ::std::string& manifest() const; + inline void set_manifest(const ::std::string& value); + inline void set_manifest(const char* value); + inline void set_manifest(const char* value, size_t size); + inline ::std::string* mutable_manifest(); + inline ::std::string* release_manifest(); + inline void set_allocated_manifest(::std::string* manifest); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo) + private: + inline void set_has_id(); + inline void clear_has_id(); + inline void set_has_version(); + inline void clear_has_version(); + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_description(); + inline void clear_has_description(); + inline void set_has_state(); + inline void clear_has_state(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_update_url(); + inline void clear_has_update_url(); + inline void set_has_has_signature_validation(); + inline void clear_has_has_signature_validation(); + inline void set_has_signature_is_valid(); + inline void clear_has_signature_is_valid(); + inline void set_has_installed_by_custodian(); + inline void clear_has_installed_by_custodian(); + inline void set_has_installed_by_default(); + inline void clear_has_installed_by_default(); + inline void set_has_installed_by_oem(); + inline void clear_has_installed_by_oem(); + inline void set_has_from_bookmark(); + inline void clear_has_from_bookmark(); + inline void set_has_from_webstore(); + inline void clear_has_from_webstore(); + inline void set_has_converted_from_user_script(); + inline void clear_has_converted_from_user_script(); + inline void set_has_may_be_untrusted(); + inline void clear_has_may_be_untrusted(); + inline void set_has_install_time_msec(); + inline void clear_has_install_time_msec(); + inline void set_has_manifest_location_type(); + inline void clear_has_manifest_location_type(); + inline void set_has_manifest(); + inline void clear_has_manifest(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* id_; + ::std::string* version_; + ::std::string* name_; + ::std::string* description_; + int state_; + ::google::protobuf::int32 type_; + ::std::string* update_url_; + bool has_signature_validation_; + bool signature_is_valid_; + bool installed_by_custodian_; + bool installed_by_default_; + bool installed_by_oem_; + bool from_bookmark_; + bool from_webstore_; + bool converted_from_user_script_; + ::google::protobuf::int64 install_time_msec_; + bool may_be_untrusted_; + ::google::protobuf::int32 manifest_location_type_; + ::std::string* manifest_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_ExtensionData_ExtensionInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_ExtensionData : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_ExtensionData(); + virtual ~ClientIncidentReport_ExtensionData(); + + ClientIncidentReport_ExtensionData(const ClientIncidentReport_ExtensionData& from); + + inline ClientIncidentReport_ExtensionData& operator=(const ClientIncidentReport_ExtensionData& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_ExtensionData& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_ExtensionData* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_ExtensionData* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_ExtensionData* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_ExtensionData& from); + void MergeFrom(const ClientIncidentReport_ExtensionData& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_ExtensionData_ExtensionInfo ExtensionInfo; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo last_installed_extension = 1; + inline bool has_last_installed_extension() const; + inline void clear_last_installed_extension(); + static const int kLastInstalledExtensionFieldNumber = 1; + inline const ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo& last_installed_extension() const; + inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* mutable_last_installed_extension(); + inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* release_last_installed_extension(); + inline void set_allocated_last_installed_extension(::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* last_installed_extension); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.ExtensionData) + private: + inline void set_has_last_installed_extension(); + inline void clear_has_last_installed_extension(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* last_installed_extension_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_ExtensionData* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport_NonBinaryDownloadDetails : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport_NonBinaryDownloadDetails(); + virtual ~ClientIncidentReport_NonBinaryDownloadDetails(); + + ClientIncidentReport_NonBinaryDownloadDetails(const ClientIncidentReport_NonBinaryDownloadDetails& from); + + inline ClientIncidentReport_NonBinaryDownloadDetails& operator=(const ClientIncidentReport_NonBinaryDownloadDetails& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport_NonBinaryDownloadDetails& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport_NonBinaryDownloadDetails* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport_NonBinaryDownloadDetails* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport_NonBinaryDownloadDetails* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport_NonBinaryDownloadDetails& from); + void MergeFrom(const ClientIncidentReport_NonBinaryDownloadDetails& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string file_type = 1; + inline bool has_file_type() const; + inline void clear_file_type(); + static const int kFileTypeFieldNumber = 1; + inline const ::std::string& file_type() const; + inline void set_file_type(const ::std::string& value); + inline void set_file_type(const char* value); + inline void set_file_type(const char* value, size_t size); + inline ::std::string* mutable_file_type(); + inline ::std::string* release_file_type(); + inline void set_allocated_file_type(::std::string* file_type); + + // optional bytes url_spec_sha256 = 2; + inline bool has_url_spec_sha256() const; + inline void clear_url_spec_sha256(); + static const int kUrlSpecSha256FieldNumber = 2; + inline const ::std::string& url_spec_sha256() const; + inline void set_url_spec_sha256(const ::std::string& value); + inline void set_url_spec_sha256(const char* value); + inline void set_url_spec_sha256(const void* value, size_t size); + inline ::std::string* mutable_url_spec_sha256(); + inline ::std::string* release_url_spec_sha256(); + inline void set_allocated_url_spec_sha256(::std::string* url_spec_sha256); + + // optional string host = 3; + inline bool has_host() const; + inline void clear_host(); + static const int kHostFieldNumber = 3; + inline const ::std::string& host() const; + inline void set_host(const ::std::string& value); + inline void set_host(const char* value); + inline void set_host(const char* value, size_t size); + inline ::std::string* mutable_host(); + inline ::std::string* release_host(); + inline void set_allocated_host(::std::string* host); + + // optional int64 length = 4; + inline bool has_length() const; + inline void clear_length(); + static const int kLengthFieldNumber = 4; + inline ::google::protobuf::int64 length() const; + inline void set_length(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails) + private: + inline void set_has_file_type(); + inline void clear_has_file_type(); + inline void set_has_url_spec_sha256(); + inline void clear_has_url_spec_sha256(); + inline void set_has_host(); + inline void clear_has_host(); + inline void set_has_length(); + inline void clear_has_length(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* file_type_; + ::std::string* url_spec_sha256_; + ::std::string* host_; + ::google::protobuf::int64 length_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport_NonBinaryDownloadDetails* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentReport : public ::google::protobuf::MessageLite { + public: + ClientIncidentReport(); + virtual ~ClientIncidentReport(); + + ClientIncidentReport(const ClientIncidentReport& from); + + inline ClientIncidentReport& operator=(const ClientIncidentReport& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentReport& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentReport* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentReport* other); + + // implements Message ---------------------------------------------- + + ClientIncidentReport* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentReport& from); + void MergeFrom(const ClientIncidentReport& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentReport_IncidentData IncidentData; + typedef ClientIncidentReport_DownloadDetails DownloadDetails; + typedef ClientIncidentReport_EnvironmentData EnvironmentData; + typedef ClientIncidentReport_ExtensionData ExtensionData; + typedef ClientIncidentReport_NonBinaryDownloadDetails NonBinaryDownloadDetails; + + // accessors ------------------------------------------------------- + + // repeated .safe_browsing.ClientIncidentReport.IncidentData incident = 1; + inline int incident_size() const; + inline void clear_incident(); + static const int kIncidentFieldNumber = 1; + inline const ::safe_browsing::ClientIncidentReport_IncidentData& incident(int index) const; + inline ::safe_browsing::ClientIncidentReport_IncidentData* mutable_incident(int index); + inline ::safe_browsing::ClientIncidentReport_IncidentData* add_incident(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData >& + incident() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData >* + mutable_incident(); + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + inline bool has_download() const; + inline void clear_download(); + static const int kDownloadFieldNumber = 2; + inline const ::safe_browsing::ClientIncidentReport_DownloadDetails& download() const; + inline ::safe_browsing::ClientIncidentReport_DownloadDetails* mutable_download(); + inline ::safe_browsing::ClientIncidentReport_DownloadDetails* release_download(); + inline void set_allocated_download(::safe_browsing::ClientIncidentReport_DownloadDetails* download); + + // optional .safe_browsing.ClientIncidentReport.EnvironmentData environment = 3; + inline bool has_environment() const; + inline void clear_environment(); + static const int kEnvironmentFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentReport_EnvironmentData& environment() const; + inline ::safe_browsing::ClientIncidentReport_EnvironmentData* mutable_environment(); + inline ::safe_browsing::ClientIncidentReport_EnvironmentData* release_environment(); + inline void set_allocated_environment(::safe_browsing::ClientIncidentReport_EnvironmentData* environment); + + // optional .safe_browsing.ChromeUserPopulation population = 7; + inline bool has_population() const; + inline void clear_population(); + static const int kPopulationFieldNumber = 7; + inline const ::safe_browsing::ChromeUserPopulation& population() const; + inline ::safe_browsing::ChromeUserPopulation* mutable_population(); + inline ::safe_browsing::ChromeUserPopulation* release_population(); + inline void set_allocated_population(::safe_browsing::ChromeUserPopulation* population); + + // optional .safe_browsing.ClientIncidentReport.ExtensionData extension_data = 8; + inline bool has_extension_data() const; + inline void clear_extension_data(); + static const int kExtensionDataFieldNumber = 8; + inline const ::safe_browsing::ClientIncidentReport_ExtensionData& extension_data() const; + inline ::safe_browsing::ClientIncidentReport_ExtensionData* mutable_extension_data(); + inline ::safe_browsing::ClientIncidentReport_ExtensionData* release_extension_data(); + inline void set_allocated_extension_data(::safe_browsing::ClientIncidentReport_ExtensionData* extension_data); + + // optional .safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails non_binary_download = 9; + inline bool has_non_binary_download() const; + inline void clear_non_binary_download(); + static const int kNonBinaryDownloadFieldNumber = 9; + inline const ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails& non_binary_download() const; + inline ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* mutable_non_binary_download(); + inline ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* release_non_binary_download(); + inline void set_allocated_non_binary_download(::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* non_binary_download); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentReport) + private: + inline void set_has_download(); + inline void clear_has_download(); + inline void set_has_environment(); + inline void clear_has_environment(); + inline void set_has_population(); + inline void clear_has_population(); + inline void set_has_extension_data(); + inline void clear_has_extension_data(); + inline void set_has_non_binary_download(); + inline void clear_has_non_binary_download(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData > incident_; + ::safe_browsing::ClientIncidentReport_DownloadDetails* download_; + ::safe_browsing::ClientIncidentReport_EnvironmentData* environment_; + ::safe_browsing::ChromeUserPopulation* population_; + ::safe_browsing::ClientIncidentReport_ExtensionData* extension_data_; + ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* non_binary_download_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentReport* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentResponse_EnvironmentRequest : public ::google::protobuf::MessageLite { + public: + ClientIncidentResponse_EnvironmentRequest(); + virtual ~ClientIncidentResponse_EnvironmentRequest(); + + ClientIncidentResponse_EnvironmentRequest(const ClientIncidentResponse_EnvironmentRequest& from); + + inline ClientIncidentResponse_EnvironmentRequest& operator=(const ClientIncidentResponse_EnvironmentRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentResponse_EnvironmentRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentResponse_EnvironmentRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentResponse_EnvironmentRequest* other); + + // implements Message ---------------------------------------------- + + ClientIncidentResponse_EnvironmentRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentResponse_EnvironmentRequest& from); + void MergeFrom(const ClientIncidentResponse_EnvironmentRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 dll_index = 1; + inline bool has_dll_index() const; + inline void clear_dll_index(); + static const int kDllIndexFieldNumber = 1; + inline ::google::protobuf::int32 dll_index() const; + inline void set_dll_index(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentResponse.EnvironmentRequest) + private: + inline void set_has_dll_index(); + inline void clear_has_dll_index(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 dll_index_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentResponse_EnvironmentRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientIncidentResponse : public ::google::protobuf::MessageLite { + public: + ClientIncidentResponse(); + virtual ~ClientIncidentResponse(); + + ClientIncidentResponse(const ClientIncidentResponse& from); + + inline ClientIncidentResponse& operator=(const ClientIncidentResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientIncidentResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientIncidentResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientIncidentResponse* other); + + // implements Message ---------------------------------------------- + + ClientIncidentResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientIncidentResponse& from); + void MergeFrom(const ClientIncidentResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientIncidentResponse_EnvironmentRequest EnvironmentRequest; + + // accessors ------------------------------------------------------- + + // optional bytes token = 1; + inline bool has_token() const; + inline void clear_token(); + static const int kTokenFieldNumber = 1; + inline const ::std::string& token() const; + inline void set_token(const ::std::string& value); + inline void set_token(const char* value); + inline void set_token(const void* value, size_t size); + inline ::std::string* mutable_token(); + inline ::std::string* release_token(); + inline void set_allocated_token(::std::string* token); + + // optional bool download_requested = 2; + inline bool has_download_requested() const; + inline void clear_download_requested(); + static const int kDownloadRequestedFieldNumber = 2; + inline bool download_requested() const; + inline void set_download_requested(bool value); + + // repeated .safe_browsing.ClientIncidentResponse.EnvironmentRequest environment_requests = 3; + inline int environment_requests_size() const; + inline void clear_environment_requests(); + static const int kEnvironmentRequestsFieldNumber = 3; + inline const ::safe_browsing::ClientIncidentResponse_EnvironmentRequest& environment_requests(int index) const; + inline ::safe_browsing::ClientIncidentResponse_EnvironmentRequest* mutable_environment_requests(int index); + inline ::safe_browsing::ClientIncidentResponse_EnvironmentRequest* add_environment_requests(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentResponse_EnvironmentRequest >& + environment_requests() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentResponse_EnvironmentRequest >* + mutable_environment_requests(); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientIncidentResponse) + private: + inline void set_has_token(); + inline void clear_has_token(); + inline void set_has_download_requested(); + inline void clear_has_download_requested(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* token_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentResponse_EnvironmentRequest > environment_requests_; + bool download_requested_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientIncidentResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class DownloadMetadata : public ::google::protobuf::MessageLite { + public: + DownloadMetadata(); + virtual ~DownloadMetadata(); + + DownloadMetadata(const DownloadMetadata& from); + + inline DownloadMetadata& operator=(const DownloadMetadata& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const DownloadMetadata& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const DownloadMetadata* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(DownloadMetadata* other); + + // implements Message ---------------------------------------------- + + DownloadMetadata* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const DownloadMetadata& from); + void MergeFrom(const DownloadMetadata& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional uint32 download_id = 1; + inline bool has_download_id() const; + inline void clear_download_id(); + static const int kDownloadIdFieldNumber = 1; + inline ::google::protobuf::uint32 download_id() const; + inline void set_download_id(::google::protobuf::uint32 value); + + // optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; + inline bool has_download() const; + inline void clear_download(); + static const int kDownloadFieldNumber = 2; + inline const ::safe_browsing::ClientIncidentReport_DownloadDetails& download() const; + inline ::safe_browsing::ClientIncidentReport_DownloadDetails* mutable_download(); + inline ::safe_browsing::ClientIncidentReport_DownloadDetails* release_download(); + inline void set_allocated_download(::safe_browsing::ClientIncidentReport_DownloadDetails* download); + + // @@protoc_insertion_point(class_scope:safe_browsing.DownloadMetadata) + private: + inline void set_has_download_id(); + inline void clear_has_download_id(); + inline void set_has_download(); + inline void clear_has_download(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientIncidentReport_DownloadDetails* download_; + ::google::protobuf::uint32 download_id_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static DownloadMetadata* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_HTTPHeader : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_HTTPHeader(); + virtual ~ClientSafeBrowsingReportRequest_HTTPHeader(); + + ClientSafeBrowsingReportRequest_HTTPHeader(const ClientSafeBrowsingReportRequest_HTTPHeader& from); + + inline ClientSafeBrowsingReportRequest_HTTPHeader& operator=(const ClientSafeBrowsingReportRequest_HTTPHeader& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_HTTPHeader& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_HTTPHeader* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_HTTPHeader* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_HTTPHeader* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_HTTPHeader& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_HTTPHeader& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bytes name = 1; + inline bool has_name() const; + inline void clear_name(); + static const int kNameFieldNumber = 1; + inline const ::std::string& name() const; + inline void set_name(const ::std::string& value); + inline void set_name(const char* value); + inline void set_name(const void* value, size_t size); + inline ::std::string* mutable_name(); + inline ::std::string* release_name(); + inline void set_allocated_name(::std::string* name); + + // optional bytes value = 2; + inline bool has_value() const; + inline void clear_value(); + static const int kValueFieldNumber = 2; + inline const ::std::string& value() const; + inline void set_value(const ::std::string& value); + inline void set_value(const char* value); + inline void set_value(const void* value, size_t size); + inline ::std::string* mutable_value(); + inline ::std::string* release_value(); + inline void set_allocated_value(::std::string* value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_value(); + inline void clear_has_value(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* name_; + ::std::string* value_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_HTTPHeader* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine(); + virtual ~ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine(); + + ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from); + + inline ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& operator=(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bytes verb = 1; + inline bool has_verb() const; + inline void clear_verb(); + static const int kVerbFieldNumber = 1; + inline const ::std::string& verb() const; + inline void set_verb(const ::std::string& value); + inline void set_verb(const char* value); + inline void set_verb(const void* value, size_t size); + inline ::std::string* mutable_verb(); + inline ::std::string* release_verb(); + inline void set_allocated_verb(::std::string* verb); + + // optional bytes uri = 2; + inline bool has_uri() const; + inline void clear_uri(); + static const int kUriFieldNumber = 2; + inline const ::std::string& uri() const; + inline void set_uri(const ::std::string& value); + inline void set_uri(const char* value); + inline void set_uri(const void* value, size_t size); + inline ::std::string* mutable_uri(); + inline ::std::string* release_uri(); + inline void set_allocated_uri(::std::string* uri); + + // optional bytes version = 3; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 3; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const void* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine) + private: + inline void set_has_verb(); + inline void clear_has_verb(); + inline void set_has_uri(); + inline void clear_has_uri(); + inline void set_has_version(); + inline void clear_has_version(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* verb_; + ::std::string* uri_; + ::std::string* version_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_HTTPRequest : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_HTTPRequest(); + virtual ~ClientSafeBrowsingReportRequest_HTTPRequest(); + + ClientSafeBrowsingReportRequest_HTTPRequest(const ClientSafeBrowsingReportRequest_HTTPRequest& from); + + inline ClientSafeBrowsingReportRequest_HTTPRequest& operator=(const ClientSafeBrowsingReportRequest_HTTPRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_HTTPRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_HTTPRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_HTTPRequest* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_HTTPRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_HTTPRequest& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_HTTPRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine FirstLine; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine firstline = 1; + inline bool has_firstline() const; + inline void clear_firstline(); + static const int kFirstlineFieldNumber = 1; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& firstline() const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* mutable_firstline(); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* release_firstline(); + inline void set_allocated_firstline(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* firstline); + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + inline int headers_size() const; + inline void clear_headers(); + static const int kHeadersFieldNumber = 2; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader& headers(int index) const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* mutable_headers(int index); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* add_headers(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >& + headers() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >* + mutable_headers(); + + // optional bytes body = 3; + inline bool has_body() const; + inline void clear_body(); + static const int kBodyFieldNumber = 3; + inline const ::std::string& body() const; + inline void set_body(const ::std::string& value); + inline void set_body(const char* value); + inline void set_body(const void* value, size_t size); + inline ::std::string* mutable_body(); + inline ::std::string* release_body(); + inline void set_allocated_body(::std::string* body); + + // optional bytes bodydigest = 4; + inline bool has_bodydigest() const; + inline void clear_bodydigest(); + static const int kBodydigestFieldNumber = 4; + inline const ::std::string& bodydigest() const; + inline void set_bodydigest(const ::std::string& value); + inline void set_bodydigest(const char* value); + inline void set_bodydigest(const void* value, size_t size); + inline ::std::string* mutable_bodydigest(); + inline ::std::string* release_bodydigest(); + inline void set_allocated_bodydigest(::std::string* bodydigest); + + // optional int32 bodylength = 5; + inline bool has_bodylength() const; + inline void clear_bodylength(); + static const int kBodylengthFieldNumber = 5; + inline ::google::protobuf::int32 bodylength() const; + inline void set_bodylength(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest) + private: + inline void set_has_firstline(); + inline void clear_has_firstline(); + inline void set_has_body(); + inline void clear_has_body(); + inline void set_has_bodydigest(); + inline void clear_has_bodydigest(); + inline void set_has_bodylength(); + inline void clear_has_bodylength(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* firstline_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader > headers_; + ::std::string* body_; + ::std::string* bodydigest_; + ::google::protobuf::int32 bodylength_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_HTTPRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine(); + virtual ~ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine(); + + ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from); + + inline ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& operator=(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 code = 1; + inline bool has_code() const; + inline void clear_code(); + static const int kCodeFieldNumber = 1; + inline ::google::protobuf::int32 code() const; + inline void set_code(::google::protobuf::int32 value); + + // optional bytes reason = 2; + inline bool has_reason() const; + inline void clear_reason(); + static const int kReasonFieldNumber = 2; + inline const ::std::string& reason() const; + inline void set_reason(const ::std::string& value); + inline void set_reason(const char* value); + inline void set_reason(const void* value, size_t size); + inline ::std::string* mutable_reason(); + inline ::std::string* release_reason(); + inline void set_allocated_reason(::std::string* reason); + + // optional bytes version = 3; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 3; + inline const ::std::string& version() const; + inline void set_version(const ::std::string& value); + inline void set_version(const char* value); + inline void set_version(const void* value, size_t size); + inline ::std::string* mutable_version(); + inline ::std::string* release_version(); + inline void set_allocated_version(::std::string* version); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine) + private: + inline void set_has_code(); + inline void clear_has_code(); + inline void set_has_reason(); + inline void clear_has_reason(); + inline void set_has_version(); + inline void clear_has_version(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* reason_; + ::std::string* version_; + ::google::protobuf::int32 code_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_HTTPResponse : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_HTTPResponse(); + virtual ~ClientSafeBrowsingReportRequest_HTTPResponse(); + + ClientSafeBrowsingReportRequest_HTTPResponse(const ClientSafeBrowsingReportRequest_HTTPResponse& from); + + inline ClientSafeBrowsingReportRequest_HTTPResponse& operator=(const ClientSafeBrowsingReportRequest_HTTPResponse& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_HTTPResponse& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_HTTPResponse* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_HTTPResponse* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_HTTPResponse* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_HTTPResponse& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_HTTPResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine FirstLine; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine firstline = 1; + inline bool has_firstline() const; + inline void clear_firstline(); + static const int kFirstlineFieldNumber = 1; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& firstline() const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* mutable_firstline(); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* release_firstline(); + inline void set_allocated_firstline(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* firstline); + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; + inline int headers_size() const; + inline void clear_headers(); + static const int kHeadersFieldNumber = 2; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader& headers(int index) const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* mutable_headers(int index); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* add_headers(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >& + headers() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >* + mutable_headers(); + + // optional bytes body = 3; + inline bool has_body() const; + inline void clear_body(); + static const int kBodyFieldNumber = 3; + inline const ::std::string& body() const; + inline void set_body(const ::std::string& value); + inline void set_body(const char* value); + inline void set_body(const void* value, size_t size); + inline ::std::string* mutable_body(); + inline ::std::string* release_body(); + inline void set_allocated_body(::std::string* body); + + // optional bytes bodydigest = 4; + inline bool has_bodydigest() const; + inline void clear_bodydigest(); + static const int kBodydigestFieldNumber = 4; + inline const ::std::string& bodydigest() const; + inline void set_bodydigest(const ::std::string& value); + inline void set_bodydigest(const char* value); + inline void set_bodydigest(const void* value, size_t size); + inline ::std::string* mutable_bodydigest(); + inline ::std::string* release_bodydigest(); + inline void set_allocated_bodydigest(::std::string* bodydigest); + + // optional int32 bodylength = 5; + inline bool has_bodylength() const; + inline void clear_bodylength(); + static const int kBodylengthFieldNumber = 5; + inline ::google::protobuf::int32 bodylength() const; + inline void set_bodylength(::google::protobuf::int32 value); + + // optional bytes remote_ip = 6; + inline bool has_remote_ip() const; + inline void clear_remote_ip(); + static const int kRemoteIpFieldNumber = 6; + inline const ::std::string& remote_ip() const; + inline void set_remote_ip(const ::std::string& value); + inline void set_remote_ip(const char* value); + inline void set_remote_ip(const void* value, size_t size); + inline ::std::string* mutable_remote_ip(); + inline ::std::string* release_remote_ip(); + inline void set_allocated_remote_ip(::std::string* remote_ip); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse) + private: + inline void set_has_firstline(); + inline void clear_has_firstline(); + inline void set_has_body(); + inline void clear_has_body(); + inline void set_has_bodydigest(); + inline void clear_has_bodydigest(); + inline void set_has_bodylength(); + inline void clear_has_bodylength(); + inline void set_has_remote_ip(); + inline void clear_has_remote_ip(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* firstline_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader > headers_; + ::std::string* body_; + ::std::string* bodydigest_; + ::std::string* remote_ip_; + ::google::protobuf::int32 bodylength_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_HTTPResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest_Resource : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest_Resource(); + virtual ~ClientSafeBrowsingReportRequest_Resource(); + + ClientSafeBrowsingReportRequest_Resource(const ClientSafeBrowsingReportRequest_Resource& from); + + inline ClientSafeBrowsingReportRequest_Resource& operator=(const ClientSafeBrowsingReportRequest_Resource& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest_Resource& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest_Resource* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest_Resource* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest_Resource* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest_Resource& from); + void MergeFrom(const ClientSafeBrowsingReportRequest_Resource& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int32 id() const; + inline void set_id(::google::protobuf::int32 value); + + // optional string url = 2; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 2; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest request = 3; + inline bool has_request() const; + inline void clear_request(); + static const int kRequestFieldNumber = 3; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest& request() const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* mutable_request(); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* release_request(); + inline void set_allocated_request(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* request); + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse response = 4; + inline bool has_response() const; + inline void clear_response(); + static const int kResponseFieldNumber = 4; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse& response() const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* mutable_response(); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* release_response(); + inline void set_allocated_response(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* response); + + // optional int32 parent_id = 5; + inline bool has_parent_id() const; + inline void clear_parent_id(); + static const int kParentIdFieldNumber = 5; + inline ::google::protobuf::int32 parent_id() const; + inline void set_parent_id(::google::protobuf::int32 value); + + // repeated int32 child_ids = 6; + inline int child_ids_size() const; + inline void clear_child_ids(); + static const int kChildIdsFieldNumber = 6; + inline ::google::protobuf::int32 child_ids(int index) const; + inline void set_child_ids(int index, ::google::protobuf::int32 value); + inline void add_child_ids(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + child_ids() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_child_ids(); + + // optional string tag_name = 7; + inline bool has_tag_name() const; + inline void clear_tag_name(); + static const int kTagNameFieldNumber = 7; + inline const ::std::string& tag_name() const; + inline void set_tag_name(const ::std::string& value); + inline void set_tag_name(const char* value); + inline void set_tag_name(const char* value, size_t size); + inline ::std::string* mutable_tag_name(); + inline ::std::string* release_tag_name(); + inline void set_allocated_tag_name(::std::string* tag_name); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest.Resource) + private: + inline void set_has_id(); + inline void clear_has_id(); + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_request(); + inline void clear_has_request(); + inline void set_has_response(); + inline void clear_has_response(); + inline void set_has_parent_id(); + inline void clear_has_parent_id(); + inline void set_has_tag_name(); + inline void clear_has_tag_name(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::std::string* url_; + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* request_; + ::google::protobuf::int32 id_; + ::google::protobuf::int32 parent_id_; + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* response_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > child_ids_; + ::std::string* tag_name_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest_Resource* default_instance_; +}; +// ------------------------------------------------------------------- + +class ClientSafeBrowsingReportRequest : public ::google::protobuf::MessageLite { + public: + ClientSafeBrowsingReportRequest(); + virtual ~ClientSafeBrowsingReportRequest(); + + ClientSafeBrowsingReportRequest(const ClientSafeBrowsingReportRequest& from); + + inline ClientSafeBrowsingReportRequest& operator=(const ClientSafeBrowsingReportRequest& from) { + CopyFrom(from); + return *this; + } + + inline const ::std::string& unknown_fields() const { + return _unknown_fields_; + } + + inline ::std::string* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ClientSafeBrowsingReportRequest& default_instance(); + + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + // Returns the internal default instance pointer. This function can + // return NULL thus should not be used by the user. This is intended + // for Protobuf internal code. Please use default_instance() declared + // above instead. + static inline const ClientSafeBrowsingReportRequest* internal_default_instance() { + return default_instance_; + } + #endif + + void Swap(ClientSafeBrowsingReportRequest* other); + + // implements Message ---------------------------------------------- + + ClientSafeBrowsingReportRequest* New() const; + void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from); + void CopyFrom(const ClientSafeBrowsingReportRequest& from); + void MergeFrom(const ClientSafeBrowsingReportRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + void DiscardUnknownFields(); + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + ::std::string GetTypeName() const; + + // nested types ---------------------------------------------------- + + typedef ClientSafeBrowsingReportRequest_HTTPHeader HTTPHeader; + typedef ClientSafeBrowsingReportRequest_HTTPRequest HTTPRequest; + typedef ClientSafeBrowsingReportRequest_HTTPResponse HTTPResponse; + typedef ClientSafeBrowsingReportRequest_Resource Resource; + + typedef ClientSafeBrowsingReportRequest_ReportType ReportType; + static const ReportType UNKNOWN = ClientSafeBrowsingReportRequest_ReportType_UNKNOWN; + static const ReportType URL_PHISHING = ClientSafeBrowsingReportRequest_ReportType_URL_PHISHING; + static const ReportType URL_MALWARE = ClientSafeBrowsingReportRequest_ReportType_URL_MALWARE; + static const ReportType URL_UNWANTED = ClientSafeBrowsingReportRequest_ReportType_URL_UNWANTED; + static const ReportType CLIENT_SIDE_PHISHING_URL = ClientSafeBrowsingReportRequest_ReportType_CLIENT_SIDE_PHISHING_URL; + static const ReportType CLIENT_SIDE_MALWARE_URL = ClientSafeBrowsingReportRequest_ReportType_CLIENT_SIDE_MALWARE_URL; + static const ReportType DANGEROUS_DOWNLOAD_RECOVERY = ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_RECOVERY; + static const ReportType DANGEROUS_DOWNLOAD_WARNING = ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_WARNING; + static const ReportType DANGEROUS_DOWNLOAD_BY_API = ClientSafeBrowsingReportRequest_ReportType_DANGEROUS_DOWNLOAD_BY_API; + static inline bool ReportType_IsValid(int value) { + return ClientSafeBrowsingReportRequest_ReportType_IsValid(value); + } + static const ReportType ReportType_MIN = + ClientSafeBrowsingReportRequest_ReportType_ReportType_MIN; + static const ReportType ReportType_MAX = + ClientSafeBrowsingReportRequest_ReportType_ReportType_MAX; + static const int ReportType_ARRAYSIZE = + ClientSafeBrowsingReportRequest_ReportType_ReportType_ARRAYSIZE; + + // accessors ------------------------------------------------------- + + // optional .safe_browsing.ClientSafeBrowsingReportRequest.ReportType type = 10; + inline bool has_type() const; + inline void clear_type(); + static const int kTypeFieldNumber = 10; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_ReportType type() const; + inline void set_type(::safe_browsing::ClientSafeBrowsingReportRequest_ReportType value); + + // optional .safe_browsing.ClientDownloadResponse.Verdict download_verdict = 11; + inline bool has_download_verdict() const; + inline void clear_download_verdict(); + static const int kDownloadVerdictFieldNumber = 11; + inline ::safe_browsing::ClientDownloadResponse_Verdict download_verdict() const; + inline void set_download_verdict(::safe_browsing::ClientDownloadResponse_Verdict value); + + // optional string url = 1; + inline bool has_url() const; + inline void clear_url(); + static const int kUrlFieldNumber = 1; + inline const ::std::string& url() const; + inline void set_url(const ::std::string& value); + inline void set_url(const char* value); + inline void set_url(const char* value, size_t size); + inline ::std::string* mutable_url(); + inline ::std::string* release_url(); + inline void set_allocated_url(::std::string* url); + + // optional string page_url = 2; + inline bool has_page_url() const; + inline void clear_page_url(); + static const int kPageUrlFieldNumber = 2; + inline const ::std::string& page_url() const; + inline void set_page_url(const ::std::string& value); + inline void set_page_url(const char* value); + inline void set_page_url(const char* value, size_t size); + inline ::std::string* mutable_page_url(); + inline ::std::string* release_page_url(); + inline void set_allocated_page_url(::std::string* page_url); + + // optional string referrer_url = 3; + inline bool has_referrer_url() const; + inline void clear_referrer_url(); + static const int kReferrerUrlFieldNumber = 3; + inline const ::std::string& referrer_url() const; + inline void set_referrer_url(const ::std::string& value); + inline void set_referrer_url(const char* value); + inline void set_referrer_url(const char* value, size_t size); + inline ::std::string* mutable_referrer_url(); + inline ::std::string* release_referrer_url(); + inline void set_allocated_referrer_url(::std::string* referrer_url); + + // repeated .safe_browsing.ClientSafeBrowsingReportRequest.Resource resources = 4; + inline int resources_size() const; + inline void clear_resources(); + static const int kResourcesFieldNumber = 4; + inline const ::safe_browsing::ClientSafeBrowsingReportRequest_Resource& resources(int index) const; + inline ::safe_browsing::ClientSafeBrowsingReportRequest_Resource* mutable_resources(int index); + inline ::safe_browsing::ClientSafeBrowsingReportRequest_Resource* add_resources(); + inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_Resource >& + resources() const; + inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_Resource >* + mutable_resources(); + + // optional bool complete = 5; + inline bool has_complete() const; + inline void clear_complete(); + static const int kCompleteFieldNumber = 5; + inline bool complete() const; + inline void set_complete(bool value); + + // repeated string client_asn = 6; + inline int client_asn_size() const; + inline void clear_client_asn(); + static const int kClientAsnFieldNumber = 6; + inline const ::std::string& client_asn(int index) const; + inline ::std::string* mutable_client_asn(int index); + inline void set_client_asn(int index, const ::std::string& value); + inline void set_client_asn(int index, const char* value); + inline void set_client_asn(int index, const char* value, size_t size); + inline ::std::string* add_client_asn(); + inline void add_client_asn(const ::std::string& value); + inline void add_client_asn(const char* value); + inline void add_client_asn(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& client_asn() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_client_asn(); + + // optional string client_country = 7; + inline bool has_client_country() const; + inline void clear_client_country(); + static const int kClientCountryFieldNumber = 7; + inline const ::std::string& client_country() const; + inline void set_client_country(const ::std::string& value); + inline void set_client_country(const char* value); + inline void set_client_country(const char* value, size_t size); + inline ::std::string* mutable_client_country(); + inline ::std::string* release_client_country(); + inline void set_allocated_client_country(::std::string* client_country); + + // optional bool did_proceed = 8; + inline bool has_did_proceed() const; + inline void clear_did_proceed(); + static const int kDidProceedFieldNumber = 8; + inline bool did_proceed() const; + inline void set_did_proceed(bool value); + + // optional bool repeat_visit = 9; + inline bool has_repeat_visit() const; + inline void clear_repeat_visit(); + static const int kRepeatVisitFieldNumber = 9; + inline bool repeat_visit() const; + inline void set_repeat_visit(bool value); + + // optional bytes token = 15; + inline bool has_token() const; + inline void clear_token(); + static const int kTokenFieldNumber = 15; + inline const ::std::string& token() const; + inline void set_token(const ::std::string& value); + inline void set_token(const char* value); + inline void set_token(const void* value, size_t size); + inline ::std::string* mutable_token(); + inline ::std::string* release_token(); + inline void set_allocated_token(::std::string* token); + + // @@protoc_insertion_point(class_scope:safe_browsing.ClientSafeBrowsingReportRequest) + private: + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_download_verdict(); + inline void clear_has_download_verdict(); + inline void set_has_url(); + inline void clear_has_url(); + inline void set_has_page_url(); + inline void clear_has_page_url(); + inline void set_has_referrer_url(); + inline void clear_has_referrer_url(); + inline void set_has_complete(); + inline void clear_has_complete(); + inline void set_has_client_country(); + inline void clear_has_client_country(); + inline void set_has_did_proceed(); + inline void clear_has_did_proceed(); + inline void set_has_repeat_visit(); + inline void clear_has_repeat_visit(); + inline void set_has_token(); + inline void clear_has_token(); + + ::std::string _unknown_fields_; + + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int type_; + int download_verdict_; + ::std::string* url_; + ::std::string* page_url_; + ::std::string* referrer_url_; + ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_Resource > resources_; + ::google::protobuf::RepeatedPtrField< ::std::string> client_asn_; + ::std::string* client_country_; + ::std::string* token_; + bool complete_; + bool did_proceed_; + bool repeat_visit_; + #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto_impl(); + #else + friend void protobuf_AddDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + #endif + friend void protobuf_AssignDesc_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + friend void protobuf_ShutdownFile_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto(); + + void InitAsDefaultInstance(); + static ClientSafeBrowsingReportRequest* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// ChromeUserPopulation + +// optional .safe_browsing.ChromeUserPopulation.UserPopulation user_population = 1; +inline bool ChromeUserPopulation::has_user_population() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ChromeUserPopulation::set_has_user_population() { + _has_bits_[0] |= 0x00000001u; +} +inline void ChromeUserPopulation::clear_has_user_population() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ChromeUserPopulation::clear_user_population() { + user_population_ = 0; + clear_has_user_population(); +} +inline ::safe_browsing::ChromeUserPopulation_UserPopulation ChromeUserPopulation::user_population() const { + // @@protoc_insertion_point(field_get:safe_browsing.ChromeUserPopulation.user_population) + return static_cast< ::safe_browsing::ChromeUserPopulation_UserPopulation >(user_population_); +} +inline void ChromeUserPopulation::set_user_population(::safe_browsing::ChromeUserPopulation_UserPopulation value) { + assert(::safe_browsing::ChromeUserPopulation_UserPopulation_IsValid(value)); + set_has_user_population(); + user_population_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ChromeUserPopulation.user_population) +} + +// ------------------------------------------------------------------- + +// ClientPhishingRequest_Feature + +// required string name = 1; +inline bool ClientPhishingRequest_Feature::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientPhishingRequest_Feature::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientPhishingRequest_Feature::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientPhishingRequest_Feature::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientPhishingRequest_Feature::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.Feature.name) + return *name_; +} +inline void ClientPhishingRequest_Feature::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.Feature.name) +} +inline void ClientPhishingRequest_Feature::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingRequest.Feature.name) +} +inline void ClientPhishingRequest_Feature::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingRequest.Feature.name) +} +inline ::std::string* ClientPhishingRequest_Feature::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.Feature.name) + return name_; +} +inline ::std::string* ClientPhishingRequest_Feature::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientPhishingRequest_Feature::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.Feature.name) +} + +// required double value = 2; +inline bool ClientPhishingRequest_Feature::has_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientPhishingRequest_Feature::set_has_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientPhishingRequest_Feature::clear_has_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientPhishingRequest_Feature::clear_value() { + value_ = 0; + clear_has_value(); +} +inline double ClientPhishingRequest_Feature::value() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.Feature.value) + return value_; +} +inline void ClientPhishingRequest_Feature::set_value(double value) { + set_has_value(); + value_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.Feature.value) +} + +// ------------------------------------------------------------------- + +// ClientPhishingRequest + +// optional string url = 1; +inline bool ClientPhishingRequest::has_url() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientPhishingRequest::set_has_url() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientPhishingRequest::clear_has_url() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientPhishingRequest::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientPhishingRequest::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.url) + return *url_; +} +inline void ClientPhishingRequest::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.url) +} +inline void ClientPhishingRequest::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingRequest.url) +} +inline void ClientPhishingRequest::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingRequest.url) +} +inline ::std::string* ClientPhishingRequest::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.url) + return url_; +} +inline ::std::string* ClientPhishingRequest::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientPhishingRequest::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.url) +} + +// optional bytes OBSOLETE_hash_prefix = 10; +inline bool ClientPhishingRequest::has_obsolete_hash_prefix() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientPhishingRequest::set_has_obsolete_hash_prefix() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientPhishingRequest::clear_has_obsolete_hash_prefix() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientPhishingRequest::clear_obsolete_hash_prefix() { + if (obsolete_hash_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_->clear(); + } + clear_has_obsolete_hash_prefix(); +} +inline const ::std::string& ClientPhishingRequest::obsolete_hash_prefix() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) + return *obsolete_hash_prefix_; +} +inline void ClientPhishingRequest::set_obsolete_hash_prefix(const ::std::string& value) { + set_has_obsolete_hash_prefix(); + if (obsolete_hash_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_ = new ::std::string; + } + obsolete_hash_prefix_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) +} +inline void ClientPhishingRequest::set_obsolete_hash_prefix(const char* value) { + set_has_obsolete_hash_prefix(); + if (obsolete_hash_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_ = new ::std::string; + } + obsolete_hash_prefix_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) +} +inline void ClientPhishingRequest::set_obsolete_hash_prefix(const void* value, size_t size) { + set_has_obsolete_hash_prefix(); + if (obsolete_hash_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_ = new ::std::string; + } + obsolete_hash_prefix_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) +} +inline ::std::string* ClientPhishingRequest::mutable_obsolete_hash_prefix() { + set_has_obsolete_hash_prefix(); + if (obsolete_hash_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_hash_prefix_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) + return obsolete_hash_prefix_; +} +inline ::std::string* ClientPhishingRequest::release_obsolete_hash_prefix() { + clear_has_obsolete_hash_prefix(); + if (obsolete_hash_prefix_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = obsolete_hash_prefix_; + obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientPhishingRequest::set_allocated_obsolete_hash_prefix(::std::string* obsolete_hash_prefix) { + if (obsolete_hash_prefix_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete obsolete_hash_prefix_; + } + if (obsolete_hash_prefix) { + set_has_obsolete_hash_prefix(); + obsolete_hash_prefix_ = obsolete_hash_prefix; + } else { + clear_has_obsolete_hash_prefix(); + obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.OBSOLETE_hash_prefix) +} + +// required float client_score = 2; +inline bool ClientPhishingRequest::has_client_score() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientPhishingRequest::set_has_client_score() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientPhishingRequest::clear_has_client_score() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientPhishingRequest::clear_client_score() { + client_score_ = 0; + clear_has_client_score(); +} +inline float ClientPhishingRequest::client_score() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.client_score) + return client_score_; +} +inline void ClientPhishingRequest::set_client_score(float value) { + set_has_client_score(); + client_score_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.client_score) +} + +// optional bool is_phishing = 4; +inline bool ClientPhishingRequest::has_is_phishing() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientPhishingRequest::set_has_is_phishing() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientPhishingRequest::clear_has_is_phishing() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientPhishingRequest::clear_is_phishing() { + is_phishing_ = false; + clear_has_is_phishing(); +} +inline bool ClientPhishingRequest::is_phishing() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.is_phishing) + return is_phishing_; +} +inline void ClientPhishingRequest::set_is_phishing(bool value) { + set_has_is_phishing(); + is_phishing_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.is_phishing) +} + +// repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5; +inline int ClientPhishingRequest::feature_map_size() const { + return feature_map_.size(); +} +inline void ClientPhishingRequest::clear_feature_map() { + feature_map_.Clear(); +} +inline const ::safe_browsing::ClientPhishingRequest_Feature& ClientPhishingRequest::feature_map(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.feature_map) + return feature_map_.Get(index); +} +inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::mutable_feature_map(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.feature_map) + return feature_map_.Mutable(index); +} +inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::add_feature_map() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientPhishingRequest.feature_map) + return feature_map_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >& +ClientPhishingRequest::feature_map() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientPhishingRequest.feature_map) + return feature_map_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >* +ClientPhishingRequest::mutable_feature_map() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientPhishingRequest.feature_map) + return &feature_map_; +} + +// optional int32 model_version = 6; +inline bool ClientPhishingRequest::has_model_version() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientPhishingRequest::set_has_model_version() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientPhishingRequest::clear_has_model_version() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientPhishingRequest::clear_model_version() { + model_version_ = 0; + clear_has_model_version(); +} +inline ::google::protobuf::int32 ClientPhishingRequest::model_version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.model_version) + return model_version_; +} +inline void ClientPhishingRequest::set_model_version(::google::protobuf::int32 value) { + set_has_model_version(); + model_version_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.model_version) +} + +// repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8; +inline int ClientPhishingRequest::non_model_feature_map_size() const { + return non_model_feature_map_.size(); +} +inline void ClientPhishingRequest::clear_non_model_feature_map() { + non_model_feature_map_.Clear(); +} +inline const ::safe_browsing::ClientPhishingRequest_Feature& ClientPhishingRequest::non_model_feature_map(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.non_model_feature_map) + return non_model_feature_map_.Get(index); +} +inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::mutable_non_model_feature_map(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.non_model_feature_map) + return non_model_feature_map_.Mutable(index); +} +inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::add_non_model_feature_map() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientPhishingRequest.non_model_feature_map) + return non_model_feature_map_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >& +ClientPhishingRequest::non_model_feature_map() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientPhishingRequest.non_model_feature_map) + return non_model_feature_map_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >* +ClientPhishingRequest::mutable_non_model_feature_map() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientPhishingRequest.non_model_feature_map) + return &non_model_feature_map_; +} + +// optional string OBSOLETE_referrer_url = 9; +inline bool ClientPhishingRequest::has_obsolete_referrer_url() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ClientPhishingRequest::set_has_obsolete_referrer_url() { + _has_bits_[0] |= 0x00000080u; +} +inline void ClientPhishingRequest::clear_has_obsolete_referrer_url() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ClientPhishingRequest::clear_obsolete_referrer_url() { + if (obsolete_referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_->clear(); + } + clear_has_obsolete_referrer_url(); +} +inline const ::std::string& ClientPhishingRequest::obsolete_referrer_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) + return *obsolete_referrer_url_; +} +inline void ClientPhishingRequest::set_obsolete_referrer_url(const ::std::string& value) { + set_has_obsolete_referrer_url(); + if (obsolete_referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_ = new ::std::string; + } + obsolete_referrer_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) +} +inline void ClientPhishingRequest::set_obsolete_referrer_url(const char* value) { + set_has_obsolete_referrer_url(); + if (obsolete_referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_ = new ::std::string; + } + obsolete_referrer_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) +} +inline void ClientPhishingRequest::set_obsolete_referrer_url(const char* value, size_t size) { + set_has_obsolete_referrer_url(); + if (obsolete_referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_ = new ::std::string; + } + obsolete_referrer_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) +} +inline ::std::string* ClientPhishingRequest::mutable_obsolete_referrer_url() { + set_has_obsolete_referrer_url(); + if (obsolete_referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + obsolete_referrer_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) + return obsolete_referrer_url_; +} +inline ::std::string* ClientPhishingRequest::release_obsolete_referrer_url() { + clear_has_obsolete_referrer_url(); + if (obsolete_referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = obsolete_referrer_url_; + obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientPhishingRequest::set_allocated_obsolete_referrer_url(::std::string* obsolete_referrer_url) { + if (obsolete_referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete obsolete_referrer_url_; + } + if (obsolete_referrer_url) { + set_has_obsolete_referrer_url(); + obsolete_referrer_url_ = obsolete_referrer_url; + } else { + clear_has_obsolete_referrer_url(); + obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.OBSOLETE_referrer_url) +} + +// repeated uint32 shingle_hashes = 12 [packed = true]; +inline int ClientPhishingRequest::shingle_hashes_size() const { + return shingle_hashes_.size(); +} +inline void ClientPhishingRequest::clear_shingle_hashes() { + shingle_hashes_.Clear(); +} +inline ::google::protobuf::uint32 ClientPhishingRequest::shingle_hashes(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.shingle_hashes) + return shingle_hashes_.Get(index); +} +inline void ClientPhishingRequest::set_shingle_hashes(int index, ::google::protobuf::uint32 value) { + shingle_hashes_.Set(index, value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.shingle_hashes) +} +inline void ClientPhishingRequest::add_shingle_hashes(::google::protobuf::uint32 value) { + shingle_hashes_.Add(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientPhishingRequest.shingle_hashes) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +ClientPhishingRequest::shingle_hashes() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientPhishingRequest.shingle_hashes) + return shingle_hashes_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +ClientPhishingRequest::mutable_shingle_hashes() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientPhishingRequest.shingle_hashes) + return &shingle_hashes_; +} + +// optional string model_filename = 13; +inline bool ClientPhishingRequest::has_model_filename() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ClientPhishingRequest::set_has_model_filename() { + _has_bits_[0] |= 0x00000200u; +} +inline void ClientPhishingRequest::clear_has_model_filename() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ClientPhishingRequest::clear_model_filename() { + if (model_filename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_->clear(); + } + clear_has_model_filename(); +} +inline const ::std::string& ClientPhishingRequest::model_filename() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.model_filename) + return *model_filename_; +} +inline void ClientPhishingRequest::set_model_filename(const ::std::string& value) { + set_has_model_filename(); + if (model_filename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_ = new ::std::string; + } + model_filename_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingRequest.model_filename) +} +inline void ClientPhishingRequest::set_model_filename(const char* value) { + set_has_model_filename(); + if (model_filename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_ = new ::std::string; + } + model_filename_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingRequest.model_filename) +} +inline void ClientPhishingRequest::set_model_filename(const char* value, size_t size) { + set_has_model_filename(); + if (model_filename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_ = new ::std::string; + } + model_filename_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingRequest.model_filename) +} +inline ::std::string* ClientPhishingRequest::mutable_model_filename() { + set_has_model_filename(); + if (model_filename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + model_filename_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.model_filename) + return model_filename_; +} +inline ::std::string* ClientPhishingRequest::release_model_filename() { + clear_has_model_filename(); + if (model_filename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = model_filename_; + model_filename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientPhishingRequest::set_allocated_model_filename(::std::string* model_filename) { + if (model_filename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete model_filename_; + } + if (model_filename) { + set_has_model_filename(); + model_filename_ = model_filename; + } else { + clear_has_model_filename(); + model_filename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.model_filename) +} + +// optional .safe_browsing.ChromeUserPopulation population = 14; +inline bool ClientPhishingRequest::has_population() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void ClientPhishingRequest::set_has_population() { + _has_bits_[0] |= 0x00000400u; +} +inline void ClientPhishingRequest::clear_has_population() { + _has_bits_[0] &= ~0x00000400u; +} +inline void ClientPhishingRequest::clear_population() { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + clear_has_population(); +} +inline const ::safe_browsing::ChromeUserPopulation& ClientPhishingRequest::population() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingRequest.population) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return population_ != NULL ? *population_ : *default_instance().population_; +#else + return population_ != NULL ? *population_ : *default_instance_->population_; +#endif +} +inline ::safe_browsing::ChromeUserPopulation* ClientPhishingRequest::mutable_population() { + set_has_population(); + if (population_ == NULL) population_ = new ::safe_browsing::ChromeUserPopulation; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingRequest.population) + return population_; +} +inline ::safe_browsing::ChromeUserPopulation* ClientPhishingRequest::release_population() { + clear_has_population(); + ::safe_browsing::ChromeUserPopulation* temp = population_; + population_ = NULL; + return temp; +} +inline void ClientPhishingRequest::set_allocated_population(::safe_browsing::ChromeUserPopulation* population) { + delete population_; + population_ = population; + if (population) { + set_has_population(); + } else { + clear_has_population(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientPhishingRequest.population) +} + +// ------------------------------------------------------------------- + +// ClientPhishingResponse + +// required bool phishy = 1; +inline bool ClientPhishingResponse::has_phishy() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientPhishingResponse::set_has_phishy() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientPhishingResponse::clear_has_phishy() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientPhishingResponse::clear_phishy() { + phishy_ = false; + clear_has_phishy(); +} +inline bool ClientPhishingResponse::phishy() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingResponse.phishy) + return phishy_; +} +inline void ClientPhishingResponse::set_phishy(bool value) { + set_has_phishy(); + phishy_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingResponse.phishy) +} + +// repeated string OBSOLETE_whitelist_expression = 2; +inline int ClientPhishingResponse::obsolete_whitelist_expression_size() const { + return obsolete_whitelist_expression_.size(); +} +inline void ClientPhishingResponse::clear_obsolete_whitelist_expression() { + obsolete_whitelist_expression_.Clear(); +} +inline const ::std::string& ClientPhishingResponse::obsolete_whitelist_expression(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) + return obsolete_whitelist_expression_.Get(index); +} +inline ::std::string* ClientPhishingResponse::mutable_obsolete_whitelist_expression(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) + return obsolete_whitelist_expression_.Mutable(index); +} +inline void ClientPhishingResponse::set_obsolete_whitelist_expression(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) + obsolete_whitelist_expression_.Mutable(index)->assign(value); +} +inline void ClientPhishingResponse::set_obsolete_whitelist_expression(int index, const char* value) { + obsolete_whitelist_expression_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) +} +inline void ClientPhishingResponse::set_obsolete_whitelist_expression(int index, const char* value, size_t size) { + obsolete_whitelist_expression_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) +} +inline ::std::string* ClientPhishingResponse::add_obsolete_whitelist_expression() { + return obsolete_whitelist_expression_.Add(); +} +inline void ClientPhishingResponse::add_obsolete_whitelist_expression(const ::std::string& value) { + obsolete_whitelist_expression_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) +} +inline void ClientPhishingResponse::add_obsolete_whitelist_expression(const char* value) { + obsolete_whitelist_expression_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) +} +inline void ClientPhishingResponse::add_obsolete_whitelist_expression(const char* value, size_t size) { + obsolete_whitelist_expression_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientPhishingResponse::obsolete_whitelist_expression() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) + return obsolete_whitelist_expression_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientPhishingResponse::mutable_obsolete_whitelist_expression() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientPhishingResponse.OBSOLETE_whitelist_expression) + return &obsolete_whitelist_expression_; +} + +// ------------------------------------------------------------------- + +// ClientMalwareRequest_UrlInfo + +// required string ip = 1; +inline bool ClientMalwareRequest_UrlInfo::has_ip() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientMalwareRequest_UrlInfo::set_has_ip() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientMalwareRequest_UrlInfo::clear_has_ip() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientMalwareRequest_UrlInfo::clear_ip() { + if (ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_->clear(); + } + clear_has_ip(); +} +inline const ::std::string& ClientMalwareRequest_UrlInfo::ip() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.UrlInfo.ip) + return *ip_; +} +inline void ClientMalwareRequest_UrlInfo::set_ip(const ::std::string& value) { + set_has_ip(); + if (ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_ = new ::std::string; + } + ip_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.UrlInfo.ip) +} +inline void ClientMalwareRequest_UrlInfo::set_ip(const char* value) { + set_has_ip(); + if (ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_ = new ::std::string; + } + ip_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.UrlInfo.ip) +} +inline void ClientMalwareRequest_UrlInfo::set_ip(const char* value, size_t size) { + set_has_ip(); + if (ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_ = new ::std::string; + } + ip_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.UrlInfo.ip) +} +inline ::std::string* ClientMalwareRequest_UrlInfo::mutable_ip() { + set_has_ip(); + if (ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.UrlInfo.ip) + return ip_; +} +inline ::std::string* ClientMalwareRequest_UrlInfo::release_ip() { + clear_has_ip(); + if (ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = ip_; + ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest_UrlInfo::set_allocated_ip(::std::string* ip) { + if (ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete ip_; + } + if (ip) { + set_has_ip(); + ip_ = ip; + } else { + clear_has_ip(); + ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.UrlInfo.ip) +} + +// required string url = 2; +inline bool ClientMalwareRequest_UrlInfo::has_url() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientMalwareRequest_UrlInfo::set_has_url() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientMalwareRequest_UrlInfo::clear_has_url() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientMalwareRequest_UrlInfo::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientMalwareRequest_UrlInfo::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.UrlInfo.url) + return *url_; +} +inline void ClientMalwareRequest_UrlInfo::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.UrlInfo.url) +} +inline void ClientMalwareRequest_UrlInfo::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.UrlInfo.url) +} +inline void ClientMalwareRequest_UrlInfo::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.UrlInfo.url) +} +inline ::std::string* ClientMalwareRequest_UrlInfo::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.UrlInfo.url) + return url_; +} +inline ::std::string* ClientMalwareRequest_UrlInfo::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest_UrlInfo::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.UrlInfo.url) +} + +// optional string method = 3; +inline bool ClientMalwareRequest_UrlInfo::has_method() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientMalwareRequest_UrlInfo::set_has_method() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientMalwareRequest_UrlInfo::clear_has_method() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientMalwareRequest_UrlInfo::clear_method() { + if (method_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_->clear(); + } + clear_has_method(); +} +inline const ::std::string& ClientMalwareRequest_UrlInfo::method() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.UrlInfo.method) + return *method_; +} +inline void ClientMalwareRequest_UrlInfo::set_method(const ::std::string& value) { + set_has_method(); + if (method_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_ = new ::std::string; + } + method_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.UrlInfo.method) +} +inline void ClientMalwareRequest_UrlInfo::set_method(const char* value) { + set_has_method(); + if (method_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_ = new ::std::string; + } + method_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.UrlInfo.method) +} +inline void ClientMalwareRequest_UrlInfo::set_method(const char* value, size_t size) { + set_has_method(); + if (method_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_ = new ::std::string; + } + method_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.UrlInfo.method) +} +inline ::std::string* ClientMalwareRequest_UrlInfo::mutable_method() { + set_has_method(); + if (method_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + method_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.UrlInfo.method) + return method_; +} +inline ::std::string* ClientMalwareRequest_UrlInfo::release_method() { + clear_has_method(); + if (method_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = method_; + method_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest_UrlInfo::set_allocated_method(::std::string* method) { + if (method_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete method_; + } + if (method) { + set_has_method(); + method_ = method; + } else { + clear_has_method(); + method_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.UrlInfo.method) +} + +// optional string referrer = 4; +inline bool ClientMalwareRequest_UrlInfo::has_referrer() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientMalwareRequest_UrlInfo::set_has_referrer() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientMalwareRequest_UrlInfo::clear_has_referrer() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientMalwareRequest_UrlInfo::clear_referrer() { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + clear_has_referrer(); +} +inline const ::std::string& ClientMalwareRequest_UrlInfo::referrer() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) + return *referrer_; +} +inline void ClientMalwareRequest_UrlInfo::set_referrer(const ::std::string& value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) +} +inline void ClientMalwareRequest_UrlInfo::set_referrer(const char* value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) +} +inline void ClientMalwareRequest_UrlInfo::set_referrer(const char* value, size_t size) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) +} +inline ::std::string* ClientMalwareRequest_UrlInfo::mutable_referrer() { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) + return referrer_; +} +inline ::std::string* ClientMalwareRequest_UrlInfo::release_referrer() { + clear_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = referrer_; + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest_UrlInfo::set_allocated_referrer(::std::string* referrer) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + if (referrer) { + set_has_referrer(); + referrer_ = referrer; + } else { + clear_has_referrer(); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.UrlInfo.referrer) +} + +// optional int32 resource_type = 5; +inline bool ClientMalwareRequest_UrlInfo::has_resource_type() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientMalwareRequest_UrlInfo::set_has_resource_type() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientMalwareRequest_UrlInfo::clear_has_resource_type() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientMalwareRequest_UrlInfo::clear_resource_type() { + resource_type_ = 0; + clear_has_resource_type(); +} +inline ::google::protobuf::int32 ClientMalwareRequest_UrlInfo::resource_type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.UrlInfo.resource_type) + return resource_type_; +} +inline void ClientMalwareRequest_UrlInfo::set_resource_type(::google::protobuf::int32 value) { + set_has_resource_type(); + resource_type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.UrlInfo.resource_type) +} + +// ------------------------------------------------------------------- + +// ClientMalwareRequest + +// required string url = 1; +inline bool ClientMalwareRequest::has_url() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientMalwareRequest::set_has_url() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientMalwareRequest::clear_has_url() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientMalwareRequest::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientMalwareRequest::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.url) + return *url_; +} +inline void ClientMalwareRequest::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.url) +} +inline void ClientMalwareRequest::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.url) +} +inline void ClientMalwareRequest::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.url) +} +inline ::std::string* ClientMalwareRequest::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.url) + return url_; +} +inline ::std::string* ClientMalwareRequest::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.url) +} + +// optional string referrer_url = 4; +inline bool ClientMalwareRequest::has_referrer_url() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientMalwareRequest::set_has_referrer_url() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientMalwareRequest::clear_has_referrer_url() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientMalwareRequest::clear_referrer_url() { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_->clear(); + } + clear_has_referrer_url(); +} +inline const ::std::string& ClientMalwareRequest::referrer_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.referrer_url) + return *referrer_url_; +} +inline void ClientMalwareRequest::set_referrer_url(const ::std::string& value) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareRequest.referrer_url) +} +inline void ClientMalwareRequest::set_referrer_url(const char* value) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareRequest.referrer_url) +} +inline void ClientMalwareRequest::set_referrer_url(const char* value, size_t size) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareRequest.referrer_url) +} +inline ::std::string* ClientMalwareRequest::mutable_referrer_url() { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.referrer_url) + return referrer_url_; +} +inline ::std::string* ClientMalwareRequest::release_referrer_url() { + clear_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = referrer_url_; + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareRequest::set_allocated_referrer_url(::std::string* referrer_url) { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_url_; + } + if (referrer_url) { + set_has_referrer_url(); + referrer_url_ = referrer_url; + } else { + clear_has_referrer_url(); + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.referrer_url) +} + +// repeated .safe_browsing.ClientMalwareRequest.UrlInfo bad_ip_url_info = 7; +inline int ClientMalwareRequest::bad_ip_url_info_size() const { + return bad_ip_url_info_.size(); +} +inline void ClientMalwareRequest::clear_bad_ip_url_info() { + bad_ip_url_info_.Clear(); +} +inline const ::safe_browsing::ClientMalwareRequest_UrlInfo& ClientMalwareRequest::bad_ip_url_info(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.bad_ip_url_info) + return bad_ip_url_info_.Get(index); +} +inline ::safe_browsing::ClientMalwareRequest_UrlInfo* ClientMalwareRequest::mutable_bad_ip_url_info(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.bad_ip_url_info) + return bad_ip_url_info_.Mutable(index); +} +inline ::safe_browsing::ClientMalwareRequest_UrlInfo* ClientMalwareRequest::add_bad_ip_url_info() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientMalwareRequest.bad_ip_url_info) + return bad_ip_url_info_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_UrlInfo >& +ClientMalwareRequest::bad_ip_url_info() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientMalwareRequest.bad_ip_url_info) + return bad_ip_url_info_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_UrlInfo >* +ClientMalwareRequest::mutable_bad_ip_url_info() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientMalwareRequest.bad_ip_url_info) + return &bad_ip_url_info_; +} + +// optional .safe_browsing.ChromeUserPopulation population = 9; +inline bool ClientMalwareRequest::has_population() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientMalwareRequest::set_has_population() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientMalwareRequest::clear_has_population() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientMalwareRequest::clear_population() { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + clear_has_population(); +} +inline const ::safe_browsing::ChromeUserPopulation& ClientMalwareRequest::population() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareRequest.population) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return population_ != NULL ? *population_ : *default_instance().population_; +#else + return population_ != NULL ? *population_ : *default_instance_->population_; +#endif +} +inline ::safe_browsing::ChromeUserPopulation* ClientMalwareRequest::mutable_population() { + set_has_population(); + if (population_ == NULL) population_ = new ::safe_browsing::ChromeUserPopulation; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareRequest.population) + return population_; +} +inline ::safe_browsing::ChromeUserPopulation* ClientMalwareRequest::release_population() { + clear_has_population(); + ::safe_browsing::ChromeUserPopulation* temp = population_; + population_ = NULL; + return temp; +} +inline void ClientMalwareRequest::set_allocated_population(::safe_browsing::ChromeUserPopulation* population) { + delete population_; + population_ = population; + if (population) { + set_has_population(); + } else { + clear_has_population(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareRequest.population) +} + +// ------------------------------------------------------------------- + +// ClientMalwareResponse + +// required bool blacklist = 1; +inline bool ClientMalwareResponse::has_blacklist() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientMalwareResponse::set_has_blacklist() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientMalwareResponse::clear_has_blacklist() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientMalwareResponse::clear_blacklist() { + blacklist_ = false; + clear_has_blacklist(); +} +inline bool ClientMalwareResponse::blacklist() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareResponse.blacklist) + return blacklist_; +} +inline void ClientMalwareResponse::set_blacklist(bool value) { + set_has_blacklist(); + blacklist_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareResponse.blacklist) +} + +// optional string bad_ip = 2; +inline bool ClientMalwareResponse::has_bad_ip() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientMalwareResponse::set_has_bad_ip() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientMalwareResponse::clear_has_bad_ip() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientMalwareResponse::clear_bad_ip() { + if (bad_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_->clear(); + } + clear_has_bad_ip(); +} +inline const ::std::string& ClientMalwareResponse::bad_ip() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareResponse.bad_ip) + return *bad_ip_; +} +inline void ClientMalwareResponse::set_bad_ip(const ::std::string& value) { + set_has_bad_ip(); + if (bad_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_ = new ::std::string; + } + bad_ip_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareResponse.bad_ip) +} +inline void ClientMalwareResponse::set_bad_ip(const char* value) { + set_has_bad_ip(); + if (bad_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_ = new ::std::string; + } + bad_ip_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareResponse.bad_ip) +} +inline void ClientMalwareResponse::set_bad_ip(const char* value, size_t size) { + set_has_bad_ip(); + if (bad_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_ = new ::std::string; + } + bad_ip_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareResponse.bad_ip) +} +inline ::std::string* ClientMalwareResponse::mutable_bad_ip() { + set_has_bad_ip(); + if (bad_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_ip_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareResponse.bad_ip) + return bad_ip_; +} +inline ::std::string* ClientMalwareResponse::release_bad_ip() { + clear_has_bad_ip(); + if (bad_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = bad_ip_; + bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareResponse::set_allocated_bad_ip(::std::string* bad_ip) { + if (bad_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bad_ip_; + } + if (bad_ip) { + set_has_bad_ip(); + bad_ip_ = bad_ip; + } else { + clear_has_bad_ip(); + bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareResponse.bad_ip) +} + +// optional string bad_url = 3; +inline bool ClientMalwareResponse::has_bad_url() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientMalwareResponse::set_has_bad_url() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientMalwareResponse::clear_has_bad_url() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientMalwareResponse::clear_bad_url() { + if (bad_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_->clear(); + } + clear_has_bad_url(); +} +inline const ::std::string& ClientMalwareResponse::bad_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientMalwareResponse.bad_url) + return *bad_url_; +} +inline void ClientMalwareResponse::set_bad_url(const ::std::string& value) { + set_has_bad_url(); + if (bad_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_ = new ::std::string; + } + bad_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientMalwareResponse.bad_url) +} +inline void ClientMalwareResponse::set_bad_url(const char* value) { + set_has_bad_url(); + if (bad_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_ = new ::std::string; + } + bad_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientMalwareResponse.bad_url) +} +inline void ClientMalwareResponse::set_bad_url(const char* value, size_t size) { + set_has_bad_url(); + if (bad_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_ = new ::std::string; + } + bad_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientMalwareResponse.bad_url) +} +inline ::std::string* ClientMalwareResponse::mutable_bad_url() { + set_has_bad_url(); + if (bad_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bad_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientMalwareResponse.bad_url) + return bad_url_; +} +inline ::std::string* ClientMalwareResponse::release_bad_url() { + clear_has_bad_url(); + if (bad_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = bad_url_; + bad_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientMalwareResponse::set_allocated_bad_url(::std::string* bad_url) { + if (bad_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bad_url_; + } + if (bad_url) { + set_has_bad_url(); + bad_url_ = bad_url; + } else { + clear_has_bad_url(); + bad_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientMalwareResponse.bad_url) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_Digests + +// optional bytes sha256 = 1; +inline bool ClientDownloadRequest_Digests::has_sha256() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_Digests::set_has_sha256() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_Digests::clear_has_sha256() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_Digests::clear_sha256() { + if (sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_->clear(); + } + clear_has_sha256(); +} +inline const ::std::string& ClientDownloadRequest_Digests::sha256() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Digests.sha256) + return *sha256_; +} +inline void ClientDownloadRequest_Digests::set_sha256(const ::std::string& value) { + set_has_sha256(); + if (sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_ = new ::std::string; + } + sha256_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Digests.sha256) +} +inline void ClientDownloadRequest_Digests::set_sha256(const char* value) { + set_has_sha256(); + if (sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_ = new ::std::string; + } + sha256_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Digests.sha256) +} +inline void ClientDownloadRequest_Digests::set_sha256(const void* value, size_t size) { + set_has_sha256(); + if (sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_ = new ::std::string; + } + sha256_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Digests.sha256) +} +inline ::std::string* ClientDownloadRequest_Digests::mutable_sha256() { + set_has_sha256(); + if (sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha256_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Digests.sha256) + return sha256_; +} +inline ::std::string* ClientDownloadRequest_Digests::release_sha256() { + clear_has_sha256(); + if (sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = sha256_; + sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Digests::set_allocated_sha256(::std::string* sha256) { + if (sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete sha256_; + } + if (sha256) { + set_has_sha256(); + sha256_ = sha256; + } else { + clear_has_sha256(); + sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Digests.sha256) +} + +// optional bytes sha1 = 2; +inline bool ClientDownloadRequest_Digests::has_sha1() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_Digests::set_has_sha1() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_Digests::clear_has_sha1() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_Digests::clear_sha1() { + if (sha1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_->clear(); + } + clear_has_sha1(); +} +inline const ::std::string& ClientDownloadRequest_Digests::sha1() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Digests.sha1) + return *sha1_; +} +inline void ClientDownloadRequest_Digests::set_sha1(const ::std::string& value) { + set_has_sha1(); + if (sha1_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_ = new ::std::string; + } + sha1_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Digests.sha1) +} +inline void ClientDownloadRequest_Digests::set_sha1(const char* value) { + set_has_sha1(); + if (sha1_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_ = new ::std::string; + } + sha1_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Digests.sha1) +} +inline void ClientDownloadRequest_Digests::set_sha1(const void* value, size_t size) { + set_has_sha1(); + if (sha1_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_ = new ::std::string; + } + sha1_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Digests.sha1) +} +inline ::std::string* ClientDownloadRequest_Digests::mutable_sha1() { + set_has_sha1(); + if (sha1_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + sha1_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Digests.sha1) + return sha1_; +} +inline ::std::string* ClientDownloadRequest_Digests::release_sha1() { + clear_has_sha1(); + if (sha1_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = sha1_; + sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Digests::set_allocated_sha1(::std::string* sha1) { + if (sha1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete sha1_; + } + if (sha1) { + set_has_sha1(); + sha1_ = sha1; + } else { + clear_has_sha1(); + sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Digests.sha1) +} + +// optional bytes md5 = 3; +inline bool ClientDownloadRequest_Digests::has_md5() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest_Digests::set_has_md5() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest_Digests::clear_has_md5() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest_Digests::clear_md5() { + if (md5_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_->clear(); + } + clear_has_md5(); +} +inline const ::std::string& ClientDownloadRequest_Digests::md5() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Digests.md5) + return *md5_; +} +inline void ClientDownloadRequest_Digests::set_md5(const ::std::string& value) { + set_has_md5(); + if (md5_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_ = new ::std::string; + } + md5_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Digests.md5) +} +inline void ClientDownloadRequest_Digests::set_md5(const char* value) { + set_has_md5(); + if (md5_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_ = new ::std::string; + } + md5_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Digests.md5) +} +inline void ClientDownloadRequest_Digests::set_md5(const void* value, size_t size) { + set_has_md5(); + if (md5_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_ = new ::std::string; + } + md5_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Digests.md5) +} +inline ::std::string* ClientDownloadRequest_Digests::mutable_md5() { + set_has_md5(); + if (md5_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + md5_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Digests.md5) + return md5_; +} +inline ::std::string* ClientDownloadRequest_Digests::release_md5() { + clear_has_md5(); + if (md5_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = md5_; + md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Digests::set_allocated_md5(::std::string* md5) { + if (md5_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete md5_; + } + if (md5) { + set_has_md5(); + md5_ = md5; + } else { + clear_has_md5(); + md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Digests.md5) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_Resource + +// required string url = 1; +inline bool ClientDownloadRequest_Resource::has_url() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_Resource::set_has_url() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_Resource::clear_has_url() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_Resource::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientDownloadRequest_Resource::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Resource.url) + return *url_; +} +inline void ClientDownloadRequest_Resource::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Resource.url) +} +inline void ClientDownloadRequest_Resource::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Resource.url) +} +inline void ClientDownloadRequest_Resource::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Resource.url) +} +inline ::std::string* ClientDownloadRequest_Resource::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Resource.url) + return url_; +} +inline ::std::string* ClientDownloadRequest_Resource::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Resource::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Resource.url) +} + +// required .safe_browsing.ClientDownloadRequest.ResourceType type = 2; +inline bool ClientDownloadRequest_Resource::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_Resource::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_Resource::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_Resource::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::safe_browsing::ClientDownloadRequest_ResourceType ClientDownloadRequest_Resource::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Resource.type) + return static_cast< ::safe_browsing::ClientDownloadRequest_ResourceType >(type_); +} +inline void ClientDownloadRequest_Resource::set_type(::safe_browsing::ClientDownloadRequest_ResourceType value) { + assert(::safe_browsing::ClientDownloadRequest_ResourceType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Resource.type) +} + +// optional bytes remote_ip = 3; +inline bool ClientDownloadRequest_Resource::has_remote_ip() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest_Resource::set_has_remote_ip() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest_Resource::clear_has_remote_ip() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest_Resource::clear_remote_ip() { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_->clear(); + } + clear_has_remote_ip(); +} +inline const ::std::string& ClientDownloadRequest_Resource::remote_ip() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Resource.remote_ip) + return *remote_ip_; +} +inline void ClientDownloadRequest_Resource::set_remote_ip(const ::std::string& value) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Resource.remote_ip) +} +inline void ClientDownloadRequest_Resource::set_remote_ip(const char* value) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Resource.remote_ip) +} +inline void ClientDownloadRequest_Resource::set_remote_ip(const void* value, size_t size) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Resource.remote_ip) +} +inline ::std::string* ClientDownloadRequest_Resource::mutable_remote_ip() { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Resource.remote_ip) + return remote_ip_; +} +inline ::std::string* ClientDownloadRequest_Resource::release_remote_ip() { + clear_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = remote_ip_; + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Resource::set_allocated_remote_ip(::std::string* remote_ip) { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete remote_ip_; + } + if (remote_ip) { + set_has_remote_ip(); + remote_ip_ = remote_ip; + } else { + clear_has_remote_ip(); + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Resource.remote_ip) +} + +// optional string referrer = 4; +inline bool ClientDownloadRequest_Resource::has_referrer() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientDownloadRequest_Resource::set_has_referrer() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientDownloadRequest_Resource::clear_has_referrer() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientDownloadRequest_Resource::clear_referrer() { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + clear_has_referrer(); +} +inline const ::std::string& ClientDownloadRequest_Resource::referrer() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.Resource.referrer) + return *referrer_; +} +inline void ClientDownloadRequest_Resource::set_referrer(const ::std::string& value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.Resource.referrer) +} +inline void ClientDownloadRequest_Resource::set_referrer(const char* value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.Resource.referrer) +} +inline void ClientDownloadRequest_Resource::set_referrer(const char* value, size_t size) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.Resource.referrer) +} +inline ::std::string* ClientDownloadRequest_Resource::mutable_referrer() { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.Resource.referrer) + return referrer_; +} +inline ::std::string* ClientDownloadRequest_Resource::release_referrer() { + clear_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = referrer_; + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_Resource::set_allocated_referrer(::std::string* referrer) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + if (referrer) { + set_has_referrer(); + referrer_ = referrer; + } else { + clear_has_referrer(); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.Resource.referrer) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_CertificateChain_Element + +// optional bytes certificate = 1; +inline bool ClientDownloadRequest_CertificateChain_Element::has_certificate() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_CertificateChain_Element::set_has_certificate() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_CertificateChain_Element::clear_has_certificate() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_CertificateChain_Element::clear_certificate() { + if (certificate_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_->clear(); + } + clear_has_certificate(); +} +inline const ::std::string& ClientDownloadRequest_CertificateChain_Element::certificate() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) + return *certificate_; +} +inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const ::std::string& value) { + set_has_certificate(); + if (certificate_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_ = new ::std::string; + } + certificate_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) +} +inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const char* value) { + set_has_certificate(); + if (certificate_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_ = new ::std::string; + } + certificate_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) +} +inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const void* value, size_t size) { + set_has_certificate(); + if (certificate_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_ = new ::std::string; + } + certificate_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) +} +inline ::std::string* ClientDownloadRequest_CertificateChain_Element::mutable_certificate() { + set_has_certificate(); + if (certificate_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + certificate_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) + return certificate_; +} +inline ::std::string* ClientDownloadRequest_CertificateChain_Element::release_certificate() { + clear_has_certificate(); + if (certificate_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = certificate_; + certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_CertificateChain_Element::set_allocated_certificate(::std::string* certificate) { + if (certificate_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete certificate_; + } + if (certificate) { + set_has_certificate(); + certificate_ = certificate; + } else { + clear_has_certificate(); + certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.CertificateChain.Element.certificate) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_CertificateChain + +// repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1; +inline int ClientDownloadRequest_CertificateChain::element_size() const { + return element_.size(); +} +inline void ClientDownloadRequest_CertificateChain::clear_element() { + element_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_CertificateChain_Element& ClientDownloadRequest_CertificateChain::element(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.CertificateChain.element) + return element_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain::mutable_element(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.CertificateChain.element) + return element_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain::add_element() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.CertificateChain.element) + return element_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >& +ClientDownloadRequest_CertificateChain::element() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.CertificateChain.element) + return element_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >* +ClientDownloadRequest_CertificateChain::mutable_element() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.CertificateChain.element) + return &element_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_ExtendedAttr + +// required string key = 1; +inline bool ClientDownloadRequest_ExtendedAttr::has_key() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_ExtendedAttr::set_has_key() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_ExtendedAttr::clear_has_key() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_ExtendedAttr::clear_key() { + if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_->clear(); + } + clear_has_key(); +} +inline const ::std::string& ClientDownloadRequest_ExtendedAttr::key() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) + return *key_; +} +inline void ClientDownloadRequest_ExtendedAttr::set_key(const ::std::string& value) { + set_has_key(); + if (key_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_ = new ::std::string; + } + key_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) +} +inline void ClientDownloadRequest_ExtendedAttr::set_key(const char* value) { + set_has_key(); + if (key_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_ = new ::std::string; + } + key_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) +} +inline void ClientDownloadRequest_ExtendedAttr::set_key(const char* value, size_t size) { + set_has_key(); + if (key_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_ = new ::std::string; + } + key_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) +} +inline ::std::string* ClientDownloadRequest_ExtendedAttr::mutable_key() { + set_has_key(); + if (key_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + key_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) + return key_; +} +inline ::std::string* ClientDownloadRequest_ExtendedAttr::release_key() { + clear_has_key(); + if (key_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = key_; + key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_ExtendedAttr::set_allocated_key(::std::string* key) { + if (key_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete key_; + } + if (key) { + set_has_key(); + key_ = key; + } else { + clear_has_key(); + key_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ExtendedAttr.key) +} + +// optional bytes value = 2; +inline bool ClientDownloadRequest_ExtendedAttr::has_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_ExtendedAttr::set_has_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_ExtendedAttr::clear_has_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_ExtendedAttr::clear_value() { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_->clear(); + } + clear_has_value(); +} +inline const ::std::string& ClientDownloadRequest_ExtendedAttr::value() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) + return *value_; +} +inline void ClientDownloadRequest_ExtendedAttr::set_value(const ::std::string& value) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) +} +inline void ClientDownloadRequest_ExtendedAttr::set_value(const char* value) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) +} +inline void ClientDownloadRequest_ExtendedAttr::set_value(const void* value, size_t size) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) +} +inline ::std::string* ClientDownloadRequest_ExtendedAttr::mutable_value() { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) + return value_; +} +inline ::std::string* ClientDownloadRequest_ExtendedAttr::release_value() { + clear_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = value_; + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_ExtendedAttr::set_allocated_value(::std::string* value) { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete value_; + } + if (value) { + set_has_value(); + value_ = value; + } else { + clear_has_value(); + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ExtendedAttr.value) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_SignatureInfo + +// repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1; +inline int ClientDownloadRequest_SignatureInfo::certificate_chain_size() const { + return certificate_chain_.size(); +} +inline void ClientDownloadRequest_SignatureInfo::clear_certificate_chain() { + certificate_chain_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_CertificateChain& ClientDownloadRequest_SignatureInfo::certificate_chain(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.SignatureInfo.certificate_chain) + return certificate_chain_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_CertificateChain* ClientDownloadRequest_SignatureInfo::mutable_certificate_chain(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.SignatureInfo.certificate_chain) + return certificate_chain_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_CertificateChain* ClientDownloadRequest_SignatureInfo::add_certificate_chain() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.SignatureInfo.certificate_chain) + return certificate_chain_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >& +ClientDownloadRequest_SignatureInfo::certificate_chain() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.SignatureInfo.certificate_chain) + return certificate_chain_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >* +ClientDownloadRequest_SignatureInfo::mutable_certificate_chain() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.SignatureInfo.certificate_chain) + return &certificate_chain_; +} + +// optional bool trusted = 2; +inline bool ClientDownloadRequest_SignatureInfo::has_trusted() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_SignatureInfo::set_has_trusted() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_SignatureInfo::clear_has_trusted() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_SignatureInfo::clear_trusted() { + trusted_ = false; + clear_has_trusted(); +} +inline bool ClientDownloadRequest_SignatureInfo::trusted() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.SignatureInfo.trusted) + return trusted_; +} +inline void ClientDownloadRequest_SignatureInfo::set_trusted(bool value) { + set_has_trusted(); + trusted_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.SignatureInfo.trusted) +} + +// repeated bytes signed_data = 3; +inline int ClientDownloadRequest_SignatureInfo::signed_data_size() const { + return signed_data_.size(); +} +inline void ClientDownloadRequest_SignatureInfo::clear_signed_data() { + signed_data_.Clear(); +} +inline const ::std::string& ClientDownloadRequest_SignatureInfo::signed_data(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) + return signed_data_.Get(index); +} +inline ::std::string* ClientDownloadRequest_SignatureInfo::mutable_signed_data(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) + return signed_data_.Mutable(index); +} +inline void ClientDownloadRequest_SignatureInfo::set_signed_data(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) + signed_data_.Mutable(index)->assign(value); +} +inline void ClientDownloadRequest_SignatureInfo::set_signed_data(int index, const char* value) { + signed_data_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) +} +inline void ClientDownloadRequest_SignatureInfo::set_signed_data(int index, const void* value, size_t size) { + signed_data_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) +} +inline ::std::string* ClientDownloadRequest_SignatureInfo::add_signed_data() { + return signed_data_.Add(); +} +inline void ClientDownloadRequest_SignatureInfo::add_signed_data(const ::std::string& value) { + signed_data_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) +} +inline void ClientDownloadRequest_SignatureInfo::add_signed_data(const char* value) { + signed_data_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) +} +inline void ClientDownloadRequest_SignatureInfo::add_signed_data(const void* value, size_t size) { + signed_data_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientDownloadRequest_SignatureInfo::signed_data() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) + return signed_data_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientDownloadRequest_SignatureInfo::mutable_signed_data() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.SignatureInfo.signed_data) + return &signed_data_; +} + +// repeated .safe_browsing.ClientDownloadRequest.ExtendedAttr xattr = 4; +inline int ClientDownloadRequest_SignatureInfo::xattr_size() const { + return xattr_.size(); +} +inline void ClientDownloadRequest_SignatureInfo::clear_xattr() { + xattr_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_ExtendedAttr& ClientDownloadRequest_SignatureInfo::xattr(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.SignatureInfo.xattr) + return xattr_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_ExtendedAttr* ClientDownloadRequest_SignatureInfo::mutable_xattr(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.SignatureInfo.xattr) + return xattr_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_ExtendedAttr* ClientDownloadRequest_SignatureInfo::add_xattr() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.SignatureInfo.xattr) + return xattr_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ExtendedAttr >& +ClientDownloadRequest_SignatureInfo::xattr() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.SignatureInfo.xattr) + return xattr_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ExtendedAttr >* +ClientDownloadRequest_SignatureInfo::mutable_xattr() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.SignatureInfo.xattr) + return &xattr_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_PEImageHeaders_DebugData + +// optional bytes directory_entry = 1; +inline bool ClientDownloadRequest_PEImageHeaders_DebugData::has_directory_entry() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_has_directory_entry() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::clear_has_directory_entry() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::clear_directory_entry() { + if (directory_entry_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_->clear(); + } + clear_has_directory_entry(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders_DebugData::directory_entry() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) + return *directory_entry_; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_directory_entry(const ::std::string& value) { + set_has_directory_entry(); + if (directory_entry_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_ = new ::std::string; + } + directory_entry_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_directory_entry(const char* value) { + set_has_directory_entry(); + if (directory_entry_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_ = new ::std::string; + } + directory_entry_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_directory_entry(const void* value, size_t size) { + set_has_directory_entry(); + if (directory_entry_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_ = new ::std::string; + } + directory_entry_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders_DebugData::mutable_directory_entry() { + set_has_directory_entry(); + if (directory_entry_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + directory_entry_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) + return directory_entry_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders_DebugData::release_directory_entry() { + clear_has_directory_entry(); + if (directory_entry_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = directory_entry_; + directory_entry_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_allocated_directory_entry(::std::string* directory_entry) { + if (directory_entry_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete directory_entry_; + } + if (directory_entry) { + set_has_directory_entry(); + directory_entry_ = directory_entry; + } else { + clear_has_directory_entry(); + directory_entry_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.directory_entry) +} + +// optional bytes raw_data = 2; +inline bool ClientDownloadRequest_PEImageHeaders_DebugData::has_raw_data() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_has_raw_data() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::clear_has_raw_data() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::clear_raw_data() { + if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_->clear(); + } + clear_has_raw_data(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders_DebugData::raw_data() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) + return *raw_data_; +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_raw_data(const ::std::string& value) { + set_has_raw_data(); + if (raw_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_ = new ::std::string; + } + raw_data_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_raw_data(const char* value) { + set_has_raw_data(); + if (raw_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_ = new ::std::string; + } + raw_data_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_raw_data(const void* value, size_t size) { + set_has_raw_data(); + if (raw_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_ = new ::std::string; + } + raw_data_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders_DebugData::mutable_raw_data() { + set_has_raw_data(); + if (raw_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + raw_data_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) + return raw_data_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders_DebugData::release_raw_data() { + clear_has_raw_data(); + if (raw_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = raw_data_; + raw_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders_DebugData::set_allocated_raw_data(::std::string* raw_data) { + if (raw_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete raw_data_; + } + if (raw_data) { + set_has_raw_data(); + raw_data_ = raw_data; + } else { + clear_has_raw_data(); + raw_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData.raw_data) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_PEImageHeaders + +// optional bytes dos_header = 1; +inline bool ClientDownloadRequest_PEImageHeaders::has_dos_header() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders::set_has_dos_header() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_has_dos_header() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_dos_header() { + if (dos_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_->clear(); + } + clear_has_dos_header(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::dos_header() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) + return *dos_header_; +} +inline void ClientDownloadRequest_PEImageHeaders::set_dos_header(const ::std::string& value) { + set_has_dos_header(); + if (dos_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_ = new ::std::string; + } + dos_header_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) +} +inline void ClientDownloadRequest_PEImageHeaders::set_dos_header(const char* value) { + set_has_dos_header(); + if (dos_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_ = new ::std::string; + } + dos_header_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) +} +inline void ClientDownloadRequest_PEImageHeaders::set_dos_header(const void* value, size_t size) { + set_has_dos_header(); + if (dos_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_ = new ::std::string; + } + dos_header_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_dos_header() { + set_has_dos_header(); + if (dos_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + dos_header_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) + return dos_header_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::release_dos_header() { + clear_has_dos_header(); + if (dos_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = dos_header_; + dos_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders::set_allocated_dos_header(::std::string* dos_header) { + if (dos_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete dos_header_; + } + if (dos_header) { + set_has_dos_header(); + dos_header_ = dos_header; + } else { + clear_has_dos_header(); + dos_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.dos_header) +} + +// optional bytes file_header = 2; +inline bool ClientDownloadRequest_PEImageHeaders::has_file_header() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders::set_has_file_header() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_has_file_header() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_file_header() { + if (file_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_->clear(); + } + clear_has_file_header(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::file_header() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) + return *file_header_; +} +inline void ClientDownloadRequest_PEImageHeaders::set_file_header(const ::std::string& value) { + set_has_file_header(); + if (file_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_ = new ::std::string; + } + file_header_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) +} +inline void ClientDownloadRequest_PEImageHeaders::set_file_header(const char* value) { + set_has_file_header(); + if (file_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_ = new ::std::string; + } + file_header_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) +} +inline void ClientDownloadRequest_PEImageHeaders::set_file_header(const void* value, size_t size) { + set_has_file_header(); + if (file_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_ = new ::std::string; + } + file_header_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_file_header() { + set_has_file_header(); + if (file_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_header_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) + return file_header_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::release_file_header() { + clear_has_file_header(); + if (file_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_header_; + file_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders::set_allocated_file_header(::std::string* file_header) { + if (file_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_header_; + } + if (file_header) { + set_has_file_header(); + file_header_ = file_header; + } else { + clear_has_file_header(); + file_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.file_header) +} + +// optional bytes optional_headers32 = 3; +inline bool ClientDownloadRequest_PEImageHeaders::has_optional_headers32() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders::set_has_optional_headers32() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_has_optional_headers32() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_optional_headers32() { + if (optional_headers32_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_->clear(); + } + clear_has_optional_headers32(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::optional_headers32() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) + return *optional_headers32_; +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers32(const ::std::string& value) { + set_has_optional_headers32(); + if (optional_headers32_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_ = new ::std::string; + } + optional_headers32_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers32(const char* value) { + set_has_optional_headers32(); + if (optional_headers32_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_ = new ::std::string; + } + optional_headers32_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers32(const void* value, size_t size) { + set_has_optional_headers32(); + if (optional_headers32_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_ = new ::std::string; + } + optional_headers32_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_optional_headers32() { + set_has_optional_headers32(); + if (optional_headers32_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers32_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) + return optional_headers32_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::release_optional_headers32() { + clear_has_optional_headers32(); + if (optional_headers32_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = optional_headers32_; + optional_headers32_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders::set_allocated_optional_headers32(::std::string* optional_headers32) { + if (optional_headers32_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete optional_headers32_; + } + if (optional_headers32) { + set_has_optional_headers32(); + optional_headers32_ = optional_headers32; + } else { + clear_has_optional_headers32(); + optional_headers32_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers32) +} + +// optional bytes optional_headers64 = 4; +inline bool ClientDownloadRequest_PEImageHeaders::has_optional_headers64() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders::set_has_optional_headers64() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_has_optional_headers64() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_optional_headers64() { + if (optional_headers64_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_->clear(); + } + clear_has_optional_headers64(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::optional_headers64() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) + return *optional_headers64_; +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers64(const ::std::string& value) { + set_has_optional_headers64(); + if (optional_headers64_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_ = new ::std::string; + } + optional_headers64_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers64(const char* value) { + set_has_optional_headers64(); + if (optional_headers64_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_ = new ::std::string; + } + optional_headers64_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) +} +inline void ClientDownloadRequest_PEImageHeaders::set_optional_headers64(const void* value, size_t size) { + set_has_optional_headers64(); + if (optional_headers64_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_ = new ::std::string; + } + optional_headers64_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_optional_headers64() { + set_has_optional_headers64(); + if (optional_headers64_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + optional_headers64_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) + return optional_headers64_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::release_optional_headers64() { + clear_has_optional_headers64(); + if (optional_headers64_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = optional_headers64_; + optional_headers64_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders::set_allocated_optional_headers64(::std::string* optional_headers64) { + if (optional_headers64_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete optional_headers64_; + } + if (optional_headers64) { + set_has_optional_headers64(); + optional_headers64_ = optional_headers64; + } else { + clear_has_optional_headers64(); + optional_headers64_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.optional_headers64) +} + +// repeated bytes section_header = 5; +inline int ClientDownloadRequest_PEImageHeaders::section_header_size() const { + return section_header_.size(); +} +inline void ClientDownloadRequest_PEImageHeaders::clear_section_header() { + section_header_.Clear(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::section_header(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) + return section_header_.Get(index); +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_section_header(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) + return section_header_.Mutable(index); +} +inline void ClientDownloadRequest_PEImageHeaders::set_section_header(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) + section_header_.Mutable(index)->assign(value); +} +inline void ClientDownloadRequest_PEImageHeaders::set_section_header(int index, const char* value) { + section_header_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) +} +inline void ClientDownloadRequest_PEImageHeaders::set_section_header(int index, const void* value, size_t size) { + section_header_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::add_section_header() { + return section_header_.Add(); +} +inline void ClientDownloadRequest_PEImageHeaders::add_section_header(const ::std::string& value) { + section_header_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) +} +inline void ClientDownloadRequest_PEImageHeaders::add_section_header(const char* value) { + section_header_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) +} +inline void ClientDownloadRequest_PEImageHeaders::add_section_header(const void* value, size_t size) { + section_header_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientDownloadRequest_PEImageHeaders::section_header() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) + return section_header_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientDownloadRequest_PEImageHeaders::mutable_section_header() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.PEImageHeaders.section_header) + return §ion_header_; +} + +// optional bytes export_section_data = 6; +inline bool ClientDownloadRequest_PEImageHeaders::has_export_section_data() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientDownloadRequest_PEImageHeaders::set_has_export_section_data() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_has_export_section_data() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientDownloadRequest_PEImageHeaders::clear_export_section_data() { + if (export_section_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_->clear(); + } + clear_has_export_section_data(); +} +inline const ::std::string& ClientDownloadRequest_PEImageHeaders::export_section_data() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) + return *export_section_data_; +} +inline void ClientDownloadRequest_PEImageHeaders::set_export_section_data(const ::std::string& value) { + set_has_export_section_data(); + if (export_section_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_ = new ::std::string; + } + export_section_data_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) +} +inline void ClientDownloadRequest_PEImageHeaders::set_export_section_data(const char* value) { + set_has_export_section_data(); + if (export_section_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_ = new ::std::string; + } + export_section_data_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) +} +inline void ClientDownloadRequest_PEImageHeaders::set_export_section_data(const void* value, size_t size) { + set_has_export_section_data(); + if (export_section_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_ = new ::std::string; + } + export_section_data_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::mutable_export_section_data() { + set_has_export_section_data(); + if (export_section_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_section_data_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) + return export_section_data_; +} +inline ::std::string* ClientDownloadRequest_PEImageHeaders::release_export_section_data() { + clear_has_export_section_data(); + if (export_section_data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = export_section_data_; + export_section_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_PEImageHeaders::set_allocated_export_section_data(::std::string* export_section_data) { + if (export_section_data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete export_section_data_; + } + if (export_section_data) { + set_has_export_section_data(); + export_section_data_ = export_section_data; + } else { + clear_has_export_section_data(); + export_section_data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.PEImageHeaders.export_section_data) +} + +// repeated .safe_browsing.ClientDownloadRequest.PEImageHeaders.DebugData debug_data = 7; +inline int ClientDownloadRequest_PEImageHeaders::debug_data_size() const { + return debug_data_.size(); +} +inline void ClientDownloadRequest_PEImageHeaders::clear_debug_data() { + debug_data_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData& ClientDownloadRequest_PEImageHeaders::debug_data(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.PEImageHeaders.debug_data) + return debug_data_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData* ClientDownloadRequest_PEImageHeaders::mutable_debug_data(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.PEImageHeaders.debug_data) + return debug_data_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData* ClientDownloadRequest_PEImageHeaders::add_debug_data() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.PEImageHeaders.debug_data) + return debug_data_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData >& +ClientDownloadRequest_PEImageHeaders::debug_data() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.PEImageHeaders.debug_data) + return debug_data_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData >* +ClientDownloadRequest_PEImageHeaders::mutable_debug_data() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.PEImageHeaders.debug_data) + return &debug_data_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_MachOHeaders_LoadCommand + +// required uint32 command_id = 1; +inline bool ClientDownloadRequest_MachOHeaders_LoadCommand::has_command_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_has_command_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::clear_has_command_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::clear_command_id() { + command_id_ = 0u; + clear_has_command_id(); +} +inline ::google::protobuf::uint32 ClientDownloadRequest_MachOHeaders_LoadCommand::command_id() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command_id) + return command_id_; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_command_id(::google::protobuf::uint32 value) { + set_has_command_id(); + command_id_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command_id) +} + +// required bytes command = 2; +inline bool ClientDownloadRequest_MachOHeaders_LoadCommand::has_command() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_has_command() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::clear_has_command() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::clear_command() { + if (command_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_->clear(); + } + clear_has_command(); +} +inline const ::std::string& ClientDownloadRequest_MachOHeaders_LoadCommand::command() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) + return *command_; +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_command(const ::std::string& value) { + set_has_command(); + if (command_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_ = new ::std::string; + } + command_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_command(const char* value) { + set_has_command(); + if (command_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_ = new ::std::string; + } + command_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_command(const void* value, size_t size) { + set_has_command(); + if (command_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_ = new ::std::string; + } + command_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) +} +inline ::std::string* ClientDownloadRequest_MachOHeaders_LoadCommand::mutable_command() { + set_has_command(); + if (command_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + command_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) + return command_; +} +inline ::std::string* ClientDownloadRequest_MachOHeaders_LoadCommand::release_command() { + clear_has_command(); + if (command_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = command_; + command_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_MachOHeaders_LoadCommand::set_allocated_command(::std::string* command) { + if (command_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete command_; + } + if (command) { + set_has_command(); + command_ = command; + } else { + clear_has_command(); + command_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand.command) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_MachOHeaders + +// required bytes mach_header = 1; +inline bool ClientDownloadRequest_MachOHeaders::has_mach_header() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_MachOHeaders::set_has_mach_header() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_MachOHeaders::clear_has_mach_header() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_MachOHeaders::clear_mach_header() { + if (mach_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_->clear(); + } + clear_has_mach_header(); +} +inline const ::std::string& ClientDownloadRequest_MachOHeaders::mach_header() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) + return *mach_header_; +} +inline void ClientDownloadRequest_MachOHeaders::set_mach_header(const ::std::string& value) { + set_has_mach_header(); + if (mach_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_ = new ::std::string; + } + mach_header_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) +} +inline void ClientDownloadRequest_MachOHeaders::set_mach_header(const char* value) { + set_has_mach_header(); + if (mach_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_ = new ::std::string; + } + mach_header_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) +} +inline void ClientDownloadRequest_MachOHeaders::set_mach_header(const void* value, size_t size) { + set_has_mach_header(); + if (mach_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_ = new ::std::string; + } + mach_header_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) +} +inline ::std::string* ClientDownloadRequest_MachOHeaders::mutable_mach_header() { + set_has_mach_header(); + if (mach_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + mach_header_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) + return mach_header_; +} +inline ::std::string* ClientDownloadRequest_MachOHeaders::release_mach_header() { + clear_has_mach_header(); + if (mach_header_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = mach_header_; + mach_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_MachOHeaders::set_allocated_mach_header(::std::string* mach_header) { + if (mach_header_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete mach_header_; + } + if (mach_header) { + set_has_mach_header(); + mach_header_ = mach_header; + } else { + clear_has_mach_header(); + mach_header_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.MachOHeaders.mach_header) +} + +// repeated .safe_browsing.ClientDownloadRequest.MachOHeaders.LoadCommand load_commands = 2; +inline int ClientDownloadRequest_MachOHeaders::load_commands_size() const { + return load_commands_.size(); +} +inline void ClientDownloadRequest_MachOHeaders::clear_load_commands() { + load_commands_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand& ClientDownloadRequest_MachOHeaders::load_commands(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.MachOHeaders.load_commands) + return load_commands_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand* ClientDownloadRequest_MachOHeaders::mutable_load_commands(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.MachOHeaders.load_commands) + return load_commands_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand* ClientDownloadRequest_MachOHeaders::add_load_commands() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.MachOHeaders.load_commands) + return load_commands_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand >& +ClientDownloadRequest_MachOHeaders::load_commands() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.MachOHeaders.load_commands) + return load_commands_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders_LoadCommand >* +ClientDownloadRequest_MachOHeaders::mutable_load_commands() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.MachOHeaders.load_commands) + return &load_commands_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_ImageHeaders + +// optional .safe_browsing.ClientDownloadRequest.PEImageHeaders pe_headers = 1; +inline bool ClientDownloadRequest_ImageHeaders::has_pe_headers() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_ImageHeaders::set_has_pe_headers() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_ImageHeaders::clear_has_pe_headers() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_ImageHeaders::clear_pe_headers() { + if (pe_headers_ != NULL) pe_headers_->::safe_browsing::ClientDownloadRequest_PEImageHeaders::Clear(); + clear_has_pe_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_PEImageHeaders& ClientDownloadRequest_ImageHeaders::pe_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ImageHeaders.pe_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return pe_headers_ != NULL ? *pe_headers_ : *default_instance().pe_headers_; +#else + return pe_headers_ != NULL ? *pe_headers_ : *default_instance_->pe_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders* ClientDownloadRequest_ImageHeaders::mutable_pe_headers() { + set_has_pe_headers(); + if (pe_headers_ == NULL) pe_headers_ = new ::safe_browsing::ClientDownloadRequest_PEImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ImageHeaders.pe_headers) + return pe_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_PEImageHeaders* ClientDownloadRequest_ImageHeaders::release_pe_headers() { + clear_has_pe_headers(); + ::safe_browsing::ClientDownloadRequest_PEImageHeaders* temp = pe_headers_; + pe_headers_ = NULL; + return temp; +} +inline void ClientDownloadRequest_ImageHeaders::set_allocated_pe_headers(::safe_browsing::ClientDownloadRequest_PEImageHeaders* pe_headers) { + delete pe_headers_; + pe_headers_ = pe_headers; + if (pe_headers) { + set_has_pe_headers(); + } else { + clear_has_pe_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ImageHeaders.pe_headers) +} + +// repeated .safe_browsing.ClientDownloadRequest.MachOHeaders mach_o_headers = 2; +inline int ClientDownloadRequest_ImageHeaders::mach_o_headers_size() const { + return mach_o_headers_.size(); +} +inline void ClientDownloadRequest_ImageHeaders::clear_mach_o_headers() { + mach_o_headers_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_MachOHeaders& ClientDownloadRequest_ImageHeaders::mach_o_headers(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ImageHeaders.mach_o_headers) + return mach_o_headers_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_MachOHeaders* ClientDownloadRequest_ImageHeaders::mutable_mach_o_headers(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ImageHeaders.mach_o_headers) + return mach_o_headers_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_MachOHeaders* ClientDownloadRequest_ImageHeaders::add_mach_o_headers() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.ImageHeaders.mach_o_headers) + return mach_o_headers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders >& +ClientDownloadRequest_ImageHeaders::mach_o_headers() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.ImageHeaders.mach_o_headers) + return mach_o_headers_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_MachOHeaders >* +ClientDownloadRequest_ImageHeaders::mutable_mach_o_headers() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.ImageHeaders.mach_o_headers) + return &mach_o_headers_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_ArchivedBinary + +// optional string file_basename = 1; +inline bool ClientDownloadRequest_ArchivedBinary::has_file_basename() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_file_basename() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_file_basename() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_file_basename() { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + clear_has_file_basename(); +} +inline const ::std::string& ClientDownloadRequest_ArchivedBinary::file_basename() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) + return *file_basename_; +} +inline void ClientDownloadRequest_ArchivedBinary::set_file_basename(const ::std::string& value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) +} +inline void ClientDownloadRequest_ArchivedBinary::set_file_basename(const char* value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) +} +inline void ClientDownloadRequest_ArchivedBinary::set_file_basename(const char* value, size_t size) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) +} +inline ::std::string* ClientDownloadRequest_ArchivedBinary::mutable_file_basename() { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) + return file_basename_; +} +inline ::std::string* ClientDownloadRequest_ArchivedBinary::release_file_basename() { + clear_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_basename_; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_ArchivedBinary::set_allocated_file_basename(::std::string* file_basename) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + if (file_basename) { + set_has_file_basename(); + file_basename_ = file_basename; + } else { + clear_has_file_basename(); + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ArchivedBinary.file_basename) +} + +// optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 2; +inline bool ClientDownloadRequest_ArchivedBinary::has_download_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_download_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_download_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_download_type() { + download_type_ = 0; + clear_has_download_type(); +} +inline ::safe_browsing::ClientDownloadRequest_DownloadType ClientDownloadRequest_ArchivedBinary::download_type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.download_type) + return static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(download_type_); +} +inline void ClientDownloadRequest_ArchivedBinary::set_download_type(::safe_browsing::ClientDownloadRequest_DownloadType value) { + assert(::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)); + set_has_download_type(); + download_type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.ArchivedBinary.download_type) +} + +// optional .safe_browsing.ClientDownloadRequest.Digests digests = 3; +inline bool ClientDownloadRequest_ArchivedBinary::has_digests() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_digests() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_digests() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_digests() { + if (digests_ != NULL) digests_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + clear_has_digests(); +} +inline const ::safe_browsing::ClientDownloadRequest_Digests& ClientDownloadRequest_ArchivedBinary::digests() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.digests) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return digests_ != NULL ? *digests_ : *default_instance().digests_; +#else + return digests_ != NULL ? *digests_ : *default_instance_->digests_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientDownloadRequest_ArchivedBinary::mutable_digests() { + set_has_digests(); + if (digests_ == NULL) digests_ = new ::safe_browsing::ClientDownloadRequest_Digests; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ArchivedBinary.digests) + return digests_; +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientDownloadRequest_ArchivedBinary::release_digests() { + clear_has_digests(); + ::safe_browsing::ClientDownloadRequest_Digests* temp = digests_; + digests_ = NULL; + return temp; +} +inline void ClientDownloadRequest_ArchivedBinary::set_allocated_digests(::safe_browsing::ClientDownloadRequest_Digests* digests) { + delete digests_; + digests_ = digests; + if (digests) { + set_has_digests(); + } else { + clear_has_digests(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ArchivedBinary.digests) +} + +// optional int64 length = 4; +inline bool ClientDownloadRequest_ArchivedBinary::has_length() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_length() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_length() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_length() { + length_ = GOOGLE_LONGLONG(0); + clear_has_length(); +} +inline ::google::protobuf::int64 ClientDownloadRequest_ArchivedBinary::length() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.length) + return length_; +} +inline void ClientDownloadRequest_ArchivedBinary::set_length(::google::protobuf::int64 value) { + set_has_length(); + length_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.ArchivedBinary.length) +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; +inline bool ClientDownloadRequest_ArchivedBinary::has_signature() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_signature() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_signature() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientDownloadRequest_ArchivedBinary::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_ArchivedBinary::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ArchivedBinary.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_ArchivedBinary::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientDownloadRequest_ArchivedBinary::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ArchivedBinary.signature) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; +inline bool ClientDownloadRequest_ArchivedBinary::has_image_headers() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientDownloadRequest_ArchivedBinary::set_has_image_headers() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientDownloadRequest_ArchivedBinary::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientDownloadRequest_ArchivedBinary::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.ArchivedBinary.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientDownloadRequest_ArchivedBinary::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.ArchivedBinary.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientDownloadRequest_ArchivedBinary::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientDownloadRequest_ArchivedBinary::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.ArchivedBinary.image_headers) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest_URLChainEntry + +// optional string url = 1; +inline bool ClientDownloadRequest_URLChainEntry::has_url() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_url() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_url() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientDownloadRequest_URLChainEntry::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.url) + return *url_; +} +inline void ClientDownloadRequest_URLChainEntry::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.url) +} +inline void ClientDownloadRequest_URLChainEntry::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.URLChainEntry.url) +} +inline void ClientDownloadRequest_URLChainEntry::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.URLChainEntry.url) +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.URLChainEntry.url) + return url_; +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_URLChainEntry::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.URLChainEntry.url) +} + +// optional .safe_browsing.ClientDownloadRequest.URLChainEntry.URLType type = 2; +inline bool ClientDownloadRequest_URLChainEntry::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_type() { + type_ = 1; + clear_has_type(); +} +inline ::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType ClientDownloadRequest_URLChainEntry::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.type) + return static_cast< ::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType >(type_); +} +inline void ClientDownloadRequest_URLChainEntry::set_type(::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType value) { + assert(::safe_browsing::ClientDownloadRequest_URLChainEntry_URLType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.type) +} + +// optional string ip_address = 3; +inline bool ClientDownloadRequest_URLChainEntry::has_ip_address() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_ip_address() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_ip_address() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_ip_address() { + if (ip_address_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_->clear(); + } + clear_has_ip_address(); +} +inline const ::std::string& ClientDownloadRequest_URLChainEntry::ip_address() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) + return *ip_address_; +} +inline void ClientDownloadRequest_URLChainEntry::set_ip_address(const ::std::string& value) { + set_has_ip_address(); + if (ip_address_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_ = new ::std::string; + } + ip_address_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) +} +inline void ClientDownloadRequest_URLChainEntry::set_ip_address(const char* value) { + set_has_ip_address(); + if (ip_address_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_ = new ::std::string; + } + ip_address_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) +} +inline void ClientDownloadRequest_URLChainEntry::set_ip_address(const char* value, size_t size) { + set_has_ip_address(); + if (ip_address_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_ = new ::std::string; + } + ip_address_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::mutable_ip_address() { + set_has_ip_address(); + if (ip_address_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + ip_address_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) + return ip_address_; +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::release_ip_address() { + clear_has_ip_address(); + if (ip_address_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = ip_address_; + ip_address_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_URLChainEntry::set_allocated_ip_address(::std::string* ip_address) { + if (ip_address_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete ip_address_; + } + if (ip_address) { + set_has_ip_address(); + ip_address_ = ip_address; + } else { + clear_has_ip_address(); + ip_address_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.URLChainEntry.ip_address) +} + +// optional string referrer = 4; +inline bool ClientDownloadRequest_URLChainEntry::has_referrer() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_referrer() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_referrer() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_referrer() { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_->clear(); + } + clear_has_referrer(); +} +inline const ::std::string& ClientDownloadRequest_URLChainEntry::referrer() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) + return *referrer_; +} +inline void ClientDownloadRequest_URLChainEntry::set_referrer(const ::std::string& value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) +} +inline void ClientDownloadRequest_URLChainEntry::set_referrer(const char* value) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) +} +inline void ClientDownloadRequest_URLChainEntry::set_referrer(const char* value, size_t size) { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + referrer_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::mutable_referrer() { + set_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) + return referrer_; +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::release_referrer() { + clear_has_referrer(); + if (referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = referrer_; + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_URLChainEntry::set_allocated_referrer(::std::string* referrer) { + if (referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_; + } + if (referrer) { + set_has_referrer(); + referrer_ = referrer; + } else { + clear_has_referrer(); + referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.URLChainEntry.referrer) +} + +// optional string main_frame_referrer = 5; +inline bool ClientDownloadRequest_URLChainEntry::has_main_frame_referrer() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_main_frame_referrer() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_main_frame_referrer() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_main_frame_referrer() { + if (main_frame_referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_->clear(); + } + clear_has_main_frame_referrer(); +} +inline const ::std::string& ClientDownloadRequest_URLChainEntry::main_frame_referrer() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) + return *main_frame_referrer_; +} +inline void ClientDownloadRequest_URLChainEntry::set_main_frame_referrer(const ::std::string& value) { + set_has_main_frame_referrer(); + if (main_frame_referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_ = new ::std::string; + } + main_frame_referrer_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) +} +inline void ClientDownloadRequest_URLChainEntry::set_main_frame_referrer(const char* value) { + set_has_main_frame_referrer(); + if (main_frame_referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_ = new ::std::string; + } + main_frame_referrer_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) +} +inline void ClientDownloadRequest_URLChainEntry::set_main_frame_referrer(const char* value, size_t size) { + set_has_main_frame_referrer(); + if (main_frame_referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_ = new ::std::string; + } + main_frame_referrer_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::mutable_main_frame_referrer() { + set_has_main_frame_referrer(); + if (main_frame_referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + main_frame_referrer_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) + return main_frame_referrer_; +} +inline ::std::string* ClientDownloadRequest_URLChainEntry::release_main_frame_referrer() { + clear_has_main_frame_referrer(); + if (main_frame_referrer_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = main_frame_referrer_; + main_frame_referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest_URLChainEntry::set_allocated_main_frame_referrer(::std::string* main_frame_referrer) { + if (main_frame_referrer_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete main_frame_referrer_; + } + if (main_frame_referrer) { + set_has_main_frame_referrer(); + main_frame_referrer_ = main_frame_referrer; + } else { + clear_has_main_frame_referrer(); + main_frame_referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.URLChainEntry.main_frame_referrer) +} + +// optional bool is_retargeting = 6; +inline bool ClientDownloadRequest_URLChainEntry::has_is_retargeting() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_is_retargeting() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_is_retargeting() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_is_retargeting() { + is_retargeting_ = false; + clear_has_is_retargeting(); +} +inline bool ClientDownloadRequest_URLChainEntry::is_retargeting() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.is_retargeting) + return is_retargeting_; +} +inline void ClientDownloadRequest_URLChainEntry::set_is_retargeting(bool value) { + set_has_is_retargeting(); + is_retargeting_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.is_retargeting) +} + +// optional bool is_user_initiated = 7; +inline bool ClientDownloadRequest_URLChainEntry::has_is_user_initiated() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_is_user_initiated() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_is_user_initiated() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_is_user_initiated() { + is_user_initiated_ = false; + clear_has_is_user_initiated(); +} +inline bool ClientDownloadRequest_URLChainEntry::is_user_initiated() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.is_user_initiated) + return is_user_initiated_; +} +inline void ClientDownloadRequest_URLChainEntry::set_is_user_initiated(bool value) { + set_has_is_user_initiated(); + is_user_initiated_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.is_user_initiated) +} + +// optional double timestamp_in_millisec = 8; +inline bool ClientDownloadRequest_URLChainEntry::has_timestamp_in_millisec() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ClientDownloadRequest_URLChainEntry::set_has_timestamp_in_millisec() { + _has_bits_[0] |= 0x00000080u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_has_timestamp_in_millisec() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ClientDownloadRequest_URLChainEntry::clear_timestamp_in_millisec() { + timestamp_in_millisec_ = 0; + clear_has_timestamp_in_millisec(); +} +inline double ClientDownloadRequest_URLChainEntry::timestamp_in_millisec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.URLChainEntry.timestamp_in_millisec) + return timestamp_in_millisec_; +} +inline void ClientDownloadRequest_URLChainEntry::set_timestamp_in_millisec(double value) { + set_has_timestamp_in_millisec(); + timestamp_in_millisec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.URLChainEntry.timestamp_in_millisec) +} + +// ------------------------------------------------------------------- + +// ClientDownloadRequest + +// required string url = 1; +inline bool ClientDownloadRequest::has_url() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadRequest::set_has_url() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadRequest::clear_has_url() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadRequest::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientDownloadRequest::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.url) + return *url_; +} +inline void ClientDownloadRequest::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.url) +} +inline void ClientDownloadRequest::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.url) +} +inline void ClientDownloadRequest::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.url) +} +inline ::std::string* ClientDownloadRequest::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.url) + return url_; +} +inline ::std::string* ClientDownloadRequest::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.url) +} + +// required .safe_browsing.ClientDownloadRequest.Digests digests = 2; +inline bool ClientDownloadRequest::has_digests() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadRequest::set_has_digests() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadRequest::clear_has_digests() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadRequest::clear_digests() { + if (digests_ != NULL) digests_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + clear_has_digests(); +} +inline const ::safe_browsing::ClientDownloadRequest_Digests& ClientDownloadRequest::digests() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.digests) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return digests_ != NULL ? *digests_ : *default_instance().digests_; +#else + return digests_ != NULL ? *digests_ : *default_instance_->digests_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientDownloadRequest::mutable_digests() { + set_has_digests(); + if (digests_ == NULL) digests_ = new ::safe_browsing::ClientDownloadRequest_Digests; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.digests) + return digests_; +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientDownloadRequest::release_digests() { + clear_has_digests(); + ::safe_browsing::ClientDownloadRequest_Digests* temp = digests_; + digests_ = NULL; + return temp; +} +inline void ClientDownloadRequest::set_allocated_digests(::safe_browsing::ClientDownloadRequest_Digests* digests) { + delete digests_; + digests_ = digests; + if (digests) { + set_has_digests(); + } else { + clear_has_digests(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.digests) +} + +// required int64 length = 3; +inline bool ClientDownloadRequest::has_length() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadRequest::set_has_length() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadRequest::clear_has_length() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadRequest::clear_length() { + length_ = GOOGLE_LONGLONG(0); + clear_has_length(); +} +inline ::google::protobuf::int64 ClientDownloadRequest::length() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.length) + return length_; +} +inline void ClientDownloadRequest::set_length(::google::protobuf::int64 value) { + set_has_length(); + length_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.length) +} + +// repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4; +inline int ClientDownloadRequest::resources_size() const { + return resources_.size(); +} +inline void ClientDownloadRequest::clear_resources() { + resources_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_Resource& ClientDownloadRequest::resources(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.resources) + return resources_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_Resource* ClientDownloadRequest::mutable_resources(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.resources) + return resources_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_Resource* ClientDownloadRequest::add_resources() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.resources) + return resources_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >& +ClientDownloadRequest::resources() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.resources) + return resources_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >* +ClientDownloadRequest::mutable_resources() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.resources) + return &resources_; +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; +inline bool ClientDownloadRequest::has_signature() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientDownloadRequest::set_has_signature() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientDownloadRequest::clear_has_signature() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientDownloadRequest::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientDownloadRequest::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientDownloadRequest::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.signature) +} + +// optional bool user_initiated = 6; +inline bool ClientDownloadRequest::has_user_initiated() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientDownloadRequest::set_has_user_initiated() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientDownloadRequest::clear_has_user_initiated() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientDownloadRequest::clear_user_initiated() { + user_initiated_ = false; + clear_has_user_initiated(); +} +inline bool ClientDownloadRequest::user_initiated() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.user_initiated) + return user_initiated_; +} +inline void ClientDownloadRequest::set_user_initiated(bool value) { + set_has_user_initiated(); + user_initiated_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.user_initiated) +} + +// optional string file_basename = 9; +inline bool ClientDownloadRequest::has_file_basename() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientDownloadRequest::set_has_file_basename() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientDownloadRequest::clear_has_file_basename() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientDownloadRequest::clear_file_basename() { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + clear_has_file_basename(); +} +inline const ::std::string& ClientDownloadRequest::file_basename() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.file_basename) + return *file_basename_; +} +inline void ClientDownloadRequest::set_file_basename(const ::std::string& value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.file_basename) +} +inline void ClientDownloadRequest::set_file_basename(const char* value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.file_basename) +} +inline void ClientDownloadRequest::set_file_basename(const char* value, size_t size) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.file_basename) +} +inline ::std::string* ClientDownloadRequest::mutable_file_basename() { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.file_basename) + return file_basename_; +} +inline ::std::string* ClientDownloadRequest::release_file_basename() { + clear_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_basename_; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest::set_allocated_file_basename(::std::string* file_basename) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + if (file_basename) { + set_has_file_basename(); + file_basename_ = file_basename; + } else { + clear_has_file_basename(); + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.file_basename) +} + +// optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE]; +inline bool ClientDownloadRequest::has_download_type() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ClientDownloadRequest::set_has_download_type() { + _has_bits_[0] |= 0x00000080u; +} +inline void ClientDownloadRequest::clear_has_download_type() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ClientDownloadRequest::clear_download_type() { + download_type_ = 0; + clear_has_download_type(); +} +inline ::safe_browsing::ClientDownloadRequest_DownloadType ClientDownloadRequest::download_type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.download_type) + return static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(download_type_); +} +inline void ClientDownloadRequest::set_download_type(::safe_browsing::ClientDownloadRequest_DownloadType value) { + assert(::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)); + set_has_download_type(); + download_type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.download_type) +} + +// optional string locale = 11; +inline bool ClientDownloadRequest::has_locale() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void ClientDownloadRequest::set_has_locale() { + _has_bits_[0] |= 0x00000100u; +} +inline void ClientDownloadRequest::clear_has_locale() { + _has_bits_[0] &= ~0x00000100u; +} +inline void ClientDownloadRequest::clear_locale() { + if (locale_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_->clear(); + } + clear_has_locale(); +} +inline const ::std::string& ClientDownloadRequest::locale() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.locale) + return *locale_; +} +inline void ClientDownloadRequest::set_locale(const ::std::string& value) { + set_has_locale(); + if (locale_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_ = new ::std::string; + } + locale_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.locale) +} +inline void ClientDownloadRequest::set_locale(const char* value) { + set_has_locale(); + if (locale_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_ = new ::std::string; + } + locale_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.locale) +} +inline void ClientDownloadRequest::set_locale(const char* value, size_t size) { + set_has_locale(); + if (locale_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_ = new ::std::string; + } + locale_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.locale) +} +inline ::std::string* ClientDownloadRequest::mutable_locale() { + set_has_locale(); + if (locale_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + locale_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.locale) + return locale_; +} +inline ::std::string* ClientDownloadRequest::release_locale() { + clear_has_locale(); + if (locale_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = locale_; + locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadRequest::set_allocated_locale(::std::string* locale) { + if (locale_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete locale_; + } + if (locale) { + set_has_locale(); + locale_ = locale; + } else { + clear_has_locale(); + locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.locale) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 18; +inline bool ClientDownloadRequest::has_image_headers() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ClientDownloadRequest::set_has_image_headers() { + _has_bits_[0] |= 0x00000200u; +} +inline void ClientDownloadRequest::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ClientDownloadRequest::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientDownloadRequest::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientDownloadRequest::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientDownloadRequest::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientDownloadRequest::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.image_headers) +} + +// repeated .safe_browsing.ClientDownloadRequest.ArchivedBinary archived_binary = 22; +inline int ClientDownloadRequest::archived_binary_size() const { + return archived_binary_.size(); +} +inline void ClientDownloadRequest::clear_archived_binary() { + archived_binary_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_ArchivedBinary& ClientDownloadRequest::archived_binary(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.archived_binary) + return archived_binary_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_ArchivedBinary* ClientDownloadRequest::mutable_archived_binary(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.archived_binary) + return archived_binary_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_ArchivedBinary* ClientDownloadRequest::add_archived_binary() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.archived_binary) + return archived_binary_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ArchivedBinary >& +ClientDownloadRequest::archived_binary() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.archived_binary) + return archived_binary_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_ArchivedBinary >* +ClientDownloadRequest::mutable_archived_binary() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.archived_binary) + return &archived_binary_; +} + +// optional .safe_browsing.ChromeUserPopulation population = 24; +inline bool ClientDownloadRequest::has_population() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ClientDownloadRequest::set_has_population() { + _has_bits_[0] |= 0x00000800u; +} +inline void ClientDownloadRequest::clear_has_population() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ClientDownloadRequest::clear_population() { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + clear_has_population(); +} +inline const ::safe_browsing::ChromeUserPopulation& ClientDownloadRequest::population() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.population) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return population_ != NULL ? *population_ : *default_instance().population_; +#else + return population_ != NULL ? *population_ : *default_instance_->population_; +#endif +} +inline ::safe_browsing::ChromeUserPopulation* ClientDownloadRequest::mutable_population() { + set_has_population(); + if (population_ == NULL) population_ = new ::safe_browsing::ChromeUserPopulation; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.population) + return population_; +} +inline ::safe_browsing::ChromeUserPopulation* ClientDownloadRequest::release_population() { + clear_has_population(); + ::safe_browsing::ChromeUserPopulation* temp = population_; + population_ = NULL; + return temp; +} +inline void ClientDownloadRequest::set_allocated_population(::safe_browsing::ChromeUserPopulation* population) { + delete population_; + population_ = population; + if (population) { + set_has_population(); + } else { + clear_has_population(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadRequest.population) +} + +// optional bool archive_valid = 26; +inline bool ClientDownloadRequest::has_archive_valid() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void ClientDownloadRequest::set_has_archive_valid() { + _has_bits_[0] |= 0x00001000u; +} +inline void ClientDownloadRequest::clear_has_archive_valid() { + _has_bits_[0] &= ~0x00001000u; +} +inline void ClientDownloadRequest::clear_archive_valid() { + archive_valid_ = false; + clear_has_archive_valid(); +} +inline bool ClientDownloadRequest::archive_valid() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.archive_valid) + return archive_valid_; +} +inline void ClientDownloadRequest::set_archive_valid(bool value) { + set_has_archive_valid(); + archive_valid_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.archive_valid) +} + +// optional bool skipped_url_whitelist = 28; +inline bool ClientDownloadRequest::has_skipped_url_whitelist() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void ClientDownloadRequest::set_has_skipped_url_whitelist() { + _has_bits_[0] |= 0x00002000u; +} +inline void ClientDownloadRequest::clear_has_skipped_url_whitelist() { + _has_bits_[0] &= ~0x00002000u; +} +inline void ClientDownloadRequest::clear_skipped_url_whitelist() { + skipped_url_whitelist_ = false; + clear_has_skipped_url_whitelist(); +} +inline bool ClientDownloadRequest::skipped_url_whitelist() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.skipped_url_whitelist) + return skipped_url_whitelist_; +} +inline void ClientDownloadRequest::set_skipped_url_whitelist(bool value) { + set_has_skipped_url_whitelist(); + skipped_url_whitelist_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.skipped_url_whitelist) +} + +// optional bool skipped_certificate_whitelist = 31; +inline bool ClientDownloadRequest::has_skipped_certificate_whitelist() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void ClientDownloadRequest::set_has_skipped_certificate_whitelist() { + _has_bits_[0] |= 0x00004000u; +} +inline void ClientDownloadRequest::clear_has_skipped_certificate_whitelist() { + _has_bits_[0] &= ~0x00004000u; +} +inline void ClientDownloadRequest::clear_skipped_certificate_whitelist() { + skipped_certificate_whitelist_ = false; + clear_has_skipped_certificate_whitelist(); +} +inline bool ClientDownloadRequest::skipped_certificate_whitelist() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.skipped_certificate_whitelist) + return skipped_certificate_whitelist_; +} +inline void ClientDownloadRequest::set_skipped_certificate_whitelist(bool value) { + set_has_skipped_certificate_whitelist(); + skipped_certificate_whitelist_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.skipped_certificate_whitelist) +} + +// repeated string alternate_extensions = 35; +inline int ClientDownloadRequest::alternate_extensions_size() const { + return alternate_extensions_.size(); +} +inline void ClientDownloadRequest::clear_alternate_extensions() { + alternate_extensions_.Clear(); +} +inline const ::std::string& ClientDownloadRequest::alternate_extensions(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.alternate_extensions) + return alternate_extensions_.Get(index); +} +inline ::std::string* ClientDownloadRequest::mutable_alternate_extensions(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.alternate_extensions) + return alternate_extensions_.Mutable(index); +} +inline void ClientDownloadRequest::set_alternate_extensions(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadRequest.alternate_extensions) + alternate_extensions_.Mutable(index)->assign(value); +} +inline void ClientDownloadRequest::set_alternate_extensions(int index, const char* value) { + alternate_extensions_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadRequest.alternate_extensions) +} +inline void ClientDownloadRequest::set_alternate_extensions(int index, const char* value, size_t size) { + alternate_extensions_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadRequest.alternate_extensions) +} +inline ::std::string* ClientDownloadRequest::add_alternate_extensions() { + return alternate_extensions_.Add(); +} +inline void ClientDownloadRequest::add_alternate_extensions(const ::std::string& value) { + alternate_extensions_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.alternate_extensions) +} +inline void ClientDownloadRequest::add_alternate_extensions(const char* value) { + alternate_extensions_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientDownloadRequest.alternate_extensions) +} +inline void ClientDownloadRequest::add_alternate_extensions(const char* value, size_t size) { + alternate_extensions_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientDownloadRequest.alternate_extensions) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientDownloadRequest::alternate_extensions() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.alternate_extensions) + return alternate_extensions_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientDownloadRequest::mutable_alternate_extensions() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.alternate_extensions) + return &alternate_extensions_; +} + +// repeated .safe_browsing.ClientDownloadRequest.URLChainEntry url_chain = 36; +inline int ClientDownloadRequest::url_chain_size() const { + return url_chain_.size(); +} +inline void ClientDownloadRequest::clear_url_chain() { + url_chain_.Clear(); +} +inline const ::safe_browsing::ClientDownloadRequest_URLChainEntry& ClientDownloadRequest::url_chain(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadRequest.url_chain) + return url_chain_.Get(index); +} +inline ::safe_browsing::ClientDownloadRequest_URLChainEntry* ClientDownloadRequest::mutable_url_chain(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadRequest.url_chain) + return url_chain_.Mutable(index); +} +inline ::safe_browsing::ClientDownloadRequest_URLChainEntry* ClientDownloadRequest::add_url_chain() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientDownloadRequest.url_chain) + return url_chain_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_URLChainEntry >& +ClientDownloadRequest::url_chain() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientDownloadRequest.url_chain) + return url_chain_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_URLChainEntry >* +ClientDownloadRequest::mutable_url_chain() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientDownloadRequest.url_chain) + return &url_chain_; +} + +// ------------------------------------------------------------------- + +// ClientDownloadResponse_MoreInfo + +// optional string description = 1; +inline bool ClientDownloadResponse_MoreInfo::has_description() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadResponse_MoreInfo::set_has_description() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadResponse_MoreInfo::clear_has_description() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadResponse_MoreInfo::clear_description() { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_->clear(); + } + clear_has_description(); +} +inline const ::std::string& ClientDownloadResponse_MoreInfo::description() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadResponse.MoreInfo.description) + return *description_; +} +inline void ClientDownloadResponse_MoreInfo::set_description(const ::std::string& value) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadResponse.MoreInfo.description) +} +inline void ClientDownloadResponse_MoreInfo::set_description(const char* value) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadResponse.MoreInfo.description) +} +inline void ClientDownloadResponse_MoreInfo::set_description(const char* value, size_t size) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadResponse.MoreInfo.description) +} +inline ::std::string* ClientDownloadResponse_MoreInfo::mutable_description() { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadResponse.MoreInfo.description) + return description_; +} +inline ::std::string* ClientDownloadResponse_MoreInfo::release_description() { + clear_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = description_; + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadResponse_MoreInfo::set_allocated_description(::std::string* description) { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete description_; + } + if (description) { + set_has_description(); + description_ = description; + } else { + clear_has_description(); + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadResponse.MoreInfo.description) +} + +// optional string url = 2; +inline bool ClientDownloadResponse_MoreInfo::has_url() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadResponse_MoreInfo::set_has_url() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadResponse_MoreInfo::clear_has_url() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadResponse_MoreInfo::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientDownloadResponse_MoreInfo::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadResponse.MoreInfo.url) + return *url_; +} +inline void ClientDownloadResponse_MoreInfo::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadResponse.MoreInfo.url) +} +inline void ClientDownloadResponse_MoreInfo::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadResponse.MoreInfo.url) +} +inline void ClientDownloadResponse_MoreInfo::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadResponse.MoreInfo.url) +} +inline ::std::string* ClientDownloadResponse_MoreInfo::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadResponse.MoreInfo.url) + return url_; +} +inline ::std::string* ClientDownloadResponse_MoreInfo::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadResponse_MoreInfo::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadResponse.MoreInfo.url) +} + +// ------------------------------------------------------------------- + +// ClientDownloadResponse + +// optional .safe_browsing.ClientDownloadResponse.Verdict verdict = 1 [default = SAFE]; +inline bool ClientDownloadResponse::has_verdict() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadResponse::set_has_verdict() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadResponse::clear_has_verdict() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadResponse::clear_verdict() { + verdict_ = 0; + clear_has_verdict(); +} +inline ::safe_browsing::ClientDownloadResponse_Verdict ClientDownloadResponse::verdict() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadResponse.verdict) + return static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(verdict_); +} +inline void ClientDownloadResponse::set_verdict(::safe_browsing::ClientDownloadResponse_Verdict value) { + assert(::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value)); + set_has_verdict(); + verdict_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadResponse.verdict) +} + +// optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2; +inline bool ClientDownloadResponse::has_more_info() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadResponse::set_has_more_info() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadResponse::clear_has_more_info() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadResponse::clear_more_info() { + if (more_info_ != NULL) more_info_->::safe_browsing::ClientDownloadResponse_MoreInfo::Clear(); + clear_has_more_info(); +} +inline const ::safe_browsing::ClientDownloadResponse_MoreInfo& ClientDownloadResponse::more_info() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadResponse.more_info) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return more_info_ != NULL ? *more_info_ : *default_instance().more_info_; +#else + return more_info_ != NULL ? *more_info_ : *default_instance_->more_info_; +#endif +} +inline ::safe_browsing::ClientDownloadResponse_MoreInfo* ClientDownloadResponse::mutable_more_info() { + set_has_more_info(); + if (more_info_ == NULL) more_info_ = new ::safe_browsing::ClientDownloadResponse_MoreInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadResponse.more_info) + return more_info_; +} +inline ::safe_browsing::ClientDownloadResponse_MoreInfo* ClientDownloadResponse::release_more_info() { + clear_has_more_info(); + ::safe_browsing::ClientDownloadResponse_MoreInfo* temp = more_info_; + more_info_ = NULL; + return temp; +} +inline void ClientDownloadResponse::set_allocated_more_info(::safe_browsing::ClientDownloadResponse_MoreInfo* more_info) { + delete more_info_; + more_info_ = more_info; + if (more_info) { + set_has_more_info(); + } else { + clear_has_more_info(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadResponse.more_info) +} + +// optional bytes token = 3; +inline bool ClientDownloadResponse::has_token() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadResponse::set_has_token() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadResponse::clear_has_token() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadResponse::clear_token() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + clear_has_token(); +} +inline const ::std::string& ClientDownloadResponse::token() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadResponse.token) + return *token_; +} +inline void ClientDownloadResponse::set_token(const ::std::string& value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadResponse.token) +} +inline void ClientDownloadResponse::set_token(const char* value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadResponse.token) +} +inline void ClientDownloadResponse::set_token(const void* value, size_t size) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadResponse.token) +} +inline ::std::string* ClientDownloadResponse::mutable_token() { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadResponse.token) + return token_; +} +inline ::std::string* ClientDownloadResponse::release_token() { + clear_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = token_; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadResponse::set_allocated_token(::std::string* token) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + if (token) { + set_has_token(); + token_ = token; + } else { + clear_has_token(); + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadResponse.token) +} + +// ------------------------------------------------------------------- + +// ClientDownloadReport_UserInformation + +// optional string email = 1; +inline bool ClientDownloadReport_UserInformation::has_email() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadReport_UserInformation::set_has_email() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadReport_UserInformation::clear_has_email() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadReport_UserInformation::clear_email() { + if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_->clear(); + } + clear_has_email(); +} +inline const ::std::string& ClientDownloadReport_UserInformation::email() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.UserInformation.email) + return *email_; +} +inline void ClientDownloadReport_UserInformation::set_email(const ::std::string& value) { + set_has_email(); + if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_ = new ::std::string; + } + email_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadReport.UserInformation.email) +} +inline void ClientDownloadReport_UserInformation::set_email(const char* value) { + set_has_email(); + if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_ = new ::std::string; + } + email_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadReport.UserInformation.email) +} +inline void ClientDownloadReport_UserInformation::set_email(const char* value, size_t size) { + set_has_email(); + if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_ = new ::std::string; + } + email_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadReport.UserInformation.email) +} +inline ::std::string* ClientDownloadReport_UserInformation::mutable_email() { + set_has_email(); + if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + email_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadReport.UserInformation.email) + return email_; +} +inline ::std::string* ClientDownloadReport_UserInformation::release_email() { + clear_has_email(); + if (email_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = email_; + email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadReport_UserInformation::set_allocated_email(::std::string* email) { + if (email_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete email_; + } + if (email) { + set_has_email(); + email_ = email; + } else { + clear_has_email(); + email_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadReport.UserInformation.email) +} + +// ------------------------------------------------------------------- + +// ClientDownloadReport + +// optional .safe_browsing.ClientDownloadReport.Reason reason = 1; +inline bool ClientDownloadReport::has_reason() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientDownloadReport::set_has_reason() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientDownloadReport::clear_has_reason() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientDownloadReport::clear_reason() { + reason_ = 0; + clear_has_reason(); +} +inline ::safe_browsing::ClientDownloadReport_Reason ClientDownloadReport::reason() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.reason) + return static_cast< ::safe_browsing::ClientDownloadReport_Reason >(reason_); +} +inline void ClientDownloadReport::set_reason(::safe_browsing::ClientDownloadReport_Reason value) { + assert(::safe_browsing::ClientDownloadReport_Reason_IsValid(value)); + set_has_reason(); + reason_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadReport.reason) +} + +// optional .safe_browsing.ClientDownloadRequest download_request = 2; +inline bool ClientDownloadReport::has_download_request() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientDownloadReport::set_has_download_request() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientDownloadReport::clear_has_download_request() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientDownloadReport::clear_download_request() { + if (download_request_ != NULL) download_request_->::safe_browsing::ClientDownloadRequest::Clear(); + clear_has_download_request(); +} +inline const ::safe_browsing::ClientDownloadRequest& ClientDownloadReport::download_request() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.download_request) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return download_request_ != NULL ? *download_request_ : *default_instance().download_request_; +#else + return download_request_ != NULL ? *download_request_ : *default_instance_->download_request_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest* ClientDownloadReport::mutable_download_request() { + set_has_download_request(); + if (download_request_ == NULL) download_request_ = new ::safe_browsing::ClientDownloadRequest; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadReport.download_request) + return download_request_; +} +inline ::safe_browsing::ClientDownloadRequest* ClientDownloadReport::release_download_request() { + clear_has_download_request(); + ::safe_browsing::ClientDownloadRequest* temp = download_request_; + download_request_ = NULL; + return temp; +} +inline void ClientDownloadReport::set_allocated_download_request(::safe_browsing::ClientDownloadRequest* download_request) { + delete download_request_; + download_request_ = download_request; + if (download_request) { + set_has_download_request(); + } else { + clear_has_download_request(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadReport.download_request) +} + +// optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3; +inline bool ClientDownloadReport::has_user_information() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientDownloadReport::set_has_user_information() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientDownloadReport::clear_has_user_information() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientDownloadReport::clear_user_information() { + if (user_information_ != NULL) user_information_->::safe_browsing::ClientDownloadReport_UserInformation::Clear(); + clear_has_user_information(); +} +inline const ::safe_browsing::ClientDownloadReport_UserInformation& ClientDownloadReport::user_information() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.user_information) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return user_information_ != NULL ? *user_information_ : *default_instance().user_information_; +#else + return user_information_ != NULL ? *user_information_ : *default_instance_->user_information_; +#endif +} +inline ::safe_browsing::ClientDownloadReport_UserInformation* ClientDownloadReport::mutable_user_information() { + set_has_user_information(); + if (user_information_ == NULL) user_information_ = new ::safe_browsing::ClientDownloadReport_UserInformation; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadReport.user_information) + return user_information_; +} +inline ::safe_browsing::ClientDownloadReport_UserInformation* ClientDownloadReport::release_user_information() { + clear_has_user_information(); + ::safe_browsing::ClientDownloadReport_UserInformation* temp = user_information_; + user_information_ = NULL; + return temp; +} +inline void ClientDownloadReport::set_allocated_user_information(::safe_browsing::ClientDownloadReport_UserInformation* user_information) { + delete user_information_; + user_information_ = user_information; + if (user_information) { + set_has_user_information(); + } else { + clear_has_user_information(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadReport.user_information) +} + +// optional bytes comment = 4; +inline bool ClientDownloadReport::has_comment() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientDownloadReport::set_has_comment() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientDownloadReport::clear_has_comment() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientDownloadReport::clear_comment() { + if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_->clear(); + } + clear_has_comment(); +} +inline const ::std::string& ClientDownloadReport::comment() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.comment) + return *comment_; +} +inline void ClientDownloadReport::set_comment(const ::std::string& value) { + set_has_comment(); + if (comment_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_ = new ::std::string; + } + comment_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientDownloadReport.comment) +} +inline void ClientDownloadReport::set_comment(const char* value) { + set_has_comment(); + if (comment_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_ = new ::std::string; + } + comment_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientDownloadReport.comment) +} +inline void ClientDownloadReport::set_comment(const void* value, size_t size) { + set_has_comment(); + if (comment_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_ = new ::std::string; + } + comment_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientDownloadReport.comment) +} +inline ::std::string* ClientDownloadReport::mutable_comment() { + set_has_comment(); + if (comment_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + comment_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadReport.comment) + return comment_; +} +inline ::std::string* ClientDownloadReport::release_comment() { + clear_has_comment(); + if (comment_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = comment_; + comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientDownloadReport::set_allocated_comment(::std::string* comment) { + if (comment_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete comment_; + } + if (comment) { + set_has_comment(); + comment_ = comment; + } else { + clear_has_comment(); + comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadReport.comment) +} + +// optional .safe_browsing.ClientDownloadResponse download_response = 5; +inline bool ClientDownloadReport::has_download_response() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientDownloadReport::set_has_download_response() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientDownloadReport::clear_has_download_response() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientDownloadReport::clear_download_response() { + if (download_response_ != NULL) download_response_->::safe_browsing::ClientDownloadResponse::Clear(); + clear_has_download_response(); +} +inline const ::safe_browsing::ClientDownloadResponse& ClientDownloadReport::download_response() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientDownloadReport.download_response) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return download_response_ != NULL ? *download_response_ : *default_instance().download_response_; +#else + return download_response_ != NULL ? *download_response_ : *default_instance_->download_response_; +#endif +} +inline ::safe_browsing::ClientDownloadResponse* ClientDownloadReport::mutable_download_response() { + set_has_download_response(); + if (download_response_ == NULL) download_response_ = new ::safe_browsing::ClientDownloadResponse; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientDownloadReport.download_response) + return download_response_; +} +inline ::safe_browsing::ClientDownloadResponse* ClientDownloadReport::release_download_response() { + clear_has_download_response(); + ::safe_browsing::ClientDownloadResponse* temp = download_response_; + download_response_ = NULL; + return temp; +} +inline void ClientDownloadReport::set_allocated_download_response(::safe_browsing::ClientDownloadResponse* download_response) { + delete download_response_; + download_response_ = download_response; + if (download_response) { + set_has_download_response(); + } else { + clear_has_download_response(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientDownloadReport.download_response) +} + +// ------------------------------------------------------------------- + +// ClientUploadResponse + +// optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1; +inline bool ClientUploadResponse::has_status() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientUploadResponse::set_has_status() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientUploadResponse::clear_has_status() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientUploadResponse::clear_status() { + status_ = 0; + clear_has_status(); +} +inline ::safe_browsing::ClientUploadResponse_UploadStatus ClientUploadResponse::status() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientUploadResponse.status) + return static_cast< ::safe_browsing::ClientUploadResponse_UploadStatus >(status_); +} +inline void ClientUploadResponse::set_status(::safe_browsing::ClientUploadResponse_UploadStatus value) { + assert(::safe_browsing::ClientUploadResponse_UploadStatus_IsValid(value)); + set_has_status(); + status_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientUploadResponse.status) +} + +// optional string permalink = 2; +inline bool ClientUploadResponse::has_permalink() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientUploadResponse::set_has_permalink() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientUploadResponse::clear_has_permalink() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientUploadResponse::clear_permalink() { + if (permalink_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_->clear(); + } + clear_has_permalink(); +} +inline const ::std::string& ClientUploadResponse::permalink() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientUploadResponse.permalink) + return *permalink_; +} +inline void ClientUploadResponse::set_permalink(const ::std::string& value) { + set_has_permalink(); + if (permalink_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_ = new ::std::string; + } + permalink_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientUploadResponse.permalink) +} +inline void ClientUploadResponse::set_permalink(const char* value) { + set_has_permalink(); + if (permalink_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_ = new ::std::string; + } + permalink_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientUploadResponse.permalink) +} +inline void ClientUploadResponse::set_permalink(const char* value, size_t size) { + set_has_permalink(); + if (permalink_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_ = new ::std::string; + } + permalink_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientUploadResponse.permalink) +} +inline ::std::string* ClientUploadResponse::mutable_permalink() { + set_has_permalink(); + if (permalink_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + permalink_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientUploadResponse.permalink) + return permalink_; +} +inline ::std::string* ClientUploadResponse::release_permalink() { + clear_has_permalink(); + if (permalink_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = permalink_; + permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientUploadResponse::set_allocated_permalink(::std::string* permalink) { + if (permalink_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete permalink_; + } + if (permalink) { + set_has_permalink(); + permalink_ = permalink; + } else { + clear_has_permalink(); + permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientUploadResponse.permalink) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_TrackedPreferenceIncident + +// optional string path = 1; +inline bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident::has_path() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_has_path() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_has_path() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_path() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + clear_has_path(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_TrackedPreferenceIncident::path() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) + return *path_; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_path(const ::std::string& value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_path(const char* value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_path(const char* value, size_t size) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::mutable_path() { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) + return path_; +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::release_path() { + clear_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = path_; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_allocated_path(::std::string* path) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (path) { + set_has_path(); + path_ = path; + } else { + clear_has_path(); + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.path) +} + +// optional string atomic_value = 2; +inline bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident::has_atomic_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_has_atomic_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_has_atomic_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_atomic_value() { + if (atomic_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_->clear(); + } + clear_has_atomic_value(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_TrackedPreferenceIncident::atomic_value() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) + return *atomic_value_; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_atomic_value(const ::std::string& value) { + set_has_atomic_value(); + if (atomic_value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_ = new ::std::string; + } + atomic_value_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_atomic_value(const char* value) { + set_has_atomic_value(); + if (atomic_value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_ = new ::std::string; + } + atomic_value_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_atomic_value(const char* value, size_t size) { + set_has_atomic_value(); + if (atomic_value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_ = new ::std::string; + } + atomic_value_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::mutable_atomic_value() { + set_has_atomic_value(); + if (atomic_value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + atomic_value_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) + return atomic_value_; +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::release_atomic_value() { + clear_has_atomic_value(); + if (atomic_value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = atomic_value_; + atomic_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_allocated_atomic_value(::std::string* atomic_value) { + if (atomic_value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete atomic_value_; + } + if (atomic_value) { + set_has_atomic_value(); + atomic_value_ = atomic_value; + } else { + clear_has_atomic_value(); + atomic_value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.atomic_value) +} + +// repeated string split_key = 3; +inline int ClientIncidentReport_IncidentData_TrackedPreferenceIncident::split_key_size() const { + return split_key_.size(); +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_split_key() { + split_key_.Clear(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_TrackedPreferenceIncident::split_key(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) + return split_key_.Get(index); +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::mutable_split_key(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) + return split_key_.Mutable(index); +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_split_key(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) + split_key_.Mutable(index)->assign(value); +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_split_key(int index, const char* value) { + split_key_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_split_key(int index, const char* value, size_t size) { + split_key_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) +} +inline ::std::string* ClientIncidentReport_IncidentData_TrackedPreferenceIncident::add_split_key() { + return split_key_.Add(); +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::add_split_key(const ::std::string& value) { + split_key_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::add_split_key(const char* value) { + split_key_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::add_split_key(const char* value, size_t size) { + split_key_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientIncidentReport_IncidentData_TrackedPreferenceIncident::split_key() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) + return split_key_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientIncidentReport_IncidentData_TrackedPreferenceIncident::mutable_split_key() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.split_key) + return &split_key_; +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.ValueState value_state = 4; +inline bool ClientIncidentReport_IncidentData_TrackedPreferenceIncident::has_value_state() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_has_value_state() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_has_value_state() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::clear_value_state() { + value_state_ = 0; + clear_has_value_state(); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState ClientIncidentReport_IncidentData_TrackedPreferenceIncident::value_state() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.value_state) + return static_cast< ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState >(value_state_); +} +inline void ClientIncidentReport_IncidentData_TrackedPreferenceIncident::set_value_state(::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState value) { + assert(::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueState_IsValid(value)); + set_has_value_state(); + value_state_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident.value_state) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile + +// optional string relative_path = 1; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::has_relative_path() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_has_relative_path() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_has_relative_path() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_relative_path() { + if (relative_path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_->clear(); + } + clear_has_relative_path(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::relative_path() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) + return *relative_path_; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_relative_path(const ::std::string& value) { + set_has_relative_path(); + if (relative_path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_ = new ::std::string; + } + relative_path_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_relative_path(const char* value) { + set_has_relative_path(); + if (relative_path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_ = new ::std::string; + } + relative_path_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_relative_path(const char* value, size_t size) { + set_has_relative_path(); + if (relative_path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_ = new ::std::string; + } + relative_path_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) +} +inline ::std::string* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::mutable_relative_path() { + set_has_relative_path(); + if (relative_path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + relative_path_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) + return relative_path_; +} +inline ::std::string* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::release_relative_path() { + clear_has_relative_path(); + if (relative_path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = relative_path_; + relative_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_allocated_relative_path(::std::string* relative_path) { + if (relative_path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete relative_path_; + } + if (relative_path) { + set_has_relative_path(); + relative_path_ = relative_path; + } else { + clear_has_relative_path(); + relative_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.relative_path) +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::has_signature() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_has_signature() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_has_signature() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.signature) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::has_image_headers() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_has_image_headers() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile.image_headers) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_BinaryIntegrityIncident + +// optional string file_basename = 1; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::has_file_basename() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_has_file_basename() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_has_file_basename() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_file_basename() { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_->clear(); + } + clear_has_file_basename(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_BinaryIntegrityIncident::file_basename() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) + return *file_basename_; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_file_basename(const ::std::string& value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_file_basename(const char* value) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_file_basename(const char* value, size_t size) { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + file_basename_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) +} +inline ::std::string* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::mutable_file_basename() { + set_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_basename_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) + return file_basename_; +} +inline ::std::string* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::release_file_basename() { + clear_has_file_basename(); + if (file_basename_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_basename_; + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_allocated_file_basename(::std::string* file_basename) { + if (file_basename_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_basename_; + } + if (file_basename) { + set_has_file_basename(); + file_basename_ = file_basename; + } else { + clear_has_file_basename(); + file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.file_basename) +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 2; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::has_signature() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_has_signature() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_has_signature() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientIncidentReport_IncidentData_BinaryIntegrityIncident::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.signature) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 3; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::has_image_headers() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_has_image_headers() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientIncidentReport_IncidentData_BinaryIntegrityIncident::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.image_headers) +} + +// optional int32 sec_error = 4; +inline bool ClientIncidentReport_IncidentData_BinaryIntegrityIncident::has_sec_error() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_has_sec_error() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_has_sec_error() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_sec_error() { + sec_error_ = 0; + clear_has_sec_error(); +} +inline ::google::protobuf::int32 ClientIncidentReport_IncidentData_BinaryIntegrityIncident::sec_error() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.sec_error) + return sec_error_; +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::set_sec_error(::google::protobuf::int32 value) { + set_has_sec_error(); + sec_error_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.sec_error) +} + +// repeated .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.ContainedFile contained_file = 5; +inline int ClientIncidentReport_IncidentData_BinaryIntegrityIncident::contained_file_size() const { + return contained_file_.size(); +} +inline void ClientIncidentReport_IncidentData_BinaryIntegrityIncident::clear_contained_file() { + contained_file_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile& ClientIncidentReport_IncidentData_BinaryIntegrityIncident::contained_file(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.contained_file) + return contained_file_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::mutable_contained_file(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.contained_file) + return contained_file_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile* ClientIncidentReport_IncidentData_BinaryIntegrityIncident::add_contained_file() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.contained_file) + return contained_file_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile >& +ClientIncidentReport_IncidentData_BinaryIntegrityIncident::contained_file() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.contained_file) + return contained_file_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident_ContainedFile >* +ClientIncidentReport_IncidentData_BinaryIntegrityIncident::mutable_contained_file() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident.contained_file) + return &contained_file_; +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_BlacklistLoadIncident + +// optional string path = 1; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_path() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_path() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_path() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_path() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + clear_has_path(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_BlacklistLoadIncident::path() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) + return *path_; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_path(const ::std::string& value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_path(const char* value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_path(const char* value, size_t size) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) +} +inline ::std::string* ClientIncidentReport_IncidentData_BlacklistLoadIncident::mutable_path() { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) + return path_; +} +inline ::std::string* ClientIncidentReport_IncidentData_BlacklistLoadIncident::release_path() { + clear_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = path_; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_allocated_path(::std::string* path) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (path) { + set_has_path(); + path_ = path; + } else { + clear_has_path(); + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.path) +} + +// optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_digest() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_digest() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_digest() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_digest() { + if (digest_ != NULL) digest_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + clear_has_digest(); +} +inline const ::safe_browsing::ClientDownloadRequest_Digests& ClientIncidentReport_IncidentData_BlacklistLoadIncident::digest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.digest) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return digest_ != NULL ? *digest_ : *default_instance().digest_; +#else + return digest_ != NULL ? *digest_ : *default_instance_->digest_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientIncidentReport_IncidentData_BlacklistLoadIncident::mutable_digest() { + set_has_digest(); + if (digest_ == NULL) digest_ = new ::safe_browsing::ClientDownloadRequest_Digests; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.digest) + return digest_; +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientIncidentReport_IncidentData_BlacklistLoadIncident::release_digest() { + clear_has_digest(); + ::safe_browsing::ClientDownloadRequest_Digests* temp = digest_; + digest_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_allocated_digest(::safe_browsing::ClientDownloadRequest_Digests* digest) { + delete digest_; + digest_ = digest; + if (digest) { + set_has_digest(); + } else { + clear_has_digest(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.digest) +} + +// optional string version = 3; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_BlacklistLoadIncident::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) + return *version_; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_version(const char* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) +} +inline ::std::string* ClientIncidentReport_IncidentData_BlacklistLoadIncident::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) + return version_; +} +inline ::std::string* ClientIncidentReport_IncidentData_BlacklistLoadIncident::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.version) +} + +// optional bool blacklist_initialized = 4; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_blacklist_initialized() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_blacklist_initialized() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_blacklist_initialized() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_blacklist_initialized() { + blacklist_initialized_ = false; + clear_has_blacklist_initialized(); +} +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::blacklist_initialized() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.blacklist_initialized) + return blacklist_initialized_; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_blacklist_initialized(bool value) { + set_has_blacklist_initialized(); + blacklist_initialized_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.blacklist_initialized) +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 5; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_signature() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_signature() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_signature() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientIncidentReport_IncidentData_BlacklistLoadIncident::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BlacklistLoadIncident::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_BlacklistLoadIncident::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.signature) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 6; +inline bool ClientIncidentReport_IncidentData_BlacklistLoadIncident::has_image_headers() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_has_image_headers() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientIncidentReport_IncidentData_BlacklistLoadIncident::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BlacklistLoadIncident::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_BlacklistLoadIncident::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_BlacklistLoadIncident::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident.image_headers) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident + +// optional string variations_seed_signature = 1; +inline bool ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::has_variations_seed_signature() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::set_has_variations_seed_signature() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::clear_has_variations_seed_signature() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::clear_variations_seed_signature() { + if (variations_seed_signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_->clear(); + } + clear_has_variations_seed_signature(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::variations_seed_signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) + return *variations_seed_signature_; +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::set_variations_seed_signature(const ::std::string& value) { + set_has_variations_seed_signature(); + if (variations_seed_signature_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_ = new ::std::string; + } + variations_seed_signature_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::set_variations_seed_signature(const char* value) { + set_has_variations_seed_signature(); + if (variations_seed_signature_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_ = new ::std::string; + } + variations_seed_signature_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::set_variations_seed_signature(const char* value, size_t size) { + set_has_variations_seed_signature(); + if (variations_seed_signature_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_ = new ::std::string; + } + variations_seed_signature_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) +} +inline ::std::string* ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::mutable_variations_seed_signature() { + set_has_variations_seed_signature(); + if (variations_seed_signature_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + variations_seed_signature_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) + return variations_seed_signature_; +} +inline ::std::string* ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::release_variations_seed_signature() { + clear_has_variations_seed_signature(); + if (variations_seed_signature_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = variations_seed_signature_; + variations_seed_signature_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::set_allocated_variations_seed_signature(::std::string* variations_seed_signature) { + if (variations_seed_signature_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete variations_seed_signature_; + } + if (variations_seed_signature) { + set_has_variations_seed_signature(); + variations_seed_signature_ = variations_seed_signature; + } else { + clear_has_variations_seed_signature(); + variations_seed_signature_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident.variations_seed_signature) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_ResourceRequestIncident + +// optional bytes digest = 1; +inline bool ClientIncidentReport_IncidentData_ResourceRequestIncident::has_digest() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_has_digest() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_has_digest() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_digest() { + if (digest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_->clear(); + } + clear_has_digest(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_ResourceRequestIncident::digest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) + return *digest_; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_digest(const ::std::string& value) { + set_has_digest(); + if (digest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_ = new ::std::string; + } + digest_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_digest(const char* value) { + set_has_digest(); + if (digest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_ = new ::std::string; + } + digest_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_digest(const void* value, size_t size) { + set_has_digest(); + if (digest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_ = new ::std::string; + } + digest_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) +} +inline ::std::string* ClientIncidentReport_IncidentData_ResourceRequestIncident::mutable_digest() { + set_has_digest(); + if (digest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + digest_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) + return digest_; +} +inline ::std::string* ClientIncidentReport_IncidentData_ResourceRequestIncident::release_digest() { + clear_has_digest(); + if (digest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = digest_; + digest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_allocated_digest(::std::string* digest) { + if (digest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete digest_; + } + if (digest) { + set_has_digest(); + digest_ = digest; + } else { + clear_has_digest(); + digest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.digest) +} + +// optional string origin = 2; +inline bool ClientIncidentReport_IncidentData_ResourceRequestIncident::has_origin() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_has_origin() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_has_origin() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_origin() { + if (origin_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_->clear(); + } + clear_has_origin(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_ResourceRequestIncident::origin() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) + return *origin_; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_origin(const ::std::string& value) { + set_has_origin(); + if (origin_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_ = new ::std::string; + } + origin_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_origin(const char* value) { + set_has_origin(); + if (origin_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_ = new ::std::string; + } + origin_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_origin(const char* value, size_t size) { + set_has_origin(); + if (origin_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_ = new ::std::string; + } + origin_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) +} +inline ::std::string* ClientIncidentReport_IncidentData_ResourceRequestIncident::mutable_origin() { + set_has_origin(); + if (origin_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + origin_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) + return origin_; +} +inline ::std::string* ClientIncidentReport_IncidentData_ResourceRequestIncident::release_origin() { + clear_has_origin(); + if (origin_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = origin_; + origin_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_allocated_origin(::std::string* origin) { + if (origin_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete origin_; + } + if (origin) { + set_has_origin(); + origin_ = origin; + } else { + clear_has_origin(); + origin_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.origin) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.Type type = 3 [default = UNKNOWN]; +inline bool ClientIncidentReport_IncidentData_ResourceRequestIncident::has_type() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_has_type() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_has_type() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type ClientIncidentReport_IncidentData_ResourceRequestIncident::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.type) + return static_cast< ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type >(type_); +} +inline void ClientIncidentReport_IncidentData_ResourceRequestIncident::set_type(::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type value) { + assert(::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident_Type_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident.type) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData_SuspiciousModuleIncident + +// optional string path = 1; +inline bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::has_path() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_has_path() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_has_path() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_path() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + clear_has_path(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::path() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) + return *path_; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_path(const ::std::string& value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_path(const char* value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_path(const char* value, size_t size) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) +} +inline ::std::string* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::mutable_path() { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) + return path_; +} +inline ::std::string* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::release_path() { + clear_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = path_; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_allocated_path(::std::string* path) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (path) { + set_has_path(); + path_ = path; + } else { + clear_has_path(); + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.path) +} + +// optional .safe_browsing.ClientDownloadRequest.Digests digest = 2; +inline bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::has_digest() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_has_digest() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_has_digest() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_digest() { + if (digest_ != NULL) digest_->::safe_browsing::ClientDownloadRequest_Digests::Clear(); + clear_has_digest(); +} +inline const ::safe_browsing::ClientDownloadRequest_Digests& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::digest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.digest) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return digest_ != NULL ? *digest_ : *default_instance().digest_; +#else + return digest_ != NULL ? *digest_ : *default_instance_->digest_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::mutable_digest() { + set_has_digest(); + if (digest_ == NULL) digest_ = new ::safe_browsing::ClientDownloadRequest_Digests; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.digest) + return digest_; +} +inline ::safe_browsing::ClientDownloadRequest_Digests* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::release_digest() { + clear_has_digest(); + ::safe_browsing::ClientDownloadRequest_Digests* temp = digest_; + digest_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_allocated_digest(::safe_browsing::ClientDownloadRequest_Digests* digest) { + delete digest_; + digest_ = digest; + if (digest) { + set_has_digest(); + } else { + clear_has_digest(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.digest) +} + +// optional string version = 3; +inline bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) + return *version_; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_version(const char* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) +} +inline ::std::string* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) + return version_; +} +inline ::std::string* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.version) +} + +// optional .safe_browsing.ClientDownloadRequest.SignatureInfo signature = 4; +inline bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::has_signature() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_has_signature() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_has_signature() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_signature() { + if (signature_ != NULL) signature_->::safe_browsing::ClientDownloadRequest_SignatureInfo::Clear(); + clear_has_signature(); +} +inline const ::safe_browsing::ClientDownloadRequest_SignatureInfo& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return signature_ != NULL ? *signature_ : *default_instance().signature_; +#else + return signature_ != NULL ? *signature_ : *default_instance_->signature_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::mutable_signature() { + set_has_signature(); + if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.signature) + return signature_; +} +inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::release_signature() { + clear_has_signature(); + ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_; + signature_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_allocated_signature(::safe_browsing::ClientDownloadRequest_SignatureInfo* signature) { + delete signature_; + signature_ = signature; + if (signature) { + set_has_signature(); + } else { + clear_has_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.signature) +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; +inline bool ClientIncidentReport_IncidentData_SuspiciousModuleIncident::has_image_headers() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_has_image_headers() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientIncidentReport_IncidentData_SuspiciousModuleIncident::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_IncidentData_SuspiciousModuleIncident::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData_SuspiciousModuleIncident::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident.image_headers) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_IncidentData + +// optional int64 incident_time_msec = 1; +inline bool ClientIncidentReport_IncidentData::has_incident_time_msec() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_incident_time_msec() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_IncidentData::clear_has_incident_time_msec() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_IncidentData::clear_incident_time_msec() { + incident_time_msec_ = GOOGLE_LONGLONG(0); + clear_has_incident_time_msec(); +} +inline ::google::protobuf::int64 ClientIncidentReport_IncidentData::incident_time_msec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.incident_time_msec) + return incident_time_msec_; +} +inline void ClientIncidentReport_IncidentData::set_incident_time_msec(::google::protobuf::int64 value) { + set_has_incident_time_msec(); + incident_time_msec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.IncidentData.incident_time_msec) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.TrackedPreferenceIncident tracked_preference = 2; +inline bool ClientIncidentReport_IncidentData::has_tracked_preference() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_tracked_preference() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_IncidentData::clear_has_tracked_preference() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_IncidentData::clear_tracked_preference() { + if (tracked_preference_ != NULL) tracked_preference_->::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident::Clear(); + clear_has_tracked_preference(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident& ClientIncidentReport_IncidentData::tracked_preference() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.tracked_preference) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return tracked_preference_ != NULL ? *tracked_preference_ : *default_instance().tracked_preference_; +#else + return tracked_preference_ != NULL ? *tracked_preference_ : *default_instance_->tracked_preference_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* ClientIncidentReport_IncidentData::mutable_tracked_preference() { + set_has_tracked_preference(); + if (tracked_preference_ == NULL) tracked_preference_ = new ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.tracked_preference) + return tracked_preference_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* ClientIncidentReport_IncidentData::release_tracked_preference() { + clear_has_tracked_preference(); + ::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* temp = tracked_preference_; + tracked_preference_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_tracked_preference(::safe_browsing::ClientIncidentReport_IncidentData_TrackedPreferenceIncident* tracked_preference) { + delete tracked_preference_; + tracked_preference_ = tracked_preference; + if (tracked_preference) { + set_has_tracked_preference(); + } else { + clear_has_tracked_preference(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.tracked_preference) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.BinaryIntegrityIncident binary_integrity = 3; +inline bool ClientIncidentReport_IncidentData::has_binary_integrity() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_binary_integrity() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_IncidentData::clear_has_binary_integrity() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_IncidentData::clear_binary_integrity() { + if (binary_integrity_ != NULL) binary_integrity_->::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident::Clear(); + clear_has_binary_integrity(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident& ClientIncidentReport_IncidentData::binary_integrity() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.binary_integrity) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return binary_integrity_ != NULL ? *binary_integrity_ : *default_instance().binary_integrity_; +#else + return binary_integrity_ != NULL ? *binary_integrity_ : *default_instance_->binary_integrity_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* ClientIncidentReport_IncidentData::mutable_binary_integrity() { + set_has_binary_integrity(); + if (binary_integrity_ == NULL) binary_integrity_ = new ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.binary_integrity) + return binary_integrity_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* ClientIncidentReport_IncidentData::release_binary_integrity() { + clear_has_binary_integrity(); + ::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* temp = binary_integrity_; + binary_integrity_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_binary_integrity(::safe_browsing::ClientIncidentReport_IncidentData_BinaryIntegrityIncident* binary_integrity) { + delete binary_integrity_; + binary_integrity_ = binary_integrity; + if (binary_integrity) { + set_has_binary_integrity(); + } else { + clear_has_binary_integrity(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.binary_integrity) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.BlacklistLoadIncident blacklist_load = 4; +inline bool ClientIncidentReport_IncidentData::has_blacklist_load() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_blacklist_load() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_IncidentData::clear_has_blacklist_load() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_IncidentData::clear_blacklist_load() { + if (blacklist_load_ != NULL) blacklist_load_->::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident::Clear(); + clear_has_blacklist_load(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident& ClientIncidentReport_IncidentData::blacklist_load() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.blacklist_load) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return blacklist_load_ != NULL ? *blacklist_load_ : *default_instance().blacklist_load_; +#else + return blacklist_load_ != NULL ? *blacklist_load_ : *default_instance_->blacklist_load_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* ClientIncidentReport_IncidentData::mutable_blacklist_load() { + set_has_blacklist_load(); + if (blacklist_load_ == NULL) blacklist_load_ = new ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.blacklist_load) + return blacklist_load_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* ClientIncidentReport_IncidentData::release_blacklist_load() { + clear_has_blacklist_load(); + ::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* temp = blacklist_load_; + blacklist_load_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_blacklist_load(::safe_browsing::ClientIncidentReport_IncidentData_BlacklistLoadIncident* blacklist_load) { + delete blacklist_load_; + blacklist_load_ = blacklist_load; + if (blacklist_load) { + set_has_blacklist_load(); + } else { + clear_has_blacklist_load(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.blacklist_load) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.VariationsSeedSignatureIncident variations_seed_signature = 6; +inline bool ClientIncidentReport_IncidentData::has_variations_seed_signature() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_variations_seed_signature() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_IncidentData::clear_has_variations_seed_signature() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_IncidentData::clear_variations_seed_signature() { + if (variations_seed_signature_ != NULL) variations_seed_signature_->::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident::Clear(); + clear_has_variations_seed_signature(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident& ClientIncidentReport_IncidentData::variations_seed_signature() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.variations_seed_signature) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return variations_seed_signature_ != NULL ? *variations_seed_signature_ : *default_instance().variations_seed_signature_; +#else + return variations_seed_signature_ != NULL ? *variations_seed_signature_ : *default_instance_->variations_seed_signature_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* ClientIncidentReport_IncidentData::mutable_variations_seed_signature() { + set_has_variations_seed_signature(); + if (variations_seed_signature_ == NULL) variations_seed_signature_ = new ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.variations_seed_signature) + return variations_seed_signature_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* ClientIncidentReport_IncidentData::release_variations_seed_signature() { + clear_has_variations_seed_signature(); + ::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* temp = variations_seed_signature_; + variations_seed_signature_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_variations_seed_signature(::safe_browsing::ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* variations_seed_signature) { + delete variations_seed_signature_; + variations_seed_signature_ = variations_seed_signature; + if (variations_seed_signature) { + set_has_variations_seed_signature(); + } else { + clear_has_variations_seed_signature(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.variations_seed_signature) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.ResourceRequestIncident resource_request = 7; +inline bool ClientIncidentReport_IncidentData::has_resource_request() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_resource_request() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientIncidentReport_IncidentData::clear_has_resource_request() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientIncidentReport_IncidentData::clear_resource_request() { + if (resource_request_ != NULL) resource_request_->::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident::Clear(); + clear_has_resource_request(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident& ClientIncidentReport_IncidentData::resource_request() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.resource_request) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return resource_request_ != NULL ? *resource_request_ : *default_instance().resource_request_; +#else + return resource_request_ != NULL ? *resource_request_ : *default_instance_->resource_request_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* ClientIncidentReport_IncidentData::mutable_resource_request() { + set_has_resource_request(); + if (resource_request_ == NULL) resource_request_ = new ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.resource_request) + return resource_request_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* ClientIncidentReport_IncidentData::release_resource_request() { + clear_has_resource_request(); + ::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* temp = resource_request_; + resource_request_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_resource_request(::safe_browsing::ClientIncidentReport_IncidentData_ResourceRequestIncident* resource_request) { + delete resource_request_; + resource_request_ = resource_request; + if (resource_request) { + set_has_resource_request(); + } else { + clear_has_resource_request(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.resource_request) +} + +// optional .safe_browsing.ClientIncidentReport.IncidentData.SuspiciousModuleIncident suspicious_module = 8; +inline bool ClientIncidentReport_IncidentData::has_suspicious_module() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientIncidentReport_IncidentData::set_has_suspicious_module() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientIncidentReport_IncidentData::clear_has_suspicious_module() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientIncidentReport_IncidentData::clear_suspicious_module() { + if (suspicious_module_ != NULL) suspicious_module_->::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident::Clear(); + clear_has_suspicious_module(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident& ClientIncidentReport_IncidentData::suspicious_module() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.IncidentData.suspicious_module) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return suspicious_module_ != NULL ? *suspicious_module_ : *default_instance().suspicious_module_; +#else + return suspicious_module_ != NULL ? *suspicious_module_ : *default_instance_->suspicious_module_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* ClientIncidentReport_IncidentData::mutable_suspicious_module() { + set_has_suspicious_module(); + if (suspicious_module_ == NULL) suspicious_module_ = new ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.IncidentData.suspicious_module) + return suspicious_module_; +} +inline ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* ClientIncidentReport_IncidentData::release_suspicious_module() { + clear_has_suspicious_module(); + ::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* temp = suspicious_module_; + suspicious_module_ = NULL; + return temp; +} +inline void ClientIncidentReport_IncidentData::set_allocated_suspicious_module(::safe_browsing::ClientIncidentReport_IncidentData_SuspiciousModuleIncident* suspicious_module) { + delete suspicious_module_; + suspicious_module_ = suspicious_module; + if (suspicious_module) { + set_has_suspicious_module(); + } else { + clear_has_suspicious_module(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.IncidentData.suspicious_module) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_DownloadDetails + +// optional bytes token = 1; +inline bool ClientIncidentReport_DownloadDetails::has_token() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_DownloadDetails::set_has_token() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_DownloadDetails::clear_has_token() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_DownloadDetails::clear_token() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + clear_has_token(); +} +inline const ::std::string& ClientIncidentReport_DownloadDetails::token() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.DownloadDetails.token) + return *token_; +} +inline void ClientIncidentReport_DownloadDetails::set_token(const ::std::string& value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.DownloadDetails.token) +} +inline void ClientIncidentReport_DownloadDetails::set_token(const char* value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.DownloadDetails.token) +} +inline void ClientIncidentReport_DownloadDetails::set_token(const void* value, size_t size) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.DownloadDetails.token) +} +inline ::std::string* ClientIncidentReport_DownloadDetails::mutable_token() { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.DownloadDetails.token) + return token_; +} +inline ::std::string* ClientIncidentReport_DownloadDetails::release_token() { + clear_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = token_; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_DownloadDetails::set_allocated_token(::std::string* token) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + if (token) { + set_has_token(); + token_ = token; + } else { + clear_has_token(); + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.DownloadDetails.token) +} + +// optional .safe_browsing.ClientDownloadRequest download = 2; +inline bool ClientIncidentReport_DownloadDetails::has_download() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_DownloadDetails::set_has_download() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_DownloadDetails::clear_has_download() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_DownloadDetails::clear_download() { + if (download_ != NULL) download_->::safe_browsing::ClientDownloadRequest::Clear(); + clear_has_download(); +} +inline const ::safe_browsing::ClientDownloadRequest& ClientIncidentReport_DownloadDetails::download() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.DownloadDetails.download) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return download_ != NULL ? *download_ : *default_instance().download_; +#else + return download_ != NULL ? *download_ : *default_instance_->download_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest* ClientIncidentReport_DownloadDetails::mutable_download() { + set_has_download(); + if (download_ == NULL) download_ = new ::safe_browsing::ClientDownloadRequest; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.DownloadDetails.download) + return download_; +} +inline ::safe_browsing::ClientDownloadRequest* ClientIncidentReport_DownloadDetails::release_download() { + clear_has_download(); + ::safe_browsing::ClientDownloadRequest* temp = download_; + download_ = NULL; + return temp; +} +inline void ClientIncidentReport_DownloadDetails::set_allocated_download(::safe_browsing::ClientDownloadRequest* download) { + delete download_; + download_ = download; + if (download) { + set_has_download(); + } else { + clear_has_download(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.DownloadDetails.download) +} + +// optional int64 download_time_msec = 3; +inline bool ClientIncidentReport_DownloadDetails::has_download_time_msec() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_DownloadDetails::set_has_download_time_msec() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_DownloadDetails::clear_has_download_time_msec() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_DownloadDetails::clear_download_time_msec() { + download_time_msec_ = GOOGLE_LONGLONG(0); + clear_has_download_time_msec(); +} +inline ::google::protobuf::int64 ClientIncidentReport_DownloadDetails::download_time_msec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.DownloadDetails.download_time_msec) + return download_time_msec_; +} +inline void ClientIncidentReport_DownloadDetails::set_download_time_msec(::google::protobuf::int64 value) { + set_has_download_time_msec(); + download_time_msec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.DownloadDetails.download_time_msec) +} + +// optional int64 open_time_msec = 4; +inline bool ClientIncidentReport_DownloadDetails::has_open_time_msec() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_DownloadDetails::set_has_open_time_msec() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_DownloadDetails::clear_has_open_time_msec() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_DownloadDetails::clear_open_time_msec() { + open_time_msec_ = GOOGLE_LONGLONG(0); + clear_has_open_time_msec(); +} +inline ::google::protobuf::int64 ClientIncidentReport_DownloadDetails::open_time_msec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.DownloadDetails.open_time_msec) + return open_time_msec_; +} +inline void ClientIncidentReport_DownloadDetails::set_open_time_msec(::google::protobuf::int64 value) { + set_has_open_time_msec(); + open_time_msec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.DownloadDetails.open_time_msec) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_OS_RegistryValue + +// optional string name = 1; +inline bool ClientIncidentReport_EnvironmentData_OS_RegistryValue::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_OS_RegistryValue::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) + return *name_; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryValue::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) + return name_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryValue::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.name) +} + +// optional uint32 type = 2; +inline bool ClientIncidentReport_EnvironmentData_OS_RegistryValue::has_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_has_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_has_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_type() { + type_ = 0u; + clear_has_type(); +} +inline ::google::protobuf::uint32 ClientIncidentReport_EnvironmentData_OS_RegistryValue::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.type) + return type_; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_type(::google::protobuf::uint32 value) { + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.type) +} + +// optional bytes data = 3; +inline bool ClientIncidentReport_EnvironmentData_OS_RegistryValue::has_data() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_has_data() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_has_data() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::clear_data() { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_->clear(); + } + clear_has_data(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_OS_RegistryValue::data() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) + return *data_; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_data(const ::std::string& value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_data(const char* value) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_data(const void* value, size_t size) { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + data_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryValue::mutable_data() { + set_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + data_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) + return data_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryValue::release_data() { + clear_has_data(); + if (data_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = data_; + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryValue::set_allocated_data(::std::string* data) { + if (data_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete data_; + } + if (data) { + set_has_data(); + data_ = data; + } else { + clear_has_data(); + data_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue.data) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_OS_RegistryKey + +// optional string name = 1; +inline bool ClientIncidentReport_EnvironmentData_OS_RegistryKey::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_OS_RegistryKey::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) + return *name_; +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryKey::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) + return name_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS_RegistryKey::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.name) +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryValue value = 2; +inline int ClientIncidentReport_EnvironmentData_OS_RegistryKey::value_size() const { + return value_.size(); +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::clear_value() { + value_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue& ClientIncidentReport_EnvironmentData_OS_RegistryKey::value(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.value) + return value_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue* ClientIncidentReport_EnvironmentData_OS_RegistryKey::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.value) + return value_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue* ClientIncidentReport_EnvironmentData_OS_RegistryKey::add_value() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.value) + return value_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue >& +ClientIncidentReport_EnvironmentData_OS_RegistryKey::value() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.value) + return value_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryValue >* +ClientIncidentReport_EnvironmentData_OS_RegistryKey::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.value) + return &value_; +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey key = 3; +inline int ClientIncidentReport_EnvironmentData_OS_RegistryKey::key_size() const { + return key_.size(); +} +inline void ClientIncidentReport_EnvironmentData_OS_RegistryKey::clear_key() { + key_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey& ClientIncidentReport_EnvironmentData_OS_RegistryKey::key(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.key) + return key_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS_RegistryKey::mutable_key(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.key) + return key_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS_RegistryKey::add_key() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.key) + return key_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >& +ClientIncidentReport_EnvironmentData_OS_RegistryKey::key() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.key) + return key_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >* +ClientIncidentReport_EnvironmentData_OS_RegistryKey::mutable_key() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey.key) + return &key_; +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_OS + +// optional string os_name = 1; +inline bool ClientIncidentReport_EnvironmentData_OS::has_os_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_has_os_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_has_os_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_os_name() { + if (os_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_->clear(); + } + clear_has_os_name(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_OS::os_name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) + return *os_name_; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_name(const ::std::string& value) { + set_has_os_name(); + if (os_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_ = new ::std::string; + } + os_name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_name(const char* value) { + set_has_os_name(); + if (os_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_ = new ::std::string; + } + os_name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_name(const char* value, size_t size) { + set_has_os_name(); + if (os_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_ = new ::std::string; + } + os_name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS::mutable_os_name() { + set_has_os_name(); + if (os_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) + return os_name_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS::release_os_name() { + clear_has_os_name(); + if (os_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = os_name_; + os_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_OS::set_allocated_os_name(::std::string* os_name) { + if (os_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete os_name_; + } + if (os_name) { + set_has_os_name(); + os_name_ = os_name; + } else { + clear_has_os_name(); + os_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_name) +} + +// optional string os_version = 2; +inline bool ClientIncidentReport_EnvironmentData_OS::has_os_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_has_os_version() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_has_os_version() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_os_version() { + if (os_version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_->clear(); + } + clear_has_os_version(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_OS::os_version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) + return *os_version_; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_version(const ::std::string& value) { + set_has_os_version(); + if (os_version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_ = new ::std::string; + } + os_version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_version(const char* value) { + set_has_os_version(); + if (os_version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_ = new ::std::string; + } + os_version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) +} +inline void ClientIncidentReport_EnvironmentData_OS::set_os_version(const char* value, size_t size) { + set_has_os_version(); + if (os_version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_ = new ::std::string; + } + os_version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS::mutable_os_version() { + set_has_os_version(); + if (os_version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + os_version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) + return os_version_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_OS::release_os_version() { + clear_has_os_version(); + if (os_version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = os_version_; + os_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_OS::set_allocated_os_version(::std::string* os_version) { + if (os_version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete os_version_; + } + if (os_version) { + set_has_os_version(); + os_version_ = os_version; + } else { + clear_has_os_version(); + os_version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.OS.os_version) +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.OS.RegistryKey registry_key = 3; +inline int ClientIncidentReport_EnvironmentData_OS::registry_key_size() const { + return registry_key_.size(); +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_registry_key() { + registry_key_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey& ClientIncidentReport_EnvironmentData_OS::registry_key(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.registry_key) + return registry_key_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS::mutable_registry_key(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.OS.registry_key) + return registry_key_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey* ClientIncidentReport_EnvironmentData_OS::add_registry_key() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.OS.registry_key) + return registry_key_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >& +ClientIncidentReport_EnvironmentData_OS::registry_key() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.registry_key) + return registry_key_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_OS_RegistryKey >* +ClientIncidentReport_EnvironmentData_OS::mutable_registry_key() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.OS.registry_key) + return ®istry_key_; +} + +// optional bool is_enrolled_to_domain = 4; +inline bool ClientIncidentReport_EnvironmentData_OS::has_is_enrolled_to_domain() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_has_is_enrolled_to_domain() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_has_is_enrolled_to_domain() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_EnvironmentData_OS::clear_is_enrolled_to_domain() { + is_enrolled_to_domain_ = false; + clear_has_is_enrolled_to_domain(); +} +inline bool ClientIncidentReport_EnvironmentData_OS::is_enrolled_to_domain() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.OS.is_enrolled_to_domain) + return is_enrolled_to_domain_; +} +inline void ClientIncidentReport_EnvironmentData_OS::set_is_enrolled_to_domain(bool value) { + set_has_is_enrolled_to_domain(); + is_enrolled_to_domain_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.OS.is_enrolled_to_domain) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Machine + +// optional string cpu_architecture = 1; +inline bool ClientIncidentReport_EnvironmentData_Machine::has_cpu_architecture() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_has_cpu_architecture() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_has_cpu_architecture() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_cpu_architecture() { + if (cpu_architecture_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_->clear(); + } + clear_has_cpu_architecture(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Machine::cpu_architecture() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) + return *cpu_architecture_; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_architecture(const ::std::string& value) { + set_has_cpu_architecture(); + if (cpu_architecture_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_ = new ::std::string; + } + cpu_architecture_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_architecture(const char* value) { + set_has_cpu_architecture(); + if (cpu_architecture_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_ = new ::std::string; + } + cpu_architecture_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_architecture(const char* value, size_t size) { + set_has_cpu_architecture(); + if (cpu_architecture_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_ = new ::std::string; + } + cpu_architecture_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Machine::mutable_cpu_architecture() { + set_has_cpu_architecture(); + if (cpu_architecture_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_architecture_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) + return cpu_architecture_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Machine::release_cpu_architecture() { + clear_has_cpu_architecture(); + if (cpu_architecture_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = cpu_architecture_; + cpu_architecture_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_allocated_cpu_architecture(::std::string* cpu_architecture) { + if (cpu_architecture_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete cpu_architecture_; + } + if (cpu_architecture) { + set_has_cpu_architecture(); + cpu_architecture_ = cpu_architecture; + } else { + clear_has_cpu_architecture(); + cpu_architecture_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_architecture) +} + +// optional string cpu_vendor = 2; +inline bool ClientIncidentReport_EnvironmentData_Machine::has_cpu_vendor() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_has_cpu_vendor() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_has_cpu_vendor() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_cpu_vendor() { + if (cpu_vendor_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_->clear(); + } + clear_has_cpu_vendor(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Machine::cpu_vendor() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) + return *cpu_vendor_; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_vendor(const ::std::string& value) { + set_has_cpu_vendor(); + if (cpu_vendor_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_ = new ::std::string; + } + cpu_vendor_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_vendor(const char* value) { + set_has_cpu_vendor(); + if (cpu_vendor_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_ = new ::std::string; + } + cpu_vendor_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpu_vendor(const char* value, size_t size) { + set_has_cpu_vendor(); + if (cpu_vendor_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_ = new ::std::string; + } + cpu_vendor_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Machine::mutable_cpu_vendor() { + set_has_cpu_vendor(); + if (cpu_vendor_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + cpu_vendor_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) + return cpu_vendor_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Machine::release_cpu_vendor() { + clear_has_cpu_vendor(); + if (cpu_vendor_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = cpu_vendor_; + cpu_vendor_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_allocated_cpu_vendor(::std::string* cpu_vendor) { + if (cpu_vendor_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete cpu_vendor_; + } + if (cpu_vendor) { + set_has_cpu_vendor(); + cpu_vendor_ = cpu_vendor; + } else { + clear_has_cpu_vendor(); + cpu_vendor_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpu_vendor) +} + +// optional uint32 cpuid = 3; +inline bool ClientIncidentReport_EnvironmentData_Machine::has_cpuid() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_has_cpuid() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_has_cpuid() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Machine::clear_cpuid() { + cpuid_ = 0u; + clear_has_cpuid(); +} +inline ::google::protobuf::uint32 ClientIncidentReport_EnvironmentData_Machine::cpuid() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpuid) + return cpuid_; +} +inline void ClientIncidentReport_EnvironmentData_Machine::set_cpuid(::google::protobuf::uint32 value) { + set_has_cpuid(); + cpuid_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Machine.cpuid) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process_Patch + +// optional string function = 1; +inline bool ClientIncidentReport_EnvironmentData_Process_Patch::has_function() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_has_function() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::clear_has_function() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::clear_function() { + if (function_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_->clear(); + } + clear_has_function(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_Patch::function() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) + return *function_; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_function(const ::std::string& value) { + set_has_function(); + if (function_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_ = new ::std::string; + } + function_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_function(const char* value) { + set_has_function(); + if (function_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_ = new ::std::string; + } + function_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_function(const char* value, size_t size) { + set_has_function(); + if (function_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_ = new ::std::string; + } + function_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Patch::mutable_function() { + set_has_function(); + if (function_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + function_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) + return function_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Patch::release_function() { + clear_has_function(); + if (function_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = function_; + function_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_allocated_function(::std::string* function) { + if (function_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete function_; + } + if (function) { + set_has_function(); + function_ = function; + } else { + clear_has_function(); + function_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.function) +} + +// optional string target_dll = 2; +inline bool ClientIncidentReport_EnvironmentData_Process_Patch::has_target_dll() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_has_target_dll() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::clear_has_target_dll() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::clear_target_dll() { + if (target_dll_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_->clear(); + } + clear_has_target_dll(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_Patch::target_dll() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) + return *target_dll_; +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_target_dll(const ::std::string& value) { + set_has_target_dll(); + if (target_dll_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_ = new ::std::string; + } + target_dll_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_target_dll(const char* value) { + set_has_target_dll(); + if (target_dll_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_ = new ::std::string; + } + target_dll_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_target_dll(const char* value, size_t size) { + set_has_target_dll(); + if (target_dll_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_ = new ::std::string; + } + target_dll_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Patch::mutable_target_dll() { + set_has_target_dll(); + if (target_dll_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + target_dll_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) + return target_dll_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Patch::release_target_dll() { + clear_has_target_dll(); + if (target_dll_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = target_dll_; + target_dll_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_Patch::set_allocated_target_dll(::std::string* target_dll) { + if (target_dll_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete target_dll_; + } + if (target_dll) { + set_has_target_dll(); + target_dll_ = target_dll; + } else { + clear_has_target_dll(); + target_dll_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch.target_dll) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process_NetworkProvider + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process_Dll + +// optional string path = 1; +inline bool ClientIncidentReport_EnvironmentData_Process_Dll::has_path() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_has_path() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_has_path() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_path() { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_->clear(); + } + clear_has_path(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_Dll::path() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) + return *path_; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_path(const ::std::string& value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_path(const char* value) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_path(const char* value, size_t size) { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + path_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Dll::mutable_path() { + set_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + path_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) + return path_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_Dll::release_path() { + clear_has_path(); + if (path_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = path_; + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_allocated_path(::std::string* path) { + if (path_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete path_; + } + if (path) { + set_has_path(); + path_ = path; + } else { + clear_has_path(); + path_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.path) +} + +// optional uint64 base_address = 2; +inline bool ClientIncidentReport_EnvironmentData_Process_Dll::has_base_address() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_has_base_address() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_has_base_address() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_base_address() { + base_address_ = GOOGLE_ULONGLONG(0); + clear_has_base_address(); +} +inline ::google::protobuf::uint64 ClientIncidentReport_EnvironmentData_Process_Dll::base_address() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.base_address) + return base_address_; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_base_address(::google::protobuf::uint64 value) { + set_has_base_address(); + base_address_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.base_address) +} + +// optional uint32 length = 3; +inline bool ClientIncidentReport_EnvironmentData_Process_Dll::has_length() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_has_length() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_has_length() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_length() { + length_ = 0u; + clear_has_length(); +} +inline ::google::protobuf::uint32 ClientIncidentReport_EnvironmentData_Process_Dll::length() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.length) + return length_; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_length(::google::protobuf::uint32 value) { + set_has_length(); + length_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.length) +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.Feature feature = 4; +inline int ClientIncidentReport_EnvironmentData_Process_Dll::feature_size() const { + return feature_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_feature() { + feature_.Clear(); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature ClientIncidentReport_EnvironmentData_Process_Dll::feature(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.feature) + return static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature >(feature_.Get(index)); +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_feature(int index, ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature value) { + assert(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(value)); + feature_.Set(index, value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.feature) +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::add_feature(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature value) { + assert(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll_Feature_IsValid(value)); + feature_.Add(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.feature) +} +inline const ::google::protobuf::RepeatedField<int>& +ClientIncidentReport_EnvironmentData_Process_Dll::feature() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.feature) + return feature_; +} +inline ::google::protobuf::RepeatedField<int>* +ClientIncidentReport_EnvironmentData_Process_Dll::mutable_feature() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.feature) + return &feature_; +} + +// optional .safe_browsing.ClientDownloadRequest.ImageHeaders image_headers = 5; +inline bool ClientIncidentReport_EnvironmentData_Process_Dll::has_image_headers() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_has_image_headers() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_has_image_headers() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::clear_image_headers() { + if (image_headers_ != NULL) image_headers_->::safe_browsing::ClientDownloadRequest_ImageHeaders::Clear(); + clear_has_image_headers(); +} +inline const ::safe_browsing::ClientDownloadRequest_ImageHeaders& ClientIncidentReport_EnvironmentData_Process_Dll::image_headers() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.image_headers) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return image_headers_ != NULL ? *image_headers_ : *default_instance().image_headers_; +#else + return image_headers_ != NULL ? *image_headers_ : *default_instance_->image_headers_; +#endif +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_EnvironmentData_Process_Dll::mutable_image_headers() { + set_has_image_headers(); + if (image_headers_ == NULL) image_headers_ = new ::safe_browsing::ClientDownloadRequest_ImageHeaders; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.image_headers) + return image_headers_; +} +inline ::safe_browsing::ClientDownloadRequest_ImageHeaders* ClientIncidentReport_EnvironmentData_Process_Dll::release_image_headers() { + clear_has_image_headers(); + ::safe_browsing::ClientDownloadRequest_ImageHeaders* temp = image_headers_; + image_headers_ = NULL; + return temp; +} +inline void ClientIncidentReport_EnvironmentData_Process_Dll::set_allocated_image_headers(::safe_browsing::ClientDownloadRequest_ImageHeaders* image_headers) { + delete image_headers_; + image_headers_ = image_headers; + if (image_headers) { + set_has_image_headers(); + } else { + clear_has_image_headers(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll.image_headers) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification + +// optional uint32 file_offset = 1; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::has_file_offset() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_has_file_offset() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_has_file_offset() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_file_offset() { + file_offset_ = 0u; + clear_has_file_offset(); +} +inline ::google::protobuf::uint32 ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::file_offset() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.file_offset) + return file_offset_; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_file_offset(::google::protobuf::uint32 value) { + set_has_file_offset(); + file_offset_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.file_offset) +} + +// optional int32 byte_count = 2; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::has_byte_count() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_has_byte_count() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_has_byte_count() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_byte_count() { + byte_count_ = 0; + clear_has_byte_count(); +} +inline ::google::protobuf::int32 ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::byte_count() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.byte_count) + return byte_count_; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_byte_count(::google::protobuf::int32 value) { + set_has_byte_count(); + byte_count_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.byte_count) +} + +// optional bytes modified_bytes = 3; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::has_modified_bytes() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_has_modified_bytes() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_has_modified_bytes() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_modified_bytes() { + if (modified_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_->clear(); + } + clear_has_modified_bytes(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::modified_bytes() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) + return *modified_bytes_; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_modified_bytes(const ::std::string& value) { + set_has_modified_bytes(); + if (modified_bytes_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_ = new ::std::string; + } + modified_bytes_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_modified_bytes(const char* value) { + set_has_modified_bytes(); + if (modified_bytes_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_ = new ::std::string; + } + modified_bytes_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_modified_bytes(const void* value, size_t size) { + set_has_modified_bytes(); + if (modified_bytes_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_ = new ::std::string; + } + modified_bytes_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::mutable_modified_bytes() { + set_has_modified_bytes(); + if (modified_bytes_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + modified_bytes_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) + return modified_bytes_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::release_modified_bytes() { + clear_has_modified_bytes(); + if (modified_bytes_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = modified_bytes_; + modified_bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_allocated_modified_bytes(::std::string* modified_bytes) { + if (modified_bytes_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete modified_bytes_; + } + if (modified_bytes) { + set_has_modified_bytes(); + modified_bytes_ = modified_bytes; + } else { + clear_has_modified_bytes(); + modified_bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.modified_bytes) +} + +// optional string export_name = 4; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::has_export_name() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_has_export_name() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_has_export_name() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::clear_export_name() { + if (export_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_->clear(); + } + clear_has_export_name(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::export_name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) + return *export_name_; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_export_name(const ::std::string& value) { + set_has_export_name(); + if (export_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_ = new ::std::string; + } + export_name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_export_name(const char* value) { + set_has_export_name(); + if (export_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_ = new ::std::string; + } + export_name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_export_name(const char* value, size_t size) { + set_has_export_name(); + if (export_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_ = new ::std::string; + } + export_name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::mutable_export_name() { + set_has_export_name(); + if (export_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + export_name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) + return export_name_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::release_export_name() { + clear_has_export_name(); + if (export_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = export_name_; + export_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification::set_allocated_export_name(::std::string* export_name) { + if (export_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete export_name_; + } + if (export_name) { + set_has_export_name(); + export_name_ = export_name; + } else { + clear_has_export_name(); + export_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification.export_name) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process_ModuleState + +// optional string name = 1; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_ModuleState::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) + return *name_; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) + return name_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.name) +} + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.ModifiedState modified_state = 2; +inline bool ClientIncidentReport_EnvironmentData_Process_ModuleState::has_modified_state() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_has_modified_state() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_has_modified_state() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_modified_state() { + modified_state_ = 0; + clear_has_modified_state(); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState ClientIncidentReport_EnvironmentData_Process_ModuleState::modified_state() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modified_state) + return static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState >(modified_state_); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_modified_state(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState value) { + assert(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState_IsValid(value)); + set_has_modified_state(); + modified_state_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modified_state) +} + +// repeated string OBSOLETE_modified_export = 3; +inline int ClientIncidentReport_EnvironmentData_Process_ModuleState::obsolete_modified_export_size() const { + return obsolete_modified_export_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_obsolete_modified_export() { + obsolete_modified_export_.Clear(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process_ModuleState::obsolete_modified_export(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) + return obsolete_modified_export_.Get(index); +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState::mutable_obsolete_modified_export(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) + return obsolete_modified_export_.Mutable(index); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_obsolete_modified_export(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) + obsolete_modified_export_.Mutable(index)->assign(value); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_obsolete_modified_export(int index, const char* value) { + obsolete_modified_export_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::set_obsolete_modified_export(int index, const char* value, size_t size) { + obsolete_modified_export_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process_ModuleState::add_obsolete_modified_export() { + return obsolete_modified_export_.Add(); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::add_obsolete_modified_export(const ::std::string& value) { + obsolete_modified_export_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::add_obsolete_modified_export(const char* value) { + obsolete_modified_export_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::add_obsolete_modified_export(const char* value, size_t size) { + obsolete_modified_export_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientIncidentReport_EnvironmentData_Process_ModuleState::obsolete_modified_export() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) + return obsolete_modified_export_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientIncidentReport_EnvironmentData_Process_ModuleState::mutable_obsolete_modified_export() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.OBSOLETE_modified_export) + return &obsolete_modified_export_; +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.Modification modification = 4; +inline int ClientIncidentReport_EnvironmentData_Process_ModuleState::modification_size() const { + return modification_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process_ModuleState::clear_modification() { + modification_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification& ClientIncidentReport_EnvironmentData_Process_ModuleState::modification(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modification) + return modification_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* ClientIncidentReport_EnvironmentData_Process_ModuleState::mutable_modification(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modification) + return modification_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification* ClientIncidentReport_EnvironmentData_Process_ModuleState::add_modification() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modification) + return modification_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification >& +ClientIncidentReport_EnvironmentData_Process_ModuleState::modification() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modification) + return modification_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState_Modification >* +ClientIncidentReport_EnvironmentData_Process_ModuleState::mutable_modification() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState.modification) + return &modification_; +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData_Process + +// optional string version = 1; +inline bool ClientIncidentReport_EnvironmentData_Process::has_version() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_version() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_version() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) + return *version_; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) +} +inline void ClientIncidentReport_EnvironmentData_Process::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) +} +inline void ClientIncidentReport_EnvironmentData_Process::set_version(const char* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) + return version_; +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_EnvironmentData_Process::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.Process.version) +} + +// repeated string OBSOLETE_dlls = 2; +inline int ClientIncidentReport_EnvironmentData_Process::obsolete_dlls_size() const { + return obsolete_dlls_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_obsolete_dlls() { + obsolete_dlls_.Clear(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process::obsolete_dlls(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) + return obsolete_dlls_.Get(index); +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::mutable_obsolete_dlls(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) + return obsolete_dlls_.Mutable(index); +} +inline void ClientIncidentReport_EnvironmentData_Process::set_obsolete_dlls(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) + obsolete_dlls_.Mutable(index)->assign(value); +} +inline void ClientIncidentReport_EnvironmentData_Process::set_obsolete_dlls(int index, const char* value) { + obsolete_dlls_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) +} +inline void ClientIncidentReport_EnvironmentData_Process::set_obsolete_dlls(int index, const char* value, size_t size) { + obsolete_dlls_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::add_obsolete_dlls() { + return obsolete_dlls_.Add(); +} +inline void ClientIncidentReport_EnvironmentData_Process::add_obsolete_dlls(const ::std::string& value) { + obsolete_dlls_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) +} +inline void ClientIncidentReport_EnvironmentData_Process::add_obsolete_dlls(const char* value) { + obsolete_dlls_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) +} +inline void ClientIncidentReport_EnvironmentData_Process::add_obsolete_dlls(const char* value, size_t size) { + obsolete_dlls_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientIncidentReport_EnvironmentData_Process::obsolete_dlls() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) + return obsolete_dlls_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientIncidentReport_EnvironmentData_Process::mutable_obsolete_dlls() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.OBSOLETE_dlls) + return &obsolete_dlls_; +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Patch patches = 3; +inline int ClientIncidentReport_EnvironmentData_Process::patches_size() const { + return patches_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_patches() { + patches_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch& ClientIncidentReport_EnvironmentData_Process::patches(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.patches) + return patches_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch* ClientIncidentReport_EnvironmentData_Process::mutable_patches(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.patches) + return patches_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch* ClientIncidentReport_EnvironmentData_Process::add_patches() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.patches) + return patches_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch >& +ClientIncidentReport_EnvironmentData_Process::patches() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.patches) + return patches_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Patch >* +ClientIncidentReport_EnvironmentData_Process::mutable_patches() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.patches) + return &patches_; +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.NetworkProvider network_providers = 4; +inline int ClientIncidentReport_EnvironmentData_Process::network_providers_size() const { + return network_providers_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_network_providers() { + network_providers_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider& ClientIncidentReport_EnvironmentData_Process::network_providers(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.network_providers) + return network_providers_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider* ClientIncidentReport_EnvironmentData_Process::mutable_network_providers(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.network_providers) + return network_providers_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider* ClientIncidentReport_EnvironmentData_Process::add_network_providers() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.network_providers) + return network_providers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider >& +ClientIncidentReport_EnvironmentData_Process::network_providers() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.network_providers) + return network_providers_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_NetworkProvider >* +ClientIncidentReport_EnvironmentData_Process::mutable_network_providers() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.network_providers) + return &network_providers_; +} + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Channel chrome_update_channel = 5; +inline bool ClientIncidentReport_EnvironmentData_Process::has_chrome_update_channel() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_chrome_update_channel() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_chrome_update_channel() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_chrome_update_channel() { + chrome_update_channel_ = 0; + clear_has_chrome_update_channel(); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel ClientIncidentReport_EnvironmentData_Process::chrome_update_channel() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.chrome_update_channel) + return static_cast< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel >(chrome_update_channel_); +} +inline void ClientIncidentReport_EnvironmentData_Process::set_chrome_update_channel(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel value) { + assert(::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Channel_IsValid(value)); + set_has_chrome_update_channel(); + chrome_update_channel_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.chrome_update_channel) +} + +// optional int64 uptime_msec = 6; +inline bool ClientIncidentReport_EnvironmentData_Process::has_uptime_msec() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_uptime_msec() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_uptime_msec() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_uptime_msec() { + uptime_msec_ = GOOGLE_LONGLONG(0); + clear_has_uptime_msec(); +} +inline ::google::protobuf::int64 ClientIncidentReport_EnvironmentData_Process::uptime_msec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.uptime_msec) + return uptime_msec_; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_uptime_msec(::google::protobuf::int64 value) { + set_has_uptime_msec(); + uptime_msec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.uptime_msec) +} + +// optional bool metrics_consent = 7; +inline bool ClientIncidentReport_EnvironmentData_Process::has_metrics_consent() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_metrics_consent() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_metrics_consent() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_metrics_consent() { + metrics_consent_ = false; + clear_has_metrics_consent(); +} +inline bool ClientIncidentReport_EnvironmentData_Process::metrics_consent() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.metrics_consent) + return metrics_consent_; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_metrics_consent(bool value) { + set_has_metrics_consent(); + metrics_consent_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.metrics_consent) +} + +// optional bool extended_consent = 8; +inline bool ClientIncidentReport_EnvironmentData_Process::has_extended_consent() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_extended_consent() { + _has_bits_[0] |= 0x00000080u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_extended_consent() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_extended_consent() { + extended_consent_ = false; + clear_has_extended_consent(); +} +inline bool ClientIncidentReport_EnvironmentData_Process::extended_consent() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.extended_consent) + return extended_consent_; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_extended_consent(bool value) { + set_has_extended_consent(); + extended_consent_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.extended_consent) +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.Dll dll = 9; +inline int ClientIncidentReport_EnvironmentData_Process::dll_size() const { + return dll_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_dll() { + dll_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll& ClientIncidentReport_EnvironmentData_Process::dll(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.dll) + return dll_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll* ClientIncidentReport_EnvironmentData_Process::mutable_dll(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.dll) + return dll_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll* ClientIncidentReport_EnvironmentData_Process::add_dll() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.dll) + return dll_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll >& +ClientIncidentReport_EnvironmentData_Process::dll() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.dll) + return dll_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_Dll >* +ClientIncidentReport_EnvironmentData_Process::mutable_dll() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.dll) + return &dll_; +} + +// repeated string blacklisted_dll = 10; +inline int ClientIncidentReport_EnvironmentData_Process::blacklisted_dll_size() const { + return blacklisted_dll_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_blacklisted_dll() { + blacklisted_dll_.Clear(); +} +inline const ::std::string& ClientIncidentReport_EnvironmentData_Process::blacklisted_dll(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) + return blacklisted_dll_.Get(index); +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::mutable_blacklisted_dll(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) + return blacklisted_dll_.Mutable(index); +} +inline void ClientIncidentReport_EnvironmentData_Process::set_blacklisted_dll(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) + blacklisted_dll_.Mutable(index)->assign(value); +} +inline void ClientIncidentReport_EnvironmentData_Process::set_blacklisted_dll(int index, const char* value) { + blacklisted_dll_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) +} +inline void ClientIncidentReport_EnvironmentData_Process::set_blacklisted_dll(int index, const char* value, size_t size) { + blacklisted_dll_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) +} +inline ::std::string* ClientIncidentReport_EnvironmentData_Process::add_blacklisted_dll() { + return blacklisted_dll_.Add(); +} +inline void ClientIncidentReport_EnvironmentData_Process::add_blacklisted_dll(const ::std::string& value) { + blacklisted_dll_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) +} +inline void ClientIncidentReport_EnvironmentData_Process::add_blacklisted_dll(const char* value) { + blacklisted_dll_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) +} +inline void ClientIncidentReport_EnvironmentData_Process::add_blacklisted_dll(const char* value, size_t size) { + blacklisted_dll_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientIncidentReport_EnvironmentData_Process::blacklisted_dll() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) + return blacklisted_dll_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientIncidentReport_EnvironmentData_Process::mutable_blacklisted_dll() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.blacklisted_dll) + return &blacklisted_dll_; +} + +// repeated .safe_browsing.ClientIncidentReport.EnvironmentData.Process.ModuleState module_state = 11; +inline int ClientIncidentReport_EnvironmentData_Process::module_state_size() const { + return module_state_.size(); +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_module_state() { + module_state_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState& ClientIncidentReport_EnvironmentData_Process::module_state(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.module_state) + return module_state_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState* ClientIncidentReport_EnvironmentData_Process::mutable_module_state(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.Process.module_state) + return module_state_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState* ClientIncidentReport_EnvironmentData_Process::add_module_state() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.EnvironmentData.Process.module_state) + return module_state_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState >& +ClientIncidentReport_EnvironmentData_Process::module_state() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.module_state) + return module_state_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_EnvironmentData_Process_ModuleState >* +ClientIncidentReport_EnvironmentData_Process::mutable_module_state() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.EnvironmentData.Process.module_state) + return &module_state_; +} + +// optional bool field_trial_participant = 12; +inline bool ClientIncidentReport_EnvironmentData_Process::has_field_trial_participant() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_has_field_trial_participant() { + _has_bits_[0] |= 0x00000800u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_has_field_trial_participant() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ClientIncidentReport_EnvironmentData_Process::clear_field_trial_participant() { + field_trial_participant_ = false; + clear_has_field_trial_participant(); +} +inline bool ClientIncidentReport_EnvironmentData_Process::field_trial_participant() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.Process.field_trial_participant) + return field_trial_participant_; +} +inline void ClientIncidentReport_EnvironmentData_Process::set_field_trial_participant(bool value) { + set_has_field_trial_participant(); + field_trial_participant_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.EnvironmentData.Process.field_trial_participant) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_EnvironmentData + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData.OS os = 1; +inline bool ClientIncidentReport_EnvironmentData::has_os() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_EnvironmentData::set_has_os() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData::clear_has_os() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_EnvironmentData::clear_os() { + if (os_ != NULL) os_->::safe_browsing::ClientIncidentReport_EnvironmentData_OS::Clear(); + clear_has_os(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_OS& ClientIncidentReport_EnvironmentData::os() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.os) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return os_ != NULL ? *os_ : *default_instance().os_; +#else + return os_ != NULL ? *os_ : *default_instance_->os_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* ClientIncidentReport_EnvironmentData::mutable_os() { + set_has_os(); + if (os_ == NULL) os_ = new ::safe_browsing::ClientIncidentReport_EnvironmentData_OS; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.os) + return os_; +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* ClientIncidentReport_EnvironmentData::release_os() { + clear_has_os(); + ::safe_browsing::ClientIncidentReport_EnvironmentData_OS* temp = os_; + os_ = NULL; + return temp; +} +inline void ClientIncidentReport_EnvironmentData::set_allocated_os(::safe_browsing::ClientIncidentReport_EnvironmentData_OS* os) { + delete os_; + os_ = os; + if (os) { + set_has_os(); + } else { + clear_has_os(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.os) +} + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData.Machine machine = 2; +inline bool ClientIncidentReport_EnvironmentData::has_machine() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_EnvironmentData::set_has_machine() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData::clear_has_machine() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_EnvironmentData::clear_machine() { + if (machine_ != NULL) machine_->::safe_browsing::ClientIncidentReport_EnvironmentData_Machine::Clear(); + clear_has_machine(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine& ClientIncidentReport_EnvironmentData::machine() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.machine) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return machine_ != NULL ? *machine_ : *default_instance().machine_; +#else + return machine_ != NULL ? *machine_ : *default_instance_->machine_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* ClientIncidentReport_EnvironmentData::mutable_machine() { + set_has_machine(); + if (machine_ == NULL) machine_ = new ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.machine) + return machine_; +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* ClientIncidentReport_EnvironmentData::release_machine() { + clear_has_machine(); + ::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* temp = machine_; + machine_ = NULL; + return temp; +} +inline void ClientIncidentReport_EnvironmentData::set_allocated_machine(::safe_browsing::ClientIncidentReport_EnvironmentData_Machine* machine) { + delete machine_; + machine_ = machine; + if (machine) { + set_has_machine(); + } else { + clear_has_machine(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.machine) +} + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData.Process process = 3; +inline bool ClientIncidentReport_EnvironmentData::has_process() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_EnvironmentData::set_has_process() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData::clear_has_process() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_EnvironmentData::clear_process() { + if (process_ != NULL) process_->::safe_browsing::ClientIncidentReport_EnvironmentData_Process::Clear(); + clear_has_process(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData_Process& ClientIncidentReport_EnvironmentData::process() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.EnvironmentData.process) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return process_ != NULL ? *process_ : *default_instance().process_; +#else + return process_ != NULL ? *process_ : *default_instance_->process_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* ClientIncidentReport_EnvironmentData::mutable_process() { + set_has_process(); + if (process_ == NULL) process_ = new ::safe_browsing::ClientIncidentReport_EnvironmentData_Process; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.EnvironmentData.process) + return process_; +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* ClientIncidentReport_EnvironmentData::release_process() { + clear_has_process(); + ::safe_browsing::ClientIncidentReport_EnvironmentData_Process* temp = process_; + process_ = NULL; + return temp; +} +inline void ClientIncidentReport_EnvironmentData::set_allocated_process(::safe_browsing::ClientIncidentReport_EnvironmentData_Process* process) { + delete process_; + process_ = process; + if (process) { + set_has_process(); + } else { + clear_has_process(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.EnvironmentData.process) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_ExtensionData_ExtensionInfo + +// optional string id = 1; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_id() { + if (id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_->clear(); + } + clear_has_id(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::id() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) + return *id_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_id(const ::std::string& value) { + set_has_id(); + if (id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_ = new ::std::string; + } + id_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_id(const char* value) { + set_has_id(); + if (id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_ = new ::std::string; + } + id_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_id(const char* value, size_t size) { + set_has_id(); + if (id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_ = new ::std::string; + } + id_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_id() { + set_has_id(); + if (id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + id_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) + return id_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_id() { + clear_has_id(); + if (id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = id_; + id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_id(::std::string* id) { + if (id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete id_; + } + if (id) { + set_has_id(); + id_ = id; + } else { + clear_has_id(); + id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.id) +} + +// optional string version = 2; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_version() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_version() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_version() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) + return *version_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_version(const char* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) + return version_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.version) +} + +// optional string name = 3; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_name() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_name() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_name() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) + return *name_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_name(const char* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) + return name_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.name) +} + +// optional string description = 4; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_description() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_description() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_description() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_description() { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_->clear(); + } + clear_has_description(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::description() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) + return *description_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_description(const ::std::string& value) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_description(const char* value) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_description(const char* value, size_t size) { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + description_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_description() { + set_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + description_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) + return description_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_description() { + clear_has_description(); + if (description_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = description_; + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_description(::std::string* description) { + if (description_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete description_; + } + if (description) { + set_has_description(); + description_ = description; + } else { + clear_has_description(); + description_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.description) +} + +// optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.ExtensionState state = 5 [default = STATE_UNKNOWN]; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_state() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_state() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_state() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_state() { + state_ = 0; + clear_has_state(); +} +inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState ClientIncidentReport_ExtensionData_ExtensionInfo::state() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.state) + return static_cast< ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState >(state_); +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_state(::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState value) { + assert(::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo_ExtensionState_IsValid(value)); + set_has_state(); + state_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.state) +} + +// optional int32 type = 6; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_type() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_type() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_type() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::google::protobuf::int32 ClientIncidentReport_ExtensionData_ExtensionInfo::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.type) + return type_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_type(::google::protobuf::int32 value) { + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.type) +} + +// optional string update_url = 7; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_update_url() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_update_url() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_update_url() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_update_url() { + if (update_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_->clear(); + } + clear_has_update_url(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::update_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) + return *update_url_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_update_url(const ::std::string& value) { + set_has_update_url(); + if (update_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_ = new ::std::string; + } + update_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_update_url(const char* value) { + set_has_update_url(); + if (update_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_ = new ::std::string; + } + update_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_update_url(const char* value, size_t size) { + set_has_update_url(); + if (update_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_ = new ::std::string; + } + update_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_update_url() { + set_has_update_url(); + if (update_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + update_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) + return update_url_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_update_url() { + clear_has_update_url(); + if (update_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = update_url_; + update_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_update_url(::std::string* update_url) { + if (update_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete update_url_; + } + if (update_url) { + set_has_update_url(); + update_url_ = update_url; + } else { + clear_has_update_url(); + update_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.update_url) +} + +// optional bool has_signature_validation = 8; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_has_signature_validation() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_has_signature_validation() { + _has_bits_[0] |= 0x00000080u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_has_signature_validation() { + _has_bits_[0] &= ~0x00000080u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_signature_validation() { + has_signature_validation_ = false; + clear_has_has_signature_validation(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_signature_validation() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.has_signature_validation) + return has_signature_validation_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_signature_validation(bool value) { + set_has_has_signature_validation(); + has_signature_validation_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.has_signature_validation) +} + +// optional bool signature_is_valid = 9; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_signature_is_valid() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_signature_is_valid() { + _has_bits_[0] |= 0x00000100u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_signature_is_valid() { + _has_bits_[0] &= ~0x00000100u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_signature_is_valid() { + signature_is_valid_ = false; + clear_has_signature_is_valid(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::signature_is_valid() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.signature_is_valid) + return signature_is_valid_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_signature_is_valid(bool value) { + set_has_signature_is_valid(); + signature_is_valid_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.signature_is_valid) +} + +// optional bool installed_by_custodian = 10; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_installed_by_custodian() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_installed_by_custodian() { + _has_bits_[0] |= 0x00000200u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_installed_by_custodian() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_installed_by_custodian() { + installed_by_custodian_ = false; + clear_has_installed_by_custodian(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::installed_by_custodian() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_custodian) + return installed_by_custodian_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_installed_by_custodian(bool value) { + set_has_installed_by_custodian(); + installed_by_custodian_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_custodian) +} + +// optional bool installed_by_default = 11; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_installed_by_default() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_installed_by_default() { + _has_bits_[0] |= 0x00000400u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_installed_by_default() { + _has_bits_[0] &= ~0x00000400u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_installed_by_default() { + installed_by_default_ = false; + clear_has_installed_by_default(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::installed_by_default() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_default) + return installed_by_default_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_installed_by_default(bool value) { + set_has_installed_by_default(); + installed_by_default_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_default) +} + +// optional bool installed_by_oem = 12; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_installed_by_oem() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_installed_by_oem() { + _has_bits_[0] |= 0x00000800u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_installed_by_oem() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_installed_by_oem() { + installed_by_oem_ = false; + clear_has_installed_by_oem(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::installed_by_oem() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_oem) + return installed_by_oem_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_installed_by_oem(bool value) { + set_has_installed_by_oem(); + installed_by_oem_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.installed_by_oem) +} + +// optional bool from_bookmark = 13; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_from_bookmark() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_from_bookmark() { + _has_bits_[0] |= 0x00001000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_from_bookmark() { + _has_bits_[0] &= ~0x00001000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_from_bookmark() { + from_bookmark_ = false; + clear_has_from_bookmark(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::from_bookmark() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.from_bookmark) + return from_bookmark_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_from_bookmark(bool value) { + set_has_from_bookmark(); + from_bookmark_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.from_bookmark) +} + +// optional bool from_webstore = 14; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_from_webstore() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_from_webstore() { + _has_bits_[0] |= 0x00002000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_from_webstore() { + _has_bits_[0] &= ~0x00002000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_from_webstore() { + from_webstore_ = false; + clear_has_from_webstore(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::from_webstore() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.from_webstore) + return from_webstore_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_from_webstore(bool value) { + set_has_from_webstore(); + from_webstore_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.from_webstore) +} + +// optional bool converted_from_user_script = 15; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_converted_from_user_script() const { + return (_has_bits_[0] & 0x00004000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_converted_from_user_script() { + _has_bits_[0] |= 0x00004000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_converted_from_user_script() { + _has_bits_[0] &= ~0x00004000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_converted_from_user_script() { + converted_from_user_script_ = false; + clear_has_converted_from_user_script(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::converted_from_user_script() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.converted_from_user_script) + return converted_from_user_script_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_converted_from_user_script(bool value) { + set_has_converted_from_user_script(); + converted_from_user_script_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.converted_from_user_script) +} + +// optional bool may_be_untrusted = 16; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_may_be_untrusted() const { + return (_has_bits_[0] & 0x00008000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_may_be_untrusted() { + _has_bits_[0] |= 0x00008000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_may_be_untrusted() { + _has_bits_[0] &= ~0x00008000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_may_be_untrusted() { + may_be_untrusted_ = false; + clear_has_may_be_untrusted(); +} +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::may_be_untrusted() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.may_be_untrusted) + return may_be_untrusted_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_may_be_untrusted(bool value) { + set_has_may_be_untrusted(); + may_be_untrusted_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.may_be_untrusted) +} + +// optional int64 install_time_msec = 17; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_install_time_msec() const { + return (_has_bits_[0] & 0x00010000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_install_time_msec() { + _has_bits_[0] |= 0x00010000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_install_time_msec() { + _has_bits_[0] &= ~0x00010000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_install_time_msec() { + install_time_msec_ = GOOGLE_LONGLONG(0); + clear_has_install_time_msec(); +} +inline ::google::protobuf::int64 ClientIncidentReport_ExtensionData_ExtensionInfo::install_time_msec() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.install_time_msec) + return install_time_msec_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_install_time_msec(::google::protobuf::int64 value) { + set_has_install_time_msec(); + install_time_msec_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.install_time_msec) +} + +// optional int32 manifest_location_type = 18; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_manifest_location_type() const { + return (_has_bits_[0] & 0x00020000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_manifest_location_type() { + _has_bits_[0] |= 0x00020000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_manifest_location_type() { + _has_bits_[0] &= ~0x00020000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_manifest_location_type() { + manifest_location_type_ = 0; + clear_has_manifest_location_type(); +} +inline ::google::protobuf::int32 ClientIncidentReport_ExtensionData_ExtensionInfo::manifest_location_type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest_location_type) + return manifest_location_type_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_manifest_location_type(::google::protobuf::int32 value) { + set_has_manifest_location_type(); + manifest_location_type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest_location_type) +} + +// optional string manifest = 19; +inline bool ClientIncidentReport_ExtensionData_ExtensionInfo::has_manifest() const { + return (_has_bits_[0] & 0x00040000u) != 0; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_has_manifest() { + _has_bits_[0] |= 0x00040000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_has_manifest() { + _has_bits_[0] &= ~0x00040000u; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::clear_manifest() { + if (manifest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_->clear(); + } + clear_has_manifest(); +} +inline const ::std::string& ClientIncidentReport_ExtensionData_ExtensionInfo::manifest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) + return *manifest_; +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_manifest(const ::std::string& value) { + set_has_manifest(); + if (manifest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_ = new ::std::string; + } + manifest_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_manifest(const char* value) { + set_has_manifest(); + if (manifest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_ = new ::std::string; + } + manifest_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_manifest(const char* value, size_t size) { + set_has_manifest(); + if (manifest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_ = new ::std::string; + } + manifest_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::mutable_manifest() { + set_has_manifest(); + if (manifest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + manifest_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) + return manifest_; +} +inline ::std::string* ClientIncidentReport_ExtensionData_ExtensionInfo::release_manifest() { + clear_has_manifest(); + if (manifest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = manifest_; + manifest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_ExtensionData_ExtensionInfo::set_allocated_manifest(::std::string* manifest) { + if (manifest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete manifest_; + } + if (manifest) { + set_has_manifest(); + manifest_ = manifest; + } else { + clear_has_manifest(); + manifest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo.manifest) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_ExtensionData + +// optional .safe_browsing.ClientIncidentReport.ExtensionData.ExtensionInfo last_installed_extension = 1; +inline bool ClientIncidentReport_ExtensionData::has_last_installed_extension() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_ExtensionData::set_has_last_installed_extension() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_ExtensionData::clear_has_last_installed_extension() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_ExtensionData::clear_last_installed_extension() { + if (last_installed_extension_ != NULL) last_installed_extension_->::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo::Clear(); + clear_has_last_installed_extension(); +} +inline const ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo& ClientIncidentReport_ExtensionData::last_installed_extension() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.ExtensionData.last_installed_extension) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return last_installed_extension_ != NULL ? *last_installed_extension_ : *default_instance().last_installed_extension_; +#else + return last_installed_extension_ != NULL ? *last_installed_extension_ : *default_instance_->last_installed_extension_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* ClientIncidentReport_ExtensionData::mutable_last_installed_extension() { + set_has_last_installed_extension(); + if (last_installed_extension_ == NULL) last_installed_extension_ = new ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.ExtensionData.last_installed_extension) + return last_installed_extension_; +} +inline ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* ClientIncidentReport_ExtensionData::release_last_installed_extension() { + clear_has_last_installed_extension(); + ::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* temp = last_installed_extension_; + last_installed_extension_ = NULL; + return temp; +} +inline void ClientIncidentReport_ExtensionData::set_allocated_last_installed_extension(::safe_browsing::ClientIncidentReport_ExtensionData_ExtensionInfo* last_installed_extension) { + delete last_installed_extension_; + last_installed_extension_ = last_installed_extension; + if (last_installed_extension) { + set_has_last_installed_extension(); + } else { + clear_has_last_installed_extension(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.ExtensionData.last_installed_extension) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport_NonBinaryDownloadDetails + +// optional string file_type = 1; +inline bool ClientIncidentReport_NonBinaryDownloadDetails::has_file_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_has_file_type() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_has_file_type() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_file_type() { + if (file_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_->clear(); + } + clear_has_file_type(); +} +inline const ::std::string& ClientIncidentReport_NonBinaryDownloadDetails::file_type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) + return *file_type_; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_file_type(const ::std::string& value) { + set_has_file_type(); + if (file_type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_ = new ::std::string; + } + file_type_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_file_type(const char* value) { + set_has_file_type(); + if (file_type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_ = new ::std::string; + } + file_type_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_file_type(const char* value, size_t size) { + set_has_file_type(); + if (file_type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_ = new ::std::string; + } + file_type_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::mutable_file_type() { + set_has_file_type(); + if (file_type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + file_type_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) + return file_type_; +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::release_file_type() { + clear_has_file_type(); + if (file_type_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = file_type_; + file_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_allocated_file_type(::std::string* file_type) { + if (file_type_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete file_type_; + } + if (file_type) { + set_has_file_type(); + file_type_ = file_type; + } else { + clear_has_file_type(); + file_type_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.file_type) +} + +// optional bytes url_spec_sha256 = 2; +inline bool ClientIncidentReport_NonBinaryDownloadDetails::has_url_spec_sha256() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_has_url_spec_sha256() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_has_url_spec_sha256() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_url_spec_sha256() { + if (url_spec_sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_->clear(); + } + clear_has_url_spec_sha256(); +} +inline const ::std::string& ClientIncidentReport_NonBinaryDownloadDetails::url_spec_sha256() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) + return *url_spec_sha256_; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_url_spec_sha256(const ::std::string& value) { + set_has_url_spec_sha256(); + if (url_spec_sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_ = new ::std::string; + } + url_spec_sha256_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_url_spec_sha256(const char* value) { + set_has_url_spec_sha256(); + if (url_spec_sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_ = new ::std::string; + } + url_spec_sha256_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_url_spec_sha256(const void* value, size_t size) { + set_has_url_spec_sha256(); + if (url_spec_sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_ = new ::std::string; + } + url_spec_sha256_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::mutable_url_spec_sha256() { + set_has_url_spec_sha256(); + if (url_spec_sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_spec_sha256_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) + return url_spec_sha256_; +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::release_url_spec_sha256() { + clear_has_url_spec_sha256(); + if (url_spec_sha256_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_spec_sha256_; + url_spec_sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_allocated_url_spec_sha256(::std::string* url_spec_sha256) { + if (url_spec_sha256_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_spec_sha256_; + } + if (url_spec_sha256) { + set_has_url_spec_sha256(); + url_spec_sha256_ = url_spec_sha256; + } else { + clear_has_url_spec_sha256(); + url_spec_sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.url_spec_sha256) +} + +// optional string host = 3; +inline bool ClientIncidentReport_NonBinaryDownloadDetails::has_host() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_has_host() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_has_host() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_host() { + if (host_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_->clear(); + } + clear_has_host(); +} +inline const ::std::string& ClientIncidentReport_NonBinaryDownloadDetails::host() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) + return *host_; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_host(const ::std::string& value) { + set_has_host(); + if (host_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_ = new ::std::string; + } + host_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_host(const char* value) { + set_has_host(); + if (host_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_ = new ::std::string; + } + host_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_host(const char* value, size_t size) { + set_has_host(); + if (host_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_ = new ::std::string; + } + host_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::mutable_host() { + set_has_host(); + if (host_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + host_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) + return host_; +} +inline ::std::string* ClientIncidentReport_NonBinaryDownloadDetails::release_host() { + clear_has_host(); + if (host_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = host_; + host_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_allocated_host(::std::string* host) { + if (host_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete host_; + } + if (host) { + set_has_host(); + host_ = host; + } else { + clear_has_host(); + host_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.host) +} + +// optional int64 length = 4; +inline bool ClientIncidentReport_NonBinaryDownloadDetails::has_length() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_has_length() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_has_length() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::clear_length() { + length_ = GOOGLE_LONGLONG(0); + clear_has_length(); +} +inline ::google::protobuf::int64 ClientIncidentReport_NonBinaryDownloadDetails::length() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.length) + return length_; +} +inline void ClientIncidentReport_NonBinaryDownloadDetails::set_length(::google::protobuf::int64 value) { + set_has_length(); + length_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails.length) +} + +// ------------------------------------------------------------------- + +// ClientIncidentReport + +// repeated .safe_browsing.ClientIncidentReport.IncidentData incident = 1; +inline int ClientIncidentReport::incident_size() const { + return incident_.size(); +} +inline void ClientIncidentReport::clear_incident() { + incident_.Clear(); +} +inline const ::safe_browsing::ClientIncidentReport_IncidentData& ClientIncidentReport::incident(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.incident) + return incident_.Get(index); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData* ClientIncidentReport::mutable_incident(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.incident) + return incident_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentReport_IncidentData* ClientIncidentReport::add_incident() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentReport.incident) + return incident_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData >& +ClientIncidentReport::incident() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentReport.incident) + return incident_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentReport_IncidentData >* +ClientIncidentReport::mutable_incident() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentReport.incident) + return &incident_; +} + +// optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; +inline bool ClientIncidentReport::has_download() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentReport::set_has_download() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentReport::clear_has_download() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentReport::clear_download() { + if (download_ != NULL) download_->::safe_browsing::ClientIncidentReport_DownloadDetails::Clear(); + clear_has_download(); +} +inline const ::safe_browsing::ClientIncidentReport_DownloadDetails& ClientIncidentReport::download() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.download) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return download_ != NULL ? *download_ : *default_instance().download_; +#else + return download_ != NULL ? *download_ : *default_instance_->download_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_DownloadDetails* ClientIncidentReport::mutable_download() { + set_has_download(); + if (download_ == NULL) download_ = new ::safe_browsing::ClientIncidentReport_DownloadDetails; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.download) + return download_; +} +inline ::safe_browsing::ClientIncidentReport_DownloadDetails* ClientIncidentReport::release_download() { + clear_has_download(); + ::safe_browsing::ClientIncidentReport_DownloadDetails* temp = download_; + download_ = NULL; + return temp; +} +inline void ClientIncidentReport::set_allocated_download(::safe_browsing::ClientIncidentReport_DownloadDetails* download) { + delete download_; + download_ = download; + if (download) { + set_has_download(); + } else { + clear_has_download(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.download) +} + +// optional .safe_browsing.ClientIncidentReport.EnvironmentData environment = 3; +inline bool ClientIncidentReport::has_environment() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientIncidentReport::set_has_environment() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientIncidentReport::clear_has_environment() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientIncidentReport::clear_environment() { + if (environment_ != NULL) environment_->::safe_browsing::ClientIncidentReport_EnvironmentData::Clear(); + clear_has_environment(); +} +inline const ::safe_browsing::ClientIncidentReport_EnvironmentData& ClientIncidentReport::environment() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.environment) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return environment_ != NULL ? *environment_ : *default_instance().environment_; +#else + return environment_ != NULL ? *environment_ : *default_instance_->environment_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData* ClientIncidentReport::mutable_environment() { + set_has_environment(); + if (environment_ == NULL) environment_ = new ::safe_browsing::ClientIncidentReport_EnvironmentData; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.environment) + return environment_; +} +inline ::safe_browsing::ClientIncidentReport_EnvironmentData* ClientIncidentReport::release_environment() { + clear_has_environment(); + ::safe_browsing::ClientIncidentReport_EnvironmentData* temp = environment_; + environment_ = NULL; + return temp; +} +inline void ClientIncidentReport::set_allocated_environment(::safe_browsing::ClientIncidentReport_EnvironmentData* environment) { + delete environment_; + environment_ = environment; + if (environment) { + set_has_environment(); + } else { + clear_has_environment(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.environment) +} + +// optional .safe_browsing.ChromeUserPopulation population = 7; +inline bool ClientIncidentReport::has_population() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientIncidentReport::set_has_population() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientIncidentReport::clear_has_population() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientIncidentReport::clear_population() { + if (population_ != NULL) population_->::safe_browsing::ChromeUserPopulation::Clear(); + clear_has_population(); +} +inline const ::safe_browsing::ChromeUserPopulation& ClientIncidentReport::population() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.population) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return population_ != NULL ? *population_ : *default_instance().population_; +#else + return population_ != NULL ? *population_ : *default_instance_->population_; +#endif +} +inline ::safe_browsing::ChromeUserPopulation* ClientIncidentReport::mutable_population() { + set_has_population(); + if (population_ == NULL) population_ = new ::safe_browsing::ChromeUserPopulation; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.population) + return population_; +} +inline ::safe_browsing::ChromeUserPopulation* ClientIncidentReport::release_population() { + clear_has_population(); + ::safe_browsing::ChromeUserPopulation* temp = population_; + population_ = NULL; + return temp; +} +inline void ClientIncidentReport::set_allocated_population(::safe_browsing::ChromeUserPopulation* population) { + delete population_; + population_ = population; + if (population) { + set_has_population(); + } else { + clear_has_population(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.population) +} + +// optional .safe_browsing.ClientIncidentReport.ExtensionData extension_data = 8; +inline bool ClientIncidentReport::has_extension_data() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientIncidentReport::set_has_extension_data() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientIncidentReport::clear_has_extension_data() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientIncidentReport::clear_extension_data() { + if (extension_data_ != NULL) extension_data_->::safe_browsing::ClientIncidentReport_ExtensionData::Clear(); + clear_has_extension_data(); +} +inline const ::safe_browsing::ClientIncidentReport_ExtensionData& ClientIncidentReport::extension_data() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.extension_data) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return extension_data_ != NULL ? *extension_data_ : *default_instance().extension_data_; +#else + return extension_data_ != NULL ? *extension_data_ : *default_instance_->extension_data_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_ExtensionData* ClientIncidentReport::mutable_extension_data() { + set_has_extension_data(); + if (extension_data_ == NULL) extension_data_ = new ::safe_browsing::ClientIncidentReport_ExtensionData; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.extension_data) + return extension_data_; +} +inline ::safe_browsing::ClientIncidentReport_ExtensionData* ClientIncidentReport::release_extension_data() { + clear_has_extension_data(); + ::safe_browsing::ClientIncidentReport_ExtensionData* temp = extension_data_; + extension_data_ = NULL; + return temp; +} +inline void ClientIncidentReport::set_allocated_extension_data(::safe_browsing::ClientIncidentReport_ExtensionData* extension_data) { + delete extension_data_; + extension_data_ = extension_data; + if (extension_data) { + set_has_extension_data(); + } else { + clear_has_extension_data(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.extension_data) +} + +// optional .safe_browsing.ClientIncidentReport.NonBinaryDownloadDetails non_binary_download = 9; +inline bool ClientIncidentReport::has_non_binary_download() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientIncidentReport::set_has_non_binary_download() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientIncidentReport::clear_has_non_binary_download() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientIncidentReport::clear_non_binary_download() { + if (non_binary_download_ != NULL) non_binary_download_->::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails::Clear(); + clear_has_non_binary_download(); +} +inline const ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails& ClientIncidentReport::non_binary_download() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentReport.non_binary_download) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return non_binary_download_ != NULL ? *non_binary_download_ : *default_instance().non_binary_download_; +#else + return non_binary_download_ != NULL ? *non_binary_download_ : *default_instance_->non_binary_download_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* ClientIncidentReport::mutable_non_binary_download() { + set_has_non_binary_download(); + if (non_binary_download_ == NULL) non_binary_download_ = new ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentReport.non_binary_download) + return non_binary_download_; +} +inline ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* ClientIncidentReport::release_non_binary_download() { + clear_has_non_binary_download(); + ::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* temp = non_binary_download_; + non_binary_download_ = NULL; + return temp; +} +inline void ClientIncidentReport::set_allocated_non_binary_download(::safe_browsing::ClientIncidentReport_NonBinaryDownloadDetails* non_binary_download) { + delete non_binary_download_; + non_binary_download_ = non_binary_download; + if (non_binary_download) { + set_has_non_binary_download(); + } else { + clear_has_non_binary_download(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentReport.non_binary_download) +} + +// ------------------------------------------------------------------- + +// ClientIncidentResponse_EnvironmentRequest + +// optional int32 dll_index = 1; +inline bool ClientIncidentResponse_EnvironmentRequest::has_dll_index() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentResponse_EnvironmentRequest::set_has_dll_index() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentResponse_EnvironmentRequest::clear_has_dll_index() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentResponse_EnvironmentRequest::clear_dll_index() { + dll_index_ = 0; + clear_has_dll_index(); +} +inline ::google::protobuf::int32 ClientIncidentResponse_EnvironmentRequest::dll_index() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentResponse.EnvironmentRequest.dll_index) + return dll_index_; +} +inline void ClientIncidentResponse_EnvironmentRequest::set_dll_index(::google::protobuf::int32 value) { + set_has_dll_index(); + dll_index_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentResponse.EnvironmentRequest.dll_index) +} + +// ------------------------------------------------------------------- + +// ClientIncidentResponse + +// optional bytes token = 1; +inline bool ClientIncidentResponse::has_token() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientIncidentResponse::set_has_token() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientIncidentResponse::clear_has_token() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientIncidentResponse::clear_token() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + clear_has_token(); +} +inline const ::std::string& ClientIncidentResponse::token() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentResponse.token) + return *token_; +} +inline void ClientIncidentResponse::set_token(const ::std::string& value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentResponse.token) +} +inline void ClientIncidentResponse::set_token(const char* value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientIncidentResponse.token) +} +inline void ClientIncidentResponse::set_token(const void* value, size_t size) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientIncidentResponse.token) +} +inline ::std::string* ClientIncidentResponse::mutable_token() { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentResponse.token) + return token_; +} +inline ::std::string* ClientIncidentResponse::release_token() { + clear_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = token_; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientIncidentResponse::set_allocated_token(::std::string* token) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + if (token) { + set_has_token(); + token_ = token; + } else { + clear_has_token(); + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientIncidentResponse.token) +} + +// optional bool download_requested = 2; +inline bool ClientIncidentResponse::has_download_requested() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientIncidentResponse::set_has_download_requested() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientIncidentResponse::clear_has_download_requested() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientIncidentResponse::clear_download_requested() { + download_requested_ = false; + clear_has_download_requested(); +} +inline bool ClientIncidentResponse::download_requested() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentResponse.download_requested) + return download_requested_; +} +inline void ClientIncidentResponse::set_download_requested(bool value) { + set_has_download_requested(); + download_requested_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientIncidentResponse.download_requested) +} + +// repeated .safe_browsing.ClientIncidentResponse.EnvironmentRequest environment_requests = 3; +inline int ClientIncidentResponse::environment_requests_size() const { + return environment_requests_.size(); +} +inline void ClientIncidentResponse::clear_environment_requests() { + environment_requests_.Clear(); +} +inline const ::safe_browsing::ClientIncidentResponse_EnvironmentRequest& ClientIncidentResponse::environment_requests(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientIncidentResponse.environment_requests) + return environment_requests_.Get(index); +} +inline ::safe_browsing::ClientIncidentResponse_EnvironmentRequest* ClientIncidentResponse::mutable_environment_requests(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientIncidentResponse.environment_requests) + return environment_requests_.Mutable(index); +} +inline ::safe_browsing::ClientIncidentResponse_EnvironmentRequest* ClientIncidentResponse::add_environment_requests() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientIncidentResponse.environment_requests) + return environment_requests_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentResponse_EnvironmentRequest >& +ClientIncidentResponse::environment_requests() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientIncidentResponse.environment_requests) + return environment_requests_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientIncidentResponse_EnvironmentRequest >* +ClientIncidentResponse::mutable_environment_requests() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientIncidentResponse.environment_requests) + return &environment_requests_; +} + +// ------------------------------------------------------------------- + +// DownloadMetadata + +// optional uint32 download_id = 1; +inline bool DownloadMetadata::has_download_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DownloadMetadata::set_has_download_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void DownloadMetadata::clear_has_download_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DownloadMetadata::clear_download_id() { + download_id_ = 0u; + clear_has_download_id(); +} +inline ::google::protobuf::uint32 DownloadMetadata::download_id() const { + // @@protoc_insertion_point(field_get:safe_browsing.DownloadMetadata.download_id) + return download_id_; +} +inline void DownloadMetadata::set_download_id(::google::protobuf::uint32 value) { + set_has_download_id(); + download_id_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.DownloadMetadata.download_id) +} + +// optional .safe_browsing.ClientIncidentReport.DownloadDetails download = 2; +inline bool DownloadMetadata::has_download() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DownloadMetadata::set_has_download() { + _has_bits_[0] |= 0x00000002u; +} +inline void DownloadMetadata::clear_has_download() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DownloadMetadata::clear_download() { + if (download_ != NULL) download_->::safe_browsing::ClientIncidentReport_DownloadDetails::Clear(); + clear_has_download(); +} +inline const ::safe_browsing::ClientIncidentReport_DownloadDetails& DownloadMetadata::download() const { + // @@protoc_insertion_point(field_get:safe_browsing.DownloadMetadata.download) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return download_ != NULL ? *download_ : *default_instance().download_; +#else + return download_ != NULL ? *download_ : *default_instance_->download_; +#endif +} +inline ::safe_browsing::ClientIncidentReport_DownloadDetails* DownloadMetadata::mutable_download() { + set_has_download(); + if (download_ == NULL) download_ = new ::safe_browsing::ClientIncidentReport_DownloadDetails; + // @@protoc_insertion_point(field_mutable:safe_browsing.DownloadMetadata.download) + return download_; +} +inline ::safe_browsing::ClientIncidentReport_DownloadDetails* DownloadMetadata::release_download() { + clear_has_download(); + ::safe_browsing::ClientIncidentReport_DownloadDetails* temp = download_; + download_ = NULL; + return temp; +} +inline void DownloadMetadata::set_allocated_download(::safe_browsing::ClientIncidentReport_DownloadDetails* download) { + delete download_; + download_ = download; + if (download) { + set_has_download(); + } else { + clear_has_download(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.DownloadMetadata.download) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_HTTPHeader + +// required bytes name = 1; +inline bool ClientSafeBrowsingReportRequest_HTTPHeader::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::clear_name() { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_->clear(); + } + clear_has_name(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPHeader::name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) + return *name_; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_name(const ::std::string& value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_name(const char* value) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_name(const void* value, size_t size) { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPHeader::mutable_name() { + set_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) + return name_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPHeader::release_name() { + clear_has_name(); + if (name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = name_; + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_allocated_name(::std::string* name) { + if (name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete name_; + } + if (name) { + set_has_name(); + name_ = name; + } else { + clear_has_name(); + name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.name) +} + +// optional bytes value = 2; +inline bool ClientSafeBrowsingReportRequest_HTTPHeader::has_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_has_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::clear_has_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::clear_value() { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_->clear(); + } + clear_has_value(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPHeader::value() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) + return *value_; +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_value(const ::std::string& value) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_value(const char* value) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_value(const void* value, size_t size) { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + value_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPHeader::mutable_value() { + set_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + value_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) + return value_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPHeader::release_value() { + clear_has_value(); + if (value_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = value_; + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPHeader::set_allocated_value(::std::string* value) { + if (value_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete value_; + } + if (value) { + set_has_value(); + value_ = value; + } else { + clear_has_value(); + value_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader.value) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine + +// optional bytes verb = 1; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::has_verb() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_has_verb() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_has_verb() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_verb() { + if (verb_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_->clear(); + } + clear_has_verb(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::verb() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) + return *verb_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_verb(const ::std::string& value) { + set_has_verb(); + if (verb_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_ = new ::std::string; + } + verb_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_verb(const char* value) { + set_has_verb(); + if (verb_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_ = new ::std::string; + } + verb_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_verb(const void* value, size_t size) { + set_has_verb(); + if (verb_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_ = new ::std::string; + } + verb_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::mutable_verb() { + set_has_verb(); + if (verb_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + verb_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) + return verb_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::release_verb() { + clear_has_verb(); + if (verb_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = verb_; + verb_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_allocated_verb(::std::string* verb) { + if (verb_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete verb_; + } + if (verb) { + set_has_verb(); + verb_ = verb; + } else { + clear_has_verb(); + verb_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.verb) +} + +// optional bytes uri = 2; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::has_uri() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_has_uri() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_has_uri() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_uri() { + if (uri_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_->clear(); + } + clear_has_uri(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::uri() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) + return *uri_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_uri(const ::std::string& value) { + set_has_uri(); + if (uri_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_ = new ::std::string; + } + uri_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_uri(const char* value) { + set_has_uri(); + if (uri_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_ = new ::std::string; + } + uri_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_uri(const void* value, size_t size) { + set_has_uri(); + if (uri_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_ = new ::std::string; + } + uri_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::mutable_uri() { + set_has_uri(); + if (uri_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + uri_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) + return uri_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::release_uri() { + clear_has_uri(); + if (uri_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = uri_; + uri_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_allocated_uri(::std::string* uri) { + if (uri_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete uri_; + } + if (uri) { + set_has_uri(); + uri_ = uri; + } else { + clear_has_uri(); + uri_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.uri) +} + +// optional bytes version = 3; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) + return *version_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_version(const void* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) + return version_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine.version) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_HTTPRequest + +// optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.FirstLine firstline = 1; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest::has_firstline() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_has_firstline() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_has_firstline() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_firstline() { + if (firstline_ != NULL) firstline_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine::Clear(); + clear_has_firstline(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine& ClientSafeBrowsingReportRequest_HTTPRequest::firstline() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.firstline) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return firstline_ != NULL ? *firstline_ : *default_instance().firstline_; +#else + return firstline_ != NULL ? *firstline_ : *default_instance_->firstline_; +#endif +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* ClientSafeBrowsingReportRequest_HTTPRequest::mutable_firstline() { + set_has_firstline(); + if (firstline_ == NULL) firstline_ = new ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.firstline) + return firstline_; +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* ClientSafeBrowsingReportRequest_HTTPRequest::release_firstline() { + clear_has_firstline(); + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* temp = firstline_; + firstline_ = NULL; + return temp; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_allocated_firstline(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest_FirstLine* firstline) { + delete firstline_; + firstline_ = firstline; + if (firstline) { + set_has_firstline(); + } else { + clear_has_firstline(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.firstline) +} + +// repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; +inline int ClientSafeBrowsingReportRequest_HTTPRequest::headers_size() const { + return headers_.size(); +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_headers() { + headers_.Clear(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader& ClientSafeBrowsingReportRequest_HTTPRequest::headers(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.headers) + return headers_.Get(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPRequest::mutable_headers(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.headers) + return headers_.Mutable(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPRequest::add_headers() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.headers) + return headers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >& +ClientSafeBrowsingReportRequest_HTTPRequest::headers() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.headers) + return headers_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >* +ClientSafeBrowsingReportRequest_HTTPRequest::mutable_headers() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.headers) + return &headers_; +} + +// optional bytes body = 3; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest::has_body() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_has_body() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_has_body() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_body() { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_->clear(); + } + clear_has_body(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPRequest::body() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) + return *body_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_body(const ::std::string& value) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_body(const char* value) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_body(const void* value, size_t size) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest::mutable_body() { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) + return body_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest::release_body() { + clear_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = body_; + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_allocated_body(::std::string* body) { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete body_; + } + if (body) { + set_has_body(); + body_ = body; + } else { + clear_has_body(); + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.body) +} + +// optional bytes bodydigest = 4; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest::has_bodydigest() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_has_bodydigest() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_has_bodydigest() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_bodydigest() { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_->clear(); + } + clear_has_bodydigest(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPRequest::bodydigest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) + return *bodydigest_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_bodydigest(const ::std::string& value) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_bodydigest(const char* value) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_bodydigest(const void* value, size_t size) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest::mutable_bodydigest() { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) + return bodydigest_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPRequest::release_bodydigest() { + clear_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = bodydigest_; + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_allocated_bodydigest(::std::string* bodydigest) { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bodydigest_; + } + if (bodydigest) { + set_has_bodydigest(); + bodydigest_ = bodydigest; + } else { + clear_has_bodydigest(); + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodydigest) +} + +// optional int32 bodylength = 5; +inline bool ClientSafeBrowsingReportRequest_HTTPRequest::has_bodylength() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_has_bodylength() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_has_bodylength() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::clear_bodylength() { + bodylength_ = 0; + clear_has_bodylength(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_HTTPRequest::bodylength() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodylength) + return bodylength_; +} +inline void ClientSafeBrowsingReportRequest_HTTPRequest::set_bodylength(::google::protobuf::int32 value) { + set_has_bodylength(); + bodylength_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest.bodylength) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine + +// optional int32 code = 1; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::has_code() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_has_code() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_has_code() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_code() { + code_ = 0; + clear_has_code(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::code() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.code) + return code_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_code(::google::protobuf::int32 value) { + set_has_code(); + code_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.code) +} + +// optional bytes reason = 2; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::has_reason() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_has_reason() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_has_reason() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_reason() { + if (reason_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_->clear(); + } + clear_has_reason(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::reason() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) + return *reason_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_reason(const ::std::string& value) { + set_has_reason(); + if (reason_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_ = new ::std::string; + } + reason_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_reason(const char* value) { + set_has_reason(); + if (reason_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_ = new ::std::string; + } + reason_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_reason(const void* value, size_t size) { + set_has_reason(); + if (reason_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_ = new ::std::string; + } + reason_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::mutable_reason() { + set_has_reason(); + if (reason_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + reason_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) + return reason_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::release_reason() { + clear_has_reason(); + if (reason_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = reason_; + reason_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_allocated_reason(::std::string* reason) { + if (reason_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete reason_; + } + if (reason) { + set_has_reason(); + reason_ = reason; + } else { + clear_has_reason(); + reason_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.reason) +} + +// optional bytes version = 3; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::has_version() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_has_version() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_has_version() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::clear_version() { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_->clear(); + } + clear_has_version(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::version() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) + return *version_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_version(const ::std::string& value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_version(const char* value) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_version(const void* value, size_t size) { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + version_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::mutable_version() { + set_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + version_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) + return version_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::release_version() { + clear_has_version(); + if (version_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = version_; + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::set_allocated_version(::std::string* version) { + if (version_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete version_; + } + if (version) { + set_has_version(); + version_ = version; + } else { + clear_has_version(); + version_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine.version) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_HTTPResponse + +// optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.FirstLine firstline = 1; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse::has_firstline() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_has_firstline() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_has_firstline() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_firstline() { + if (firstline_ != NULL) firstline_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine::Clear(); + clear_has_firstline(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine& ClientSafeBrowsingReportRequest_HTTPResponse::firstline() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.firstline) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return firstline_ != NULL ? *firstline_ : *default_instance().firstline_; +#else + return firstline_ != NULL ? *firstline_ : *default_instance_->firstline_; +#endif +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* ClientSafeBrowsingReportRequest_HTTPResponse::mutable_firstline() { + set_has_firstline(); + if (firstline_ == NULL) firstline_ = new ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.firstline) + return firstline_; +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* ClientSafeBrowsingReportRequest_HTTPResponse::release_firstline() { + clear_has_firstline(); + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* temp = firstline_; + firstline_ = NULL; + return temp; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_allocated_firstline(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse_FirstLine* firstline) { + delete firstline_; + firstline_ = firstline; + if (firstline) { + set_has_firstline(); + } else { + clear_has_firstline(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.firstline) +} + +// repeated .safe_browsing.ClientSafeBrowsingReportRequest.HTTPHeader headers = 2; +inline int ClientSafeBrowsingReportRequest_HTTPResponse::headers_size() const { + return headers_.size(); +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_headers() { + headers_.Clear(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader& ClientSafeBrowsingReportRequest_HTTPResponse::headers(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.headers) + return headers_.Get(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPResponse::mutable_headers(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.headers) + return headers_.Mutable(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader* ClientSafeBrowsingReportRequest_HTTPResponse::add_headers() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.headers) + return headers_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >& +ClientSafeBrowsingReportRequest_HTTPResponse::headers() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.headers) + return headers_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPHeader >* +ClientSafeBrowsingReportRequest_HTTPResponse::mutable_headers() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.headers) + return &headers_; +} + +// optional bytes body = 3; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse::has_body() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_has_body() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_has_body() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_body() { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_->clear(); + } + clear_has_body(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPResponse::body() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) + return *body_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_body(const ::std::string& value) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_body(const char* value) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_body(const void* value, size_t size) { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + body_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::mutable_body() { + set_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + body_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) + return body_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::release_body() { + clear_has_body(); + if (body_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = body_; + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_allocated_body(::std::string* body) { + if (body_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete body_; + } + if (body) { + set_has_body(); + body_ = body; + } else { + clear_has_body(); + body_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.body) +} + +// optional bytes bodydigest = 4; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse::has_bodydigest() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_has_bodydigest() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_has_bodydigest() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_bodydigest() { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_->clear(); + } + clear_has_bodydigest(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPResponse::bodydigest() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) + return *bodydigest_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_bodydigest(const ::std::string& value) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_bodydigest(const char* value) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_bodydigest(const void* value, size_t size) { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + bodydigest_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::mutable_bodydigest() { + set_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + bodydigest_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) + return bodydigest_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::release_bodydigest() { + clear_has_bodydigest(); + if (bodydigest_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = bodydigest_; + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_allocated_bodydigest(::std::string* bodydigest) { + if (bodydigest_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete bodydigest_; + } + if (bodydigest) { + set_has_bodydigest(); + bodydigest_ = bodydigest; + } else { + clear_has_bodydigest(); + bodydigest_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodydigest) +} + +// optional int32 bodylength = 5; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse::has_bodylength() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_has_bodylength() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_has_bodylength() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_bodylength() { + bodylength_ = 0; + clear_has_bodylength(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_HTTPResponse::bodylength() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodylength) + return bodylength_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_bodylength(::google::protobuf::int32 value) { + set_has_bodylength(); + bodylength_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.bodylength) +} + +// optional bytes remote_ip = 6; +inline bool ClientSafeBrowsingReportRequest_HTTPResponse::has_remote_ip() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_has_remote_ip() { + _has_bits_[0] |= 0x00000020u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_has_remote_ip() { + _has_bits_[0] &= ~0x00000020u; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::clear_remote_ip() { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_->clear(); + } + clear_has_remote_ip(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_HTTPResponse::remote_ip() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) + return *remote_ip_; +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_remote_ip(const ::std::string& value) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_remote_ip(const char* value) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_remote_ip(const void* value, size_t size) { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + remote_ip_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::mutable_remote_ip() { + set_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + remote_ip_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) + return remote_ip_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_HTTPResponse::release_remote_ip() { + clear_has_remote_ip(); + if (remote_ip_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = remote_ip_; + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_HTTPResponse::set_allocated_remote_ip(::std::string* remote_ip) { + if (remote_ip_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete remote_ip_; + } + if (remote_ip) { + set_has_remote_ip(); + remote_ip_ = remote_ip; + } else { + clear_has_remote_ip(); + remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse.remote_ip) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest_Resource + +// required int32 id = 1; +inline bool ClientSafeBrowsingReportRequest_Resource::has_id() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_id() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_id() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_id() { + id_ = 0; + clear_has_id(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_Resource::id() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.id) + return id_; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_id(::google::protobuf::int32 value) { + set_has_id(); + id_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.Resource.id) +} + +// optional string url = 2; +inline bool ClientSafeBrowsingReportRequest_Resource::has_url() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_url() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_url() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_Resource::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) + return *url_; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) +} +inline void ClientSafeBrowsingReportRequest_Resource::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) +} +inline void ClientSafeBrowsingReportRequest_Resource::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) +} +inline ::std::string* ClientSafeBrowsingReportRequest_Resource::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) + return url_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_Resource::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_Resource::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.Resource.url) +} + +// optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPRequest request = 3; +inline bool ClientSafeBrowsingReportRequest_Resource::has_request() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_request() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_request() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_request() { + if (request_ != NULL) request_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest::Clear(); + clear_has_request(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest& ClientSafeBrowsingReportRequest_Resource::request() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.request) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return request_ != NULL ? *request_ : *default_instance().request_; +#else + return request_ != NULL ? *request_ : *default_instance_->request_; +#endif +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* ClientSafeBrowsingReportRequest_Resource::mutable_request() { + set_has_request(); + if (request_ == NULL) request_ = new ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.Resource.request) + return request_; +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* ClientSafeBrowsingReportRequest_Resource::release_request() { + clear_has_request(); + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* temp = request_; + request_ = NULL; + return temp; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_allocated_request(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPRequest* request) { + delete request_; + request_ = request; + if (request) { + set_has_request(); + } else { + clear_has_request(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.Resource.request) +} + +// optional .safe_browsing.ClientSafeBrowsingReportRequest.HTTPResponse response = 4; +inline bool ClientSafeBrowsingReportRequest_Resource::has_response() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_response() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_response() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_response() { + if (response_ != NULL) response_->::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse::Clear(); + clear_has_response(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse& ClientSafeBrowsingReportRequest_Resource::response() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.response) +#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER + return response_ != NULL ? *response_ : *default_instance().response_; +#else + return response_ != NULL ? *response_ : *default_instance_->response_; +#endif +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* ClientSafeBrowsingReportRequest_Resource::mutable_response() { + set_has_response(); + if (response_ == NULL) response_ = new ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse; + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.Resource.response) + return response_; +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* ClientSafeBrowsingReportRequest_Resource::release_response() { + clear_has_response(); + ::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* temp = response_; + response_ = NULL; + return temp; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_allocated_response(::safe_browsing::ClientSafeBrowsingReportRequest_HTTPResponse* response) { + delete response_; + response_ = response; + if (response) { + set_has_response(); + } else { + clear_has_response(); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.Resource.response) +} + +// optional int32 parent_id = 5; +inline bool ClientSafeBrowsingReportRequest_Resource::has_parent_id() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_parent_id() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_parent_id() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_parent_id() { + parent_id_ = 0; + clear_has_parent_id(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_Resource::parent_id() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.parent_id) + return parent_id_; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_parent_id(::google::protobuf::int32 value) { + set_has_parent_id(); + parent_id_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.Resource.parent_id) +} + +// repeated int32 child_ids = 6; +inline int ClientSafeBrowsingReportRequest_Resource::child_ids_size() const { + return child_ids_.size(); +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_child_ids() { + child_ids_.Clear(); +} +inline ::google::protobuf::int32 ClientSafeBrowsingReportRequest_Resource::child_ids(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.child_ids) + return child_ids_.Get(index); +} +inline void ClientSafeBrowsingReportRequest_Resource::set_child_ids(int index, ::google::protobuf::int32 value) { + child_ids_.Set(index, value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.Resource.child_ids) +} +inline void ClientSafeBrowsingReportRequest_Resource::add_child_ids(::google::protobuf::int32 value) { + child_ids_.Add(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientSafeBrowsingReportRequest.Resource.child_ids) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +ClientSafeBrowsingReportRequest_Resource::child_ids() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientSafeBrowsingReportRequest.Resource.child_ids) + return child_ids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +ClientSafeBrowsingReportRequest_Resource::mutable_child_ids() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientSafeBrowsingReportRequest.Resource.child_ids) + return &child_ids_; +} + +// optional string tag_name = 7; +inline bool ClientSafeBrowsingReportRequest_Resource::has_tag_name() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_has_tag_name() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_has_tag_name() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientSafeBrowsingReportRequest_Resource::clear_tag_name() { + if (tag_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_->clear(); + } + clear_has_tag_name(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest_Resource::tag_name() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) + return *tag_name_; +} +inline void ClientSafeBrowsingReportRequest_Resource::set_tag_name(const ::std::string& value) { + set_has_tag_name(); + if (tag_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_ = new ::std::string; + } + tag_name_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) +} +inline void ClientSafeBrowsingReportRequest_Resource::set_tag_name(const char* value) { + set_has_tag_name(); + if (tag_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_ = new ::std::string; + } + tag_name_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) +} +inline void ClientSafeBrowsingReportRequest_Resource::set_tag_name(const char* value, size_t size) { + set_has_tag_name(); + if (tag_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_ = new ::std::string; + } + tag_name_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) +} +inline ::std::string* ClientSafeBrowsingReportRequest_Resource::mutable_tag_name() { + set_has_tag_name(); + if (tag_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + tag_name_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) + return tag_name_; +} +inline ::std::string* ClientSafeBrowsingReportRequest_Resource::release_tag_name() { + clear_has_tag_name(); + if (tag_name_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = tag_name_; + tag_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest_Resource::set_allocated_tag_name(::std::string* tag_name) { + if (tag_name_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete tag_name_; + } + if (tag_name) { + set_has_tag_name(); + tag_name_ = tag_name; + } else { + clear_has_tag_name(); + tag_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.Resource.tag_name) +} + +// ------------------------------------------------------------------- + +// ClientSafeBrowsingReportRequest + +// optional .safe_browsing.ClientSafeBrowsingReportRequest.ReportType type = 10; +inline bool ClientSafeBrowsingReportRequest::has_type() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_type() { + _has_bits_[0] |= 0x00000001u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_type() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ClientSafeBrowsingReportRequest::clear_type() { + type_ = 0; + clear_has_type(); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_ReportType ClientSafeBrowsingReportRequest::type() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.type) + return static_cast< ::safe_browsing::ClientSafeBrowsingReportRequest_ReportType >(type_); +} +inline void ClientSafeBrowsingReportRequest::set_type(::safe_browsing::ClientSafeBrowsingReportRequest_ReportType value) { + assert(::safe_browsing::ClientSafeBrowsingReportRequest_ReportType_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.type) +} + +// optional .safe_browsing.ClientDownloadResponse.Verdict download_verdict = 11; +inline bool ClientSafeBrowsingReportRequest::has_download_verdict() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_download_verdict() { + _has_bits_[0] |= 0x00000002u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_download_verdict() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ClientSafeBrowsingReportRequest::clear_download_verdict() { + download_verdict_ = 0; + clear_has_download_verdict(); +} +inline ::safe_browsing::ClientDownloadResponse_Verdict ClientSafeBrowsingReportRequest::download_verdict() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.download_verdict) + return static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(download_verdict_); +} +inline void ClientSafeBrowsingReportRequest::set_download_verdict(::safe_browsing::ClientDownloadResponse_Verdict value) { + assert(::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value)); + set_has_download_verdict(); + download_verdict_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.download_verdict) +} + +// optional string url = 1; +inline bool ClientSafeBrowsingReportRequest::has_url() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_url() { + _has_bits_[0] |= 0x00000004u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_url() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ClientSafeBrowsingReportRequest::clear_url() { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_->clear(); + } + clear_has_url(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.url) + return *url_; +} +inline void ClientSafeBrowsingReportRequest::set_url(const ::std::string& value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.url) +} +inline void ClientSafeBrowsingReportRequest::set_url(const char* value) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.url) +} +inline void ClientSafeBrowsingReportRequest::set_url(const char* value, size_t size) { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.url) +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_url() { + set_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.url) + return url_; +} +inline ::std::string* ClientSafeBrowsingReportRequest::release_url() { + clear_has_url(); + if (url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = url_; + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest::set_allocated_url(::std::string* url) { + if (url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete url_; + } + if (url) { + set_has_url(); + url_ = url; + } else { + clear_has_url(); + url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.url) +} + +// optional string page_url = 2; +inline bool ClientSafeBrowsingReportRequest::has_page_url() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_page_url() { + _has_bits_[0] |= 0x00000008u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_page_url() { + _has_bits_[0] &= ~0x00000008u; +} +inline void ClientSafeBrowsingReportRequest::clear_page_url() { + if (page_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_->clear(); + } + clear_has_page_url(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::page_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.page_url) + return *page_url_; +} +inline void ClientSafeBrowsingReportRequest::set_page_url(const ::std::string& value) { + set_has_page_url(); + if (page_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_ = new ::std::string; + } + page_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.page_url) +} +inline void ClientSafeBrowsingReportRequest::set_page_url(const char* value) { + set_has_page_url(); + if (page_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_ = new ::std::string; + } + page_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.page_url) +} +inline void ClientSafeBrowsingReportRequest::set_page_url(const char* value, size_t size) { + set_has_page_url(); + if (page_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_ = new ::std::string; + } + page_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.page_url) +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_page_url() { + set_has_page_url(); + if (page_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + page_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.page_url) + return page_url_; +} +inline ::std::string* ClientSafeBrowsingReportRequest::release_page_url() { + clear_has_page_url(); + if (page_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = page_url_; + page_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest::set_allocated_page_url(::std::string* page_url) { + if (page_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete page_url_; + } + if (page_url) { + set_has_page_url(); + page_url_ = page_url; + } else { + clear_has_page_url(); + page_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.page_url) +} + +// optional string referrer_url = 3; +inline bool ClientSafeBrowsingReportRequest::has_referrer_url() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_referrer_url() { + _has_bits_[0] |= 0x00000010u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_referrer_url() { + _has_bits_[0] &= ~0x00000010u; +} +inline void ClientSafeBrowsingReportRequest::clear_referrer_url() { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_->clear(); + } + clear_has_referrer_url(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::referrer_url() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) + return *referrer_url_; +} +inline void ClientSafeBrowsingReportRequest::set_referrer_url(const ::std::string& value) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) +} +inline void ClientSafeBrowsingReportRequest::set_referrer_url(const char* value) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) +} +inline void ClientSafeBrowsingReportRequest::set_referrer_url(const char* value, size_t size) { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + referrer_url_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_referrer_url() { + set_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + referrer_url_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) + return referrer_url_; +} +inline ::std::string* ClientSafeBrowsingReportRequest::release_referrer_url() { + clear_has_referrer_url(); + if (referrer_url_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = referrer_url_; + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest::set_allocated_referrer_url(::std::string* referrer_url) { + if (referrer_url_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete referrer_url_; + } + if (referrer_url) { + set_has_referrer_url(); + referrer_url_ = referrer_url; + } else { + clear_has_referrer_url(); + referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.referrer_url) +} + +// repeated .safe_browsing.ClientSafeBrowsingReportRequest.Resource resources = 4; +inline int ClientSafeBrowsingReportRequest::resources_size() const { + return resources_.size(); +} +inline void ClientSafeBrowsingReportRequest::clear_resources() { + resources_.Clear(); +} +inline const ::safe_browsing::ClientSafeBrowsingReportRequest_Resource& ClientSafeBrowsingReportRequest::resources(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.resources) + return resources_.Get(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_Resource* ClientSafeBrowsingReportRequest::mutable_resources(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.resources) + return resources_.Mutable(index); +} +inline ::safe_browsing::ClientSafeBrowsingReportRequest_Resource* ClientSafeBrowsingReportRequest::add_resources() { + // @@protoc_insertion_point(field_add:safe_browsing.ClientSafeBrowsingReportRequest.resources) + return resources_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_Resource >& +ClientSafeBrowsingReportRequest::resources() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientSafeBrowsingReportRequest.resources) + return resources_; +} +inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientSafeBrowsingReportRequest_Resource >* +ClientSafeBrowsingReportRequest::mutable_resources() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientSafeBrowsingReportRequest.resources) + return &resources_; +} + +// optional bool complete = 5; +inline bool ClientSafeBrowsingReportRequest::has_complete() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_complete() { + _has_bits_[0] |= 0x00000040u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_complete() { + _has_bits_[0] &= ~0x00000040u; +} +inline void ClientSafeBrowsingReportRequest::clear_complete() { + complete_ = false; + clear_has_complete(); +} +inline bool ClientSafeBrowsingReportRequest::complete() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.complete) + return complete_; +} +inline void ClientSafeBrowsingReportRequest::set_complete(bool value) { + set_has_complete(); + complete_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.complete) +} + +// repeated string client_asn = 6; +inline int ClientSafeBrowsingReportRequest::client_asn_size() const { + return client_asn_.size(); +} +inline void ClientSafeBrowsingReportRequest::clear_client_asn() { + client_asn_.Clear(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::client_asn(int index) const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) + return client_asn_.Get(index); +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_client_asn(int index) { + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) + return client_asn_.Mutable(index); +} +inline void ClientSafeBrowsingReportRequest::set_client_asn(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) + client_asn_.Mutable(index)->assign(value); +} +inline void ClientSafeBrowsingReportRequest::set_client_asn(int index, const char* value) { + client_asn_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) +} +inline void ClientSafeBrowsingReportRequest::set_client_asn(int index, const char* value, size_t size) { + client_asn_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) +} +inline ::std::string* ClientSafeBrowsingReportRequest::add_client_asn() { + return client_asn_.Add(); +} +inline void ClientSafeBrowsingReportRequest::add_client_asn(const ::std::string& value) { + client_asn_.Add()->assign(value); + // @@protoc_insertion_point(field_add:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) +} +inline void ClientSafeBrowsingReportRequest::add_client_asn(const char* value) { + client_asn_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) +} +inline void ClientSafeBrowsingReportRequest::add_client_asn(const char* value, size_t size) { + client_asn_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +ClientSafeBrowsingReportRequest::client_asn() const { + // @@protoc_insertion_point(field_list:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) + return client_asn_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +ClientSafeBrowsingReportRequest::mutable_client_asn() { + // @@protoc_insertion_point(field_mutable_list:safe_browsing.ClientSafeBrowsingReportRequest.client_asn) + return &client_asn_; +} + +// optional string client_country = 7; +inline bool ClientSafeBrowsingReportRequest::has_client_country() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_client_country() { + _has_bits_[0] |= 0x00000100u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_client_country() { + _has_bits_[0] &= ~0x00000100u; +} +inline void ClientSafeBrowsingReportRequest::clear_client_country() { + if (client_country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_->clear(); + } + clear_has_client_country(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::client_country() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.client_country) + return *client_country_; +} +inline void ClientSafeBrowsingReportRequest::set_client_country(const ::std::string& value) { + set_has_client_country(); + if (client_country_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_ = new ::std::string; + } + client_country_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.client_country) +} +inline void ClientSafeBrowsingReportRequest::set_client_country(const char* value) { + set_has_client_country(); + if (client_country_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_ = new ::std::string; + } + client_country_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.client_country) +} +inline void ClientSafeBrowsingReportRequest::set_client_country(const char* value, size_t size) { + set_has_client_country(); + if (client_country_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_ = new ::std::string; + } + client_country_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.client_country) +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_client_country() { + set_has_client_country(); + if (client_country_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + client_country_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.client_country) + return client_country_; +} +inline ::std::string* ClientSafeBrowsingReportRequest::release_client_country() { + clear_has_client_country(); + if (client_country_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = client_country_; + client_country_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest::set_allocated_client_country(::std::string* client_country) { + if (client_country_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete client_country_; + } + if (client_country) { + set_has_client_country(); + client_country_ = client_country; + } else { + clear_has_client_country(); + client_country_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.client_country) +} + +// optional bool did_proceed = 8; +inline bool ClientSafeBrowsingReportRequest::has_did_proceed() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_did_proceed() { + _has_bits_[0] |= 0x00000200u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_did_proceed() { + _has_bits_[0] &= ~0x00000200u; +} +inline void ClientSafeBrowsingReportRequest::clear_did_proceed() { + did_proceed_ = false; + clear_has_did_proceed(); +} +inline bool ClientSafeBrowsingReportRequest::did_proceed() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.did_proceed) + return did_proceed_; +} +inline void ClientSafeBrowsingReportRequest::set_did_proceed(bool value) { + set_has_did_proceed(); + did_proceed_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.did_proceed) +} + +// optional bool repeat_visit = 9; +inline bool ClientSafeBrowsingReportRequest::has_repeat_visit() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_repeat_visit() { + _has_bits_[0] |= 0x00000400u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_repeat_visit() { + _has_bits_[0] &= ~0x00000400u; +} +inline void ClientSafeBrowsingReportRequest::clear_repeat_visit() { + repeat_visit_ = false; + clear_has_repeat_visit(); +} +inline bool ClientSafeBrowsingReportRequest::repeat_visit() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.repeat_visit) + return repeat_visit_; +} +inline void ClientSafeBrowsingReportRequest::set_repeat_visit(bool value) { + set_has_repeat_visit(); + repeat_visit_ = value; + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.repeat_visit) +} + +// optional bytes token = 15; +inline bool ClientSafeBrowsingReportRequest::has_token() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void ClientSafeBrowsingReportRequest::set_has_token() { + _has_bits_[0] |= 0x00000800u; +} +inline void ClientSafeBrowsingReportRequest::clear_has_token() { + _has_bits_[0] &= ~0x00000800u; +} +inline void ClientSafeBrowsingReportRequest::clear_token() { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_->clear(); + } + clear_has_token(); +} +inline const ::std::string& ClientSafeBrowsingReportRequest::token() const { + // @@protoc_insertion_point(field_get:safe_browsing.ClientSafeBrowsingReportRequest.token) + return *token_; +} +inline void ClientSafeBrowsingReportRequest::set_token(const ::std::string& value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set:safe_browsing.ClientSafeBrowsingReportRequest.token) +} +inline void ClientSafeBrowsingReportRequest::set_token(const char* value) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(value); + // @@protoc_insertion_point(field_set_char:safe_browsing.ClientSafeBrowsingReportRequest.token) +} +inline void ClientSafeBrowsingReportRequest::set_token(const void* value, size_t size) { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + token_->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:safe_browsing.ClientSafeBrowsingReportRequest.token) +} +inline ::std::string* ClientSafeBrowsingReportRequest::mutable_token() { + set_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + token_ = new ::std::string; + } + // @@protoc_insertion_point(field_mutable:safe_browsing.ClientSafeBrowsingReportRequest.token) + return token_; +} +inline ::std::string* ClientSafeBrowsingReportRequest::release_token() { + clear_has_token(); + if (token_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + return NULL; + } else { + ::std::string* temp = token_; + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + return temp; + } +} +inline void ClientSafeBrowsingReportRequest::set_allocated_token(::std::string* token) { + if (token_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) { + delete token_; + } + if (token) { + set_has_token(); + token_ = token; + } else { + clear_has_token(); + token_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_set_allocated:safe_browsing.ClientSafeBrowsingReportRequest.token) +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace safe_browsing + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_chromium_2fchrome_2fcommon_2fsafe_5fbrowsing_2fcsd_2eproto__INCLUDED diff --git a/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.proto b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.proto new file mode 100644 index 000000000..fc588cc1f --- /dev/null +++ b/toolkit/components/downloads/chromium/chrome/common/safe_browsing/csd.proto @@ -0,0 +1,839 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// This proto file includes: +// (1) Client side phishing and malware detection request and response +// protocol buffers. Those protocol messages should be kept in sync +// with the server implementation. +// +// (2) Safe Browsing reporting protocol buffers. +// A ClientSafeBrowsingReportRequest is sent when a user opts-in to +// sending detailed threat reports from the safe browsing interstitial page. +// It is a list of Resource messages, which may contain the url of a +// resource such as the page in the address bar or any other resource +// that was loaded for this page. +// In addition to the url, a resource can contain HTTP request and response +// headers and bodies. +// +// If you want to change this protocol definition or you have questions +// regarding its format please contact chrome-anti-phishing@googlegroups.com. + +syntax = "proto2"; + +option optimize_for = LITE_RUNTIME; + +package safe_browsing; + +// Protocol buffer describing the Chrome user population of the user reporting +// data. +message ChromeUserPopulation { + enum UserPopulation { + UNKNOWN_USER_POPULATION = 0; + SAFE_BROWSING = 1; + EXTENDED_REPORTING = 2; + } + optional UserPopulation user_population = 1; +} + + +message ClientPhishingRequest { + // URL that the client visited. The CGI parameters are stripped by the + // client. + optional string url = 1; + + // A 5-byte SHA-256 hash prefix of the URL. Before hashing the URL is + // canonicalized, converted to a suffix-prefix expression and broadened + // (www prefix is removed and everything past the last '/' is stripped). + // + // Marked OBSOLETE because the URL is sent for all users, making the hash + // prefix unnecessary. + optional bytes OBSOLETE_hash_prefix = 10; + + // Score that was computed on the client. Value is between 0.0 and 1.0. + // The larger the value the more likely the url is phishing. + required float client_score = 2; + + // Note: we're skipping tag 3 because it was previously used. + + // Is true if the features for this URL were classified as phishing. + // Currently, this will always be true for all client-phishing requests + // that are sent to the server. + optional bool is_phishing = 4; + + message Feature { + // Feature name. E.g., 'PageHasForms'. + required string name = 1; + + // Feature value is always in the range [0.0, 1.0]. Boolean features + // have value 1.0. + required double value = 2; + } + + // List of features that were extracted. Those are the features that were + // sent to the scorer and which resulted in client_score being computed. + repeated Feature feature_map = 5; + + // The version number of the model that was used to compute the client-score. + // Copied from ClientSideModel.version(). + optional int32 model_version = 6; + + // Field 7 is only used on the server. + + // List of features that are extracted in the client but are not used in the + // machine learning model. + repeated Feature non_model_feature_map = 8; + + // The referrer URL. This field might not be set, for example, in the case + // where the referrer uses HTTPs. + // OBSOLETE: Use feature 'Referrer=<referrer>' instead. + optional string OBSOLETE_referrer_url = 9; + + // Field 11 is only used on the server. + + // List of shingle hashes we extracted. + repeated uint32 shingle_hashes = 12 [packed = true]; + + // The model filename (basename) that was used by the client. + optional string model_filename = 13; + + // Population that the reporting user is part of. + optional ChromeUserPopulation population = 14; +} + +message ClientPhishingResponse { + required bool phishy = 1; + + // A list of SafeBrowsing host-suffix / path-prefix expressions that + // are whitelisted. The client must match the current top-level URL + // against these whitelisted expressions and only apply a positive + // phishing verdict above if the URL does not match any expression + // on this whitelist. The client must not cache these whitelisted + // expressions. This whitelist will be empty for the vast majority + // of the responses but might contain up to 100 entries in emergency + // situations. + // + // Marked OBSOLETE because the URL is sent for all users, so the server + // can do whitelist matching. + repeated string OBSOLETE_whitelist_expression = 2; +} + +message ClientMalwareRequest { + // URL that the client visited. The CGI parameters are stripped by the + // client. + required string url = 1; + + // Field 2 is deleted and no longer in use. + + // Field 3 is only used on the server. + + // The referrer URL. This field might not be set, for example, in the case + // where the referrer uses HTTPS. + optional string referrer_url = 4; + + // Field 5 and 6 are only used on the server. + + message UrlInfo { + required string ip = 1; + required string url = 2; + optional string method = 3; + optional string referrer = 4; + // Resource type, the int value is a direct cast from the Type enum + // of ResourceType class defined in //src/webkit/commom/resource_type.h + optional int32 resource_type = 5; + } + + // List of resource urls that match the malware IP list. + repeated UrlInfo bad_ip_url_info = 7; + + // Population that the reporting user is part of. + optional ChromeUserPopulation population = 9; +} + +message ClientMalwareResponse { + required bool blacklist = 1; + // The confirmed blacklisted bad IP and its url, which will be shown in + // malware warning, if the blacklist verdict is true. + // This IP string could be either in IPv4 or IPv6 format, which is the same + // as the ones client sent to server. + optional string bad_ip = 2; + optional string bad_url = 3; +} + +message ClientDownloadRequest { + // The final URL of the download (after all redirects). + required string url = 1; + + // This message contains various binary digests of the download payload. + message Digests { + optional bytes sha256 = 1; + optional bytes sha1 = 2; + optional bytes md5 = 3; + } + required Digests digests = 2; + + // This is the length in bytes of the download payload. + required int64 length = 3; + + // Type of the resources stored below. + enum ResourceType { + // The final URL of the download payload. The resource URL should + // correspond to the URL field above. + DOWNLOAD_URL = 0; + // A redirect URL that was fetched before hitting the final DOWNLOAD_URL. + DOWNLOAD_REDIRECT = 1; + // The final top-level URL of the tab that triggered the download. + TAB_URL = 2; + // A redirect URL thas was fetched before hitting the final TAB_URL. + TAB_REDIRECT = 3; + // The document URL for a PPAPI plugin instance that initiated the download. + // This is the document.url for the container element for the plugin + // instance. + PPAPI_DOCUMENT = 4; + // The plugin URL for a PPAPI plugin instance that initiated the download. + PPAPI_PLUGIN = 5; + } + + message Resource { + required string url = 1; + required ResourceType type = 2; + optional bytes remote_ip = 3; + // This will only be set if the referrer is available and if the + // resource type is either TAB_URL or DOWNLOAD_URL. + optional string referrer = 4; + + // TODO(noelutz): add the transition type? + } + + // This repeated field will store all the redirects as well as the + // final URLs for the top-level tab URL (i.e., the URL that + // triggered the download) as well as for the download URL itself. + repeated Resource resources = 4; + + // A trust chain of certificates. Each chain begins with the signing + // certificate of the binary, and ends with a self-signed certificate, + // typically from a trusted root CA. This structure is analogous to + // CERT_CHAIN_CONTEXT on Windows. + message CertificateChain { + // A single link in the chain. + message Element { + // DER-encoded X.509 representation of the certificate. + optional bytes certificate = 1; + // Fields 2 - 7 are only used on the server. + } + repeated Element element = 1; + } + + // This is an OS X only message to report extended attribute informations. + // Extended attributes on OS X are used for various security mechanisms, + // which makes them interesting to Chrome. + message ExtendedAttr { + // This is the name of the extended attribute. + required string key = 1; + // This is the value of the extended attribute. + optional bytes value = 2; + } + + message SignatureInfo { + // All certificate chains for each of the binary's signers. Multiple chains + // may be present if the binary or any certificate has multiple signers. + // Absence of certificate chains does not imply that the binary is not + // signed (in that case, SignedData blobs extracted from the binary may be + // preset), but does mean that trust has not been verified. + repeated CertificateChain certificate_chain = 1; + + // True if the signature was trusted on the client. + optional bool trusted = 2; + + // On Windows, PKCS#7 SignedData blobs extracted from a portable executable + // image's attribute certificate table. The presence of these does not imply + // that the signatures were deemed trusted by the client. + // On Mac, this is the code signature blob referenced by the + // LC_CODE_SIGNATURE load command. + repeated bytes signed_data = 3; + + // On OS X, code signing data can be contained in the extended attributes of + // a file. As Gatekeeper respects this signature, we look for it and collect + // it. + repeated ExtendedAttr xattr = 4; + } + + // This field will only be set if the binary is signed. + optional SignatureInfo signature = 5; + + // True if the download was user initiated. + optional bool user_initiated = 6; + + // Fields 7 and 8 are only used on the server. + + // Name of the file where the download would be stored if the + // download completes. E.g., "bla.exe". + optional string file_basename = 9; + + // Starting with Chrome M19 we're also sending back pings for Chrome + // extensions that get downloaded by users. + enum DownloadType { + WIN_EXECUTABLE = 0; // Currently all .exe, .cab and .msi files. + CHROME_EXTENSION = 1; // .crx files. + ANDROID_APK = 2; // .apk files. + // .zip files containing one of the other executable types. + ZIPPED_EXECUTABLE = 3; + MAC_EXECUTABLE = 4; // .dmg, .pkg, etc. + ZIPPED_ARCHIVE = 5; // .zip file containing another archive. + ARCHIVE = 6; // Archive that doesn't have a specific DownloadType. + // A .zip that Chrome failed to unpack to the point of finding exe/zips. + INVALID_ZIP = 7; + // A .dmg, .pkg, etc, that Chrome failed to unpack to the point of finding + // Mach O's. + INVALID_MAC_ARCHIVE = 8; + // A download request initiated via PPAPI. Typically the requestor is + // a Flash applet. + PPAPI_SAVE_REQUEST = 9; + // A file we don't support, but we've decided to sample and send + // a light-ping. + SAMPLED_UNSUPPORTED_FILE = 10; + } + optional DownloadType download_type = 10 [default = WIN_EXECUTABLE]; + + // Locale of the device, eg en, en_US. + optional string locale = 11; + + message PEImageHeaders { + // IMAGE_DOS_HEADER. + optional bytes dos_header = 1; + // IMAGE_FILE_HEADER. + optional bytes file_header = 2; + // IMAGE_OPTIONAL_HEADER32. Present only for 32-bit PE images. + optional bytes optional_headers32 = 3; + // IMAGE_OPTIONAL_HEADER64. Present only for 64-bit PE images. + optional bytes optional_headers64 = 4; + // IMAGE_SECTION_HEADER. + repeated bytes section_header = 5; + // Contents of the .edata section. + optional bytes export_section_data = 6; + + message DebugData { + // IMAGE_DEBUG_DIRECTORY. + optional bytes directory_entry = 1; + optional bytes raw_data = 2; + } + + repeated DebugData debug_data = 7; + } + + message MachOHeaders { + // The mach_header or mach_header_64 struct. + required bytes mach_header = 1; + + message LoadCommand { + // |command_id| is the first uint32 of |command| as well, but is + // extracted for easier processing. + required uint32 command_id = 1; + // The entire data stream of the load command. + required bytes command = 2; + } + + // All the load commands of the Mach-O file. + repeated LoadCommand load_commands = 2; + } + + message ImageHeaders { + // Windows Portable Executable image headers. + optional PEImageHeaders pe_headers = 1; + + // OS X Mach-O image headers. + repeated MachOHeaders mach_o_headers = 2; + }; + + // Fields 12-17 are reserved for server-side use and are never sent by the + // client. + + optional ImageHeaders image_headers = 18; + + // Fields 19-21 are reserved for server-side use and are never sent by the + // client. + + // A binary contained in an archive (e.g., a .zip archive). + message ArchivedBinary { + optional string file_basename = 1; + optional DownloadType download_type = 2; + optional Digests digests = 3; + optional int64 length = 4; + optional SignatureInfo signature = 5; + optional ImageHeaders image_headers = 6; + } + + repeated ArchivedBinary archived_binary = 22; + + // Population that the reporting user is part of. + optional ChromeUserPopulation population = 24; + + // True if the .zip or DMG, etc, was 100% successfully unpacked. + optional bool archive_valid = 26; + + // True if this ClientDownloadRequest is from a whitelisted domain. + optional bool skipped_url_whitelist = 28; + + // True if this ClientDownloadRequest contains a whitelisted certificate. + optional bool skipped_certificate_whitelist = 31; + + // PPAPI_SAVE_REQUEST type messages may have more than one suggested filetype. + // Each element in this collection indicates an alternate extension including + // the leading extension separator. + repeated string alternate_extensions = 35; + + message URLChainEntry { + enum URLType { + DOWNLOAD_URL = 1; + DOWNLOAD_REFERRER = 2; + LANDING_PAGE = 3; + LANDING_REFERRER = 4; + CLIENT_REDIRECT = 5; + SERVER_REDIRECT = 6; + } + + // [required] The url of this Entry. + optional string url = 1; + + // Type of URLs, such as download url, download referrer, etc. + optional URLType type = 2; + + // IP address corresponding to url. + optional string ip_address = 3; + + // Referrer url of this entry. + optional string referrer = 4; + + // Main frame URL of referrer. + optional string main_frame_referrer = 5; + + // If this URL loads in a different tab/frame from previous one. + optional bool is_retargeting = 6; + + // If there is a user gesture attached to this transition. + optional bool is_user_initiated = 7; + + optional double timestamp_in_millisec = 8; + } // End of URLChainEntry + + // URLs transitions from landing referrer to download in reverse chronological + // order, i.e. download url comes first in this list, and landing referrer + // comes last. + repeated URLChainEntry url_chain = 36; +} + +message ClientDownloadResponse { + enum Verdict { + // Download is considered safe. + SAFE = 0; + // Download is considered dangerous. Chrome should show a warning to the + // user. + DANGEROUS = 1; + // Download is uncommon. Chrome should display a less severe warning. + UNCOMMON = 2; + // The download is potentially unwanted. + POTENTIALLY_UNWANTED = 3; + // The download is from a dangerous host. + DANGEROUS_HOST = 4; + // The backend doesn't have confidence in its verdict of this file. + // Chrome should show the default warning if configured for this file type. + UNKNOWN = 5; + } + optional Verdict verdict = 1 [default = SAFE]; + + message MoreInfo { + // A human-readable string describing the nature of the warning. + // Only if verdict != SAFE. Localized based on request.locale. + optional string description = 1; + + // A URL to get more information about this warning, if available. + optional string url = 2; + } + optional MoreInfo more_info = 2; + + // An arbitrary token that should be sent along for further server requests. + optional bytes token = 3; +} + +// The following protocol buffer holds the feedback report gathered +// from the user regarding the download. +message ClientDownloadReport { + // The information of user who provided the feedback. + // This is going to be useful for handling appeals. + message UserInformation { + optional string email = 1; + } + + enum Reason { + SHARE = 0; + FALSE_POSITIVE = 1; + APPEAL = 2; + } + + // The type of feedback for this report. + optional Reason reason = 1; + + // The original download ping + optional ClientDownloadRequest download_request = 2; + + // Stores the information of the user who provided the feedback. + optional UserInformation user_information = 3; + + // Unstructed comments provided by the user. + optional bytes comment = 4; + + // The original download response sent from the verdict server. + optional ClientDownloadResponse download_response = 5; +} + +// This is used to send back upload status to the client after upload completion +message ClientUploadResponse { + enum UploadStatus { + // The upload was successful and a complete response can be expected + SUCCESS = 0; + + // The upload was unsuccessful and the response is incomplete. + UPLOAD_FAILURE = 1; + } + + // Holds the upload status + optional UploadStatus status = 1; + + // Holds the permalink where the results of scanning the binary are available + optional string permalink = 2; +} + +message ClientIncidentReport { + message IncidentData { + message TrackedPreferenceIncident { + enum ValueState { + UNKNOWN = 0; + CLEARED = 1; + WEAK_LEGACY_OBSOLETE = 2; + CHANGED = 3; + UNTRUSTED_UNKNOWN_VALUE = 4; + } + + optional string path = 1; + optional string atomic_value = 2; + repeated string split_key = 3; + optional ValueState value_state = 4; + } + + message BinaryIntegrityIncident { + optional string file_basename = 1; + optional ClientDownloadRequest.SignatureInfo signature = 2; + optional ClientDownloadRequest.ImageHeaders image_headers = 3; + optional int32 sec_error = 4; + + message ContainedFile { + optional string relative_path = 1; + optional ClientDownloadRequest.SignatureInfo signature = 2; + optional ClientDownloadRequest.ImageHeaders image_headers = 3; + } + repeated ContainedFile contained_file = 5; + } + + message BlacklistLoadIncident { + optional string path = 1; + optional ClientDownloadRequest.Digests digest = 2; + optional string version = 3; + optional bool blacklist_initialized = 4; + optional ClientDownloadRequest.SignatureInfo signature = 5; + optional ClientDownloadRequest.ImageHeaders image_headers = 6; + } + message VariationsSeedSignatureIncident { + optional string variations_seed_signature = 1; + } + message ResourceRequestIncident { + enum Type { + UNKNOWN = 0; + TYPE_PATTERN = 3; + } + optional bytes digest = 1; + optional string origin = 2; + optional Type type = 3 [default = UNKNOWN]; + } + message SuspiciousModuleIncident { + optional string path = 1; + optional ClientDownloadRequest.Digests digest = 2; + optional string version = 3; + optional ClientDownloadRequest.SignatureInfo signature = 4; + optional ClientDownloadRequest.ImageHeaders image_headers = 5; + } + optional int64 incident_time_msec = 1; + optional TrackedPreferenceIncident tracked_preference = 2; + optional BinaryIntegrityIncident binary_integrity = 3; + optional BlacklistLoadIncident blacklist_load = 4; + // Note: skip tag 5 because it was previously used. + optional VariationsSeedSignatureIncident variations_seed_signature = 6; + optional ResourceRequestIncident resource_request = 7; + optional SuspiciousModuleIncident suspicious_module = 8; + } + + repeated IncidentData incident = 1; + + message DownloadDetails { + optional bytes token = 1; + optional ClientDownloadRequest download = 2; + optional int64 download_time_msec = 3; + optional int64 open_time_msec = 4; + } + + optional DownloadDetails download = 2; + + message EnvironmentData { + message OS { + optional string os_name = 1; + optional string os_version = 2; + + message RegistryValue { + optional string name = 1; + optional uint32 type = 2; + optional bytes data = 3; + } + + message RegistryKey { + optional string name = 1; + repeated RegistryValue value = 2; + repeated RegistryKey key = 3; + } + + repeated RegistryKey registry_key = 3; + + optional bool is_enrolled_to_domain = 4; + } + optional OS os = 1; + message Machine { + optional string cpu_architecture = 1; + optional string cpu_vendor = 2; + optional uint32 cpuid = 3; + } + optional Machine machine = 2; + message Process { + optional string version = 1; + repeated string OBSOLETE_dlls = 2; + message Patch { + optional string function = 1; + optional string target_dll = 2; + } + repeated Patch patches = 3; + message NetworkProvider {} + repeated NetworkProvider network_providers = 4; + enum Channel { + CHANNEL_UNKNOWN = 0; + CHANNEL_CANARY = 1; + CHANNEL_DEV = 2; + CHANNEL_BETA = 3; + CHANNEL_STABLE = 4; + } + optional Channel chrome_update_channel = 5; + optional int64 uptime_msec = 6; + optional bool metrics_consent = 7; + optional bool extended_consent = 8; + message Dll { + enum Feature { + UNKNOWN = 0; + LSP = 1; + } + optional string path = 1; + optional uint64 base_address = 2; + optional uint32 length = 3; + repeated Feature feature = 4; + optional ClientDownloadRequest.ImageHeaders image_headers = 5; + } + repeated Dll dll = 9; + repeated string blacklisted_dll = 10; + message ModuleState { + enum ModifiedState { + UNKNOWN = 0; + MODULE_STATE_UNKNOWN = 1; + MODULE_STATE_UNMODIFIED = 2; + MODULE_STATE_MODIFIED = 3; + } + optional string name = 1; + optional ModifiedState modified_state = 2; + repeated string OBSOLETE_modified_export = 3; + + message Modification { + optional uint32 file_offset = 1; + optional int32 byte_count = 2; + optional bytes modified_bytes = 3; + optional string export_name = 4; + } + repeated Modification modification = 4; + } + repeated ModuleState module_state = 11; + optional bool field_trial_participant = 12; + } + optional Process process = 3; + } + + message ExtensionData { + message ExtensionInfo { + enum ExtensionState { + STATE_UNKNOWN = 0; + STATE_ENABLED = 1; + STATE_DISABLED = 2; + STATE_BLACKLISTED = 3; + STATE_BLOCKED = 4; + STATE_TERMINATED = 5; + } + + optional string id = 1; + optional string version = 2; + optional string name = 3; + optional string description = 4; + optional ExtensionState state = 5 [default = STATE_UNKNOWN]; + optional int32 type = 6; + optional string update_url = 7; + optional bool has_signature_validation = 8; + optional bool signature_is_valid = 9; + optional bool installed_by_custodian = 10; + optional bool installed_by_default = 11; + optional bool installed_by_oem = 12; + optional bool from_bookmark = 13; + optional bool from_webstore = 14; + optional bool converted_from_user_script = 15; + optional bool may_be_untrusted = 16; + optional int64 install_time_msec = 17; + optional int32 manifest_location_type = 18; + optional string manifest = 19; + } + + optional ExtensionInfo last_installed_extension = 1; + } + + optional EnvironmentData environment = 3; + + // Population that the reporting user is part of. + optional ChromeUserPopulation population = 7; + + optional ExtensionData extension_data = 8; + + message NonBinaryDownloadDetails { + optional string file_type = 1; + optional bytes url_spec_sha256 = 2; + optional string host = 3; + optional int64 length = 4; + } + + optional NonBinaryDownloadDetails non_binary_download = 9; +} + +message ClientIncidentResponse { + optional bytes token = 1; + optional bool download_requested = 2; + + message EnvironmentRequest { optional int32 dll_index = 1; } + + repeated EnvironmentRequest environment_requests = 3; +} + +message DownloadMetadata { + optional uint32 download_id = 1; + + optional ClientIncidentReport.DownloadDetails download = 2; +} + +// A Detailed Safebrowsing Report from clients. Chrome safebrowsing reports are +// only sent by Chrome users who have opted into extended Safe Browsing. +// This proto is replacing ClientMalwareReportRequest. +// Next tag: 16 +message ClientSafeBrowsingReportRequest { + // Note: A lot of the "optional" fields would make sense to be + // "required" instead. However, having them as optional allows the + // clients to send "stripped down" versions of the message in the + // future, if we want to. + + enum ReportType { + UNKNOWN = 0; + URL_PHISHING = 1; + URL_MALWARE = 2; + URL_UNWANTED = 3; + CLIENT_SIDE_PHISHING_URL = 4; + CLIENT_SIDE_MALWARE_URL = 5; + DANGEROUS_DOWNLOAD_RECOVERY = 6; + DANGEROUS_DOWNLOAD_WARNING = 7; + DANGEROUS_DOWNLOAD_BY_API = 10; + } + + message HTTPHeader { + required bytes name = 1; + optional bytes value = 2; + } + + message HTTPRequest { + message FirstLine { + optional bytes verb = 1; + optional bytes uri = 2; + optional bytes version = 3; + } + + optional FirstLine firstline = 1; + repeated HTTPHeader headers = 2; + optional bytes body = 3; + + // bodydigest and bodylength can be useful if the report does not + // contain the body itself. + optional bytes bodydigest = 4; // 32-byte hex md5 digest of body. + optional int32 bodylength = 5; // length of body. + } + + message HTTPResponse { + message FirstLine { + optional int32 code = 1; + optional bytes reason = 2; + optional bytes version = 3; + } + + optional FirstLine firstline = 1; + repeated HTTPHeader headers = 2; + optional bytes body = 3; + optional bytes bodydigest = 4; // 32-byte hex md5 digest of body. + optional int32 bodylength = 5; // length of body. + optional bytes remote_ip = 6; // IP of the server. + } + + message Resource { + required int32 id = 1; + optional string url = 2; + optional HTTPRequest request = 3; + optional HTTPResponse response = 4; + optional int32 parent_id = 5; + repeated int32 child_ids = 6; + optional string tag_name = 7; + } + + optional ReportType type = 10; + + // Only set if ReportType is DANGEROUS_DOWNLOAD_RECOVERY, + // DANGEROUS_DOWNLOAD_WARNING or DANGEROUS_DOWNLOAD_BY_API. + optional ClientDownloadResponse.Verdict download_verdict = 11; + + // URL of the page in the address bar. + optional string url = 1; + optional string page_url = 2; + optional string referrer_url = 3; + + repeated Resource resources = 4; + + // Whether the report is complete. + optional bool complete = 5; + + // The ASN and country of the client IP. These fields are filled up by + // csd_frontend + repeated string client_asn = 6; + optional string client_country = 7; + + // Whether user chose to proceed. + optional bool did_proceed = 8; + + // Whether user visited this origin before. + optional bool repeat_visit = 9; + + // The same token in ClientDownloadResponse. This field is only set if its + // report type is DANGEROUS_DOWNLOAD_RECOVERY, DANGEROUS_DOWNLOAD_WARNING or + // DANGEROUS_DOWNLOAD_BY_API. + optional bytes token = 15; +} diff --git a/toolkit/components/downloads/generate_csd.sh b/toolkit/components/downloads/generate_csd.sh new file mode 100755 index 000000000..a322d4c3c --- /dev/null +++ b/toolkit/components/downloads/generate_csd.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# A script to generate +# chromium/chrome/common/safe_browsing/csd.pb.{cc,h} for use in +# nsIApplicationReputationQuery. This script assumes you have +# downloaded and installed the protocol buffer compiler. + +set -e + +if [ "${PROTOC_PATH:+set}" != "set" ]; then + PROTOC_PATH=/usr/local/bin/protoc +fi + +echo "Using $PROTOC_PATH as protocol compiler" + +if [ ! -e $PROTOC_PATH ]; then + echo "You must install the protocol compiler from " \ + "https://github.com/google/protobuf/releases" + exit 1 +fi + +if [ ! -f nsDownloadManager.cpp ]; then + echo "You must run this script in the toolkit/components/downloads" >&2 + echo "directory of the source tree." >&2 + exit 1 +fi + +# Get the protocol buffer and compile it +CSD_PROTO_URL="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/safe_browsing/csd.proto?format=TEXT" +CSD_PATH="chromium/chrome/common/safe_browsing" + +curl "$CSD_PROTO_URL" | base64 --decode > "$CSD_PATH"/csd.proto +"$PROTOC_PATH" "$CSD_PATH"/csd.proto --cpp_out=. diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build new file mode 100644 index 000000000..477db0bd6 --- /dev/null +++ b/toolkit/components/downloads/moz.build @@ -0,0 +1,74 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +with Files('*'): + BUG_COMPONENT = ('Toolkit', 'Download Manager') + +with Files('ApplicationReputation.*'): + BUG_COMPONENT = ('Toolkit', 'Safe Browsing') + +with Files('chromium/*'): + BUG_COMPONENT = ('Toolkit', 'Safe Browsing') + +with Files('generate_csd.sh'): + BUG_COMPONENT = ('Toolkit', 'Safe Browsing') + +with Files('nsIApplicationReputation.idl'): + BUG_COMPONENT = ('Toolkit', 'Safe Browsing') + +XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] + +XPIDL_SOURCES += [ + 'nsIApplicationReputation.idl', + 'nsIDownload.idl', + 'nsIDownloadManager.idl', + 'nsIDownloadManagerUI.idl', + 'nsIDownloadProgressListener.idl', +] + +XPIDL_MODULE = 'downloads' + +UNIFIED_SOURCES += [ + 'ApplicationReputation.cpp', + 'chromium/chrome/common/safe_browsing/csd.pb.cc', + 'nsDownloadManager.cpp' +] + +# SQLFunctions.cpp cannot be built in unified mode because of Windows headers. +SOURCES += [ + 'SQLFunctions.cpp', +] + +if CONFIG['OS_ARCH'] == 'WINNT': + # Can't build unified because we need CreateEvent which some IPC code + # included in LoadContext ends up undefining. + SOURCES += [ + 'nsDownloadScanner.cpp', + ] + +# XXX - Until Suite builds off XULRunner we can't guarantee our implementation +# of nsIDownloadManagerUI overrides toolkit's. +if not CONFIG['MOZ_SUITE']: + EXTRA_COMPONENTS += [ + 'nsDownloadManagerUI.js', + 'nsDownloadManagerUI.manifest', + ] + +FINAL_LIBRARY = 'xul' + +LOCAL_INCLUDES += [ + '../protobuf', + '/ipc/chromium/src', + 'chromium' +] + +DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True +DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True + +CXXFLAGS += CONFIG['TK_CFLAGS'] + +if CONFIG['GNU_CXX']: + CXXFLAGS += ['-Wno-shadow'] diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp new file mode 100644 index 000000000..ab984c5f2 --- /dev/null +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -0,0 +1,3783 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "mozilla/DebugOnly.h" +#include "mozilla/Unused.h" + +#include "mozIStorageService.h" +#include "nsIAlertsService.h" +#include "nsIArray.h" +#include "nsIClassInfoImpl.h" +#include "nsIDOMWindow.h" +#include "nsIDownloadHistory.h" +#include "nsIDownloadManagerUI.h" +#include "nsIFileURL.h" +#include "nsIMIMEService.h" +#include "nsIParentalControlsService.h" +#include "nsIPrefService.h" +#include "nsIPrivateBrowsingChannel.h" +#include "nsIPromptService.h" +#include "nsIPropertyBag2.h" +#include "nsIResumableChannel.h" +#include "nsIWebBrowserPersist.h" +#include "nsIWindowMediator.h" +#include "nsILocalFileWin.h" +#include "nsILoadContext.h" +#include "nsIXULAppInfo.h" +#include "nsContentUtils.h" + +#include "nsAppDirectoryServiceDefs.h" +#include "nsArrayEnumerator.h" +#include "nsCExternalHandlerService.h" +#include "nsCRTGlue.h" +#include "nsDirectoryServiceDefs.h" +#include "nsDownloadManager.h" +#include "nsNetUtil.h" +#include "nsThreadUtils.h" +#include "prtime.h" + +#include "mozStorageCID.h" +#include "nsDocShellCID.h" +#include "nsEmbedCID.h" +#include "nsToolkitCompsCID.h" + +#include "mozilla/net/ReferrerPolicy.h" + +#include "SQLFunctions.h" + +#include "mozilla/Preferences.h" + +#ifdef XP_WIN +#include <shlobj.h> +#include "nsWindowsHelpers.h" +#ifdef DOWNLOAD_SCANNER +#include "nsDownloadScanner.h" +#endif +#endif + +#ifdef XP_MACOSX +#include <CoreFoundation/CoreFoundation.h> +#endif + +#ifdef MOZ_WIDGET_ANDROID +#include "FennecJNIWrappers.h" +#endif + +#ifdef MOZ_WIDGET_GTK +#include <gtk/gtk.h> +#endif + +using namespace mozilla; +using mozilla::downloads::GenerateGUID; + +#define DOWNLOAD_MANAGER_BUNDLE "chrome://mozapps/locale/downloads/downloads.properties" +#define DOWNLOAD_MANAGER_ALERT_ICON "chrome://mozapps/skin/downloads/downloadIcon.png" +#define PREF_BD_USEJSTRANSFER "browser.download.useJSTransfer" +#define PREF_BDM_SHOWALERTONCOMPLETE "browser.download.manager.showAlertOnComplete" +#define PREF_BDM_SHOWALERTINTERVAL "browser.download.manager.showAlertInterval" +#define PREF_BDM_RETENTION "browser.download.manager.retention" +#define PREF_BDM_QUITBEHAVIOR "browser.download.manager.quitBehavior" +#define PREF_BDM_ADDTORECENTDOCS "browser.download.manager.addToRecentDocs" +#define PREF_BDM_SCANWHENDONE "browser.download.manager.scanWhenDone" +#define PREF_BDM_RESUMEONWAKEDELAY "browser.download.manager.resumeOnWakeDelay" +#define PREF_BH_DELETETEMPFILEONEXIT "browser.helperApps.deleteTempFileOnExit" + +static const int64_t gUpdateInterval = 400 * PR_USEC_PER_MSEC; + +#define DM_SCHEMA_VERSION 9 +#define DM_DB_NAME NS_LITERAL_STRING("downloads.sqlite") +#define DM_DB_CORRUPT_FILENAME NS_LITERAL_STRING("downloads.sqlite.corrupt") + +#define NS_SYSTEMINFO_CONTRACTID "@mozilla.org/system-info;1" + +//////////////////////////////////////////////////////////////////////////////// +//// nsDownloadManager + +NS_IMPL_ISUPPORTS( + nsDownloadManager +, nsIDownloadManager +, nsINavHistoryObserver +, nsIObserver +, nsISupportsWeakReference +) + +nsDownloadManager *nsDownloadManager::gDownloadManagerService = nullptr; + +nsDownloadManager * +nsDownloadManager::GetSingleton() +{ + if (gDownloadManagerService) { + NS_ADDREF(gDownloadManagerService); + return gDownloadManagerService; + } + + gDownloadManagerService = new nsDownloadManager(); + if (gDownloadManagerService) { +#if defined(MOZ_WIDGET_GTK) + g_type_init(); +#endif + NS_ADDREF(gDownloadManagerService); + if (NS_FAILED(gDownloadManagerService->Init())) + NS_RELEASE(gDownloadManagerService); + } + + return gDownloadManagerService; +} + +nsDownloadManager::~nsDownloadManager() +{ +#ifdef DOWNLOAD_SCANNER + if (mScanner) { + delete mScanner; + mScanner = nullptr; + } +#endif + gDownloadManagerService = nullptr; +} + +nsresult +nsDownloadManager::ResumeRetry(nsDownload *aDl) +{ + // Keep a reference in case we need to cancel the download + RefPtr<nsDownload> dl = aDl; + + // Try to resume the active download + nsresult rv = dl->Resume(); + + // If not, try to retry the download + if (NS_FAILED(rv)) { + // First cancel the download so it's no longer active + rv = dl->Cancel(); + + // Then retry it + if (NS_SUCCEEDED(rv)) + rv = dl->Retry(); + } + + return rv; +} + +nsresult +nsDownloadManager::PauseAllDownloads(bool aSetResume) +{ + nsresult rv = PauseAllDownloads(mCurrentDownloads, aSetResume); + nsresult rv2 = PauseAllDownloads(mCurrentPrivateDownloads, aSetResume); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv2, rv2); + return NS_OK; +} + +nsresult +nsDownloadManager::PauseAllDownloads(nsCOMArray<nsDownload>& aDownloads, bool aSetResume) +{ + nsresult retVal = NS_OK; + for (int32_t i = aDownloads.Count() - 1; i >= 0; --i) { + RefPtr<nsDownload> dl = aDownloads[i]; + + // Only pause things that need to be paused + if (!dl->IsPaused()) { + // Set auto-resume before pausing so that it gets into the DB + dl->mAutoResume = aSetResume ? nsDownload::AUTO_RESUME : + nsDownload::DONT_RESUME; + + // Try to pause the download but don't bail now if we fail + nsresult rv = dl->Pause(); + if (NS_FAILED(rv)) + retVal = rv; + } + } + + return retVal; +} + +nsresult +nsDownloadManager::ResumeAllDownloads(bool aResumeAll) +{ + nsresult rv = ResumeAllDownloads(mCurrentDownloads, aResumeAll); + nsresult rv2 = ResumeAllDownloads(mCurrentPrivateDownloads, aResumeAll); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv2, rv2); + return NS_OK; +} + +nsresult +nsDownloadManager::ResumeAllDownloads(nsCOMArray<nsDownload>& aDownloads, bool aResumeAll) +{ + nsresult retVal = NS_OK; + for (int32_t i = aDownloads.Count() - 1; i >= 0; --i) { + RefPtr<nsDownload> dl = aDownloads[i]; + + // If aResumeAll is true, then resume everything; otherwise, check if the + // download should auto-resume + if (aResumeAll || dl->ShouldAutoResume()) { + // Reset auto-resume before retrying so that it gets into the DB through + // ResumeRetry's eventual call to SetState. We clear the value now so we + // don't accidentally query completed downloads that were previously + // auto-resumed (and try to resume them). + dl->mAutoResume = nsDownload::DONT_RESUME; + + // Try to resume/retry the download but don't bail now if we fail + nsresult rv = ResumeRetry(dl); + if (NS_FAILED(rv)) + retVal = rv; + } + } + + return retVal; +} + +nsresult +nsDownloadManager::RemoveAllDownloads() +{ + nsresult rv = RemoveAllDownloads(mCurrentDownloads); + nsresult rv2 = RemoveAllDownloads(mCurrentPrivateDownloads); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv2, rv2); + return NS_OK; +} + +nsresult +nsDownloadManager::RemoveAllDownloads(nsCOMArray<nsDownload>& aDownloads) +{ + nsresult rv = NS_OK; + for (int32_t i = aDownloads.Count() - 1; i >= 0; --i) { + RefPtr<nsDownload> dl = aDownloads[0]; + + nsresult result = NS_OK; + if (!dl->mPrivate && dl->IsPaused() && GetQuitBehavior() != QUIT_AND_CANCEL) + aDownloads.RemoveObject(dl); + else + result = dl->Cancel(); + + // Track the failure, but don't miss out on other downloads + if (NS_FAILED(result)) + rv = result; + } + + return rv; +} + +nsresult +nsDownloadManager::RemoveDownloadsForURI(mozIStorageStatement* aStatement, nsIURI *aURI) +{ + mozStorageStatementScoper scope(aStatement); + + nsAutoCString source; + nsresult rv = aURI->GetSpec(source); + NS_ENSURE_SUCCESS(rv, rv); + + rv = aStatement->BindUTF8StringByName( + NS_LITERAL_CSTRING("source"), source); + NS_ENSURE_SUCCESS(rv, rv); + + bool hasMore = false; + AutoTArray<nsCString, 4> downloads; + // Get all the downloads that match the provided URI + while (NS_SUCCEEDED(aStatement->ExecuteStep(&hasMore)) && + hasMore) { + nsAutoCString downloadGuid; + rv = aStatement->GetUTF8String(0, downloadGuid); + NS_ENSURE_SUCCESS(rv, rv); + + downloads.AppendElement(downloadGuid); + } + + // Remove each download ignoring any failure so we reach other downloads + for (int32_t i = downloads.Length(); --i >= 0; ) + (void)RemoveDownload(downloads[i]); + + return NS_OK; +} + +void // static +nsDownloadManager::ResumeOnWakeCallback(nsITimer *aTimer, void *aClosure) +{ + // Resume the downloads that were set to autoResume + nsDownloadManager *dlMgr = static_cast<nsDownloadManager *>(aClosure); + (void)dlMgr->ResumeAllDownloads(false); +} + +already_AddRefed<mozIStorageConnection> +nsDownloadManager::GetFileDBConnection(nsIFile *dbFile) const +{ + NS_ASSERTION(dbFile, "GetFileDBConnection called with an invalid nsIFile"); + + nsCOMPtr<mozIStorageService> storage = + do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(storage, nullptr); + + nsCOMPtr<mozIStorageConnection> conn; + nsresult rv = storage->OpenDatabase(dbFile, getter_AddRefs(conn)); + if (rv == NS_ERROR_FILE_CORRUPTED) { + // delete and try again, since we don't care so much about losing a user's + // download history + rv = dbFile->Remove(false); + NS_ENSURE_SUCCESS(rv, nullptr); + rv = storage->OpenDatabase(dbFile, getter_AddRefs(conn)); + } + NS_ENSURE_SUCCESS(rv, nullptr); + + return conn.forget(); +} + +already_AddRefed<mozIStorageConnection> +nsDownloadManager::GetPrivateDBConnection() const +{ + nsCOMPtr<mozIStorageService> storage = + do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(storage, nullptr); + + nsCOMPtr<mozIStorageConnection> conn; + nsresult rv = storage->OpenSpecialDatabase("memory", getter_AddRefs(conn)); + NS_ENSURE_SUCCESS(rv, nullptr); + + return conn.forget(); +} + +void +nsDownloadManager::CloseAllDBs() +{ + CloseDB(mDBConn, mUpdateDownloadStatement, mGetIdsForURIStatement); + CloseDB(mPrivateDBConn, mUpdatePrivateDownloadStatement, mGetPrivateIdsForURIStatement); +} + +void +nsDownloadManager::CloseDB(mozIStorageConnection* aDBConn, + mozIStorageStatement* aUpdateStmt, + mozIStorageStatement* aGetIdsStmt) +{ + DebugOnly<nsresult> rv = aGetIdsStmt->Finalize(); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + rv = aUpdateStmt->Finalize(); + MOZ_ASSERT(NS_SUCCEEDED(rv)); + rv = aDBConn->AsyncClose(nullptr); + MOZ_ASSERT(NS_SUCCEEDED(rv)); +} + +static nsresult +InitSQLFunctions(mozIStorageConnection* aDBConn) +{ + nsresult rv = mozilla::downloads::GenerateGUIDFunction::create(aDBConn); + NS_ENSURE_SUCCESS(rv, rv); + return NS_OK; +} + +nsresult +nsDownloadManager::InitPrivateDB() +{ + bool ready = false; + if (mPrivateDBConn && NS_SUCCEEDED(mPrivateDBConn->GetConnectionReady(&ready)) && ready) + CloseDB(mPrivateDBConn, mUpdatePrivateDownloadStatement, mGetPrivateIdsForURIStatement); + mPrivateDBConn = GetPrivateDBConnection(); + if (!mPrivateDBConn) + return NS_ERROR_NOT_AVAILABLE; + + nsresult rv = InitSQLFunctions(mPrivateDBConn); + NS_ENSURE_SUCCESS(rv, rv); + + rv = CreateTable(mPrivateDBConn); + NS_ENSURE_SUCCESS(rv, rv); + + rv = InitStatements(mPrivateDBConn, getter_AddRefs(mUpdatePrivateDownloadStatement), + getter_AddRefs(mGetPrivateIdsForURIStatement)); + NS_ENSURE_SUCCESS(rv, rv); + return NS_OK; +} + +nsresult +nsDownloadManager::InitFileDB() +{ + nsresult rv; + + nsCOMPtr<nsIFile> dbFile; + rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, + getter_AddRefs(dbFile)); + NS_ENSURE_SUCCESS(rv, rv); + rv = dbFile->Append(DM_DB_NAME); + NS_ENSURE_SUCCESS(rv, rv); + + bool ready = false; + if (mDBConn && NS_SUCCEEDED(mDBConn->GetConnectionReady(&ready)) && ready) + CloseDB(mDBConn, mUpdateDownloadStatement, mGetIdsForURIStatement); + mDBConn = GetFileDBConnection(dbFile); + NS_ENSURE_TRUE(mDBConn, NS_ERROR_NOT_AVAILABLE); + + rv = InitSQLFunctions(mDBConn); + NS_ENSURE_SUCCESS(rv, rv); + + bool tableExists; + rv = mDBConn->TableExists(NS_LITERAL_CSTRING("moz_downloads"), &tableExists); + NS_ENSURE_SUCCESS(rv, rv); + + if (!tableExists) { + rv = CreateTable(mDBConn); + NS_ENSURE_SUCCESS(rv, rv); + + // We're done with the initialization now and can skip the remaining + // upgrading logic. + return NS_OK; + } + + // Checking the database schema now + int32_t schemaVersion; + rv = mDBConn->GetSchemaVersion(&schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + + // Changing the database? Be sure to do these two things! + // 1) Increment DM_SCHEMA_VERSION + // 2) Implement the proper downgrade/upgrade code for the current version + + switch (schemaVersion) { + // Upgrading + // Every time you increment the database schema, you need to implement + // the upgrading code from the previous version to the new one. + // Also, don't forget to make a unit test to test your upgrading code! + case 1: // Drop a column (iconURL) from the database (bug 385875) + { + // Safely wrap this in a transaction so we don't hose the whole DB + mozStorageTransaction safeTransaction(mDBConn, true); + + // Create a temporary table that will store the existing records + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE TEMPORARY TABLE moz_downloads_backup (" + "id INTEGER PRIMARY KEY, " + "name TEXT, " + "source TEXT, " + "target TEXT, " + "startTime INTEGER, " + "endTime INTEGER, " + "state INTEGER" + ")")); + NS_ENSURE_SUCCESS(rv, rv); + + // Insert into a temporary table + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "INSERT INTO moz_downloads_backup " + "SELECT id, name, source, target, startTime, endTime, state " + "FROM moz_downloads")); + NS_ENSURE_SUCCESS(rv, rv); + + // Drop the old table + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "DROP TABLE moz_downloads")); + NS_ENSURE_SUCCESS(rv, rv); + + // Now recreate it with this schema version + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE TABLE moz_downloads (" + "id INTEGER PRIMARY KEY, " + "name TEXT, " + "source TEXT, " + "target TEXT, " + "startTime INTEGER, " + "endTime INTEGER, " + "state INTEGER" + ")")); + NS_ENSURE_SUCCESS(rv, rv); + + // Insert the data back into it + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "INSERT INTO moz_downloads " + "SELECT id, name, source, target, startTime, endTime, state " + "FROM moz_downloads_backup")); + NS_ENSURE_SUCCESS(rv, rv); + + // And drop our temporary table + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "DROP TABLE moz_downloads_backup")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 2; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + case 2: // Add referrer column to the database + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN referrer TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 3; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + case 3: // This version adds a column to the database (entityID) + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN entityID TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 4; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + case 4: // This version adds a column to the database (tempPath) + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN tempPath TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 5; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + case 5: // This version adds two columns for tracking transfer progress + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN currBytes INTEGER NOT NULL DEFAULT 0")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN maxBytes INTEGER NOT NULL DEFAULT -1")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 6; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + case 6: // This version adds three columns to DB (MIME type related info) + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN mimeType TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN preferredApplication TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN preferredAction INTEGER NOT NULL DEFAULT 0")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 7; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to next upgrade + MOZ_FALLTHROUGH; + + case 7: // This version adds a column to remember to auto-resume downloads + { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads " + "ADD COLUMN autoResume INTEGER NOT NULL DEFAULT 0")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the schemaVersion variable and the database schema + schemaVersion = 8; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + MOZ_FALLTHROUGH; + + // Warning: schema versions >=8 must take into account that they can + // be operating on schemas from unknown, future versions that have + // been downgraded. Operations such as adding columns may fail, + // since the column may already exist. + + case 8: // This version adds a column for GUIDs + { + bool exists; + rv = mDBConn->IndexExists(NS_LITERAL_CSTRING("moz_downloads_guid_uniqueindex"), + &exists); + NS_ENSURE_SUCCESS(rv, rv); + if (!exists) { + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "ALTER TABLE moz_downloads ADD COLUMN guid TEXT")); + NS_ENSURE_SUCCESS(rv, rv); + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE UNIQUE INDEX moz_downloads_guid_uniqueindex ON moz_downloads (guid)")); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "UPDATE moz_downloads SET guid = GENERATE_GUID() WHERE guid ISNULL")); + NS_ENSURE_SUCCESS(rv, rv); + + // Finally, update the database schema + schemaVersion = 9; + rv = mDBConn->SetSchemaVersion(schemaVersion); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to the next upgrade + + // Extra sanity checking for developers +#ifndef DEBUG + MOZ_FALLTHROUGH; + case DM_SCHEMA_VERSION: +#endif + break; + + case 0: + { + NS_WARNING("Could not get download database's schema version!"); + + // The table may still be usable - someone may have just messed with the + // schema version, so let's just treat this like a downgrade and verify + // that the needed columns are there. If they aren't there, we'll drop + // the table anyway. + rv = mDBConn->SetSchemaVersion(DM_SCHEMA_VERSION); + NS_ENSURE_SUCCESS(rv, rv); + } + // Fallthrough to downgrade check + MOZ_FALLTHROUGH; + + // Downgrading + // If columns have been added to the table, we can still use the ones we + // understand safely. If columns have been deleted or alterd, we just + // drop the table and start from scratch. If you change how a column + // should be interpreted, make sure you also change its name so this + // check will catch it. + default: + { + nsCOMPtr<mozIStorageStatement> stmt; + rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "SELECT id, name, source, target, tempPath, startTime, endTime, state, " + "referrer, entityID, currBytes, maxBytes, mimeType, " + "preferredApplication, preferredAction, autoResume, guid " + "FROM moz_downloads"), getter_AddRefs(stmt)); + if (NS_SUCCEEDED(rv)) { + // We have a database that contains all of the elements that make up + // the latest known schema. Reset the version to force an upgrade + // path if this downgraded database is used in a later version. + mDBConn->SetSchemaVersion(DM_SCHEMA_VERSION); + break; + } + + // if the statement fails, that means all the columns were not there. + // First we backup the database + nsCOMPtr<mozIStorageService> storage = + do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID); + NS_ENSURE_TRUE(storage, NS_ERROR_NOT_AVAILABLE); + nsCOMPtr<nsIFile> backup; + rv = storage->BackupDatabaseFile(dbFile, DM_DB_CORRUPT_FILENAME, nullptr, + getter_AddRefs(backup)); + NS_ENSURE_SUCCESS(rv, rv); + + // Then we dump it + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "DROP TABLE moz_downloads")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = CreateTable(mDBConn); + NS_ENSURE_SUCCESS(rv, rv); + } + break; + } + + return NS_OK; +} + +nsresult +nsDownloadManager::CreateTable(mozIStorageConnection* aDBConn) +{ + nsresult rv = aDBConn->SetSchemaVersion(DM_SCHEMA_VERSION); + if (NS_FAILED(rv)) return rv; + + rv = aDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE TABLE moz_downloads (" + "id INTEGER PRIMARY KEY, " + "name TEXT, " + "source TEXT, " + "target TEXT, " + "tempPath TEXT, " + "startTime INTEGER, " + "endTime INTEGER, " + "state INTEGER, " + "referrer TEXT, " + "entityID TEXT, " + "currBytes INTEGER NOT NULL DEFAULT 0, " + "maxBytes INTEGER NOT NULL DEFAULT -1, " + "mimeType TEXT, " + "preferredApplication TEXT, " + "preferredAction INTEGER NOT NULL DEFAULT 0, " + "autoResume INTEGER NOT NULL DEFAULT 0, " + "guid TEXT" + ")")); + if (NS_FAILED(rv)) return rv; + + rv = aDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "CREATE UNIQUE INDEX moz_downloads_guid_uniqueindex " + "ON moz_downloads(guid)")); + return rv; +} + +nsresult +nsDownloadManager::RestoreDatabaseState() +{ + // Restore downloads that were in a scanning state. We can assume that they + // have been dealt with by the virus scanner + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "UPDATE moz_downloads " + "SET state = :state " + "WHERE state = :state_cond"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state"), nsIDownloadManager::DOWNLOAD_FINISHED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state_cond"), nsIDownloadManager::DOWNLOAD_SCANNING); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + // Convert supposedly-active downloads into downloads that should auto-resume + rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "UPDATE moz_downloads " + "SET autoResume = :autoResume " + "WHERE state = :notStarted " + "OR state = :queued " + "OR state = :downloading"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("autoResume"), nsDownload::AUTO_RESUME); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("notStarted"), nsIDownloadManager::DOWNLOAD_NOTSTARTED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("queued"), nsIDownloadManager::DOWNLOAD_QUEUED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("downloading"), nsIDownloadManager::DOWNLOAD_DOWNLOADING); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + // Switch any download that is supposed to automatically resume and is in a + // finished state to *not* automatically resume. See Bug 409179 for details. + rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "UPDATE moz_downloads " + "SET autoResume = :autoResume " + "WHERE state = :state " + "AND autoResume = :autoResume_cond"), + getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("autoResume"), nsDownload::DONT_RESUME); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state"), nsIDownloadManager::DOWNLOAD_FINISHED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("autoResume_cond"), nsDownload::AUTO_RESUME); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +nsresult +nsDownloadManager::RestoreActiveDownloads() +{ + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "SELECT id " + "FROM moz_downloads " + "WHERE (state = :state AND LENGTH(entityID) > 0) " + "OR autoResume != :autoResume"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state"), nsIDownloadManager::DOWNLOAD_PAUSED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("autoResume"), nsDownload::DONT_RESUME); + NS_ENSURE_SUCCESS(rv, rv); + + nsresult retVal = NS_OK; + bool hasResults; + while (NS_SUCCEEDED(stmt->ExecuteStep(&hasResults)) && hasResults) { + RefPtr<nsDownload> dl; + // Keep trying to add even if we fail one, but make sure to return failure. + // Additionally, be careful to not call anything that tries to change the + // database because we're iterating over a live statement. + if (NS_FAILED(GetDownloadFromDB(stmt->AsInt32(0), getter_AddRefs(dl))) || + NS_FAILED(AddToCurrentDownloads(dl))) + retVal = NS_ERROR_FAILURE; + } + + // Try to resume only the downloads that should auto-resume + rv = ResumeAllDownloads(false); + NS_ENSURE_SUCCESS(rv, rv); + + return retVal; +} + +int64_t +nsDownloadManager::AddDownloadToDB(const nsAString &aName, + const nsACString &aSource, + const nsACString &aTarget, + const nsAString &aTempPath, + int64_t aStartTime, + int64_t aEndTime, + const nsACString &aMimeType, + const nsACString &aPreferredApp, + nsHandlerInfoAction aPreferredAction, + bool aPrivate, + nsACString& aNewGUID) +{ + mozIStorageConnection* dbConn = aPrivate ? mPrivateDBConn : mDBConn; + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = dbConn->CreateStatement(NS_LITERAL_CSTRING( + "INSERT INTO moz_downloads " + "(name, source, target, tempPath, startTime, endTime, state, " + "mimeType, preferredApplication, preferredAction, guid) VALUES " + "(:name, :source, :target, :tempPath, :startTime, :endTime, :state, " + ":mimeType, :preferredApplication, :preferredAction, :guid)"), + getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("name"), aName); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("source"), aSource); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("target"), aTarget); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindStringByName(NS_LITERAL_CSTRING("tempPath"), aTempPath); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("startTime"), aStartTime); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("endTime"), aEndTime); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state"), nsIDownloadManager::DOWNLOAD_NOTSTARTED); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("mimeType"), aMimeType); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("preferredApplication"), aPreferredApp); + NS_ENSURE_SUCCESS(rv, 0); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("preferredAction"), aPreferredAction); + NS_ENSURE_SUCCESS(rv, 0); + + nsAutoCString guid; + rv = GenerateGUID(guid); + NS_ENSURE_SUCCESS(rv, 0); + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), guid); + NS_ENSURE_SUCCESS(rv, 0); + + bool hasMore; + rv = stmt->ExecuteStep(&hasMore); // we want to keep our lock + NS_ENSURE_SUCCESS(rv, 0); + + int64_t id = 0; + rv = dbConn->GetLastInsertRowID(&id); + NS_ENSURE_SUCCESS(rv, 0); + + aNewGUID = guid; + + // lock on DB from statement will be released once we return + return id; +} + +nsresult +nsDownloadManager::InitDB() +{ + nsresult rv = InitPrivateDB(); + NS_ENSURE_SUCCESS(rv, rv); + + rv = InitFileDB(); + NS_ENSURE_SUCCESS(rv, rv); + + rv = InitStatements(mDBConn, getter_AddRefs(mUpdateDownloadStatement), + getter_AddRefs(mGetIdsForURIStatement)); + NS_ENSURE_SUCCESS(rv, rv); + return NS_OK; +} + +nsresult +nsDownloadManager::InitStatements(mozIStorageConnection* aDBConn, + mozIStorageStatement** aUpdateStatement, + mozIStorageStatement** aGetIdsStatement) +{ + nsresult rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "UPDATE moz_downloads " + "SET tempPath = :tempPath, startTime = :startTime, endTime = :endTime, " + "state = :state, referrer = :referrer, entityID = :entityID, " + "currBytes = :currBytes, maxBytes = :maxBytes, autoResume = :autoResume " + "WHERE id = :id"), aUpdateStatement); + NS_ENSURE_SUCCESS(rv, rv); + + rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "SELECT guid " + "FROM moz_downloads " + "WHERE source = :source"), aGetIdsStatement); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +nsresult +nsDownloadManager::Init() +{ + nsresult rv; + + nsCOMPtr<nsIStringBundleService> bundleService = + mozilla::services::GetStringBundleService(); + if (!bundleService) + return NS_ERROR_FAILURE; + + rv = bundleService->CreateBundle(DOWNLOAD_MANAGER_BUNDLE, + getter_AddRefs(mBundle)); + NS_ENSURE_SUCCESS(rv, rv); + +#if !defined(MOZ_JSDOWNLOADS) + // When MOZ_JSDOWNLOADS is undefined, we still check the preference that can + // be used to enable the JavaScript API during the migration process. + mUseJSTransfer = Preferences::GetBool(PREF_BD_USEJSTRANSFER, false); +#else + mUseJSTransfer = true; +#endif + + if (mUseJSTransfer) + return NS_OK; + + // Clean up any old downloads.rdf files from before Firefox 3 + { + nsCOMPtr<nsIFile> oldDownloadsFile; + bool fileExists; + if (NS_SUCCEEDED(NS_GetSpecialDirectory(NS_APP_DOWNLOADS_50_FILE, + getter_AddRefs(oldDownloadsFile))) && + NS_SUCCEEDED(oldDownloadsFile->Exists(&fileExists)) && + fileExists) { + (void)oldDownloadsFile->Remove(false); + } + } + + mObserverService = mozilla::services::GetObserverService(); + if (!mObserverService) + return NS_ERROR_FAILURE; + + rv = InitDB(); + NS_ENSURE_SUCCESS(rv, rv); + +#ifdef DOWNLOAD_SCANNER + mScanner = new nsDownloadScanner(); + if (!mScanner) + return NS_ERROR_OUT_OF_MEMORY; + rv = mScanner->Init(); + if (NS_FAILED(rv)) { + delete mScanner; + mScanner = nullptr; + } +#endif + + // Do things *after* initializing various download manager properties such as + // restoring downloads to a consistent state + rv = RestoreDatabaseState(); + NS_ENSURE_SUCCESS(rv, rv); + + rv = RestoreActiveDownloads(); + NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), + "Failed to restore all active downloads"); + + nsCOMPtr<nsINavHistoryService> history = + do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID); + + (void)mObserverService->NotifyObservers( + static_cast<nsIDownloadManager *>(this), + "download-manager-initialized", + nullptr); + + // The following AddObserver calls must be the last lines in this function, + // because otherwise, this function may fail (and thus, this object would be not + // completely initialized), but the observerservice would still keep a reference + // to us and notify us about shutdown, which may cause crashes. + // failure to add an observer is not critical + (void)mObserverService->AddObserver(this, "quit-application", true); + (void)mObserverService->AddObserver(this, "quit-application-requested", true); + (void)mObserverService->AddObserver(this, "offline-requested", true); + (void)mObserverService->AddObserver(this, "sleep_notification", true); + (void)mObserverService->AddObserver(this, "wake_notification", true); + (void)mObserverService->AddObserver(this, "suspend_process_notification", true); + (void)mObserverService->AddObserver(this, "resume_process_notification", true); + (void)mObserverService->AddObserver(this, "profile-before-change", true); + (void)mObserverService->AddObserver(this, NS_IOSERVICE_GOING_OFFLINE_TOPIC, true); + (void)mObserverService->AddObserver(this, NS_IOSERVICE_OFFLINE_STATUS_TOPIC, true); + (void)mObserverService->AddObserver(this, "last-pb-context-exited", true); + (void)mObserverService->AddObserver(this, "last-pb-context-exiting", true); + + if (history) + (void)history->AddObserver(this, true); + + return NS_OK; +} + +int32_t +nsDownloadManager::GetRetentionBehavior() +{ + // We use 0 as the default, which is "remove when done" + nsresult rv; + nsCOMPtr<nsIPrefBranch> pref = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, 0); + + int32_t val; + rv = pref->GetIntPref(PREF_BDM_RETENTION, &val); + NS_ENSURE_SUCCESS(rv, 0); + + // Allow the Downloads Panel to change the retention behavior. We do this to + // allow proper migration to the new feature when using the same profile on + // multiple versions of the product (bug 697678). Implementation note: in + // order to allow observers to change the retention value, we have to pass an + // object in the aSubject parameter, we cannot use aData for that. + nsCOMPtr<nsISupportsPRInt32> retentionBehavior = + do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID); + retentionBehavior->SetData(val); + (void)mObserverService->NotifyObservers(retentionBehavior, + "download-manager-change-retention", + nullptr); + retentionBehavior->GetData(&val); + + return val; +} + +enum nsDownloadManager::QuitBehavior +nsDownloadManager::GetQuitBehavior() +{ + // We use 0 as the default, which is "remember and resume the download" + nsresult rv; + nsCOMPtr<nsIPrefBranch> pref = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, QUIT_AND_RESUME); + + int32_t val; + rv = pref->GetIntPref(PREF_BDM_QUITBEHAVIOR, &val); + NS_ENSURE_SUCCESS(rv, QUIT_AND_RESUME); + + switch (val) { + case 1: + return QUIT_AND_PAUSE; + case 2: + return QUIT_AND_CANCEL; + default: + return QUIT_AND_RESUME; + } +} + +// Using a globally-unique GUID, search all databases (both private and public). +// A return value of NS_ERROR_NOT_AVAILABLE means no download with the given GUID +// could be found, either private or public. + +nsresult +nsDownloadManager::GetDownloadFromDB(const nsACString& aGUID, nsDownload **retVal) +{ + MOZ_ASSERT(!FindDownload(aGUID), + "If it is a current download, you should not call this method!"); + + NS_NAMED_LITERAL_CSTRING(query, + "SELECT id, state, startTime, source, target, tempPath, name, referrer, " + "entityID, currBytes, maxBytes, mimeType, preferredAction, " + "preferredApplication, autoResume, guid " + "FROM moz_downloads " + "WHERE guid = :guid"); + // First, let's query the database and see if it even exists + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = mDBConn->CreateStatement(query, getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), aGUID); + NS_ENSURE_SUCCESS(rv, rv); + + rv = GetDownloadFromDB(mDBConn, stmt, retVal); + + // If the download cannot be found in the public database, try again + // in the private one. Otherwise, return whatever successful result + // or failure obtained from the public database. + if (rv == NS_ERROR_NOT_AVAILABLE) { + rv = mPrivateDBConn->CreateStatement(query, getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), aGUID); + NS_ENSURE_SUCCESS(rv, rv); + + rv = GetDownloadFromDB(mPrivateDBConn, stmt, retVal); + + // Only if it still cannot be found do we report the failure. + if (rv == NS_ERROR_NOT_AVAILABLE) { + *retVal = nullptr; + } + } + return rv; +} + +nsresult +nsDownloadManager::GetDownloadFromDB(uint32_t aID, nsDownload **retVal) +{ + NS_WARNING("Using integer IDs without compat mode enabled"); + + MOZ_ASSERT(!FindDownload(aID), + "If it is a current download, you should not call this method!"); + + // First, let's query the database and see if it even exists + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "SELECT id, state, startTime, source, target, tempPath, name, referrer, " + "entityID, currBytes, maxBytes, mimeType, preferredAction, " + "preferredApplication, autoResume, guid " + "FROM moz_downloads " + "WHERE id = :id"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), aID); + NS_ENSURE_SUCCESS(rv, rv); + + return GetDownloadFromDB(mDBConn, stmt, retVal); +} + +nsresult +nsDownloadManager::GetDownloadFromDB(mozIStorageConnection* aDBConn, + mozIStorageStatement* stmt, + nsDownload **retVal) +{ + bool hasResults = false; + nsresult rv = stmt->ExecuteStep(&hasResults); + if (NS_FAILED(rv) || !hasResults) + return NS_ERROR_NOT_AVAILABLE; + + // We have a download, so lets create it + RefPtr<nsDownload> dl = new nsDownload(); + if (!dl) + return NS_ERROR_OUT_OF_MEMORY; + dl->mPrivate = aDBConn == mPrivateDBConn; + + dl->mDownloadManager = this; + + int32_t i = 0; + // Setting all properties of the download now + dl->mCancelable = nullptr; + dl->mID = stmt->AsInt64(i++); + dl->mDownloadState = stmt->AsInt32(i++); + dl->mStartTime = stmt->AsInt64(i++); + + nsCString source; + stmt->GetUTF8String(i++, source); + rv = NS_NewURI(getter_AddRefs(dl->mSource), source); + NS_ENSURE_SUCCESS(rv, rv); + + nsCString target; + stmt->GetUTF8String(i++, target); + rv = NS_NewURI(getter_AddRefs(dl->mTarget), target); + NS_ENSURE_SUCCESS(rv, rv); + + nsString tempPath; + stmt->GetString(i++, tempPath); + if (!tempPath.IsEmpty()) { + rv = NS_NewLocalFile(tempPath, true, getter_AddRefs(dl->mTempFile)); + NS_ENSURE_SUCCESS(rv, rv); + } + + stmt->GetString(i++, dl->mDisplayName); + + nsCString referrer; + rv = stmt->GetUTF8String(i++, referrer); + if (NS_SUCCEEDED(rv) && !referrer.IsEmpty()) { + rv = NS_NewURI(getter_AddRefs(dl->mReferrer), referrer); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = stmt->GetUTF8String(i++, dl->mEntityID); + NS_ENSURE_SUCCESS(rv, rv); + + int64_t currBytes = stmt->AsInt64(i++); + int64_t maxBytes = stmt->AsInt64(i++); + dl->SetProgressBytes(currBytes, maxBytes); + + // Build mMIMEInfo only if the mimeType in DB is not empty + nsAutoCString mimeType; + rv = stmt->GetUTF8String(i++, mimeType); + NS_ENSURE_SUCCESS(rv, rv); + + if (!mimeType.IsEmpty()) { + nsCOMPtr<nsIMIMEService> mimeService = + do_GetService(NS_MIMESERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = mimeService->GetFromTypeAndExtension(mimeType, EmptyCString(), + getter_AddRefs(dl->mMIMEInfo)); + NS_ENSURE_SUCCESS(rv, rv); + + nsHandlerInfoAction action = stmt->AsInt32(i++); + rv = dl->mMIMEInfo->SetPreferredAction(action); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString persistentDescriptor; + rv = stmt->GetUTF8String(i++, persistentDescriptor); + NS_ENSURE_SUCCESS(rv, rv); + + if (!persistentDescriptor.IsEmpty()) { + nsCOMPtr<nsILocalHandlerApp> handler = + do_CreateInstance(NS_LOCALHANDLERAPP_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIFile> localExecutable; + rv = NS_NewNativeLocalFile(EmptyCString(), false, + getter_AddRefs(localExecutable)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = localExecutable->SetPersistentDescriptor(persistentDescriptor); + NS_ENSURE_SUCCESS(rv, rv); + + rv = handler->SetExecutable(localExecutable); + NS_ENSURE_SUCCESS(rv, rv); + + rv = dl->mMIMEInfo->SetPreferredApplicationHandler(handler); + NS_ENSURE_SUCCESS(rv, rv); + } + } else { + // Compensate for the i++s skipped in the true block + i += 2; + } + + dl->mAutoResume = + static_cast<enum nsDownload::AutoResume>(stmt->AsInt32(i++)); + + rv = stmt->GetUTF8String(i++, dl->mGUID); + NS_ENSURE_SUCCESS(rv, rv); + + // Handle situations where we load a download from a database that has been + // used in an older version and not gone through the upgrade path (ie. it + // contains empty GUID entries). + if (dl->mGUID.IsEmpty()) { + rv = GenerateGUID(dl->mGUID); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr<mozIStorageStatement> updateStmt; + rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "UPDATE moz_downloads SET guid = :guid " + "WHERE id = :id"), + getter_AddRefs(updateStmt)); + NS_ENSURE_SUCCESS(rv, rv); + rv = updateStmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), dl->mGUID); + NS_ENSURE_SUCCESS(rv, rv); + rv = updateStmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), dl->mID); + NS_ENSURE_SUCCESS(rv, rv); + rv = updateStmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Addrefing and returning + dl.forget(retVal); + return NS_OK; +} + +nsresult +nsDownloadManager::AddToCurrentDownloads(nsDownload *aDl) +{ + nsCOMArray<nsDownload>& currentDownloads = + aDl->mPrivate ? mCurrentPrivateDownloads : mCurrentDownloads; + if (!currentDownloads.AppendObject(aDl)) + return NS_ERROR_OUT_OF_MEMORY; + + aDl->mDownloadManager = this; + return NS_OK; +} + +void +nsDownloadManager::SendEvent(nsDownload *aDownload, const char *aTopic) +{ + (void)mObserverService->NotifyObservers(aDownload, aTopic, nullptr); +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIDownloadManager + +NS_IMETHODIMP +nsDownloadManager::GetActivePrivateDownloadCount(int32_t* aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + *aResult = mCurrentPrivateDownloads.Count(); + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::GetActiveDownloadCount(int32_t *aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + *aResult = mCurrentDownloads.Count(); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::GetActiveDownloads(nsISimpleEnumerator **aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return NS_NewArrayEnumerator(aResult, mCurrentDownloads); +} + +NS_IMETHODIMP +nsDownloadManager::GetActivePrivateDownloads(nsISimpleEnumerator **aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return NS_NewArrayEnumerator(aResult, mCurrentPrivateDownloads); +} + +/** + * For platforms where helper apps use the downloads directory (i.e. mobile), + * this should be kept in sync with nsExternalHelperAppService.cpp + */ +NS_IMETHODIMP +nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult) +{ + nsCOMPtr<nsIFile> downloadDir; + + nsresult rv; + nsCOMPtr<nsIProperties> dirService = + do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + // OSX 10.4: + // Desktop + // OSX 10.5: + // User download directory + // Vista: + // Downloads + // XP/2K: + // My Documents/Downloads + // Linux: + // XDG user dir spec, with a fallback to Home/Downloads + + nsXPIDLString folderName; + mBundle->GetStringFromName(u"downloadsFolder", + getter_Copies(folderName)); + +#if defined (XP_MACOSX) + rv = dirService->Get(NS_OSX_DEFAULT_DOWNLOAD_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); +#elif defined(XP_WIN) + rv = dirService->Get(NS_WIN_DEFAULT_DOWNLOAD_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + + // Check the os version + nsCOMPtr<nsIPropertyBag2> infoService = + do_GetService(NS_SYSTEMINFO_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + int32_t version; + NS_NAMED_LITERAL_STRING(osVersion, "version"); + rv = infoService->GetPropertyAsInt32(osVersion, &version); + NS_ENSURE_SUCCESS(rv, rv); + if (version < 6) { // XP/2K + // First get "My Documents" + rv = dirService->Get(NS_WIN_PERSONAL_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = downloadDir->Append(folderName); + NS_ENSURE_SUCCESS(rv, rv); + + // This could be the first time we are creating the downloads folder in My + // Documents, so make sure it exists. + bool exists; + rv = downloadDir->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + if (!exists) { + rv = downloadDir->Create(nsIFile::DIRECTORY_TYPE, 0755); + NS_ENSURE_SUCCESS(rv, rv); + } + } +#elif defined(XP_UNIX) +#if defined(MOZ_WIDGET_ANDROID) + // Android doesn't have a $HOME directory, and by default we only have + // write access to /data/data/org.mozilla.{$APP} and /sdcard + char* downloadDirPath = getenv("DOWNLOADS_DIRECTORY"); + if (downloadDirPath) { + rv = NS_NewNativeLocalFile(nsDependentCString(downloadDirPath), + true, getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + } + else { + rv = NS_ERROR_FAILURE; + } +#else + rv = dirService->Get(NS_UNIX_DEFAULT_DOWNLOAD_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + // fallback to Home/Downloads + if (NS_FAILED(rv)) { + rv = dirService->Get(NS_UNIX_HOME_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + rv = downloadDir->Append(folderName); + NS_ENSURE_SUCCESS(rv, rv); + } +#endif +#else + rv = dirService->Get(NS_OS_HOME_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + rv = downloadDir->Append(folderName); + NS_ENSURE_SUCCESS(rv, rv); +#endif + + downloadDir.forget(aResult); + + return NS_OK; +} + +#define NS_BRANCH_DOWNLOAD "browser.download." +#define NS_PREF_FOLDERLIST "folderList" +#define NS_PREF_DIR "dir" + +NS_IMETHODIMP +nsDownloadManager::GetUserDownloadsDirectory(nsIFile **aResult) +{ + nsresult rv; + nsCOMPtr<nsIProperties> dirService = + do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIPrefService> prefService = + do_GetService(NS_PREFSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIPrefBranch> prefBranch; + rv = prefService->GetBranch(NS_BRANCH_DOWNLOAD, + getter_AddRefs(prefBranch)); + NS_ENSURE_SUCCESS(rv, rv); + + int32_t val; + rv = prefBranch->GetIntPref(NS_PREF_FOLDERLIST, + &val); + NS_ENSURE_SUCCESS(rv, rv); + + switch(val) { + case 0: // Desktop + { + nsCOMPtr<nsIFile> downloadDir; + rv = dirService->Get(NS_OS_DESKTOP_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(downloadDir)); + NS_ENSURE_SUCCESS(rv, rv); + downloadDir.forget(aResult); + return NS_OK; + } + break; + case 1: // Downloads + return GetDefaultDownloadsDirectory(aResult); + case 2: // Custom + { + nsCOMPtr<nsIFile> customDirectory; + prefBranch->GetComplexValue(NS_PREF_DIR, + NS_GET_IID(nsIFile), + getter_AddRefs(customDirectory)); + if (customDirectory) { + bool exists = false; + (void)customDirectory->Exists(&exists); + + if (!exists) { + rv = customDirectory->Create(nsIFile::DIRECTORY_TYPE, 0755); + if (NS_SUCCEEDED(rv)) { + customDirectory.forget(aResult); + return NS_OK; + } + + // Create failed, so it still doesn't exist. Fall out and get the + // default downloads directory. + } + + bool writable = false; + bool directory = false; + (void)customDirectory->IsWritable(&writable); + (void)customDirectory->IsDirectory(&directory); + + if (exists && writable && directory) { + customDirectory.forget(aResult); + return NS_OK; + } + } + rv = GetDefaultDownloadsDirectory(aResult); + if (NS_SUCCEEDED(rv)) { + (void)prefBranch->SetComplexValue(NS_PREF_DIR, + NS_GET_IID(nsIFile), + *aResult); + } + return rv; + } + break; + } + return NS_ERROR_INVALID_ARG; +} + +NS_IMETHODIMP +nsDownloadManager::AddDownload(DownloadType aDownloadType, + nsIURI *aSource, + nsIURI *aTarget, + const nsAString& aDisplayName, + nsIMIMEInfo *aMIMEInfo, + PRTime aStartTime, + nsIFile *aTempFile, + nsICancelable *aCancelable, + bool aIsPrivate, + nsIDownload **aDownload) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_ENSURE_ARG_POINTER(aSource); + NS_ENSURE_ARG_POINTER(aTarget); + NS_ENSURE_ARG_POINTER(aDownload); + + nsresult rv; + + // target must be on the local filesystem + nsCOMPtr<nsIFileURL> targetFileURL = do_QueryInterface(aTarget, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIFile> targetFile; + rv = targetFileURL->GetFile(getter_AddRefs(targetFile)); + NS_ENSURE_SUCCESS(rv, rv); + + RefPtr<nsDownload> dl = new nsDownload(); + if (!dl) + return NS_ERROR_OUT_OF_MEMORY; + + // give our new nsIDownload some info so it's ready to go off into the world + dl->mTarget = aTarget; + dl->mSource = aSource; + dl->mTempFile = aTempFile; + dl->mPrivate = aIsPrivate; + + dl->mDisplayName = aDisplayName; + if (dl->mDisplayName.IsEmpty()) + targetFile->GetLeafName(dl->mDisplayName); + + dl->mMIMEInfo = aMIMEInfo; + dl->SetStartTime(aStartTime == 0 ? PR_Now() : aStartTime); + + // Creates a cycle that will be broken when the download finishes + dl->mCancelable = aCancelable; + + // Adding to the DB + nsAutoCString source, target; + rv = aSource->GetSpec(source); + NS_ENSURE_SUCCESS(rv, rv); + rv = aTarget->GetSpec(target); + NS_ENSURE_SUCCESS(rv, rv); + + // Track the temp file for exthandler downloads + nsAutoString tempPath; + if (aTempFile) + aTempFile->GetPath(tempPath); + + // Break down MIMEInfo but don't panic if we can't get all the pieces - we + // can still download the file + nsAutoCString persistentDescriptor, mimeType; + nsHandlerInfoAction action = nsIMIMEInfo::saveToDisk; + if (aMIMEInfo) { + (void)aMIMEInfo->GetType(mimeType); + + nsCOMPtr<nsIHandlerApp> handlerApp; + (void)aMIMEInfo->GetPreferredApplicationHandler(getter_AddRefs(handlerApp)); + nsCOMPtr<nsILocalHandlerApp> locHandlerApp = do_QueryInterface(handlerApp); + + if (locHandlerApp) { + nsCOMPtr<nsIFile> executable; + (void)locHandlerApp->GetExecutable(getter_AddRefs(executable)); + Unused << executable->GetPersistentDescriptor(persistentDescriptor); + } + + (void)aMIMEInfo->GetPreferredAction(&action); + } + + int64_t id = AddDownloadToDB(dl->mDisplayName, source, target, tempPath, + dl->mStartTime, dl->mLastUpdate, + mimeType, persistentDescriptor, action, + dl->mPrivate, dl->mGUID /* outparam */); + NS_ENSURE_TRUE(id, NS_ERROR_FAILURE); + dl->mID = id; + + rv = AddToCurrentDownloads(dl); + (void)dl->SetState(nsIDownloadManager::DOWNLOAD_QUEUED); + NS_ENSURE_SUCCESS(rv, rv); + +#ifdef DOWNLOAD_SCANNER + if (mScanner) { + bool scan = true; + nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (prefs) { + (void)prefs->GetBoolPref(PREF_BDM_SCANWHENDONE, &scan); + } + // We currently apply local security policy to downloads when we scan + // via windows all-in-one download security api. The CheckPolicy call + // below is a pre-emptive part of that process. So tie applying security + // zone policy settings when downloads are intiated to the same pref + // that triggers applying security zone policy settings after a download + // completes. (bug 504804) + if (scan) { + AVCheckPolicyState res = mScanner->CheckPolicy(aSource, aTarget); + if (res == AVPOLICY_BLOCKED) { + // This download will get deleted during a call to IAE's Save, + // so go ahead and mark it as blocked and avoid the download. + (void)CancelDownload(id); + (void)dl->SetState(nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY); + } + } + } +#endif + + // Check with parental controls to see if file downloads + // are allowed for this user. If not allowed, cancel the + // download and mark its state as being blocked. + nsCOMPtr<nsIParentalControlsService> pc = + do_CreateInstance(NS_PARENTALCONTROLSSERVICE_CONTRACTID); + if (pc) { + bool enabled = false; + (void)pc->GetBlockFileDownloadsEnabled(&enabled); + if (enabled) { + (void)CancelDownload(id); + (void)dl->SetState(nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL); + } + + // Log the event if required by pc settings. + bool logEnabled = false; + (void)pc->GetLoggingEnabled(&logEnabled); + if (logEnabled) { + (void)pc->Log(nsIParentalControlsService::ePCLog_FileDownload, + enabled, + aSource, + nullptr); + } + } + + dl.forget(aDownload); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::GetDownload(uint32_t aID, nsIDownload **aDownloadItem) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + nsDownload *itm = FindDownload(aID); + + RefPtr<nsDownload> dl; + if (!itm) { + nsresult rv = GetDownloadFromDB(aID, getter_AddRefs(dl)); + NS_ENSURE_SUCCESS(rv, rv); + + itm = dl.get(); + } + + NS_ADDREF(*aDownloadItem = itm); + + return NS_OK; +} + +namespace { +class AsyncResult : public Runnable +{ +public: + AsyncResult(nsresult aStatus, nsIDownload* aResult, + nsIDownloadManagerResult* aCallback) + : mStatus(aStatus), mResult(aResult), mCallback(aCallback) + { + } + + NS_IMETHOD Run() override + { + mCallback->HandleResult(mStatus, mResult); + return NS_OK; + } + +private: + nsresult mStatus; + nsCOMPtr<nsIDownload> mResult; + nsCOMPtr<nsIDownloadManagerResult> mCallback; +}; +} // namespace + +NS_IMETHODIMP +nsDownloadManager::GetDownloadByGUID(const nsACString& aGUID, + nsIDownloadManagerResult* aCallback) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + nsDownload *itm = FindDownload(aGUID); + + nsresult rv = NS_OK; + RefPtr<nsDownload> dl; + if (!itm) { + rv = GetDownloadFromDB(aGUID, getter_AddRefs(dl)); + itm = dl.get(); + } + + RefPtr<AsyncResult> runnable = new AsyncResult(rv, itm, aCallback); + NS_DispatchToMainThread(runnable); + return NS_OK; +} + +nsDownload * +nsDownloadManager::FindDownload(uint32_t aID) +{ + // we shouldn't ever have many downloads, so we can loop over them + for (int32_t i = mCurrentDownloads.Count() - 1; i >= 0; --i) { + nsDownload *dl = mCurrentDownloads[i]; + if (dl->mID == aID) + return dl; + } + + return nullptr; +} + +nsDownload * +nsDownloadManager::FindDownload(const nsACString& aGUID) +{ + // we shouldn't ever have many downloads, so we can loop over them + for (int32_t i = mCurrentDownloads.Count() - 1; i >= 0; --i) { + nsDownload *dl = mCurrentDownloads[i]; + if (dl->mGUID == aGUID) + return dl; + } + + for (int32_t i = mCurrentPrivateDownloads.Count() - 1; i >= 0; --i) { + nsDownload *dl = mCurrentPrivateDownloads[i]; + if (dl->mGUID == aGUID) + return dl; + } + + return nullptr; +} + +NS_IMETHODIMP +nsDownloadManager::CancelDownload(uint32_t aID) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + // We AddRef here so we don't lose access to member variables when we remove + RefPtr<nsDownload> dl = FindDownload(aID); + + // if it's null, someone passed us a bad id. + if (!dl) + return NS_ERROR_FAILURE; + + return dl->Cancel(); +} + +nsresult +nsDownloadManager::RetryDownload(const nsACString& aGUID) +{ + RefPtr<nsDownload> dl; + nsresult rv = GetDownloadFromDB(aGUID, getter_AddRefs(dl)); + NS_ENSURE_SUCCESS(rv, rv); + + return RetryDownload(dl); +} + +NS_IMETHODIMP +nsDownloadManager::RetryDownload(uint32_t aID) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + RefPtr<nsDownload> dl; + nsresult rv = GetDownloadFromDB(aID, getter_AddRefs(dl)); + NS_ENSURE_SUCCESS(rv, rv); + + return RetryDownload(dl); +} + +nsresult +nsDownloadManager::RetryDownload(nsDownload* dl) +{ + // if our download is not canceled or failed, we should fail + if (dl->mDownloadState != nsIDownloadManager::DOWNLOAD_FAILED && + dl->mDownloadState != nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL && + dl->mDownloadState != nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY && + dl->mDownloadState != nsIDownloadManager::DOWNLOAD_DIRTY && + dl->mDownloadState != nsIDownloadManager::DOWNLOAD_CANCELED) + return NS_ERROR_FAILURE; + + // If the download has failed and is resumable then we first try resuming it + nsresult rv; + if (dl->mDownloadState == nsIDownloadManager::DOWNLOAD_FAILED && dl->IsResumable()) { + rv = dl->Resume(); + if (NS_SUCCEEDED(rv)) + return rv; + } + + // reset time and download progress + dl->SetStartTime(PR_Now()); + dl->SetProgressBytes(0, -1); + + nsCOMPtr<nsIWebBrowserPersist> wbp = + do_CreateInstance("@mozilla.org/embedding/browser/nsWebBrowserPersist;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = wbp->SetPersistFlags(nsIWebBrowserPersist::PERSIST_FLAGS_REPLACE_EXISTING_FILES | + nsIWebBrowserPersist::PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION); + NS_ENSURE_SUCCESS(rv, rv); + + rv = AddToCurrentDownloads(dl); + NS_ENSURE_SUCCESS(rv, rv); + + rv = dl->SetState(nsIDownloadManager::DOWNLOAD_QUEUED); + NS_ENSURE_SUCCESS(rv, rv); + + // Creates a cycle that will be broken when the download finishes + dl->mCancelable = wbp; + (void)wbp->SetProgressListener(dl); + + // referrer policy can be anything since referrer is nullptr + rv = wbp->SavePrivacyAwareURI(dl->mSource, nullptr, + nullptr, mozilla::net::RP_Default, + nullptr, nullptr, + dl->mTarget, dl->mPrivate); + if (NS_FAILED(rv)) { + dl->mCancelable = nullptr; + (void)wbp->SetProgressListener(nullptr); + return rv; + } + + return NS_OK; +} + +static nsresult +RemoveDownloadByGUID(const nsACString& aGUID, mozIStorageConnection* aDBConn) +{ + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "DELETE FROM moz_downloads " + "WHERE guid = :guid"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("guid"), aGUID); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +nsresult +nsDownloadManager::RemoveDownload(const nsACString& aGUID) +{ + RefPtr<nsDownload> dl = FindDownload(aGUID); + MOZ_ASSERT(!dl, "Can't call RemoveDownload on a download in progress!"); + if (dl) + return NS_ERROR_FAILURE; + + nsresult rv = GetDownloadFromDB(aGUID, getter_AddRefs(dl)); + NS_ENSURE_SUCCESS(rv, rv); + + if (dl->mPrivate) { + RemoveDownloadByGUID(aGUID, mPrivateDBConn); + } else { + RemoveDownloadByGUID(aGUID, mDBConn); + } + + return NotifyDownloadRemoval(dl); +} + +NS_IMETHODIMP +nsDownloadManager::RemoveDownload(uint32_t aID) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + RefPtr<nsDownload> dl = FindDownload(aID); + MOZ_ASSERT(!dl, "Can't call RemoveDownload on a download in progress!"); + if (dl) + return NS_ERROR_FAILURE; + + nsresult rv = GetDownloadFromDB(aID, getter_AddRefs(dl)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<mozIStorageStatement> stmt; + rv = mDBConn->CreateStatement(NS_LITERAL_CSTRING( + "DELETE FROM moz_downloads " + "WHERE id = :id"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), aID); // unsigned; 64-bit to prevent overflow + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + // Notify the UI with the topic and download id + return NotifyDownloadRemoval(dl); +} + +nsresult +nsDownloadManager::NotifyDownloadRemoval(nsDownload* aRemoved) +{ + nsCOMPtr<nsISupportsPRUint32> id; + nsCOMPtr<nsISupportsCString> guid; + nsresult rv; + + // Only send an integer ID notification if the download is public. + bool sendDeprecatedNotification = !(aRemoved && aRemoved->mPrivate); + + if (sendDeprecatedNotification && aRemoved) { + id = do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + uint32_t dlID; + rv = aRemoved->GetId(&dlID); + NS_ENSURE_SUCCESS(rv, rv); + rv = id->SetData(dlID); + NS_ENSURE_SUCCESS(rv, rv); + } + + if (sendDeprecatedNotification) { + mObserverService->NotifyObservers(id, + "download-manager-remove-download", + nullptr); + } + + if (aRemoved) { + guid = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + nsAutoCString guidStr; + rv = aRemoved->GetGuid(guidStr); + NS_ENSURE_SUCCESS(rv, rv); + rv = guid->SetData(guidStr); + NS_ENSURE_SUCCESS(rv, rv); + } + + mObserverService->NotifyObservers(guid, + "download-manager-remove-download-guid", + nullptr); + return NS_OK; +} + +static nsresult +DoRemoveDownloadsByTimeframe(mozIStorageConnection* aDBConn, + int64_t aStartTime, + int64_t aEndTime) +{ + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "DELETE FROM moz_downloads " + "WHERE startTime >= :startTime " + "AND startTime <= :endTime " + "AND state NOT IN (:downloading, :paused, :queued)"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + + // Bind the times + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("startTime"), aStartTime); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("endTime"), aEndTime); + NS_ENSURE_SUCCESS(rv, rv); + + // Bind the active states + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("downloading"), nsIDownloadManager::DOWNLOAD_DOWNLOADING); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("paused"), nsIDownloadManager::DOWNLOAD_PAUSED); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("queued"), nsIDownloadManager::DOWNLOAD_QUEUED); + NS_ENSURE_SUCCESS(rv, rv); + + // Execute + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::RemoveDownloadsByTimeframe(int64_t aStartTime, + int64_t aEndTime) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + nsresult rv = DoRemoveDownloadsByTimeframe(mDBConn, aStartTime, aEndTime); + nsresult rv2 = DoRemoveDownloadsByTimeframe(mPrivateDBConn, aStartTime, aEndTime); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv2, rv2); + + // Notify the UI with the topic and null subject to indicate "remove multiple" + return NotifyDownloadRemoval(nullptr); +} + +NS_IMETHODIMP +nsDownloadManager::CleanUp() +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return CleanUp(mDBConn); +} + +NS_IMETHODIMP +nsDownloadManager::CleanUpPrivate() +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return CleanUp(mPrivateDBConn); +} + +nsresult +nsDownloadManager::CleanUp(mozIStorageConnection* aDBConn) +{ + DownloadState states[] = { nsIDownloadManager::DOWNLOAD_FINISHED, + nsIDownloadManager::DOWNLOAD_FAILED, + nsIDownloadManager::DOWNLOAD_CANCELED, + nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL, + nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY, + nsIDownloadManager::DOWNLOAD_DIRTY }; + + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "DELETE FROM moz_downloads " + "WHERE state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ?"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, rv); + for (uint32_t i = 0; i < ArrayLength(states); ++i) { + rv = stmt->BindInt32ByIndex(i, states[i]); + NS_ENSURE_SUCCESS(rv, rv); + } + + rv = stmt->Execute(); + NS_ENSURE_SUCCESS(rv, rv); + + // Notify the UI with the topic and null subject to indicate "remove multiple" + return NotifyDownloadRemoval(nullptr); +} + +static nsresult +DoGetCanCleanUp(mozIStorageConnection* aDBConn, bool *aResult) +{ + // This method should never return anything but NS_OK for the benefit of + // unwitting consumers. + + *aResult = false; + + DownloadState states[] = { nsIDownloadManager::DOWNLOAD_FINISHED, + nsIDownloadManager::DOWNLOAD_FAILED, + nsIDownloadManager::DOWNLOAD_CANCELED, + nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL, + nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY, + nsIDownloadManager::DOWNLOAD_DIRTY }; + + nsCOMPtr<mozIStorageStatement> stmt; + nsresult rv = aDBConn->CreateStatement(NS_LITERAL_CSTRING( + "SELECT COUNT(*) " + "FROM moz_downloads " + "WHERE state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ? " + "OR state = ?"), getter_AddRefs(stmt)); + NS_ENSURE_SUCCESS(rv, NS_OK); + for (uint32_t i = 0; i < ArrayLength(states); ++i) { + rv = stmt->BindInt32ByIndex(i, states[i]); + NS_ENSURE_SUCCESS(rv, NS_OK); + } + + bool moreResults; // We don't really care... + rv = stmt->ExecuteStep(&moreResults); + NS_ENSURE_SUCCESS(rv, NS_OK); + + int32_t count; + rv = stmt->GetInt32(0, &count); + NS_ENSURE_SUCCESS(rv, NS_OK); + + if (count > 0) + *aResult = true; + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::GetCanCleanUp(bool *aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return DoGetCanCleanUp(mDBConn, aResult); +} + +NS_IMETHODIMP +nsDownloadManager::GetCanCleanUpPrivate(bool *aResult) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + return DoGetCanCleanUp(mPrivateDBConn, aResult); +} + +NS_IMETHODIMP +nsDownloadManager::PauseDownload(uint32_t aID) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + nsDownload *dl = FindDownload(aID); + if (!dl) + return NS_ERROR_FAILURE; + + return dl->Pause(); +} + +NS_IMETHODIMP +nsDownloadManager::ResumeDownload(uint32_t aID) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_WARNING("Using integer IDs without compat mode enabled"); + + nsDownload *dl = FindDownload(aID); + if (!dl) + return NS_ERROR_FAILURE; + + return dl->Resume(); +} + +NS_IMETHODIMP +nsDownloadManager::GetDBConnection(mozIStorageConnection **aDBConn) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_ADDREF(*aDBConn = mDBConn); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::GetPrivateDBConnection(mozIStorageConnection **aDBConn) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + NS_ADDREF(*aDBConn = mPrivateDBConn); + + return NS_OK; + } + +NS_IMETHODIMP +nsDownloadManager::AddListener(nsIDownloadProgressListener *aListener) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + mListeners.AppendObject(aListener); + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::AddPrivacyAwareListener(nsIDownloadProgressListener *aListener) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + mPrivacyAwareListeners.AppendObject(aListener); + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::RemoveListener(nsIDownloadProgressListener *aListener) +{ + NS_ENSURE_STATE(!mUseJSTransfer); + + mListeners.RemoveObject(aListener); + mPrivacyAwareListeners.RemoveObject(aListener); + return NS_OK; +} + +void +nsDownloadManager::NotifyListenersOnDownloadStateChange(int16_t aOldState, + nsDownload *aDownload) +{ + for (int32_t i = mPrivacyAwareListeners.Count() - 1; i >= 0; --i) { + mPrivacyAwareListeners[i]->OnDownloadStateChange(aOldState, aDownload); + } + + // Only privacy-aware listeners should receive notifications about private + // downloads, while non-privacy-aware listeners receive no sign they exist. + if (aDownload->mPrivate) { + return; + } + + for (int32_t i = mListeners.Count() - 1; i >= 0; --i) { + mListeners[i]->OnDownloadStateChange(aOldState, aDownload); + } +} + +void +nsDownloadManager::NotifyListenersOnProgressChange(nsIWebProgress *aProgress, + nsIRequest *aRequest, + int64_t aCurSelfProgress, + int64_t aMaxSelfProgress, + int64_t aCurTotalProgress, + int64_t aMaxTotalProgress, + nsDownload *aDownload) +{ + for (int32_t i = mPrivacyAwareListeners.Count() - 1; i >= 0; --i) { + mPrivacyAwareListeners[i]->OnProgressChange(aProgress, aRequest, aCurSelfProgress, + aMaxSelfProgress, aCurTotalProgress, + aMaxTotalProgress, aDownload); + } + + // Only privacy-aware listeners should receive notifications about private + // downloads, while non-privacy-aware listeners receive no sign they exist. + if (aDownload->mPrivate) { + return; + } + + for (int32_t i = mListeners.Count() - 1; i >= 0; --i) { + mListeners[i]->OnProgressChange(aProgress, aRequest, aCurSelfProgress, + aMaxSelfProgress, aCurTotalProgress, + aMaxTotalProgress, aDownload); + } +} + +void +nsDownloadManager::NotifyListenersOnStateChange(nsIWebProgress *aProgress, + nsIRequest *aRequest, + uint32_t aStateFlags, + nsresult aStatus, + nsDownload *aDownload) +{ + for (int32_t i = mPrivacyAwareListeners.Count() - 1; i >= 0; --i) { + mPrivacyAwareListeners[i]->OnStateChange(aProgress, aRequest, aStateFlags, aStatus, + aDownload); + } + + // Only privacy-aware listeners should receive notifications about private + // downloads, while non-privacy-aware listeners receive no sign they exist. + if (aDownload->mPrivate) { + return; + } + + for (int32_t i = mListeners.Count() - 1; i >= 0; --i) { + mListeners[i]->OnStateChange(aProgress, aRequest, aStateFlags, aStatus, + aDownload); + } +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsINavHistoryObserver + +NS_IMETHODIMP +nsDownloadManager::OnBeginUpdateBatch() +{ + // This method in not normally invoked when mUseJSTransfer is enabled, however + // we provide an extra check in case it is called manually by add-ons. + NS_ENSURE_STATE(!mUseJSTransfer); + + // We already have a transaction, so don't make another + if (mHistoryTransaction) + return NS_OK; + + // Start a transaction that commits when deleted + mHistoryTransaction = new mozStorageTransaction(mDBConn, true); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnEndUpdateBatch() +{ + // Get rid of the transaction and cause it to commit + mHistoryTransaction = nullptr; + + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnVisit(nsIURI *aURI, int64_t aVisitID, PRTime aTime, + int64_t aSessionID, int64_t aReferringID, + uint32_t aTransitionType, const nsACString& aGUID, + bool aHidden, uint32_t aVisitCount, uint32_t aTyped) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnTitleChanged(nsIURI *aURI, + const nsAString &aPageTitle, + const nsACString &aGUID) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnFrecencyChanged(nsIURI* aURI, + int32_t aNewFrecency, + const nsACString& aGUID, + bool aHidden, + PRTime aLastVisitDate) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnManyFrecenciesChanged() +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnDeleteURI(nsIURI *aURI, + const nsACString& aGUID, + uint16_t aReason) +{ + // This method in not normally invoked when mUseJSTransfer is enabled, however + // we provide an extra check in case it is called manually by add-ons. + NS_ENSURE_STATE(!mUseJSTransfer); + + nsresult rv = RemoveDownloadsForURI(mGetIdsForURIStatement, aURI); + nsresult rv2 = RemoveDownloadsForURI(mGetPrivateIdsForURIStatement, aURI); + NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv2, rv2); + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnClearHistory() +{ + return CleanUp(); +} + +NS_IMETHODIMP +nsDownloadManager::OnPageChanged(nsIURI *aURI, + uint32_t aChangedAttribute, + const nsAString& aNewValue, + const nsACString &aGUID) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownloadManager::OnDeleteVisits(nsIURI *aURI, PRTime aVisitTime, + const nsACString& aGUID, + uint16_t aReason, uint32_t aTransitionType) +{ + // Don't bother removing downloads until the page is removed. + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIObserver + +NS_IMETHODIMP +nsDownloadManager::Observe(nsISupports *aSubject, + const char *aTopic, + const char16_t *aData) +{ + // This method in not normally invoked when mUseJSTransfer is enabled, however + // we provide an extra check in case it is called manually by add-ons. + NS_ENSURE_STATE(!mUseJSTransfer); + + // We need to count the active public downloads that could be lost + // by quitting, and add any active private ones as well, since per-window + // private browsing may be active. + int32_t currDownloadCount = mCurrentDownloads.Count(); + + // If we don't need to cancel all the downloads on quit, only count the ones + // that aren't resumable. + if (GetQuitBehavior() != QUIT_AND_CANCEL) { + for (int32_t i = currDownloadCount - 1; i >= 0; --i) { + if (mCurrentDownloads[i]->IsResumable()) { + currDownloadCount--; + } + } + + // We have a count of the public, non-resumable downloads. Now we need + // to add the total number of private downloads, since they are in danger + // of being lost. + currDownloadCount += mCurrentPrivateDownloads.Count(); + } + + nsresult rv; + if (strcmp(aTopic, "oncancel") == 0) { + nsCOMPtr<nsIDownload> dl = do_QueryInterface(aSubject, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + dl->Cancel(); + } else if (strcmp(aTopic, "profile-before-change") == 0) { + CloseAllDBs(); + } else if (strcmp(aTopic, "quit-application") == 0) { + // Try to pause all downloads and, if appropriate, mark them as auto-resume + // unless user has specified that downloads should be canceled + enum QuitBehavior behavior = GetQuitBehavior(); + if (behavior != QUIT_AND_CANCEL) + (void)PauseAllDownloads(bool(behavior != QUIT_AND_PAUSE)); + + // Remove downloads to break cycles and cancel downloads + (void)RemoveAllDownloads(); + + // Now that active downloads have been canceled, remove all completed or + // aborted downloads if the user's retention policy specifies it. + if (GetRetentionBehavior() == 1) + CleanUp(); + } else if (strcmp(aTopic, "quit-application-requested") == 0 && + currDownloadCount) { + nsCOMPtr<nsISupportsPRBool> cancelDownloads = + do_QueryInterface(aSubject, &rv); + NS_ENSURE_SUCCESS(rv, rv); +#ifndef XP_MACOSX + ConfirmCancelDownloads(currDownloadCount, cancelDownloads, + u"quitCancelDownloadsAlertTitle", + u"quitCancelDownloadsAlertMsgMultiple", + u"quitCancelDownloadsAlertMsg", + u"dontQuitButtonWin"); +#else + ConfirmCancelDownloads(currDownloadCount, cancelDownloads, + u"quitCancelDownloadsAlertTitle", + u"quitCancelDownloadsAlertMsgMacMultiple", + u"quitCancelDownloadsAlertMsgMac", + u"dontQuitButtonMac"); +#endif + } else if (strcmp(aTopic, "offline-requested") == 0 && currDownloadCount) { + nsCOMPtr<nsISupportsPRBool> cancelDownloads = + do_QueryInterface(aSubject, &rv); + NS_ENSURE_SUCCESS(rv, rv); + ConfirmCancelDownloads(currDownloadCount, cancelDownloads, + u"offlineCancelDownloadsAlertTitle", + u"offlineCancelDownloadsAlertMsgMultiple", + u"offlineCancelDownloadsAlertMsg", + u"dontGoOfflineButton"); + } + else if (strcmp(aTopic, NS_IOSERVICE_GOING_OFFLINE_TOPIC) == 0) { + // Pause all downloads, and mark them to auto-resume. + (void)PauseAllDownloads(true); + } + else if (strcmp(aTopic, NS_IOSERVICE_OFFLINE_STATUS_TOPIC) == 0 && + nsDependentString(aData).EqualsLiteral(NS_IOSERVICE_ONLINE)) { + // We can now resume all downloads that are supposed to auto-resume. + (void)ResumeAllDownloads(false); + } + else if (strcmp(aTopic, "alertclickcallback") == 0) { + nsCOMPtr<nsIDownloadManagerUI> dmui = + do_GetService("@mozilla.org/download-manager-ui;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + return dmui->Show(nullptr, nullptr, nsIDownloadManagerUI::REASON_USER_INTERACTED, + aData && NS_strcmp(aData, u"private") == 0); + } else if (strcmp(aTopic, "sleep_notification") == 0 || + strcmp(aTopic, "suspend_process_notification") == 0) { + // Pause downloads if we're sleeping, and mark the downloads as auto-resume + (void)PauseAllDownloads(true); + } else if (strcmp(aTopic, "wake_notification") == 0 || + strcmp(aTopic, "resume_process_notification") == 0) { + int32_t resumeOnWakeDelay = 10000; + nsCOMPtr<nsIPrefBranch> pref = do_GetService(NS_PREFSERVICE_CONTRACTID); + if (pref) + (void)pref->GetIntPref(PREF_BDM_RESUMEONWAKEDELAY, &resumeOnWakeDelay); + + // Wait a little bit before trying to resume to avoid resuming when network + // connections haven't restarted yet + mResumeOnWakeTimer = do_CreateInstance("@mozilla.org/timer;1"); + if (resumeOnWakeDelay >= 0 && mResumeOnWakeTimer) { + (void)mResumeOnWakeTimer->InitWithFuncCallback(ResumeOnWakeCallback, + this, resumeOnWakeDelay, nsITimer::TYPE_ONE_SHOT); + } + } else if (strcmp(aTopic, "last-pb-context-exited") == 0) { + // Upon leaving private browsing mode, cancel all private downloads, + // remove all trace of them, and then blow away the private database + // and recreate a blank one. + RemoveAllDownloads(mCurrentPrivateDownloads); + InitPrivateDB(); + } else if (strcmp(aTopic, "last-pb-context-exiting") == 0) { + // If there are active private downloads, prompt the user to confirm leaving + // private browsing mode (thereby cancelling them). Otherwise, silently proceed. + if (!mCurrentPrivateDownloads.Count()) + return NS_OK; + + nsCOMPtr<nsISupportsPRBool> cancelDownloads = do_QueryInterface(aSubject, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + ConfirmCancelDownloads(mCurrentPrivateDownloads.Count(), cancelDownloads, + u"leavePrivateBrowsingCancelDownloadsAlertTitle", + u"leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2", + u"leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2", + u"dontLeavePrivateBrowsingButton2"); + } + + return NS_OK; +} + +void +nsDownloadManager::ConfirmCancelDownloads(int32_t aCount, + nsISupportsPRBool *aCancelDownloads, + const char16_t *aTitle, + const char16_t *aCancelMessageMultiple, + const char16_t *aCancelMessageSingle, + const char16_t *aDontCancelButton) +{ + // If user has already dismissed quit request, then do nothing + bool quitRequestCancelled = false; + aCancelDownloads->GetData(&quitRequestCancelled); + if (quitRequestCancelled) + return; + + nsXPIDLString title, message, quitButton, dontQuitButton; + + mBundle->GetStringFromName(aTitle, getter_Copies(title)); + + nsAutoString countString; + countString.AppendInt(aCount); + const char16_t *strings[1] = { countString.get() }; + if (aCount > 1) { + mBundle->FormatStringFromName(aCancelMessageMultiple, strings, 1, + getter_Copies(message)); + mBundle->FormatStringFromName(u"cancelDownloadsOKTextMultiple", + strings, 1, getter_Copies(quitButton)); + } else { + mBundle->GetStringFromName(aCancelMessageSingle, getter_Copies(message)); + mBundle->GetStringFromName(u"cancelDownloadsOKText", + getter_Copies(quitButton)); + } + + mBundle->GetStringFromName(aDontCancelButton, getter_Copies(dontQuitButton)); + + // Get Download Manager window, to be parent of alert. + nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID); + nsCOMPtr<mozIDOMWindowProxy> dmWindow; + if (wm) { + wm->GetMostRecentWindow(u"Download:Manager", + getter_AddRefs(dmWindow)); + } + + // Show alert. + nsCOMPtr<nsIPromptService> prompter(do_GetService(NS_PROMPTSERVICE_CONTRACTID)); + if (prompter) { + int32_t flags = (nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_0) + (nsIPromptService::BUTTON_TITLE_IS_STRING * nsIPromptService::BUTTON_POS_1); + bool nothing = false; + int32_t button; + prompter->ConfirmEx(dmWindow, title, message, flags, quitButton.get(), dontQuitButton.get(), nullptr, nullptr, ¬hing, &button); + + aCancelDownloads->SetData(button == 1); + } +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsDownload + +NS_IMPL_CLASSINFO(nsDownload, nullptr, 0, NS_DOWNLOAD_CID) +NS_IMPL_ISUPPORTS_CI( + nsDownload + , nsIDownload + , nsITransfer + , nsIWebProgressListener + , nsIWebProgressListener2 +) + +nsDownload::nsDownload() : mDownloadState(nsIDownloadManager::DOWNLOAD_NOTSTARTED), + mID(0), + mPercentComplete(0), + mCurrBytes(0), + mMaxBytes(-1), + mStartTime(0), + mLastUpdate(PR_Now() - (uint32_t)gUpdateInterval), + mResumedAt(-1), + mSpeed(0), + mHasMultipleFiles(false), + mPrivate(false), + mAutoResume(DONT_RESUME) +{ +} + +nsDownload::~nsDownload() +{ +} + +NS_IMETHODIMP nsDownload::SetSha256Hash(const nsACString& aHash) { + MOZ_ASSERT(NS_IsMainThread(), "Must call SetSha256Hash on main thread"); + // This will be used later to query the application reputation service. + mHash = aHash; + return NS_OK; +} + +NS_IMETHODIMP nsDownload::SetSignatureInfo(nsIArray* aSignatureInfo) { + MOZ_ASSERT(NS_IsMainThread(), "Must call SetSignatureInfo on main thread"); + // This will be used later to query the application reputation service. + mSignatureInfo = aSignatureInfo; + return NS_OK; +} + +NS_IMETHODIMP nsDownload::SetRedirects(nsIArray* aRedirects) { + MOZ_ASSERT(NS_IsMainThread(), "Must call SetRedirects on main thread"); + // This will be used later to query the application reputation service. + mRedirects = aRedirects; + return NS_OK; +} + +#ifdef MOZ_ENABLE_GIO +static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data) +{ + GError *err = nullptr; + g_file_set_attributes_finish(G_FILE(source_obj), res, nullptr, &err); + if (err) { +#ifdef DEBUG + NS_DebugBreak(NS_DEBUG_WARNING, "Set file metadata failed: ", err->message, __FILE__, __LINE__); +#endif + g_error_free(err); + } +} +#endif + +nsresult +nsDownload::SetState(DownloadState aState) +{ + NS_ASSERTION(mDownloadState != aState, + "Trying to set the download state to what it already is set to!"); + + int16_t oldState = mDownloadState; + mDownloadState = aState; + + // We don't want to lose access to our member variables + RefPtr<nsDownload> kungFuDeathGrip = this; + + // When the state changed listener is dispatched, queries to the database and + // the download manager api should reflect what the nsIDownload object would + // return. So, if a download is done (finished, canceled, etc.), it should + // first be removed from the current downloads. We will also have to update + // the database *before* notifying listeners. At this point, you can safely + // dispatch to the observers as well. + switch (aState) { + case nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL: + case nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY: + case nsIDownloadManager::DOWNLOAD_DIRTY: + case nsIDownloadManager::DOWNLOAD_CANCELED: + case nsIDownloadManager::DOWNLOAD_FAILED: +#ifdef ANDROID + // If we still have a temp file, remove it + bool tempExists; + if (mTempFile && NS_SUCCEEDED(mTempFile->Exists(&tempExists)) && tempExists) { + nsresult rv = mTempFile->Remove(false); + NS_ENSURE_SUCCESS(rv, rv); + } +#endif + + // Transfers are finished, so break the reference cycle + Finalize(); + break; +#ifdef DOWNLOAD_SCANNER + case nsIDownloadManager::DOWNLOAD_SCANNING: + { + nsresult rv = mDownloadManager->mScanner ? mDownloadManager->mScanner->ScanDownload(this) : NS_ERROR_NOT_INITIALIZED; + // If we failed, then fall through to 'download finished' + if (NS_SUCCEEDED(rv)) + break; + mDownloadState = aState = nsIDownloadManager::DOWNLOAD_FINISHED; + } +#endif + case nsIDownloadManager::DOWNLOAD_FINISHED: + { + nsresult rv = ExecuteDesiredAction(); + if (NS_FAILED(rv)) { + // We've failed to execute the desired action. As a result, we should + // fail the download so the user can try again. + (void)FailDownload(rv, nullptr); + return rv; + } + + // Now that we're done with handling the download, clean it up + Finalize(); + + nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID)); + + // Master pref to control this function. + bool showTaskbarAlert = true; + if (pref) + pref->GetBoolPref(PREF_BDM_SHOWALERTONCOMPLETE, &showTaskbarAlert); + + if (showTaskbarAlert) { + int32_t alertInterval = 2000; + if (pref) + pref->GetIntPref(PREF_BDM_SHOWALERTINTERVAL, &alertInterval); + + int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC; + int64_t goat = PR_Now() - mStartTime; + showTaskbarAlert = goat > alertIntervalUSec; + + int32_t size = mPrivate ? + mDownloadManager->mCurrentPrivateDownloads.Count() : + mDownloadManager->mCurrentDownloads.Count(); + if (showTaskbarAlert && size == 0) { + nsCOMPtr<nsIAlertsService> alerts = + do_GetService("@mozilla.org/alerts-service;1"); + if (alerts) { + nsXPIDLString title, message; + + mDownloadManager->mBundle->GetStringFromName( + u"downloadsCompleteTitle", + getter_Copies(title)); + mDownloadManager->mBundle->GetStringFromName( + u"downloadsCompleteMsg", + getter_Copies(message)); + + bool removeWhenDone = + mDownloadManager->GetRetentionBehavior() == 0; + + // If downloads are automatically removed per the user's + // retention policy, there's no reason to make the text clickable + // because if it is, they'll click open the download manager and + // the items they downloaded will have been removed. + alerts->ShowAlertNotification( + NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title, + message, !removeWhenDone, + mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"), + mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"), + EmptyString(), EmptyString(), nullptr, mPrivate, + false /* requireInteraction */); + } + } + } + +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK) + nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget); + nsCOMPtr<nsIFile> file; + nsAutoString path; + + if (fileURL && + NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) && + file && + NS_SUCCEEDED(file->GetPath(path))) { + +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID) + // On Windows and Gtk, add the download to the system's "recent documents" + // list, with a pref to disable. + { + bool addToRecentDocs = true; + if (pref) + pref->GetBoolPref(PREF_BDM_ADDTORECENTDOCS, &addToRecentDocs); +#ifdef MOZ_WIDGET_ANDROID + if (addToRecentDocs) { + nsCOMPtr<nsIMIMEInfo> mimeInfo; + nsAutoCString contentType; + GetMIMEInfo(getter_AddRefs(mimeInfo)); + + if (mimeInfo) + mimeInfo->GetMIMEType(contentType); + + if (jni::IsFennec()) { + java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType)); + } + } +#else + if (addToRecentDocs && !mPrivate) { +#ifdef XP_WIN + ::SHAddToRecentDocs(SHARD_PATHW, path.get()); +#elif defined(MOZ_WIDGET_GTK) + GtkRecentManager* manager = gtk_recent_manager_get_default(); + + gchar* uri = g_filename_to_uri(NS_ConvertUTF16toUTF8(path).get(), + nullptr, nullptr); + if (uri) { + gtk_recent_manager_add_item(manager, uri); + g_free(uri); + } +#endif + } +#endif +#ifdef MOZ_ENABLE_GIO + // Use GIO to store the source URI for later display in the file manager. + GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get()); + nsCString source_uri; + rv = mSource->GetSpec(source_uri); + NS_ENSURE_SUCCESS(rv, rv); + GFileInfo *file_info = g_file_info_new(); + g_file_info_set_attribute_string(file_info, "metadata::download-uri", source_uri.get()); + g_file_set_attributes_async(gio_file, + file_info, + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + nullptr, gio_set_metadata_done, nullptr); + g_object_unref(file_info); + g_object_unref(gio_file); +#endif + } +#endif + +#ifdef XP_MACOSX + // On OS X, make the downloads stack bounce. + CFStringRef observedObject = ::CFStringCreateWithCString(kCFAllocatorDefault, + NS_ConvertUTF16toUTF8(path).get(), + kCFStringEncodingUTF8); + CFNotificationCenterRef center = ::CFNotificationCenterGetDistributedCenter(); + ::CFNotificationCenterPostNotification(center, CFSTR("com.apple.DownloadFileFinished"), + observedObject, nullptr, TRUE); + ::CFRelease(observedObject); +#endif + } + +#ifdef XP_WIN + // Adjust file attributes so that by default, new files are indexed + // by desktop search services. Skip off those that land in the temp + // folder. + nsCOMPtr<nsIFile> tempDir, fileDir; + rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tempDir)); + NS_ENSURE_SUCCESS(rv, rv); + (void)file->GetParent(getter_AddRefs(fileDir)); + + bool isTemp = false; + if (fileDir) + (void)fileDir->Equals(tempDir, &isTemp); + + nsCOMPtr<nsILocalFileWin> localFileWin(do_QueryInterface(file)); + if (!isTemp && localFileWin) + (void)localFileWin->SetFileAttributesWin(nsILocalFileWin::WFA_SEARCH_INDEXED); +#endif + +#endif + // Now remove the download if the user's retention policy is "Remove when Done" + if (mDownloadManager->GetRetentionBehavior() == 0) + mDownloadManager->RemoveDownload(mGUID); + } + break; + default: + break; + } + + // Before notifying the listener, we must update the database so that calls + // to it work out properly. + nsresult rv = UpdateDB(); + NS_ENSURE_SUCCESS(rv, rv); + + mDownloadManager->NotifyListenersOnDownloadStateChange(oldState, this); + + switch (mDownloadState) { + case nsIDownloadManager::DOWNLOAD_DOWNLOADING: + // Only send the dl-start event to downloads that are actually starting. + if (oldState == nsIDownloadManager::DOWNLOAD_QUEUED) { + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-start"); + } + break; + case nsIDownloadManager::DOWNLOAD_FAILED: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-failed"); + break; + case nsIDownloadManager::DOWNLOAD_SCANNING: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-scanning"); + break; + case nsIDownloadManager::DOWNLOAD_FINISHED: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-done"); + break; + case nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL: + case nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-blocked"); + break; + case nsIDownloadManager::DOWNLOAD_DIRTY: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-dirty"); + break; + case nsIDownloadManager::DOWNLOAD_CANCELED: + if (!mPrivate) + mDownloadManager->SendEvent(this, "dl-cancel"); + break; + default: + break; + } + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIWebProgressListener2 + +NS_IMETHODIMP +nsDownload::OnProgressChange64(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + int64_t aCurSelfProgress, + int64_t aMaxSelfProgress, + int64_t aCurTotalProgress, + int64_t aMaxTotalProgress) +{ + if (!mRequest) + mRequest = aRequest; // used for pause/resume + + if (mDownloadState == nsIDownloadManager::DOWNLOAD_QUEUED) { + // Obtain the referrer + nsresult rv; + nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest)); + nsCOMPtr<nsIURI> referrer = mReferrer; + if (channel) + (void)NS_GetReferrerFromChannel(channel, getter_AddRefs(mReferrer)); + + // Restore the original referrer if the new one isn't useful + if (!mReferrer) + mReferrer = referrer; + + // If we have a MIME info, we know that exthandler has already added this to + // the history, but if we do not, we'll have to add it ourselves. + if (!mMIMEInfo && !mPrivate) { + nsCOMPtr<nsIDownloadHistory> dh = + do_GetService(NS_DOWNLOADHISTORY_CONTRACTID); + if (dh) + (void)dh->AddDownload(mSource, mReferrer, mStartTime, mTarget); + } + + // Fetch the entityID, but if we can't get it, don't panic (non-resumable) + nsCOMPtr<nsIResumableChannel> resumableChannel(do_QueryInterface(aRequest)); + if (resumableChannel) + (void)resumableChannel->GetEntityID(mEntityID); + + // Before we update the state and dispatch state notifications, we want to + // ensure that we have the correct state for this download with regards to + // its percent completion and size. + SetProgressBytes(0, aMaxTotalProgress); + + // Update the state and the database + rv = SetState(nsIDownloadManager::DOWNLOAD_DOWNLOADING); + NS_ENSURE_SUCCESS(rv, rv); + } + + // filter notifications since they come in so frequently + PRTime now = PR_Now(); + PRIntervalTime delta = now - mLastUpdate; + if (delta < gUpdateInterval) + return NS_OK; + + mLastUpdate = now; + + // Calculate the speed using the elapsed delta time and bytes downloaded + // during that time for more accuracy. + double elapsedSecs = double(delta) / PR_USEC_PER_SEC; + if (elapsedSecs > 0) { + double speed = double(aCurTotalProgress - mCurrBytes) / elapsedSecs; + if (mCurrBytes == 0) { + mSpeed = speed; + } else { + // Calculate 'smoothed average' of 10 readings. + mSpeed = mSpeed * 0.9 + speed * 0.1; + } + } + + SetProgressBytes(aCurTotalProgress, aMaxTotalProgress); + + // Report to the listener our real sizes + int64_t currBytes, maxBytes; + (void)GetAmountTransferred(&currBytes); + (void)GetSize(&maxBytes); + mDownloadManager->NotifyListenersOnProgressChange( + aWebProgress, aRequest, currBytes, maxBytes, currBytes, maxBytes, this); + + // If the maximums are different, then there must be more than one file + if (aMaxSelfProgress != aMaxTotalProgress) + mHasMultipleFiles = true; + + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::OnRefreshAttempted(nsIWebProgress *aWebProgress, + nsIURI *aUri, + int32_t aDelay, + bool aSameUri, + bool *allowRefresh) +{ + *allowRefresh = true; + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIWebProgressListener + +NS_IMETHODIMP +nsDownload::OnProgressChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + int32_t aCurSelfProgress, + int32_t aMaxSelfProgress, + int32_t aCurTotalProgress, + int32_t aMaxTotalProgress) +{ + return OnProgressChange64(aWebProgress, aRequest, + aCurSelfProgress, aMaxSelfProgress, + aCurTotalProgress, aMaxTotalProgress); +} + +NS_IMETHODIMP +nsDownload::OnLocationChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, nsIURI *aLocation, + uint32_t aFlags) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::OnStatusChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, nsresult aStatus, + const char16_t *aMessage) +{ + if (NS_FAILED(aStatus)) + return FailDownload(aStatus, aMessage); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::OnStateChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, uint32_t aStateFlags, + nsresult aStatus) +{ + MOZ_ASSERT(NS_IsMainThread(), "Must call OnStateChange in main thread"); + + // We don't want to lose access to our member variables + RefPtr<nsDownload> kungFuDeathGrip = this; + + // Check if we're starting a request; the NETWORK flag is necessary to not + // pick up the START of *each* file but only for the whole request + if ((aStateFlags & STATE_START) && (aStateFlags & STATE_IS_NETWORK)) { + nsresult rv; + nsCOMPtr<nsIHttpChannel> channel = do_QueryInterface(aRequest, &rv); + if (NS_SUCCEEDED(rv)) { + uint32_t status; + rv = channel->GetResponseStatus(&status); + // HTTP 450 - Blocked by parental control proxies + if (NS_SUCCEEDED(rv) && status == 450) { + // Cancel using the provided object + (void)Cancel(); + + // Fail the download + (void)SetState(nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL); + } + } + } else if ((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_NETWORK) && + IsFinishable()) { + // We got both STOP and NETWORK so that means the whole request is done + // (and not just a single file if there are multiple files) + if (NS_SUCCEEDED(aStatus)) { + // We can't completely trust the bytes we've added up because we might be + // missing on some/all of the progress updates (especially from cache). + // Our best bet is the file itself, but if for some reason it's gone or + // if we have multiple files, the next best is what we've calculated. + int64_t fileSize; + nsCOMPtr<nsIFile> file; + // We need a nsIFile clone to deal with file size caching issues. :( + nsCOMPtr<nsIFile> clone; + if (!mHasMultipleFiles && + NS_SUCCEEDED(GetTargetFile(getter_AddRefs(file))) && + NS_SUCCEEDED(file->Clone(getter_AddRefs(clone))) && + NS_SUCCEEDED(clone->GetFileSize(&fileSize)) && fileSize > 0) { + mCurrBytes = mMaxBytes = fileSize; + + // If we resumed, keep the fact that we did and fix size calculations + if (WasResumed()) + mResumedAt = 0; + } else if (mMaxBytes == -1) { + mMaxBytes = mCurrBytes; + } else { + mCurrBytes = mMaxBytes; + } + + mPercentComplete = 100; + mLastUpdate = PR_Now(); + +#ifdef DOWNLOAD_SCANNER + bool scan = true; + nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (prefs) + (void)prefs->GetBoolPref(PREF_BDM_SCANWHENDONE, &scan); + + if (scan) + (void)SetState(nsIDownloadManager::DOWNLOAD_SCANNING); + else + (void)SetState(nsIDownloadManager::DOWNLOAD_FINISHED); +#else + (void)SetState(nsIDownloadManager::DOWNLOAD_FINISHED); +#endif + } else { + // We failed for some unknown reason -- fail with a generic message + (void)FailDownload(aStatus, nullptr); + } + } + + mDownloadManager->NotifyListenersOnStateChange(aWebProgress, aRequest, + aStateFlags, aStatus, this); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, uint32_t aState) +{ + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsIDownload + +NS_IMETHODIMP +nsDownload::Init(nsIURI *aSource, + nsIURI *aTarget, + const nsAString& aDisplayName, + nsIMIMEInfo *aMIMEInfo, + PRTime aStartTime, + nsIFile *aTempFile, + nsICancelable *aCancelable, + bool aIsPrivate) +{ + NS_WARNING("Huh...how did we get here?!"); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetState(int16_t *aState) +{ + *aState = mDownloadState; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetDisplayName(nsAString &aDisplayName) +{ + aDisplayName = mDisplayName; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetCancelable(nsICancelable **aCancelable) +{ + *aCancelable = mCancelable; + NS_IF_ADDREF(*aCancelable); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetTarget(nsIURI **aTarget) +{ + *aTarget = mTarget; + NS_IF_ADDREF(*aTarget); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetSource(nsIURI **aSource) +{ + *aSource = mSource; + NS_IF_ADDREF(*aSource); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetStartTime(int64_t *aStartTime) +{ + *aStartTime = mStartTime; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetPercentComplete(int32_t *aPercentComplete) +{ + *aPercentComplete = mPercentComplete; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetAmountTransferred(int64_t *aAmountTransferred) +{ + *aAmountTransferred = mCurrBytes + (WasResumed() ? mResumedAt : 0); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetSize(int64_t *aSize) +{ + *aSize = mMaxBytes + (WasResumed() && mMaxBytes != -1 ? mResumedAt : 0); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetMIMEInfo(nsIMIMEInfo **aMIMEInfo) +{ + *aMIMEInfo = mMIMEInfo; + NS_IF_ADDREF(*aMIMEInfo); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetTargetFile(nsIFile **aTargetFile) +{ + nsresult rv; + + nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget, &rv); + if (NS_FAILED(rv)) { + return rv; + } + + nsCOMPtr<nsIFile> file; + rv = fileURL->GetFile(getter_AddRefs(file)); + if (NS_FAILED(rv)) { + return rv; + } + + file.forget(aTargetFile); + return rv; +} + +NS_IMETHODIMP +nsDownload::GetSpeed(double *aSpeed) +{ + *aSpeed = mSpeed; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetId(uint32_t *aId) +{ + if (mPrivate) { + return NS_ERROR_NOT_AVAILABLE; + } + *aId = mID; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetGuid(nsACString &aGUID) +{ + aGUID = mGUID; + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetReferrer(nsIURI **referrer) +{ + NS_IF_ADDREF(*referrer = mReferrer); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetResumable(bool *resumable) +{ + *resumable = IsResumable(); + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::GetIsPrivate(bool *isPrivate) +{ + *isPrivate = mPrivate; + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// +//// nsDownload Helper Functions + +void +nsDownload::Finalize() +{ + // We're stopping, so break the cycle we created at download start + mCancelable = nullptr; + + // Reset values that aren't needed anymore, so the DB can be updated as well + mEntityID.Truncate(); + mTempFile = nullptr; + + // Remove ourself from the active downloads + nsCOMArray<nsDownload>& currentDownloads = mPrivate ? + mDownloadManager->mCurrentPrivateDownloads : + mDownloadManager->mCurrentDownloads; + (void)currentDownloads.RemoveObject(this); + + // Make sure we do not automatically resume + mAutoResume = DONT_RESUME; +} + +nsresult +nsDownload::ExecuteDesiredAction() +{ + // nsExternalHelperAppHandler is the only caller of AddDownload that sets a + // tempfile parameter. In this case, execute the desired action according to + // the saved mime info. + if (!mTempFile) { + return NS_OK; + } + + // We need to bail if for some reason the temp file got removed + bool fileExists; + if (NS_FAILED(mTempFile->Exists(&fileExists)) || !fileExists) + return NS_ERROR_FILE_NOT_FOUND; + + // Assume an unknown action is save to disk + nsHandlerInfoAction action = nsIMIMEInfo::saveToDisk; + if (mMIMEInfo) { + nsresult rv = mMIMEInfo->GetPreferredAction(&action); + NS_ENSURE_SUCCESS(rv, rv); + } + + nsresult rv = NS_OK; + switch (action) { + case nsIMIMEInfo::saveToDisk: + // Move the file to the proper location + rv = MoveTempToTarget(); + if (NS_SUCCEEDED(rv)) { + rv = FixTargetPermissions(); + } + break; + case nsIMIMEInfo::useHelperApp: + case nsIMIMEInfo::useSystemDefault: + // For these cases we have to move the file to the target location and + // open with the appropriate application + rv = OpenWithApplication(); + break; + default: + break; + } + + return rv; +} + +nsresult +nsDownload::FixTargetPermissions() +{ + nsCOMPtr<nsIFile> target; + nsresult rv = GetTargetFile(getter_AddRefs(target)); + NS_ENSURE_SUCCESS(rv, rv); + + // Set perms according to umask. + nsCOMPtr<nsIPropertyBag2> infoService = + do_GetService("@mozilla.org/system-info;1"); + uint32_t gUserUmask = 0; + rv = infoService->GetPropertyAsUint32(NS_LITERAL_STRING("umask"), + &gUserUmask); + if (NS_SUCCEEDED(rv)) { + (void)target->SetPermissions(0666 & ~gUserUmask); + } + return NS_OK; +} + +nsresult +nsDownload::MoveTempToTarget() +{ + nsCOMPtr<nsIFile> target; + nsresult rv = GetTargetFile(getter_AddRefs(target)); + NS_ENSURE_SUCCESS(rv, rv); + + // MoveTo will fail if the file already exists, but we've already obtained + // confirmation from the user that this is OK, so remove it if it exists. + bool fileExists; + if (NS_SUCCEEDED(target->Exists(&fileExists)) && fileExists) { + rv = target->Remove(false); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Extract the new leaf name from the file location + nsAutoString fileName; + rv = target->GetLeafName(fileName); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr<nsIFile> dir; + rv = target->GetParent(getter_AddRefs(dir)); + NS_ENSURE_SUCCESS(rv, rv); + rv = mTempFile->MoveTo(dir, fileName); + return rv; +} + +nsresult +nsDownload::OpenWithApplication() +{ + // First move the temporary file to the target location + nsCOMPtr<nsIFile> target; + nsresult rv = GetTargetFile(getter_AddRefs(target)); + NS_ENSURE_SUCCESS(rv, rv); + + // Move the temporary file to the target location + rv = MoveTempToTarget(); + NS_ENSURE_SUCCESS(rv, rv); + + bool deleteTempFileOnExit; + nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (!prefs || NS_FAILED(prefs->GetBoolPref(PREF_BH_DELETETEMPFILEONEXIT, + &deleteTempFileOnExit))) { + // No prefservice or no pref set; use default value +#if !defined(XP_MACOSX) + // Mac users have been very verbal about temp files being deleted on + // app exit - they don't like it - but we'll continue to do this on + // other platforms for now. + deleteTempFileOnExit = true; +#else + deleteTempFileOnExit = false; +#endif + } + + // Always schedule files to be deleted at the end of the private browsing + // mode, regardless of the value of the pref. + if (deleteTempFileOnExit || mPrivate) { + + // Make the tmp file readonly so users won't lose changes. + target->SetPermissions(0400); + + // Use the ExternalHelperAppService to push the temporary file to the list + // of files to be deleted on exit. + nsCOMPtr<nsPIExternalAppLauncher> appLauncher(do_GetService + (NS_EXTERNALHELPERAPPSERVICE_CONTRACTID)); + + // Even if we are unable to get this service we return the result + // of LaunchWithFile() which makes more sense. + if (appLauncher) { + if (mPrivate) { + (void)appLauncher->DeleteTemporaryPrivateFileWhenPossible(target); + } else { + (void)appLauncher->DeleteTemporaryFileOnExit(target); + } + } + } + + return mMIMEInfo->LaunchWithFile(target); +} + +void +nsDownload::SetStartTime(int64_t aStartTime) +{ + mStartTime = aStartTime; + mLastUpdate = aStartTime; +} + +void +nsDownload::SetProgressBytes(int64_t aCurrBytes, int64_t aMaxBytes) +{ + mCurrBytes = aCurrBytes; + mMaxBytes = aMaxBytes; + + // Get the real bytes that include resume position + int64_t currBytes, maxBytes; + (void)GetAmountTransferred(&currBytes); + (void)GetSize(&maxBytes); + + if (currBytes == maxBytes) + mPercentComplete = 100; + else if (maxBytes <= 0) + mPercentComplete = -1; + else + mPercentComplete = (int32_t)((double)currBytes / maxBytes * 100 + .5); +} + +NS_IMETHODIMP +nsDownload::Pause() +{ + if (!IsResumable()) + return NS_ERROR_UNEXPECTED; + + nsresult rv = CancelTransfer(); + NS_ENSURE_SUCCESS(rv, rv); + + return SetState(nsIDownloadManager::DOWNLOAD_PAUSED); +} + +nsresult +nsDownload::CancelTransfer() +{ + nsresult rv = NS_OK; + if (mCancelable) { + rv = mCancelable->Cancel(NS_BINDING_ABORTED); + // we're done with this, so break the cycle + mCancelable = nullptr; + } + + return rv; +} + +NS_IMETHODIMP +nsDownload::Cancel() +{ + // Don't cancel if download is already finished + if (IsFinished()) + return NS_OK; + + // Have the download cancel its connection + (void)CancelTransfer(); + + // Dump the temp file because we know we don't need the file anymore. The + // underlying transfer creating the file doesn't delete the file because it + // can't distinguish between a pause that cancels the transfer or a real + // cancel. + if (mTempFile) { + bool exists; + mTempFile->Exists(&exists); + if (exists) + mTempFile->Remove(false); + } + + nsCOMPtr<nsIFile> file; + if (NS_SUCCEEDED(GetTargetFile(getter_AddRefs(file)))) + { + bool exists; + file->Exists(&exists); + if (exists) + file->Remove(false); + } + + nsresult rv = SetState(nsIDownloadManager::DOWNLOAD_CANCELED); + NS_ENSURE_SUCCESS(rv, rv); + + return NS_OK; +} + +NS_IMETHODIMP +nsDownload::Resume() +{ + if (!IsPaused() || !IsResumable()) + return NS_ERROR_UNEXPECTED; + + nsresult rv; + nsCOMPtr<nsIWebBrowserPersist> wbp = + do_CreateInstance("@mozilla.org/embedding/browser/nsWebBrowserPersist;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = wbp->SetPersistFlags(nsIWebBrowserPersist::PERSIST_FLAGS_APPEND_TO_FILE | + nsIWebBrowserPersist::PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION); + NS_ENSURE_SUCCESS(rv, rv); + + // Create a new channel for the source URI + nsCOMPtr<nsIChannel> channel; + nsCOMPtr<nsIInterfaceRequestor> ir(do_QueryInterface(wbp)); + rv = NS_NewChannel(getter_AddRefs(channel), + mSource, + nsContentUtils::GetSystemPrincipal(), + nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL, + nsIContentPolicy::TYPE_OTHER, + nullptr, // aLoadGroup + ir); + + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryInterface(channel); + if (pbChannel) { + pbChannel->SetPrivate(mPrivate); + } + + // Make sure we can get a file, either the temporary or the real target, for + // both purposes of file size and a target to write to + nsCOMPtr<nsIFile> targetLocalFile(mTempFile); + if (!targetLocalFile) { + rv = GetTargetFile(getter_AddRefs(targetLocalFile)); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Get the file size to be used as an offset, but if anything goes wrong + // along the way, we'll silently restart at 0. + int64_t fileSize; + // We need a nsIFile clone to deal with file size caching issues. :( + nsCOMPtr<nsIFile> clone; + if (NS_FAILED(targetLocalFile->Clone(getter_AddRefs(clone))) || + NS_FAILED(clone->GetFileSize(&fileSize))) + fileSize = 0; + + // Set the channel to resume at the right position along with the entityID + nsCOMPtr<nsIResumableChannel> resumableChannel(do_QueryInterface(channel)); + if (!resumableChannel) + return NS_ERROR_UNEXPECTED; + rv = resumableChannel->ResumeAt(fileSize, mEntityID); + NS_ENSURE_SUCCESS(rv, rv); + + // If we know the max size, we know what it should be when resuming + int64_t maxBytes; + GetSize(&maxBytes); + SetProgressBytes(0, maxBytes != -1 ? maxBytes - fileSize : -1); + // Track where we resumed because progress notifications restart at 0 + mResumedAt = fileSize; + + // Set the referrer + if (mReferrer) { + nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel)); + if (httpChannel) { + rv = httpChannel->SetReferrer(mReferrer); + NS_ENSURE_SUCCESS(rv, rv); + } + } + + // Creates a cycle that will be broken when the download finishes + mCancelable = wbp; + (void)wbp->SetProgressListener(this); + + // Save the channel using nsIWBP + rv = wbp->SaveChannel(channel, targetLocalFile); + if (NS_FAILED(rv)) { + mCancelable = nullptr; + (void)wbp->SetProgressListener(nullptr); + return rv; + } + + return SetState(nsIDownloadManager::DOWNLOAD_DOWNLOADING); +} + +NS_IMETHODIMP +nsDownload::Remove() +{ + return mDownloadManager->RemoveDownload(mGUID); +} + +NS_IMETHODIMP +nsDownload::Retry() +{ + return mDownloadManager->RetryDownload(mGUID); +} + +bool +nsDownload::IsPaused() +{ + return mDownloadState == nsIDownloadManager::DOWNLOAD_PAUSED; +} + +bool +nsDownload::IsResumable() +{ + return !mEntityID.IsEmpty(); +} + +bool +nsDownload::WasResumed() +{ + return mResumedAt != -1; +} + +bool +nsDownload::ShouldAutoResume() +{ + return mAutoResume == AUTO_RESUME; +} + +bool +nsDownload::IsFinishable() +{ + return mDownloadState == nsIDownloadManager::DOWNLOAD_NOTSTARTED || + mDownloadState == nsIDownloadManager::DOWNLOAD_QUEUED || + mDownloadState == nsIDownloadManager::DOWNLOAD_DOWNLOADING; +} + +bool +nsDownload::IsFinished() +{ + return mDownloadState == nsIDownloadManager::DOWNLOAD_FINISHED; +} + +nsresult +nsDownload::UpdateDB() +{ + NS_ASSERTION(mID, "Download ID is stored as zero. This is bad!"); + NS_ASSERTION(mDownloadManager, "Egads! We have no download manager!"); + + mozIStorageStatement *stmt = mPrivate ? + mDownloadManager->mUpdatePrivateDownloadStatement : mDownloadManager->mUpdateDownloadStatement; + + nsAutoString tempPath; + if (mTempFile) + (void)mTempFile->GetPath(tempPath); + nsresult rv = stmt->BindStringByName(NS_LITERAL_CSTRING("tempPath"), tempPath); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("startTime"), mStartTime); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("endTime"), mLastUpdate); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("state"), mDownloadState); + NS_ENSURE_SUCCESS(rv, rv); + + if (mReferrer) { + nsAutoCString referrer; + rv = mReferrer->GetSpec(referrer); + NS_ENSURE_SUCCESS(rv, rv); + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("referrer"), referrer); + } else { + rv = stmt->BindNullByName(NS_LITERAL_CSTRING("referrer")); + } + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindUTF8StringByName(NS_LITERAL_CSTRING("entityID"), mEntityID); + NS_ENSURE_SUCCESS(rv, rv); + + int64_t currBytes; + (void)GetAmountTransferred(&currBytes); + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("currBytes"), currBytes); + NS_ENSURE_SUCCESS(rv, rv); + + int64_t maxBytes; + (void)GetSize(&maxBytes); + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("maxBytes"), maxBytes); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt32ByName(NS_LITERAL_CSTRING("autoResume"), mAutoResume); + NS_ENSURE_SUCCESS(rv, rv); + + rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("id"), mID); + NS_ENSURE_SUCCESS(rv, rv); + + return stmt->Execute(); +} + +nsresult +nsDownload::FailDownload(nsresult aStatus, const char16_t *aMessage) +{ + // Grab the bundle before potentially losing our member variables + nsCOMPtr<nsIStringBundle> bundle = mDownloadManager->mBundle; + + (void)SetState(nsIDownloadManager::DOWNLOAD_FAILED); + + // Get title for alert. + nsXPIDLString title; + nsresult rv = bundle->GetStringFromName( + u"downloadErrorAlertTitle", getter_Copies(title)); + NS_ENSURE_SUCCESS(rv, rv); + + // Get a generic message if we weren't supplied one + nsXPIDLString message; + message = aMessage; + if (message.IsEmpty()) { + rv = bundle->GetStringFromName( + u"downloadErrorGeneric", getter_Copies(message)); + NS_ENSURE_SUCCESS(rv, rv); + } + + // Get Download Manager window to be parent of alert + nsCOMPtr<nsIWindowMediator> wm = + do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr<mozIDOMWindowProxy> dmWindow; + rv = wm->GetMostRecentWindow(u"Download:Manager", + getter_AddRefs(dmWindow)); + NS_ENSURE_SUCCESS(rv, rv); + + // Show alert + nsCOMPtr<nsIPromptService> prompter = + do_GetService("@mozilla.org/embedcomp/prompt-service;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + return prompter->Alert(dmWindow, title, message); +} diff --git a/toolkit/components/downloads/nsDownloadManager.h b/toolkit/components/downloads/nsDownloadManager.h new file mode 100644 index 000000000..566e3560a --- /dev/null +++ b/toolkit/components/downloads/nsDownloadManager.h @@ -0,0 +1,454 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef downloadmanager___h___ +#define downloadmanager___h___ + +#if defined(XP_WIN) +#define DOWNLOAD_SCANNER +#endif + +#include "nsIDownload.h" +#include "nsIDownloadManager.h" +#include "nsIDownloadProgressListener.h" +#include "nsIFile.h" +#include "nsIMIMEInfo.h" +#include "nsINavHistoryService.h" +#include "nsIObserver.h" +#include "nsIObserverService.h" +#include "nsIStringBundle.h" +#include "nsISupportsPrimitives.h" +#include "nsWeakReference.h" +#include "nsITimer.h" +#include "nsString.h" + +#include "mozIDOMWindow.h" +#include "mozStorageHelper.h" +#include "nsAutoPtr.h" +#include "nsCOMArray.h" + +typedef int16_t DownloadState; +typedef int16_t DownloadType; + +class nsIArray; +class nsDownload; + +#ifdef DOWNLOAD_SCANNER +#include "nsDownloadScanner.h" +#endif + +class nsDownloadManager final : public nsIDownloadManager, + public nsINavHistoryObserver, + public nsIObserver, + public nsSupportsWeakReference +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIDOWNLOADMANAGER + NS_DECL_NSINAVHISTORYOBSERVER + NS_DECL_NSIOBSERVER + + nsresult Init(); + + static nsDownloadManager *GetSingleton(); + + nsDownloadManager() +#ifdef DOWNLOAD_SCANNER + : mScanner(nullptr) +#endif + { + } + +protected: + virtual ~nsDownloadManager(); + + nsresult InitDB(); + nsresult InitFileDB(); + void CloseAllDBs(); + void CloseDB(mozIStorageConnection* aDBConn, + mozIStorageStatement* aUpdateStmt, + mozIStorageStatement* aGetIdsStmt); + nsresult InitPrivateDB(); + already_AddRefed<mozIStorageConnection> GetFileDBConnection(nsIFile *dbFile) const; + already_AddRefed<mozIStorageConnection> GetPrivateDBConnection() const; + nsresult CreateTable(mozIStorageConnection* aDBConn); + + /** + * Fix up the database after a crash such as dealing with previously-active + * downloads. Call this before RestoreActiveDownloads to get the downloads + * fixed here to be auto-resumed. + */ + nsresult RestoreDatabaseState(); + + /** + * Paused downloads that survive across sessions are considered active, so + * rebuild the list of these downloads. + */ + nsresult RestoreActiveDownloads(); + + nsresult GetDownloadFromDB(const nsACString& aGUID, nsDownload **retVal); + nsresult GetDownloadFromDB(uint32_t aID, nsDownload **retVal); + nsresult GetDownloadFromDB(mozIStorageConnection* aDBConn, + mozIStorageStatement* stmt, + nsDownload **retVal); + + /** + * Specially track the active downloads so that we don't need to check + * every download to see if they're in progress. + */ + nsresult AddToCurrentDownloads(nsDownload *aDl); + + void SendEvent(nsDownload *aDownload, const char *aTopic); + + /** + * Adds a download with the specified information to the DB. + * + * @return The id of the download, or 0 if there was an error. + */ + int64_t AddDownloadToDB(const nsAString &aName, + const nsACString &aSource, + const nsACString &aTarget, + const nsAString &aTempPath, + int64_t aStartTime, + int64_t aEndTime, + const nsACString &aMimeType, + const nsACString &aPreferredApp, + nsHandlerInfoAction aPreferredAction, + bool aPrivate, + nsACString &aNewGUID); + + void NotifyListenersOnDownloadStateChange(int16_t aOldState, + nsDownload *aDownload); + void NotifyListenersOnProgressChange(nsIWebProgress *aProgress, + nsIRequest *aRequest, + int64_t aCurSelfProgress, + int64_t aMaxSelfProgress, + int64_t aCurTotalProgress, + int64_t aMaxTotalProgress, + nsDownload *aDownload); + void NotifyListenersOnStateChange(nsIWebProgress *aProgress, + nsIRequest *aRequest, + uint32_t aStateFlags, + nsresult aStatus, + nsDownload *aDownload); + + nsDownload *FindDownload(const nsACString& aGUID); + nsDownload *FindDownload(uint32_t aID); + + /** + * First try to resume the download, and if that fails, retry it. + * + * @param aDl The download to resume and/or retry. + */ + nsresult ResumeRetry(nsDownload *aDl); + + /** + * Pause all active downloads and remember if they should try to auto-resume + * when the download manager starts again. + * + * @param aSetResume Indicate if the downloads that get paused should be set + * as auto-resume. + */ + nsresult PauseAllDownloads(bool aSetResume); + + /** + * Resume all paused downloads unless we're only supposed to do the automatic + * ones; in that case, try to retry them as well if resuming doesn't work. + * + * @param aResumeAll If true, all downloads will be resumed; otherwise, only + * those that are marked as auto-resume will resume. + */ + nsresult ResumeAllDownloads(bool aResumeAll); + + /** + * Stop tracking the active downloads. Only use this when we're about to quit + * the download manager because we destroy our list of active downloads to + * break the dlmgr<->dl cycle. Active downloads that aren't real-paused will + * be canceled. + */ + nsresult RemoveAllDownloads(); + + /** + * Find all downloads from a source URI and delete them. + * + * @param aURI + * The source URI to remove downloads + */ + nsresult RemoveDownloadsForURI(nsIURI *aURI); + + /** + * Callback used for resuming downloads after getting a wake notification. + * + * @param aTimer + * Timer object fired after some delay after a wake notification + * @param aClosure + * nsDownloadManager object used to resume downloads + */ + static void ResumeOnWakeCallback(nsITimer *aTimer, void *aClosure); + nsCOMPtr<nsITimer> mResumeOnWakeTimer; + + void ConfirmCancelDownloads(int32_t aCount, + nsISupportsPRBool *aCancelDownloads, + const char16_t *aTitle, + const char16_t *aCancelMessageMultiple, + const char16_t *aCancelMessageSingle, + const char16_t *aDontCancelButton); + + int32_t GetRetentionBehavior(); + + /** + * Type to indicate possible behaviors for active downloads across sessions. + * + * Possible values are: + * QUIT_AND_RESUME - downloads should be auto-resumed + * QUIT_AND_PAUSE - downloads should be paused + * QUIT_AND_CANCEL - downloads should be cancelled + */ + enum QuitBehavior { + QUIT_AND_RESUME = 0, + QUIT_AND_PAUSE = 1, + QUIT_AND_CANCEL = 2 + }; + + /** + * Indicates user-set behavior for active downloads across sessions, + * + * @return value of user-set pref for active download behavior + */ + enum QuitBehavior GetQuitBehavior(); + + void OnEnterPrivateBrowsingMode(); + void OnLeavePrivateBrowsingMode(); + + nsresult RetryDownload(const nsACString& aGUID); + nsresult RetryDownload(nsDownload* dl); + + nsresult RemoveDownload(const nsACString& aGUID); + + nsresult NotifyDownloadRemoval(nsDownload* aRemoved); + + // Virus scanner for windows +#ifdef DOWNLOAD_SCANNER +private: + nsDownloadScanner* mScanner; +#endif + +private: + nsresult CleanUp(mozIStorageConnection* aDBConn); + nsresult InitStatements(mozIStorageConnection* aDBConn, + mozIStorageStatement** aUpdateStatement, + mozIStorageStatement** aGetIdsStatement); + nsresult RemoveAllDownloads(nsCOMArray<nsDownload>& aDownloads); + nsresult PauseAllDownloads(nsCOMArray<nsDownload>& aDownloads, bool aSetResume); + nsresult ResumeAllDownloads(nsCOMArray<nsDownload>& aDownloads, bool aResumeAll); + nsresult RemoveDownloadsForURI(mozIStorageStatement* aStatement, nsIURI *aURI); + + bool mUseJSTransfer; + nsCOMArray<nsIDownloadProgressListener> mListeners; + nsCOMArray<nsIDownloadProgressListener> mPrivacyAwareListeners; + nsCOMPtr<nsIStringBundle> mBundle; + nsCOMPtr<mozIStorageConnection> mDBConn; + nsCOMPtr<mozIStorageConnection> mPrivateDBConn; + nsCOMArray<nsDownload> mCurrentDownloads; + nsCOMArray<nsDownload> mCurrentPrivateDownloads; + nsCOMPtr<nsIObserverService> mObserverService; + nsCOMPtr<mozIStorageStatement> mUpdateDownloadStatement; + nsCOMPtr<mozIStorageStatement> mUpdatePrivateDownloadStatement; + nsCOMPtr<mozIStorageStatement> mGetIdsForURIStatement; + nsCOMPtr<mozIStorageStatement> mGetPrivateIdsForURIStatement; + nsAutoPtr<mozStorageTransaction> mHistoryTransaction; + + static nsDownloadManager *gDownloadManagerService; + + friend class nsDownload; +}; + +class nsDownload final : public nsIDownload +{ +public: + NS_DECL_NSIWEBPROGRESSLISTENER + NS_DECL_NSIWEBPROGRESSLISTENER2 + NS_DECL_NSITRANSFER + NS_DECL_NSIDOWNLOAD + NS_DECL_ISUPPORTS + + nsDownload(); + + /** + * This method MUST be called when changing states on a download. It will + * notify the download listener when a change happens. This also updates the + * database, by calling UpdateDB(). + */ + nsresult SetState(DownloadState aState); + +protected: + virtual ~nsDownload(); + + /** + * Finish up the download by breaking reference cycles and clearing unneeded + * data. Additionally, the download removes itself from the download + * manager's list of current downloads. + * + * NOTE: This method removes the cycle created when starting the download, so + * make sure to use kungFuDeathGrip if you want to access member variables. + */ + void Finalize(); + + /** + * For finished resumed downloads that came in from exthandler, perform the + * action that would have been done if the download wasn't resumed. + */ + nsresult ExecuteDesiredAction(); + + /** + * Move the temporary file to the final destination by removing the existing + * dummy target and renaming the temporary. + */ + nsresult MoveTempToTarget(); + + /** + * Set the target file permissions to be appropriate. + */ + nsresult FixTargetPermissions(); + + /** + * Update the start time which also implies the last update time is the same. + */ + void SetStartTime(int64_t aStartTime); + + /** + * Update the amount of bytes transferred and max bytes; and recalculate the + * download percent. + */ + void SetProgressBytes(int64_t aCurrBytes, int64_t aMaxBytes); + + /** + * All this does is cancel the connection that the download is using. It does + * not remove it from the download manager. + */ + nsresult CancelTransfer(); + + /** + * Download is not transferring? + */ + bool IsPaused(); + + /** + * Download can continue from the middle of a transfer? + */ + bool IsResumable(); + + /** + * Download was resumed? + */ + bool WasResumed(); + + /** + * Indicates if the download should try to automatically resume or not. + */ + bool ShouldAutoResume(); + + /** + * Download is in a state to stop and complete the download? + */ + bool IsFinishable(); + + /** + * Download is totally done transferring and all? + */ + bool IsFinished(); + + /** + * Update the DB with the current state of the download including time, + * download state and other values not known when first creating the + * download DB entry. + */ + nsresult UpdateDB(); + + /** + * Fail a download because of a failure status and prompt the provided + * message or use a generic download failure message if nullptr. + */ + nsresult FailDownload(nsresult aStatus, const char16_t *aMessage); + + /** + * Opens the downloaded file with the appropriate application, which is + * either the OS default, MIME type default, or the one selected by the user. + * + * This also adds the temporary file to the "To be deleted on Exit" list, if + * the corresponding user preference is set (except on OS X). + * + * This function was adopted from nsExternalAppHandler::OpenWithApplication + * (uriloader/exthandler/nsExternalHelperAppService.cpp). + */ + nsresult OpenWithApplication(); + + nsDownloadManager *mDownloadManager; + nsCOMPtr<nsIURI> mTarget; + +private: + nsString mDisplayName; + nsCString mEntityID; + nsCString mGUID; + + nsCOMPtr<nsIURI> mSource; + nsCOMPtr<nsIURI> mReferrer; + nsCOMPtr<nsICancelable> mCancelable; + nsCOMPtr<nsIRequest> mRequest; + nsCOMPtr<nsIFile> mTempFile; + nsCOMPtr<nsIMIMEInfo> mMIMEInfo; + + DownloadState mDownloadState; + + uint32_t mID; + int32_t mPercentComplete; + + /** + * These bytes are based on the position of where the request started, so 0 + * doesn't necessarily mean we have nothing. Use GetAmountTransferred and + * GetSize for the real transferred amount and size. + */ + int64_t mCurrBytes; + int64_t mMaxBytes; + + PRTime mStartTime; + PRTime mLastUpdate; + int64_t mResumedAt; + double mSpeed; + + bool mHasMultipleFiles; + bool mPrivate; + + /** + * Track various states of the download trying to auto-resume when starting + * the download manager or restoring from a crash. + * + * DONT_RESUME: Don't automatically resume the download + * AUTO_RESUME: Automaically resume the download + */ + enum AutoResume { DONT_RESUME, AUTO_RESUME }; + AutoResume mAutoResume; + + /** + * Stores the SHA-256 hash associated with the downloaded file. + */ + nsCString mHash; + + /** + * Stores the certificate chains in an nsIArray of nsIX509CertList of + * nsIX509Cert, if this binary is signed. + */ + nsCOMPtr<nsIArray> mSignatureInfo; + + /** + * Stores the redirects that led to this download in an nsIArray of + * nsIPrincipal. + */ + nsCOMPtr<nsIArray> mRedirects; + + friend class nsDownloadManager; +}; + +#endif diff --git a/toolkit/components/downloads/nsDownloadManagerUI.js b/toolkit/components/downloads/nsDownloadManagerUI.js new file mode 100644 index 000000000..11e241403 --- /dev/null +++ b/toolkit/components/downloads/nsDownloadManagerUI.js @@ -0,0 +1,107 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + +// Constants + +const Cc = Components.classes; +const Ci = Components.interfaces; +const Cr = Components.results; +const DOWNLOAD_MANAGER_URL = "chrome://mozapps/content/downloads/downloads.xul"; +const PREF_FLASH_COUNT = "browser.download.manager.flashCount"; + +// nsDownloadManagerUI class + +function nsDownloadManagerUI() {} + +nsDownloadManagerUI.prototype = { + classID: Components.ID("7dfdf0d1-aff6-4a34-bad1-d0fe74601642"), + + // nsIDownloadManagerUI + + show: function show(aWindowContext, aDownload, aReason, aUsePrivateUI) + { + if (!aReason) + aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED; + + // First we see if it is already visible + let window = this.recentWindow; + if (window) { + window.focus(); + + // If we are being asked to show again, with a user interaction reason, + // set the appropriate variable. + if (aReason == Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED) + window.gUserInteracted = true; + return; + } + + let parent = null; + // We try to get a window to use as the parent here. If we don't have one, + // the download manager will close immediately after opening if the pref + // browser.download.manager.closeWhenDone is set to true. + try { + if (aWindowContext) + parent = aWindowContext.getInterface(Ci.nsIDOMWindow); + } catch (e) { /* it's OK to not have a parent window */ } + + // We pass the download manager and the nsIDownload we want selected (if any) + var params = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); + params.appendElement(aDownload, false); + + // Pass in the reason as well + let reason = Cc["@mozilla.org/supports-PRInt16;1"]. + createInstance(Ci.nsISupportsPRInt16); + reason.data = aReason; + params.appendElement(reason, false); + + var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]. + getService(Ci.nsIWindowWatcher); + ww.openWindow(parent, + DOWNLOAD_MANAGER_URL, + "Download:Manager", + "chrome,dialog=no,resizable", + params); + }, + + get visible() { + return (null != this.recentWindow); + }, + + getAttention: function getAttention() + { + if (!this.visible) + throw Cr.NS_ERROR_UNEXPECTED; + + var prefs = Cc["@mozilla.org/preferences-service;1"]. + getService(Ci.nsIPrefBranch); + // This preference may not be set, so defaulting to two. + let flashCount = 2; + try { + flashCount = prefs.getIntPref(PREF_FLASH_COUNT); + } catch (e) { } + + var win = this.recentWindow.QueryInterface(Ci.nsIDOMChromeWindow); + win.getAttentionWithCycleCount(flashCount); + }, + + // nsDownloadManagerUI + + get recentWindow() { + var wm = Cc["@mozilla.org/appshell/window-mediator;1"]. + getService(Ci.nsIWindowMediator); + return wm.getMostRecentWindow("Download:Manager"); + }, + + // nsISupports + + QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]) +}; + +// Module + +var components = [nsDownloadManagerUI]; +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); + diff --git a/toolkit/components/downloads/nsDownloadManagerUI.manifest b/toolkit/components/downloads/nsDownloadManagerUI.manifest new file mode 100644 index 000000000..4073c23fb --- /dev/null +++ b/toolkit/components/downloads/nsDownloadManagerUI.manifest @@ -0,0 +1,2 @@ +component {7dfdf0d1-aff6-4a34-bad1-d0fe74601642} nsDownloadManagerUI.js +contract @mozilla.org/download-manager-ui;1 {7dfdf0d1-aff6-4a34-bad1-d0fe74601642} diff --git a/toolkit/components/downloads/nsDownloadProxy.h b/toolkit/components/downloads/nsDownloadProxy.h new file mode 100644 index 000000000..ca48c9dad --- /dev/null +++ b/toolkit/components/downloads/nsDownloadProxy.h @@ -0,0 +1,179 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef downloadproxy___h___ +#define downloadproxy___h___ + +#include "nsIDownloadManager.h" +#include "nsIPrefBranch.h" +#include "nsIPrefService.h" +#include "nsIMIMEInfo.h" +#include "nsIFileURL.h" +#include "nsIDownloadManagerUI.h" + +#define PREF_BDM_SHOWWHENSTARTING "browser.download.manager.showWhenStarting" +#define PREF_BDM_FOCUSWHENSTARTING "browser.download.manager.focusWhenStarting" + +// This class only exists because nsDownload cannot inherit from nsITransfer +// directly. The reason for this is that nsDownloadManager (incorrectly) keeps +// an nsCOMArray of nsDownloads, and nsCOMArray is only intended for use with +// abstract classes. Using a concrete class that multiply inherits from classes +// deriving from nsISupports will throw ambiguous base class errors. +class nsDownloadProxy : public nsITransfer +{ +protected: + + virtual ~nsDownloadProxy() { } + +public: + + nsDownloadProxy() { } + + NS_DECL_ISUPPORTS + + NS_IMETHOD Init(nsIURI* aSource, + nsIURI* aTarget, + const nsAString& aDisplayName, + nsIMIMEInfo *aMIMEInfo, + PRTime aStartTime, + nsIFile* aTempFile, + nsICancelable* aCancelable, + bool aIsPrivate) override { + nsresult rv; + nsCOMPtr<nsIDownloadManager> dm = do_GetService("@mozilla.org/download-manager;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + rv = dm->AddDownload(nsIDownloadManager::DOWNLOAD_TYPE_DOWNLOAD, aSource, + aTarget, aDisplayName, aMIMEInfo, aStartTime, + aTempFile, aCancelable, aIsPrivate, + getter_AddRefs(mInner)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs); + + bool showDM = true; + if (branch) + branch->GetBoolPref(PREF_BDM_SHOWWHENSTARTING, &showDM); + + if (showDM) { + nsCOMPtr<nsIDownloadManagerUI> dmui = + do_GetService("@mozilla.org/download-manager-ui;1", &rv); + NS_ENSURE_SUCCESS(rv, rv); + + bool visible; + rv = dmui->GetVisible(&visible); + NS_ENSURE_SUCCESS(rv, rv); + + bool focusWhenStarting = true; + if (branch) + (void)branch->GetBoolPref(PREF_BDM_FOCUSWHENSTARTING, &focusWhenStarting); + + if (visible && !focusWhenStarting) + return NS_OK; + + return dmui->Show(nullptr, mInner, nsIDownloadManagerUI::REASON_NEW_DOWNLOAD, aIsPrivate); + } + return rv; + } + + NS_IMETHOD OnStateChange(nsIWebProgress* aWebProgress, + nsIRequest* aRequest, uint32_t aStateFlags, + nsresult aStatus) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); + } + + NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, nsresult aStatus, + const char16_t *aMessage) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); + } + + NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, nsIURI *aLocation, + uint32_t aFlags) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnLocationChange(aWebProgress, aRequest, aLocation, aFlags); + } + + NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + int32_t aCurSelfProgress, + int32_t aMaxSelfProgress, + int32_t aCurTotalProgress, + int32_t aMaxTotalProgress) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnProgressChange(aWebProgress, aRequest, + aCurSelfProgress, + aMaxSelfProgress, + aCurTotalProgress, + aMaxTotalProgress); + } + + NS_IMETHOD OnProgressChange64(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, + int64_t aCurSelfProgress, + int64_t aMaxSelfProgress, + int64_t aCurTotalProgress, + int64_t aMaxTotalProgress) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnProgressChange64(aWebProgress, aRequest, + aCurSelfProgress, + aMaxSelfProgress, + aCurTotalProgress, + aMaxTotalProgress); + } + + NS_IMETHOD OnRefreshAttempted(nsIWebProgress *aWebProgress, + nsIURI *aUri, + int32_t aDelay, + bool aSameUri, + bool *allowRefresh) override + { + *allowRefresh = true; + return NS_OK; + } + + NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, + nsIRequest *aRequest, uint32_t aState) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->OnSecurityChange(aWebProgress, aRequest, aState); + } + + NS_IMETHOD SetSha256Hash(const nsACString& aHash) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->SetSha256Hash(aHash); + } + + NS_IMETHOD SetSignatureInfo(nsIArray* aSignatureInfo) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->SetSignatureInfo(aSignatureInfo); + } + + NS_IMETHOD SetRedirects(nsIArray* aRedirects) override + { + NS_ENSURE_TRUE(mInner, NS_ERROR_NOT_INITIALIZED); + return mInner->SetRedirects(aRedirects); + } + +private: + nsCOMPtr<nsIDownload> mInner; +}; + +NS_IMPL_ISUPPORTS(nsDownloadProxy, nsITransfer, + nsIWebProgressListener, nsIWebProgressListener2) + +#endif diff --git a/toolkit/components/downloads/nsDownloadScanner.cpp b/toolkit/components/downloads/nsDownloadScanner.cpp new file mode 100644 index 000000000..1ef5b3660 --- /dev/null +++ b/toolkit/components/downloads/nsDownloadScanner.cpp @@ -0,0 +1,728 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: se cin sw=2 ts=2 et : */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsDownloadScanner.h" +#include <comcat.h> +#include <process.h> +#include "nsDownloadManager.h" +#include "nsIXULAppInfo.h" +#include "nsXULAppAPI.h" +#include "nsIPrefService.h" +#include "nsNetUtil.h" +#include "prtime.h" +#include "nsDeque.h" +#include "nsIFileURL.h" +#include "nsIPrefBranch.h" +#include "nsXPCOMCIDInternal.h" + +/** + * Code overview + * + * Download scanner attempts to make use of one of two different virus + * scanning interfaces available on Windows - IOfficeAntiVirus (Windows + * 95/NT 4 and IE 5) and IAttachmentExecute (XPSP2 and up). The latter + * interface supports calling IOfficeAntiVirus internally, while also + * adding support for XPSP2+ ADS forks which define security related + * prompting on downloaded content. + * + * Both interfaces are synchronous and can take a while, so it is not a + * good idea to call either from the main thread. Some antivirus scanners can + * take a long time to scan or the call might block while the scanner shows + * its UI so if the user were to download many files that finished around the + * same time, they would have to wait a while if the scanning were done on + * exactly one other thread. Since the overhead of creating a thread is + * relatively small compared to the time it takes to download a file and scan + * it, a new thread is spawned for each download that is to be scanned. Since + * most of the mozilla codebase is not threadsafe, all the information needed + * for the scanner is gathered in the main thread in nsDownloadScanner::Scan::Start. + * The only function of nsDownloadScanner::Scan which is invoked on another + * thread is DoScan. + * + * Watchdog overview + * + * The watchdog is used internally by the scanner. It maintains a queue of + * current download scans. In a separate thread, it dequeues the oldest scan + * and waits on that scan's thread with a timeout given by WATCHDOG_TIMEOUT + * (default is 30 seconds). If the wait times out, then the watchdog notifies + * the Scan that it has timed out. If the scan really has timed out, then the + * Scan object will dispatch its run method to the main thread; this will + * release the watchdog thread's addref on the Scan. If it has not timed out + * (i.e. the Scan just finished in time), then the watchdog dispatches a + * ReleaseDispatcher to release its ref of the Scan on the main thread. + * + * In order to minimize execution time, there are two events used to notify the + * watchdog thread of a non-empty queue and a quit event. Every blocking wait + * that the watchdog thread does waits on the quit event; this lets the thread + * quickly exit when shutting down. Also, the download scan queue will be empty + * most of the time; rather than use a spin loop, a simple event is triggered + * by the main thread when a new scan is added to an empty queue. When the + * watchdog thread knows that it has run out of elements in the queue, it will + * wait on the new item event. + * + * Memory/resource leaks due to timeout: + * In the event of a timeout, the thread must remain alive; terminating it may + * very well cause the antivirus scanner to crash or be put into an + * inconsistent state; COM resources may also not be cleaned up. The downside + * is that we need to leave the thread running; suspending it may lead to a + * deadlock. Because the scan call may be ongoing, it may be dependent on the + * memory referenced by the MSOAVINFO structure, so we cannot free mName, mPath + * or mOrigin; this means that we cannot free the Scan object since doing so + * will deallocate that memory. Note that mDownload is set to null upon timeout + * or completion, so the download itself is never leaked. If the scan does + * eventually complete, then the all the memory and resources will be freed. + * It is possible, however extremely rare, that in the event of a timeout, the + * mStateSync critical section will leak its event; this will happen only if + * the scanning thread, watchdog thread or main thread try to enter the + * critical section when one of the others is already in it. + * + * Reasoning for CheckAndSetState - there exists a race condition between the time when + * either the timeout or normal scan sets the state and when Scan::Run is + * executed on the main thread. Ex: mStatus could be set by Scan::DoScan* which + * then queues a dispatch on the main thread. Before that dispatch is executed, + * the timeout code fires and sets mStatus to AVSCAN_TIMEDOUT which then queues + * its dispatch to the main thread (the same function as DoScan*). Both + * dispatches run and both try to set the download state to AVSCAN_TIMEDOUT + * which is incorrect. + * + * There are 5 possible outcomes of the virus scan: + * AVSCAN_GOOD => the file is clean + * AVSCAN_BAD => the file has a virus + * AVSCAN_UGLY => the file had a virus, but it was cleaned + * AVSCAN_FAILED => something else went wrong with the virus scanner. + * AVSCAN_TIMEDOUT => the scan (thread setup + execution) took too long + * + * Both the good and ugly states leave the user with a benign file, so they + * transition to the finished state. Bad files are sent to the blocked state. + * The failed and timedout states transition to finished downloads. + * + * Possible Future enhancements: + * * Create an interface for scanning files in general + * * Make this a service + * * Get antivirus scanner status via WMI/registry + */ + +// IAttachementExecute supports user definable settings for certain +// security related prompts. This defines a general GUID for use in +// all projects. Individual projects can define an individual guid +// if they want to. +#ifndef MOZ_VIRUS_SCANNER_PROMPT_GUID +#define MOZ_VIRUS_SCANNER_PROMPT_GUID \ + { 0xb50563d1, 0x16b6, 0x43c2, { 0xa6, 0x6a, 0xfa, 0xe6, 0xd2, 0x11, 0xf2, \ + 0xea } } +#endif +static const GUID GUID_MozillaVirusScannerPromptGeneric = + MOZ_VIRUS_SCANNER_PROMPT_GUID; + +// Initial timeout is 30 seconds +#define WATCHDOG_TIMEOUT (30*PR_USEC_PER_SEC) + +// Maximum length for URI's passed into IAE +#define MAX_IAEURILENGTH 1683 + +class nsDownloadScannerWatchdog +{ + typedef nsDownloadScanner::Scan Scan; +public: + nsDownloadScannerWatchdog(); + ~nsDownloadScannerWatchdog(); + + nsresult Init(); + nsresult Shutdown(); + + void Watch(Scan *scan); +private: + static unsigned int __stdcall WatchdogThread(void *p); + CRITICAL_SECTION mQueueSync; + nsDeque mScanQueue; + HANDLE mThread; + HANDLE mNewItemEvent; + HANDLE mQuitEvent; +}; + +nsDownloadScanner::nsDownloadScanner() : + mAESExists(false) +{ +} + +// This destructor appeases the compiler; it would otherwise complain about an +// incomplete type for nsDownloadWatchdog in the instantiation of +// nsAutoPtr::~nsAutoPtr +// Plus, it's a handy location to call nsDownloadScannerWatchdog::Shutdown from +nsDownloadScanner::~nsDownloadScanner() { + if (mWatchdog) + (void)mWatchdog->Shutdown(); +} + +nsresult +nsDownloadScanner::Init() +{ + // This CoInitialize/CoUninitialize pattern seems to be common in the Mozilla + // codebase. All other COM calls/objects are made on different threads. + nsresult rv = NS_OK; + CoInitialize(nullptr); + + if (!IsAESAvailable()) { + CoUninitialize(); + return NS_ERROR_NOT_AVAILABLE; + } + + mAESExists = true; + + // Initialize scanning + mWatchdog = new nsDownloadScannerWatchdog(); + if (mWatchdog) { + rv = mWatchdog->Init(); + if (FAILED(rv)) + mWatchdog = nullptr; + } else { + rv = NS_ERROR_OUT_OF_MEMORY; + } + + if (NS_FAILED(rv)) + return rv; + + return rv; +} + +bool +nsDownloadScanner::IsAESAvailable() +{ + // Try to instantiate IAE to see if it's available. + RefPtr<IAttachmentExecute> ae; + HRESULT hr; + hr = CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_INPROC, + IID_IAttachmentExecute, getter_AddRefs(ae)); + if (FAILED(hr)) { + NS_WARNING("Could not instantiate attachment execution service\n"); + return false; + } + return true; +} + +// If IAttachementExecute is available, use the CheckPolicy call to find out +// if this download should be prevented due to Security Zone Policy settings. +AVCheckPolicyState +nsDownloadScanner::CheckPolicy(nsIURI *aSource, nsIURI *aTarget) +{ + nsresult rv; + + if (!mAESExists || !aSource || !aTarget) + return AVPOLICY_DOWNLOAD; + + nsAutoCString source; + rv = aSource->GetSpec(source); + if (NS_FAILED(rv)) + return AVPOLICY_DOWNLOAD; + + nsCOMPtr<nsIFileURL> fileUrl(do_QueryInterface(aTarget)); + if (!fileUrl) + return AVPOLICY_DOWNLOAD; + + nsCOMPtr<nsIFile> theFile; + nsAutoString aFileName; + if (NS_FAILED(fileUrl->GetFile(getter_AddRefs(theFile))) || + NS_FAILED(theFile->GetLeafName(aFileName))) + return AVPOLICY_DOWNLOAD; + + // IAttachementExecute prohibits src data: schemes by default but we + // support them. If this is a data src, skip off doing a policy check. + // (The file will still be scanned once it lands on the local system.) + bool isDataScheme(false); + nsCOMPtr<nsIURI> innerURI = NS_GetInnermostURI(aSource); + if (innerURI) + (void)innerURI->SchemeIs("data", &isDataScheme); + if (isDataScheme) + return AVPOLICY_DOWNLOAD; + + RefPtr<IAttachmentExecute> ae; + HRESULT hr; + hr = CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_INPROC, + IID_IAttachmentExecute, getter_AddRefs(ae)); + if (FAILED(hr)) + return AVPOLICY_DOWNLOAD; + + (void)ae->SetClientGuid(GUID_MozillaVirusScannerPromptGeneric); + (void)ae->SetSource(NS_ConvertUTF8toUTF16(source).get()); + (void)ae->SetFileName(aFileName.get()); + + // Any failure means the file download/exec will be blocked by the system. + // S_OK or S_FALSE imply it's ok. + hr = ae->CheckPolicy(); + + if (hr == S_OK) + return AVPOLICY_DOWNLOAD; + + if (hr == S_FALSE) + return AVPOLICY_PROMPT; + + if (hr == E_INVALIDARG) + return AVPOLICY_PROMPT; + + return AVPOLICY_BLOCKED; +} + +#ifndef THREAD_MODE_BACKGROUND_BEGIN +#define THREAD_MODE_BACKGROUND_BEGIN 0x00010000 +#endif + +#ifndef THREAD_MODE_BACKGROUND_END +#define THREAD_MODE_BACKGROUND_END 0x00020000 +#endif + +unsigned int __stdcall +nsDownloadScanner::ScannerThreadFunction(void *p) +{ + HANDLE currentThread = GetCurrentThread(); + NS_ASSERTION(!NS_IsMainThread(), "Antivirus scan should not be run on the main thread"); + nsDownloadScanner::Scan *scan = static_cast<nsDownloadScanner::Scan*>(p); + if (!SetThreadPriority(currentThread, THREAD_MODE_BACKGROUND_BEGIN)) + (void)SetThreadPriority(currentThread, THREAD_PRIORITY_IDLE); + scan->DoScan(); + (void)SetThreadPriority(currentThread, THREAD_MODE_BACKGROUND_END); + _endthreadex(0); + return 0; +} + +// The sole purpose of this class is to release an object on the main thread +// It assumes that its creator will addref it and it will release itself on +// the main thread too +class ReleaseDispatcher : public mozilla::Runnable { +public: + ReleaseDispatcher(nsISupports *ptr) + : mPtr(ptr) {} + NS_IMETHOD Run(); +private: + nsISupports *mPtr; +}; + +nsresult ReleaseDispatcher::Run() { + NS_ASSERTION(NS_IsMainThread(), "Antivirus scan release dispatch should be run on the main thread"); + NS_RELEASE(mPtr); + NS_RELEASE_THIS(); + return NS_OK; +} + +nsDownloadScanner::Scan::Scan(nsDownloadScanner *scanner, nsDownload *download) + : mDLScanner(scanner), mThread(nullptr), + mDownload(download), mStatus(AVSCAN_NOTSTARTED), + mSkipSource(false) +{ + InitializeCriticalSection(&mStateSync); +} + +nsDownloadScanner::Scan::~Scan() { + DeleteCriticalSection(&mStateSync); +} + +nsresult +nsDownloadScanner::Scan::Start() +{ + mStartTime = PR_Now(); + + mThread = (HANDLE)_beginthreadex(nullptr, 0, ScannerThreadFunction, + this, CREATE_SUSPENDED, nullptr); + if (!mThread) + return NS_ERROR_OUT_OF_MEMORY; + + nsresult rv = NS_OK; + + // Get the path to the file on disk + nsCOMPtr<nsIFile> file; + rv = mDownload->GetTargetFile(getter_AddRefs(file)); + NS_ENSURE_SUCCESS(rv, rv); + rv = file->GetPath(mPath); + NS_ENSURE_SUCCESS(rv, rv); + + // Grab the app name + nsCOMPtr<nsIXULAppInfo> appinfo = + do_GetService(XULAPPINFO_SERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString name; + rv = appinfo->GetName(name); + NS_ENSURE_SUCCESS(rv, rv); + CopyUTF8toUTF16(name, mName); + + // Get the origin + nsCOMPtr<nsIURI> uri; + rv = mDownload->GetSource(getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + + nsAutoCString origin; + rv = uri->GetSpec(origin); + NS_ENSURE_SUCCESS(rv, rv); + + // Certain virus interfaces do not like extremely long uris. + // Chop off the path and cgi data and just pass the base domain. + if (origin.Length() > MAX_IAEURILENGTH) { + rv = uri->GetPrePath(origin); + NS_ENSURE_SUCCESS(rv, rv); + } + + CopyUTF8toUTF16(origin, mOrigin); + + // We count https/ftp/http as an http download + bool isHttp(false), isFtp(false), isHttps(false); + nsCOMPtr<nsIURI> innerURI = NS_GetInnermostURI(uri); + if (!innerURI) innerURI = uri; + (void)innerURI->SchemeIs("http", &isHttp); + (void)innerURI->SchemeIs("ftp", &isFtp); + (void)innerURI->SchemeIs("https", &isHttps); + mIsHttpDownload = isHttp || isFtp || isHttps; + + // IAttachementExecute prohibits src data: schemes by default but we + // support them. Mark the download if it's a data scheme, so we + // can skip off supplying the src to IAttachementExecute when we scan + // the resulting file. + (void)innerURI->SchemeIs("data", &mSkipSource); + + // ResumeThread returns the previous suspend count + if (1 != ::ResumeThread(mThread)) { + CloseHandle(mThread); + return NS_ERROR_UNEXPECTED; + } + return NS_OK; +} + +nsresult +nsDownloadScanner::Scan::Run() +{ + NS_ASSERTION(NS_IsMainThread(), "Antivirus scan dispatch should be run on the main thread"); + + // Cleanup our thread + if (mStatus != AVSCAN_TIMEDOUT) + WaitForSingleObject(mThread, INFINITE); + CloseHandle(mThread); + + DownloadState downloadState = 0; + EnterCriticalSection(&mStateSync); + switch (mStatus) { + case AVSCAN_BAD: + downloadState = nsIDownloadManager::DOWNLOAD_DIRTY; + break; + default: + case AVSCAN_FAILED: + case AVSCAN_GOOD: + case AVSCAN_UGLY: + case AVSCAN_TIMEDOUT: + downloadState = nsIDownloadManager::DOWNLOAD_FINISHED; + break; + } + LeaveCriticalSection(&mStateSync); + // Download will be null if we already timed out + if (mDownload) + (void)mDownload->SetState(downloadState); + + // Clean up some other variables + // In the event of a timeout, our destructor won't be called + mDownload = nullptr; + + NS_RELEASE_THIS(); + return NS_OK; +} + +static DWORD +ExceptionFilterFunction(DWORD exceptionCode) { + switch(exceptionCode) { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_STACK_OVERFLOW: + return EXCEPTION_EXECUTE_HANDLER; + default: + return EXCEPTION_CONTINUE_SEARCH; + } +} + +bool +nsDownloadScanner::Scan::DoScanAES() +{ + // This warning is for the destructor of ae which will not be invoked in the + // event of a win32 exception +#pragma warning(disable: 4509) + HRESULT hr; + RefPtr<IAttachmentExecute> ae; + MOZ_SEH_TRY { + hr = CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_ALL, + IID_IAttachmentExecute, getter_AddRefs(ae)); + } MOZ_SEH_EXCEPT(ExceptionFilterFunction(GetExceptionCode())) { + return CheckAndSetState(AVSCAN_NOTSTARTED,AVSCAN_FAILED); + } + + // If we (somehow) already timed out, then don't bother scanning + if (CheckAndSetState(AVSCAN_SCANNING, AVSCAN_NOTSTARTED)) { + AVScanState newState; + if (SUCCEEDED(hr)) { + bool gotException = false; + MOZ_SEH_TRY { + (void)ae->SetClientGuid(GUID_MozillaVirusScannerPromptGeneric); + (void)ae->SetLocalPath(mPath.get()); + // Provide the src for everything but data: schemes. + if (!mSkipSource) + (void)ae->SetSource(mOrigin.get()); + + // Save() will invoke the scanner + hr = ae->Save(); + } MOZ_SEH_EXCEPT(ExceptionFilterFunction(GetExceptionCode())) { + gotException = true; + } + + MOZ_SEH_TRY { + ae = nullptr; + } MOZ_SEH_EXCEPT(ExceptionFilterFunction(GetExceptionCode())) { + gotException = true; + } + + if(gotException) { + newState = AVSCAN_FAILED; + } + else if (SUCCEEDED(hr)) { // Passed the scan + newState = AVSCAN_GOOD; + } + else if (HRESULT_CODE(hr) == ERROR_FILE_NOT_FOUND) { + NS_WARNING("Downloaded file disappeared before it could be scanned"); + newState = AVSCAN_FAILED; + } + else if (hr == E_INVALIDARG) { + NS_WARNING("IAttachementExecute returned invalid argument error"); + newState = AVSCAN_FAILED; + } + else { + newState = AVSCAN_UGLY; + } + } + else { + newState = AVSCAN_FAILED; + } + return CheckAndSetState(newState, AVSCAN_SCANNING); + } + return false; +} +#pragma warning(default: 4509) + +void +nsDownloadScanner::Scan::DoScan() +{ + CoInitialize(nullptr); + + if (DoScanAES()) { + // We need to do a few more things on the main thread + NS_DispatchToMainThread(this); + } else { + // We timed out, so just release + ReleaseDispatcher* releaser = new ReleaseDispatcher(this); + if(releaser) { + NS_ADDREF(releaser); + NS_DispatchToMainThread(releaser); + } + } + + MOZ_SEH_TRY { + CoUninitialize(); + } MOZ_SEH_EXCEPT(ExceptionFilterFunction(GetExceptionCode())) { + // Not much we can do at this point... + } +} + +HANDLE +nsDownloadScanner::Scan::GetWaitableThreadHandle() const +{ + HANDLE targetHandle = INVALID_HANDLE_VALUE; + (void)DuplicateHandle(GetCurrentProcess(), mThread, + GetCurrentProcess(), &targetHandle, + SYNCHRONIZE, // Only allow clients to wait on this handle + FALSE, // cannot be inherited by child processes + 0); + return targetHandle; +} + +bool +nsDownloadScanner::Scan::NotifyTimeout() +{ + bool didTimeout = CheckAndSetState(AVSCAN_TIMEDOUT, AVSCAN_SCANNING) || + CheckAndSetState(AVSCAN_TIMEDOUT, AVSCAN_NOTSTARTED); + if (didTimeout) { + // We need to do a few more things on the main thread + NS_DispatchToMainThread(this); + } + return didTimeout; +} + +bool +nsDownloadScanner::Scan::CheckAndSetState(AVScanState newState, AVScanState expectedState) { + bool gotExpectedState = false; + EnterCriticalSection(&mStateSync); + if((gotExpectedState = (mStatus == expectedState))) + mStatus = newState; + LeaveCriticalSection(&mStateSync); + return gotExpectedState; +} + +nsresult +nsDownloadScanner::ScanDownload(nsDownload *download) +{ + if (!mAESExists) + return NS_ERROR_NOT_AVAILABLE; + + // No ref ptr, see comment below + Scan *scan = new Scan(this, download); + if (!scan) + return NS_ERROR_OUT_OF_MEMORY; + + NS_ADDREF(scan); + + nsresult rv = scan->Start(); + + // Note that we only release upon error. On success, the scan is passed off + // to a new thread. It is eventually released in Scan::Run on the main thread. + if (NS_FAILED(rv)) + NS_RELEASE(scan); + else + // Notify the watchdog + mWatchdog->Watch(scan); + + return rv; +} + +nsDownloadScannerWatchdog::nsDownloadScannerWatchdog() + : mNewItemEvent(nullptr), mQuitEvent(nullptr) { + InitializeCriticalSection(&mQueueSync); +} +nsDownloadScannerWatchdog::~nsDownloadScannerWatchdog() { + DeleteCriticalSection(&mQueueSync); +} + +nsresult +nsDownloadScannerWatchdog::Init() { + // Both events are auto-reset + mNewItemEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr); + if (INVALID_HANDLE_VALUE == mNewItemEvent) + return NS_ERROR_OUT_OF_MEMORY; + mQuitEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr); + if (INVALID_HANDLE_VALUE == mQuitEvent) { + (void)CloseHandle(mNewItemEvent); + return NS_ERROR_OUT_OF_MEMORY; + } + + // This thread is always running, however it will be asleep + // for most of the dlmgr's lifetime + mThread = (HANDLE)_beginthreadex(nullptr, 0, WatchdogThread, + this, 0, nullptr); + if (!mThread) { + (void)CloseHandle(mNewItemEvent); + (void)CloseHandle(mQuitEvent); + return NS_ERROR_OUT_OF_MEMORY; + } + + return NS_OK; +} + +nsresult +nsDownloadScannerWatchdog::Shutdown() { + // Tell the watchdog thread to quite + (void)SetEvent(mQuitEvent); + (void)WaitForSingleObject(mThread, INFINITE); + (void)CloseHandle(mThread); + // Manually clear and release the queued scans + while (mScanQueue.GetSize() != 0) { + Scan *scan = reinterpret_cast<Scan*>(mScanQueue.Pop()); + NS_RELEASE(scan); + } + (void)CloseHandle(mNewItemEvent); + (void)CloseHandle(mQuitEvent); + return NS_OK; +} + +void +nsDownloadScannerWatchdog::Watch(Scan *scan) { + bool wasEmpty; + // Note that there is no release in this method + // The scan will be released by the watchdog ALWAYS on the main thread + // when either the watchdog thread processes the scan or the watchdog + // is shut down + NS_ADDREF(scan); + EnterCriticalSection(&mQueueSync); + wasEmpty = mScanQueue.GetSize()==0; + mScanQueue.Push(scan); + LeaveCriticalSection(&mQueueSync); + // If the queue was empty, then the watchdog thread is/will be asleep + if (wasEmpty) + (void)SetEvent(mNewItemEvent); +} + +unsigned int +__stdcall +nsDownloadScannerWatchdog::WatchdogThread(void *p) { + NS_ASSERTION(!NS_IsMainThread(), "Antivirus scan watchdog should not be run on the main thread"); + nsDownloadScannerWatchdog *watchdog = (nsDownloadScannerWatchdog*)p; + HANDLE waitHandles[3] = {watchdog->mNewItemEvent, watchdog->mQuitEvent, INVALID_HANDLE_VALUE}; + DWORD waitStatus; + DWORD queueItemsLeft = 0; + // Loop until quit event or error + while (0 != queueItemsLeft || + ((WAIT_OBJECT_0 + 1) != + (waitStatus = + WaitForMultipleObjects(2, waitHandles, FALSE, INFINITE)) && + waitStatus != WAIT_FAILED)) { + Scan *scan = nullptr; + PRTime startTime, expectedEndTime, now; + DWORD waitTime; + + // Pop scan from queue + EnterCriticalSection(&watchdog->mQueueSync); + scan = reinterpret_cast<Scan*>(watchdog->mScanQueue.Pop()); + queueItemsLeft = watchdog->mScanQueue.GetSize(); + LeaveCriticalSection(&watchdog->mQueueSync); + + // Calculate expected end time + startTime = scan->GetStartTime(); + expectedEndTime = WATCHDOG_TIMEOUT + startTime; + now = PR_Now(); + // PRTime is not guaranteed to be a signed integral type (afaik), but + // currently it is + if (now > expectedEndTime) { + waitTime = 0; + } else { + // This is a positive value, and we know that it will not overflow + // (bounded by WATCHDOG_TIMEOUT) + // waitTime is in milliseconds, nspr uses microseconds + waitTime = static_cast<DWORD>((expectedEndTime - now)/PR_USEC_PER_MSEC); + } + HANDLE hThread = waitHandles[2] = scan->GetWaitableThreadHandle(); + + // Wait for the thread (obj 1) or quit event (obj 0) + waitStatus = WaitForMultipleObjects(2, (waitHandles+1), FALSE, waitTime); + CloseHandle(hThread); + + ReleaseDispatcher* releaser = new ReleaseDispatcher(scan); + if(!releaser) + continue; + NS_ADDREF(releaser); + // Got quit event or error + if (waitStatus == WAIT_FAILED || waitStatus == WAIT_OBJECT_0) { + NS_DispatchToMainThread(releaser); + break; + // Thread exited normally + } else if (waitStatus == (WAIT_OBJECT_0+1)) { + NS_DispatchToMainThread(releaser); + continue; + // Timeout case + } else { + NS_ASSERTION(waitStatus == WAIT_TIMEOUT, "Unexpected wait status in dlmgr watchdog thread"); + if (!scan->NotifyTimeout()) { + // If we didn't time out, then release the thread + NS_DispatchToMainThread(releaser); + } else { + // NotifyTimeout did a dispatch which will release the scan, so we + // don't need to release the scan + NS_RELEASE(releaser); + } + } + } + _endthreadex(0); + return 0; +} diff --git a/toolkit/components/downloads/nsDownloadScanner.h b/toolkit/components/downloads/nsDownloadScanner.h new file mode 100644 index 000000000..3301489fe --- /dev/null +++ b/toolkit/components/downloads/nsDownloadScanner.h @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* vim: se cin sw=2 ts=2 et : */ + +#ifndef nsDownloadScanner_h_ +#define nsDownloadScanner_h_ + +#ifdef WIN32_LEAN_AND_MEAN +#undef WIN32_LEAN_AND_MEAN +#endif +#include <windows.h> +#define AVVENDOR +#include <objidl.h> +#include <msoav.h> +#include <shlobj.h> + +#include "nsAutoPtr.h" +#include "nsThreadUtils.h" +#include "nsTArray.h" +#include "nsIObserver.h" +#include "nsIURI.h" + +enum AVScanState +{ + AVSCAN_NOTSTARTED = 0, + AVSCAN_SCANNING, + AVSCAN_GOOD, + AVSCAN_BAD, + AVSCAN_UGLY, + AVSCAN_FAILED, + AVSCAN_TIMEDOUT +}; + +enum AVCheckPolicyState +{ + AVPOLICY_DOWNLOAD, + AVPOLICY_PROMPT, + AVPOLICY_BLOCKED +}; + +// See nsDownloadScanner.cpp for declaration and definition +class nsDownloadScannerWatchdog; +class nsDownload; + +class nsDownloadScanner +{ +public: + nsDownloadScanner(); + ~nsDownloadScanner(); + nsresult Init(); + nsresult ScanDownload(nsDownload *download); + AVCheckPolicyState CheckPolicy(nsIURI *aSource, nsIURI *aTarget); + +private: + bool mAESExists; + nsTArray<CLSID> mScanCLSID; + bool IsAESAvailable(); + bool EnumerateOAVProviders(); + + nsAutoPtr<nsDownloadScannerWatchdog> mWatchdog; + + static unsigned int __stdcall ScannerThreadFunction(void *p); + class Scan : public mozilla::Runnable + { + public: + Scan(nsDownloadScanner *scanner, nsDownload *download); + ~Scan(); + nsresult Start(); + + // Returns the time that Start was called + PRTime GetStartTime() const { return mStartTime; } + // Returns a copy of the thread handle that can be waited on, but not + // terminated + // The caller is responsible for closing the handle + // If the thread has terminated, then this will return the pseudo-handle + // INVALID_HANDLE_VALUE + HANDLE GetWaitableThreadHandle() const; + + // Called on a secondary thread to notify the scan that it has timed out + // this is used only by the watchdog thread + bool NotifyTimeout(); + + private: + nsDownloadScanner *mDLScanner; + PRTime mStartTime; + HANDLE mThread; + RefPtr<nsDownload> mDownload; + // Guards mStatus + CRITICAL_SECTION mStateSync; + AVScanState mStatus; + nsString mPath; + nsString mName; + nsString mOrigin; + // Also true if it is an ftp download + bool mIsHttpDownload; + bool mSkipSource; + + /* @summary Sets the Scan's state to newState if the current state is + expectedState + * @param newState The new state of the scan + * @param expectedState The state that the caller expects the scan to be in + * @return If the old state matched expectedState + */ + bool CheckAndSetState(AVScanState newState, AVScanState expectedState); + + NS_IMETHOD Run(); + + void DoScan(); + bool DoScanAES(); + bool DoScanOAV(); + + friend unsigned int __stdcall nsDownloadScanner::ScannerThreadFunction(void *); + }; + // Used to give access to Scan + friend class nsDownloadScannerWatchdog; +}; +#endif + diff --git a/toolkit/components/downloads/nsIApplicationReputation.idl b/toolkit/components/downloads/nsIApplicationReputation.idl new file mode 100644 index 000000000..3250cbb75 --- /dev/null +++ b/toolkit/components/downloads/nsIApplicationReputation.idl @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" + +interface nsIApplicationReputationCallback; +interface nsIApplicationReputationQuery; +interface nsIArray; +interface nsIURI; + +/* + * A service for asynchronously querying an application reputation service + * based on metadata of the downloaded file. + */ +[scriptable, uuid(c9f03479-fd68-4393-acb2-c88d4f563174)] +interface nsIApplicationReputationService : nsISupports { + /** + * Indicates the reason for the application reputation block. + */ + const unsigned long VERDICT_SAFE = 0; + const unsigned long VERDICT_DANGEROUS = 1; + const unsigned long VERDICT_UNCOMMON = 2; + const unsigned long VERDICT_POTENTIALLY_UNWANTED = 3; + const unsigned long VERDICT_DANGEROUS_HOST = 4; + + /** + * Start querying the application reputation service. + * + * @param aQuery + * The nsIApplicationReputationQuery containing metadata of the + * downloaded file. + * + * @param aCallback + * The callback for receiving the results of the query. + * + * @remarks aCallback may not be null. onComplete is guaranteed to be called + * on aCallback. This function may not be called more than once with + * the same query object. If any of the attributes of aQuery have + * not been set or have been set with empty data (with the exception + * of sourceURI), then a valid request can still be constructed and + * will solicit a valid response, but won't produce any useful + * information. + */ + void queryReputation(in nsIApplicationReputationQuery aQuery, + in nsIApplicationReputationCallback aCallback); +}; + +/** + * A single-use, write-once interface for recording the metadata of the + * downloaded file. nsIApplicationReputationService.Start() may only be called + * once with a single query. + */ +[scriptable, uuid(812d7509-a9a3-446e-a66f-3ed8cc91ebd0)] +interface nsIApplicationReputationQuery : nsISupports { + /* + * The nsIURI from which the file was downloaded. This may not be null. + */ + readonly attribute nsIURI sourceURI; + + /* + * The reference, if any. + */ + readonly attribute nsIURI referrerURI; + + /* + * The target filename for the downloaded file, as inferred from the source + * URI or provided by the Content-Disposition attachment file name. If this + * is not set by the caller, it will be passed as an empty string but the + * query won't produce any useful information. + */ + readonly attribute AString suggestedFileName; + + /* + * The size of the downloaded file in bytes. + */ + readonly attribute unsigned long fileSize; + + /* + * The SHA256 hash of the downloaded file in raw bytes. If this is not set by + * the caller, it will be passed as an empty string but the query won't + * produce any useful information. + */ + readonly attribute ACString sha256Hash; + + /* + * The nsIArray of nsIX509CertList of nsIX509Cert that verify for this + * binary, if it is signed. + */ + readonly attribute nsIArray signatureInfo; + + /* + * The nsIArray of nsIPrincipal of redirects that lead to this download. The + * most recent redirect is the last element. + */ + readonly attribute nsIArray redirects; +}; + +[scriptable, function, uuid(9a228470-cfe5-11e2-8b8b-0800200c9a66)] +interface nsIApplicationReputationCallback : nsISupports { + /** + * Callback for the result of the application reputation query. + * @param aStatus + * NS_OK if and only if the query succeeded. If it did, then + * shouldBlock is meaningful (otherwise it defaults to false). This + * may be NS_ERROR_FAILURE if the response cannot be parsed, or + * NS_ERROR_NOT_AVAILABLE if the service has been disabled or is not + * reachable. + * @param aShouldBlock + * Whether or not the download should be blocked. + * @param aVerdict + * Indicates the result of the lookup that determines whether the + * download should be blocked, according to the "VERDICT_" constants. + * This may be set to a value different than "VERDICT_SAFE" even if + * aShouldBlock is false, so you should always check aShouldBlock. + */ + void onComplete(in bool aShouldBlock, + in nsresult aStatus, + in unsigned long aVerdict); +}; diff --git a/toolkit/components/downloads/nsIDownload.idl b/toolkit/components/downloads/nsIDownload.idl new file mode 100644 index 000000000..47eb48780 --- /dev/null +++ b/toolkit/components/downloads/nsIDownload.idl @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsITransfer.idl" + +interface nsIURI; +interface nsIFile; +interface nsIObserver; +interface nsICancelable; +interface nsIWebProgressListener; +interface nsIMIMEInfo; + +/** + * Represents a download object. + * + * @note This object is no longer updated once it enters a completed state. + * Completed states are the following: + * nsIDownloadManager::DOWNLOAD_FINISHED + * nsIDownloadManager::DOWNLOAD_FAILED + * nsIDownloadManager::DOWNLOAD_CANCELED + * nsIDownloadManager::DOWNLOAD_BLOCKED_PARENTAL + * nsIDownloadManager::DOWNLOAD_DIRTY + * nsIDownloadManager::DOWNLOAD_BLOCKED_POLICY + */ +[scriptable, uuid(2258f465-656e-4566-87cb-f791dbaf0322)] +interface nsIDownload : nsITransfer { + + /** + * The target of a download is always a file on the local file system. + */ + readonly attribute nsIFile targetFile; + + /** + * The percentage of transfer completed. + * If the file size is unknown it'll be -1 here. + */ + readonly attribute long percentComplete; + + /** + * The amount of bytes downloaded so far. + */ + readonly attribute long long amountTransferred; + + /** + * The size of file in bytes. + * Unknown size is represented by -1. + */ + readonly attribute long long size; + + /** + * The source of the transfer. + */ + readonly attribute nsIURI source; + + /** + * The target of the transfer. + */ + readonly attribute nsIURI target; + + /** + * Object that can be used to cancel the download. + * Will be null after the download is finished. + */ + readonly attribute nsICancelable cancelable; + + /** + * The user-readable description of the transfer. + */ + readonly attribute AString displayName; + + /** + * The time a transfer was started. + */ + readonly attribute long long startTime; + + /** + * The speed of the transfer in bytes/sec. + */ + readonly attribute double speed; + + /** + * Optional. If set, it will contain the target's relevant MIME information. + * This includes its MIME Type, helper app, and whether that helper should be + * executed. + */ + readonly attribute nsIMIMEInfo MIMEInfo; + + /** + * The id of the download that is stored in the database - not globally unique. + * For example, a private download and a public one might have identical ids. + * Can only be safely used for direct database manipulation in the database that + * contains this download. Use the guid property instead for safe, database-agnostic + * searching and manipulation. + * + * @deprecated + */ + readonly attribute unsigned long id; + + /** + * The guid of the download that is stored in the database. + * Has the form of twelve alphanumeric characters. + */ + readonly attribute ACString guid; + + /** + * The state of the download. + * @see nsIDownloadManager and nsIXPInstallManagerUI + */ + readonly attribute short state; + + /** + * The referrer uri of the download. This is only valid for HTTP downloads, + * and can be null. + */ + readonly attribute nsIURI referrer; + + /** + * Indicates if the download can be resumed after being paused or not. This + * is only the case if the download is over HTTP/1.1 or FTP and if the + * server supports it. + */ + readonly attribute boolean resumable; + + /** + * Indicates if the download was initiated from a context marked as private, + * controlling whether it should be stored in a permanent manner or not. + */ + readonly attribute boolean isPrivate; + + /** + * Cancel this download if it's currently in progress. + */ + void cancel(); + + /** + * Pause this download if it is in progress. + * + * @throws NS_ERROR_UNEXPECTED if it cannot be paused. + */ + void pause(); + + /** + * Resume this download if it is paused. + * + * @throws NS_ERROR_UNEXPECTED if it cannot be resumed or is not paused. + */ + void resume(); + + /** + * Instruct the download manager to remove this download. Whereas + * cancel simply cancels the transfer, but retains information about it, + * remove removes all knowledge of it. + * + * @see nsIDownloadManager.removeDownload for more detail + * @throws NS_ERROR_FAILURE if the download is active. + */ + void remove(); + + /** + * Instruct the download manager to retry this failed download + * @throws NS_ERROR_NOT_AVAILABLE if the download is not known. + * @throws NS_ERROR_FAILURE if the download is not in the following states: + * nsIDownloadManager::DOWNLOAD_CANCELED + * nsIDownloadManager::DOWNLOAD_FAILED + */ + void retry(); +}; + +%{C++ +// {b02be33b-d47c-4bd3-afd9-402a942426b0} +#define NS_DOWNLOAD_CID \ + { 0xb02be33b, 0xd47c, 0x4bd3, { 0xaf, 0xd9, 0x40, 0x2a, 0x94, 0x24, 0x26, 0xb0 } } +%} diff --git a/toolkit/components/downloads/nsIDownloadManager.idl b/toolkit/components/downloads/nsIDownloadManager.idl new file mode 100644 index 000000000..d7eba8940 --- /dev/null +++ b/toolkit/components/downloads/nsIDownloadManager.idl @@ -0,0 +1,358 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Keeps track of ongoing downloads, in the form of nsIDownload's. + +#include "nsISupports.idl" + +interface nsIURI; +interface nsIFile; +interface nsIDownload; +interface nsICancelable; +interface nsIMIMEInfo; +interface nsIDownloadProgressListener; +interface nsISimpleEnumerator; +interface mozIStorageConnection; + +[scriptable, function, uuid(0c07ffeb-791b-49f3-ae38-2c331fd55a52)] +interface nsIDownloadManagerResult : nsISupports { + /** + * Process an asynchronous result from getDownloadByGUID. + * + * @param aStatus The result code of the operation: + * * NS_OK: an item was found. No other success values are returned. + * * NS_ERROR_NOT_AVAILABLE: no such item was found. + * * Other error values are possible, but less well-defined. + */ + void handleResult(in nsresult aStatus, in nsIDownload aDownload); +}; + +[scriptable, uuid(b29aac15-7ec4-4ab3-a53b-08f78aed3b34)] +interface nsIDownloadManager : nsISupports { + /** + * Download type for generic file download. + */ + const short DOWNLOAD_TYPE_DOWNLOAD = 0; + + /** + * Download state for uninitialized download object. + */ + const short DOWNLOAD_NOTSTARTED = -1; + + /** + * Download is currently transferring data. + */ + const short DOWNLOAD_DOWNLOADING = 0; + + /** + * Download completed including any processing of the target + * file. (completed) + */ + const short DOWNLOAD_FINISHED = 1; + + /** + * Transfer failed due to error. (completed) + */ + const short DOWNLOAD_FAILED = 2; + + /** + * Download was canceled by the user. (completed) + */ + const short DOWNLOAD_CANCELED = 3; + + /** + * Transfer was paused by the user. + */ + const short DOWNLOAD_PAUSED = 4; + + /** + * Download is active but data has not yet been received. + */ + const short DOWNLOAD_QUEUED = 5; + + /** + * Transfer request was blocked by parental controls proxies. (completed) + */ + const short DOWNLOAD_BLOCKED_PARENTAL = 6; + + /** + * Transferred download is being scanned by virus scanners. + */ + const short DOWNLOAD_SCANNING = 7; + + /** + * A virus was detected in the download. The target will most likely + * no longer exist. (completed) + */ + const short DOWNLOAD_DIRTY = 8; + + /** + * Win specific: Request was blocked by zone policy settings. + * (see bug #416683) (completed) + */ + const short DOWNLOAD_BLOCKED_POLICY = 9; + + + /** + * Creates an nsIDownload and adds it to be managed by the download manager. + * + * @param aSource The source URI of the transfer. Must not be null. + * + * @param aTarget The target URI of the transfer. Must not be null. + * + * @param aDisplayName The user-readable description of the transfer. + * Can be empty. + * + * @param aMIMEInfo The MIME info associated with the target, + * including MIME type and helper app when appropriate. + * This parameter is optional. + * + * @param startTime Time when the download started + * + * @param aTempFile The location of a temporary file; i.e. a file in which + * the received data will be stored, but which is not + * equal to the target file. (will be moved to the real + * target by the DownloadManager, when the download is + * finished). This will be null for all callers except for + * nsExternalHelperAppHandler. Addons should generally pass + * null for aTempFile. This will be moved to the real target + * by the download manager when the download is finished, + * and the action indicated by aMIMEInfo will be executed. + * + * @param aCancelable An object that can be used to abort the download. + * Must not be null. + * + * @param aIsPrivate Used to determine the privacy status of the new download. + * If true, the download is stored in a manner that leaves + * no permanent trace outside of the current private session. + * + * @return The newly created download item with the passed-in properties. + * + * @note This does not actually start a download. If you want to add and + * start a download, you need to create an nsIWebBrowserPersist, pass it + * as the aCancelable object, call this method, set the progressListener + * as the returned download object, then call saveURI. + */ + nsIDownload addDownload(in short aDownloadType, + in nsIURI aSource, + in nsIURI aTarget, + in AString aDisplayName, + in nsIMIMEInfo aMIMEInfo, + in PRTime aStartTime, + in nsIFile aTempFile, + in nsICancelable aCancelable, + in boolean aIsPrivate); + + /** + * Retrieves a download managed by the download manager. This can be one that + * is in progress, or one that has completed in the past and is stored in the + * database. + * + * @param aID The unique ID of the download. + * @return The download with the specified ID. + * @throws NS_ERROR_NOT_AVAILABLE if the download is not in the database. + */ + nsIDownload getDownload(in unsigned long aID); + + /** + * Retrieves a download managed by the download manager. This can be one that + * is in progress, or one that has completed in the past and is stored in the + * database. The result of this method is returned via an asynchronous callback, + * the parameter of which will be an nsIDownload object, or null if none exists + * with the provided GUID. + * + * @param aGUID The unique GUID of the download. + * @param aCallback The callback to invoke with the result of the search. + */ + void getDownloadByGUID(in ACString aGUID, in nsIDownloadManagerResult aCallback); + + /** + * Cancels the download with the specified ID if it's currently in-progress. + * This calls cancel(NS_BINDING_ABORTED) on the nsICancelable provided by the + * download. + * + * @param aID The unique ID of the download. + * @throws NS_ERROR_FAILURE if the download is not in-progress. + */ + void cancelDownload(in unsigned long aID); + + /** + * Removes the download with the specified id if it's not currently + * in-progress. Whereas cancelDownload simply cancels the transfer, but + * retains information about it, removeDownload removes all knowledge of it. + * + * Also notifies observers of the "download-manager-remove-download-guid" + * topic with the download guid as the subject to allow any DM consumers to + * react to the removal. + * + * Also may notify observers of the "download-manager-remove-download" topic + * with the download id as the subject, if the download removed is public + * or if global private browsing mode is in use. This notification is deprecated; + * the guid notification should be relied upon instead. + * + * @param aID The unique ID of the download. + * @throws NS_ERROR_FAILURE if the download is active. + */ + void removeDownload(in unsigned long aID); + + /** + * Removes all inactive downloads that were started inclusively within the + * specified time frame. + * + * @param aBeginTime + * The start time to remove downloads by in microseconds. + * @param aEndTime + * The end time to remove downloads by in microseconds. + */ + void removeDownloadsByTimeframe(in long long aBeginTime, + in long long aEndTime); + + /** + * Pause the specified download. + * + * @param aID The unique ID of the download. + * @throws NS_ERROR_FAILURE if the download is not in-progress. + */ + void pauseDownload(in unsigned long aID); + + /** + * Resume the specified download. + * + * @param aID The unique ID of the download. + * @throws NS_ERROR_FAILURE if the download is not in-progress. + */ + void resumeDownload(in unsigned long aID); + + /** + * Retries a failed download. + * + * @param aID The unique ID of the download. + * @throws NS_ERROR_NOT_AVAILALE if the download id is not known. + * @throws NS_ERROR_FAILURE if the download is not in the following states: + * nsIDownloadManager::DOWNLOAD_CANCELED + * nsIDownloadManager::DOWNLOAD_FAILED + */ + void retryDownload(in unsigned long aID); + + /** + * The database connection to the downloads database. + */ + readonly attribute mozIStorageConnection DBConnection; + readonly attribute mozIStorageConnection privateDBConnection; + + /** + * Whether or not there are downloads that can be cleaned up (removed) + * i.e. downloads that have completed, have failed or have been canceled. + * In global private browsing mode, this reports the status of the relevant + * private or public downloads. In per-window mode, it only reports for + * public ones. + */ + readonly attribute boolean canCleanUp; + + /** + * Whether or not there are private downloads that can be cleaned up (removed) + * i.e. downloads that have completed, have failed or have been canceled. + */ +readonly attribute boolean canCleanUpPrivate; + + /** + * Removes completed, failed, and canceled downloads from the list. + * In global private browsing mode, this operates on the relevant + * private or public downloads. In per-window mode, it only operates + * on public ones. + * + * Also notifies observers of the "download-manager-remove-download-gui" + * and "download-manager-remove-download" topics with a null subject to + * allow any DM consumers to react to the removals. + */ + void cleanUp(); + + /** + * Removes completed, failed, and canceled downloads from the list + * of private downloads. + * + * Also notifies observers of the "download-manager-remove-download-gui" + * and "download-manager-remove-download" topics with a null subject to + * allow any DM consumers to react to the removals. + */ +void cleanUpPrivate(); + + /** + * The number of files currently being downloaded. + * + * In global private browsing mode, this reports the status of the relevant + * private or public downloads. In per-window mode, it only reports public + * ones. + */ + readonly attribute long activeDownloadCount; + + /** + * The number of private files currently being downloaded. + */ + readonly attribute long activePrivateDownloadCount; + + /** + * An enumeration of active nsIDownloads + * + * In global private browsing mode, this reports the status of the relevant + * private or public downloads. In per-window mode, it only reports public + * ones. + */ + readonly attribute nsISimpleEnumerator activeDownloads; + + /** + * An enumeration of active private nsIDownloads + */ + readonly attribute nsISimpleEnumerator activePrivateDownloads; + + /** + * Adds a listener to the download manager. It is expected that this + * listener will only access downloads via their deprecated integer id attribute, + * and when global private browsing compatibility mode is disabled, this listener + * will receive no notifications for downloads marked private. + */ + void addListener(in nsIDownloadProgressListener aListener); + + /** + * Adds a listener to the download manager. This listener must be able to + * understand and use the guid attribute of downloads for all interactions + * with the download manager. + */ + void addPrivacyAwareListener(in nsIDownloadProgressListener aListener); + + /** + * Removes a listener from the download manager. + */ + void removeListener(in nsIDownloadProgressListener aListener); + + /** + * Returns the platform default downloads directory. + */ + readonly attribute nsIFile defaultDownloadsDirectory; + + /** + * Returns the user configured downloads directory. + * The path is dependent on two user configurable prefs + * set in preferences: + * + * browser.download.folderList + * Indicates the location users wish to save downloaded + * files too. + * Values: + * 0 - The desktop is the default download location. + * 1 - The system's downloads folder is the default download location. + * 2 - The default download location is elsewhere as specified in + * browser.download.dir. If invalid, userDownloadsDirectory + * will fallback on defaultDownloadsDirectory. + * + * browser.download.dir - + * A local path the user may have selected at some point + * where downloaded files are saved. The use of which is + * enabled when folderList equals 2. + */ + readonly attribute nsIFile userDownloadsDirectory; +}; + + diff --git a/toolkit/components/downloads/nsIDownloadManagerUI.idl b/toolkit/components/downloads/nsIDownloadManagerUI.idl new file mode 100644 index 000000000..b5ceff5b0 --- /dev/null +++ b/toolkit/components/downloads/nsIDownloadManagerUI.idl @@ -0,0 +1,55 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +interface nsIInterfaceRequestor; +interface nsIDownload; + +[scriptable, uuid(0c76d4cf-0b06-4c1a-9bea-520c7bbdba99)] +interface nsIDownloadManagerUI : nsISupports { + /** + * The reason that should be passed when the user requests to show the + * download manager's UI. + */ + const short REASON_USER_INTERACTED = 0; + + /** + * The reason that should be passed to the show method when we are displaying + * the UI because a new download is being added to it. + */ + const short REASON_NEW_DOWNLOAD = 1; + + /** + * Shows the Download Manager's UI to the user. + * + * @param [optional] aWindowContext + * The parent window context to show the UI. + * @param [optional] aDownload + * The download to be preselected upon opening. + * @param [optional] aReason + * The reason to show the download manager's UI. This defaults to + * REASON_USER_INTERACTED, and should be one of the previously listed + * constants. + * @param [optional] aUsePrivateUI + * Pass true as this argument to hint to the implementation that it + * should only display private downloads in the UI, if possible. + */ + void show([optional] in nsIInterfaceRequestor aWindowContext, + [optional] in nsIDownload aDownload, + [optional] in short aReason, + [optional] in boolean aUsePrivateUI); + + /** + * Indicates if the UI is visible or not. + */ + readonly attribute boolean visible; + + /** + * Brings attention to the UI if it is already visible + * + * @throws NS_ERROR_UNEXPECTED if the UI is not visible. + */ + void getAttention(); +}; + diff --git a/toolkit/components/downloads/nsIDownloadProgressListener.idl b/toolkit/components/downloads/nsIDownloadProgressListener.idl new file mode 100644 index 000000000..e406f64d6 --- /dev/null +++ b/toolkit/components/downloads/nsIDownloadProgressListener.idl @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* A minimally extended progress listener used by download manager + * to update its default UI. This is implemented in nsDownloadProgressListener.js. + * See nsIWebProgressListener for documentation, and use its constants. This isn't + * too pretty, but the alternative is having this extend nsIWebProgressListener and + * adding an |item| attribute, which would mean a separate nsIDownloadProgressListener + * for every nsIDownloadItem, which is a waste... + */ + +#include "nsISupports.idl" + +interface nsIWebProgress; +interface nsIRequest; +interface nsIURI; +interface nsIDownload; +interface nsIDOMDocument; + +[scriptable, uuid(7acb07ea-cac2-4c15-a3ad-23aaa789ed51)] +interface nsIDownloadProgressListener : nsISupports { + + /** + * document + * The document of the download manager frontend. + */ + + attribute nsIDOMDocument document; + + /** + * Dispatched whenever the state of the download changes. + * + * @param aState The previous download sate. + * @param aDownload The download object. + * @see nsIDownloadManager for download states. + */ + void onDownloadStateChange(in short aState, in nsIDownload aDownload); + + void onStateChange(in nsIWebProgress aWebProgress, + in nsIRequest aRequest, + in unsigned long aStateFlags, + in nsresult aStatus, + in nsIDownload aDownload); + + void onProgressChange(in nsIWebProgress aWebProgress, + in nsIRequest aRequest, + in long long aCurSelfProgress, + in long long aMaxSelfProgress, + in long long aCurTotalProgress, + in long long aMaxTotalProgress, + in nsIDownload aDownload); + + void onSecurityChange(in nsIWebProgress aWebProgress, + in nsIRequest aRequest, + in unsigned long aState, + in nsIDownload aDownload); + +}; diff --git a/toolkit/components/downloads/test/unit/.eslintrc.js b/toolkit/components/downloads/test/unit/.eslintrc.js new file mode 100644 index 000000000..d35787cd2 --- /dev/null +++ b/toolkit/components/downloads/test/unit/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + "extends": [ + "../../../../../testing/xpcshell/xpcshell.eslintrc.js" + ] +}; diff --git a/toolkit/components/downloads/test/unit/data/block_digest.chunk b/toolkit/components/downloads/test/unit/data/block_digest.chunk new file mode 100644 index 000000000..34c47c4bb --- /dev/null +++ b/toolkit/components/downloads/test/unit/data/block_digest.chunk @@ -0,0 +1,2 @@ +a:5:32:37 +,AÎJ,AÎJ„ä8æW´bbòñ_e‹;OÏÏ„CVù
\ No newline at end of file diff --git a/toolkit/components/downloads/test/unit/data/digest.chunk b/toolkit/components/downloads/test/unit/data/digest.chunk new file mode 100644 index 000000000..b1fbb4667 --- /dev/null +++ b/toolkit/components/downloads/test/unit/data/digest.chunk @@ -0,0 +1,3 @@ +a:5:32:64 +“Ê_Há^˜aÍ7ÂÙ]´=#ÌnmåÃøún‹æo—ÌQ‰÷ãÍ +‡É@.R0ðD©7Y4±íËퟆËS$³8
\ No newline at end of file diff --git a/toolkit/components/downloads/test/unit/data/signed_win.exe b/toolkit/components/downloads/test/unit/data/signed_win.exe Binary files differnew file mode 100644 index 000000000..de3bb40e8 --- /dev/null +++ b/toolkit/components/downloads/test/unit/data/signed_win.exe diff --git a/toolkit/components/downloads/test/unit/head_download_manager.js b/toolkit/components/downloads/test/unit/head_download_manager.js new file mode 100644 index 000000000..1e8248071 --- /dev/null +++ b/toolkit/components/downloads/test/unit/head_download_manager.js @@ -0,0 +1,26 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// This file tests the download manager backend + +var Cc = Components.classes; +var Ci = Components.interfaces; +var Cu = Components.utils; +var Cr = Components.results; + +do_get_profile(); + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://testing-common/httpd.js"); +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); + +function createURI(aObj) +{ + var ios = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService); + return (aObj instanceof Ci.nsIFile) ? ios.newFileURI(aObj) : + ios.newURI(aObj, null, null); +} diff --git a/toolkit/components/downloads/test/unit/tail_download_manager.js b/toolkit/components/downloads/test/unit/tail_download_manager.js new file mode 100644 index 000000000..4043f31b9 --- /dev/null +++ b/toolkit/components/downloads/test/unit/tail_download_manager.js @@ -0,0 +1,23 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/** + * Provides infrastructure for automated download components tests. + */ + +"use strict"; + +// Termination functions common to all tests + +add_task(function* test_common_terminate() +{ + // Stop the HTTP server. We must do this inside a task in "tail.js" until the + // xpcshell testing framework supports asynchronous termination functions. + let deferred = Promise.defer(); + gHttpServer.stop(deferred.resolve); + yield deferred.promise; +}); + diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js new file mode 100644 index 000000000..636a71e78 --- /dev/null +++ b/toolkit/components/downloads/test/unit/test_app_rep.js @@ -0,0 +1,342 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +Cu.import('resource://gre/modules/NetUtil.jsm'); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"]. + getService(Ci.nsIApplicationReputationService); +var gHttpServ = null; +var gTables = {}; + +var ALLOW_LIST = 0; +var BLOCK_LIST = 1; +var NO_LIST = 2; + +var whitelistedURI = createURI("http://foo:bar@whitelisted.com/index.htm#junk"); +var exampleURI = createURI("http://user:password@example.com/i.html?foo=bar"); +var blocklistedURI = createURI("http://baz:qux@blocklisted.com?xyzzy"); + +const appRepURLPref = "browser.safebrowsing.downloads.remote.url"; + +function readFileToString(aFilename) { + let f = do_get_file(aFilename); + let stream = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + stream.init(f, -1, 0, 0); + let buf = NetUtil.readInputStreamToString(stream, stream.available()); + return buf; +} + +// Registers a table for which to serve update chunks. Returns a promise that +// resolves when that chunk has been downloaded. +function registerTableUpdate(aTable, aFilename) { + // If we haven't been given an update for this table yet, add it to the map + if (!(aTable in gTables)) { + gTables[aTable] = []; + } + + // The number of chunks associated with this table. + let numChunks = gTables[aTable].length + 1; + let redirectPath = "/" + aTable + "-" + numChunks; + let redirectUrl = "localhost:4444" + redirectPath; + + // Store redirect url for that table so we can return it later when we + // process an update request. + gTables[aTable].push(redirectUrl); + + gHttpServ.registerPathHandler(redirectPath, function(request, response) { + do_print("Mock safebrowsing server handling request for " + redirectPath); + let contents = readFileToString(aFilename); + do_print("Length of " + aFilename + ": " + contents.length); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(contents, contents.length); + }); +} + +add_task(function* test_setup() { + // Set up a local HTTP server to return bad verdicts. + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // Ensure safebrowsing is enabled for this test, even if the app + // doesn't have it enabled. + Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true); + Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true); + do_register_cleanup(function() { + Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled"); + Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled"); + }); + + // Set block and allow tables explicitly, since the allowlist is normally + // disabled on non-Windows platforms. + Services.prefs.setCharPref("urlclassifier.downloadBlockTable", + "goog-badbinurl-shavar"); + Services.prefs.setCharPref("urlclassifier.downloadAllowTable", + "goog-downloadwhite-digest256"); + do_register_cleanup(function() { + Services.prefs.clearUserPref("urlclassifier.downloadBlockTable"); + Services.prefs.clearUserPref("urlclassifier.downloadAllowTable"); + }); + + gHttpServ = new HttpServer(); + gHttpServ.registerDirectory("/", do_get_cwd()); + gHttpServ.registerPathHandler("/download", function(request, response) { + do_throw("This test should never make a remote lookup"); + }); + gHttpServ.start(4444); +}); + +function run_test() { + run_next_test(); +} + +function check_telemetry(aCount, + aShouldBlockCount, + aListCounts) { + let count = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_COUNT") + .snapshot(); + do_check_eq(count.counts[1], aCount); + let local = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_LOCAL") + .snapshot(); + do_check_eq(local.counts[ALLOW_LIST], aListCounts[ALLOW_LIST], + "Allow list counts don't match"); + do_check_eq(local.counts[BLOCK_LIST], aListCounts[BLOCK_LIST], + "Block list counts don't match"); + do_check_eq(local.counts[NO_LIST], aListCounts[NO_LIST], + "No list counts don't match"); + + let shouldBlock = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_SHOULD_BLOCK") + .snapshot(); + // SHOULD_BLOCK = true + do_check_eq(shouldBlock.counts[1], aShouldBlockCount); + // Sanity check that SHOULD_BLOCK total adds up to the COUNT. + do_check_eq(shouldBlock.counts[0] + shouldBlock.counts[1], aCount); +} + +function get_telemetry_counts() { + let count = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_COUNT") + .snapshot(); + let local = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_LOCAL") + .snapshot(); + let shouldBlock = Cc["@mozilla.org/base/telemetry;1"] + .getService(Ci.nsITelemetry) + .getHistogramById("APPLICATION_REPUTATION_SHOULD_BLOCK") + .snapshot(); + return { total: count.counts[1], + shouldBlock: shouldBlock.counts[1], + listCounts: local.counts }; +} + +add_test(function test_nullSourceURI() { + let counts = get_telemetry_counts(); + gAppRep.queryReputation({ + // No source URI + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_ERROR_UNEXPECTED, aStatus); + do_check_false(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock, counts.listCounts); + run_next_test(); + }); +}); + +add_test(function test_nullCallback() { + let counts = get_telemetry_counts(); + try { + gAppRep.queryReputation({ + sourceURI: createURI("http://example.com"), + fileSize: 12, + }, null); + do_throw("Callback cannot be null"); + } catch (ex) { + if (ex.result != Cr.NS_ERROR_INVALID_POINTER) + throw ex; + // We don't even increment the count here, because there's no callback. + check_telemetry(counts.total, counts.shouldBlock, counts.listCounts); + run_next_test(); + } +}); + +// Set up the local whitelist. +add_test(function test_local_list() { + // Construct a response with redirect urls. + function processUpdateRequest() { + let response = "n:1000\n"; + for (let table in gTables) { + response += "i:" + table + "\n"; + for (let i = 0; i < gTables[table].length; ++i) { + response += "u:" + gTables[table][i] + "\n"; + } + } + do_print("Returning update response: " + response); + return response; + } + gHttpServ.registerPathHandler("/downloads", function(request, response) { + let blob = processUpdateRequest(); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(blob, blob.length); + }); + + let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"] + .getService(Ci.nsIUrlClassifierStreamUpdater); + + // Load up some update chunks for the safebrowsing server to serve. + // This chunk contains the hash of blocklisted.com/. + registerTableUpdate("goog-badbinurl-shavar", "data/block_digest.chunk"); + // This chunk contains the hash of whitelisted.com/. + registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk"); + + // Download some updates, and don't continue until the downloads are done. + function updateSuccess(aEvent) { + // Timeout of n:1000 is constructed in processUpdateRequest above and + // passed back in the callback in nsIUrlClassifierStreamUpdater on success. + do_check_eq("1000", aEvent); + do_print("All data processed"); + run_next_test(); + } + // Just throw if we ever get an update or download error. + function handleError(aEvent) { + do_throw("We didn't download or update correctly: " + aEvent); + } + streamUpdater.downloadUpdates( + "goog-downloadwhite-digest256,goog-badbinurl-shavar", + "goog-downloadwhite-digest256,goog-badbinurl-shavar;\n", + true, // isPostRequest. + "http://localhost:4444/downloads", + updateSuccess, handleError, handleError); +}); + +add_test(function test_unlisted() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + listCounts[NO_LIST]++; + gAppRep.queryReputation({ + sourceURI: exampleURI, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_false(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock, listCounts); + run_next_test(); + }); +}); + +add_test(function test_non_uri() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + // No listcount is incremented, since the sourceURI is not an nsIURL + let source = NetUtil.newURI("data:application/octet-stream,ABC"); + do_check_false(source instanceof Ci.nsIURL); + gAppRep.queryReputation({ + sourceURI: source, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_false(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock, listCounts); + run_next_test(); + }); +}); + +add_test(function test_local_blacklist() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + listCounts[BLOCK_LIST]++; + gAppRep.queryReputation({ + sourceURI: blocklistedURI, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_true(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts); + run_next_test(); + }); +}); + +add_test(function test_referer_blacklist() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + listCounts[BLOCK_LIST]++; + gAppRep.queryReputation({ + sourceURI: exampleURI, + referrerURI: blocklistedURI, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_true(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts); + run_next_test(); + }); +}); + +add_test(function test_blocklist_trumps_allowlist() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + listCounts[BLOCK_LIST]++; + gAppRep.queryReputation({ + sourceURI: whitelistedURI, + referrerURI: blocklistedURI, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_true(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts); + run_next_test(); + }); +}); + +add_test(function test_redirect_on_blocklist() { + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + let counts = get_telemetry_counts(); + let listCounts = counts.listCounts; + listCounts[BLOCK_LIST]++; + listCounts[ALLOW_LIST]++; + let secman = Services.scriptSecurityManager; + let badRedirects = Cc["@mozilla.org/array;1"] + .createInstance(Ci.nsIMutableArray); + badRedirects.appendElement(secman.createCodebasePrincipal(exampleURI, {}), + false); + badRedirects.appendElement(secman.createCodebasePrincipal(blocklistedURI, {}), + false); + badRedirects.appendElement(secman.createCodebasePrincipal(whitelistedURI, {}), + false); + gAppRep.queryReputation({ + sourceURI: whitelistedURI, + referrerURI: exampleURI, + redirects: badRedirects, + fileSize: 12, + }, function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_true(aShouldBlock); + check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts); + run_next_test(); + }); +}); diff --git a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js new file mode 100644 index 000000000..7f94d1520 --- /dev/null +++ b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js @@ -0,0 +1,303 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * This file tests signature extraction using Windows Authenticode APIs of + * downloaded files. + */ + +// Globals + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", + "resource://gre/modules/NetUtil.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); + +const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"]. + getService(Ci.nsIApplicationReputationService); +var gStillRunning = true; +var gTables = {}; +var gHttpServer = null; + +const appRepURLPref = "browser.safebrowsing.downloads.remote.url"; +const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled"; + +function readFileToString(aFilename) { + let f = do_get_file(aFilename); + let stream = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + stream.init(f, -1, 0, 0); + let buf = NetUtil.readInputStreamToString(stream, stream.available()); + return buf; +} + +function registerTableUpdate(aTable, aFilename) { + // If we haven't been given an update for this table yet, add it to the map + if (!(aTable in gTables)) { + gTables[aTable] = []; + } + + // The number of chunks associated with this table. + let numChunks = gTables[aTable].length + 1; + let redirectPath = "/" + aTable + "-" + numChunks; + let redirectUrl = "localhost:4444" + redirectPath; + + // Store redirect url for that table so we can return it later when we + // process an update request. + gTables[aTable].push(redirectUrl); + + gHttpServer.registerPathHandler(redirectPath, function(request, response) { + do_print("Mock safebrowsing server handling request for " + redirectPath); + let contents = readFileToString(aFilename); + do_print("Length of " + aFilename + ": " + contents.length); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(contents, contents.length); + }); +} + +// Tests + +function run_test() +{ + run_next_test(); +} + +add_task(function test_setup() +{ + // Wait 10 minutes, that is half of the external xpcshell timeout. + do_timeout(10 * 60 * 1000, function() { + if (gStillRunning) { + do_throw("Test timed out."); + } + }); + // Set up a local HTTP server to return bad verdicts. + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // Ensure safebrowsing is enabled for this test, even if the app + // doesn't have it enabled. + Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true); + Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true); + // Set block table explicitly, no need for the allow table though + Services.prefs.setCharPref("urlclassifier.downloadBlockTable", + "goog-badbinurl-shavar"); + // SendRemoteQueryInternal needs locale preference. + let locale = Services.prefs.getCharPref("general.useragent.locale"); + Services.prefs.setCharPref("general.useragent.locale", "en-US"); + + do_register_cleanup(function() { + Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled"); + Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled"); + Services.prefs.clearUserPref("urlclassifier.downloadBlockTable"); + Services.prefs.setCharPref("general.useragent.locale", locale); + }); + + gHttpServer = new HttpServer(); + gHttpServer.registerDirectory("/", do_get_cwd()); + + function createVerdict(aShouldBlock) { + // We can't programmatically create a protocol buffer here, so just + // hardcode some already serialized ones. + let blob = String.fromCharCode(parseInt(0x08, 16)); + if (aShouldBlock) { + // A safe_browsing::ClientDownloadRequest with a DANGEROUS verdict + blob += String.fromCharCode(parseInt(0x01, 16)); + } else { + // A safe_browsing::ClientDownloadRequest with a SAFE verdict + blob += String.fromCharCode(parseInt(0x00, 16)); + } + return blob; + } + + gHttpServer.registerPathHandler("/throw", function(request, response) { + do_throw("We shouldn't be getting here"); + }); + + gHttpServer.registerPathHandler("/download", function(request, response) { + do_print("Querying remote server for verdict"); + response.setHeader("Content-Type", "application/octet-stream", false); + let buf = NetUtil.readInputStreamToString( + request.bodyInputStream, + request.bodyInputStream.available()); + do_print("Request length: " + buf.length); + // A garbage response. By default this produces NS_CANNOT_CONVERT_DATA as + // the callback status. + let blob = "this is not a serialized protocol buffer (the length doesn't match our hard-coded values)"; + // We can't actually parse the protocol buffer here, so just switch on the + // length instead of inspecting the contents. + if (buf.length == 67) { + // evil.com + blob = createVerdict(true); + } else if (buf.length == 73) { + // mozilla.com + blob = createVerdict(false); + } + response.bodyOutputStream.write(blob, blob.length); + }); + + gHttpServer.start(4444); +}); + +// Construct a response with redirect urls. +function processUpdateRequest() { + let response = "n:1000\n"; + for (let table in gTables) { + response += "i:" + table + "\n"; + for (let i = 0; i < gTables[table].length; ++i) { + response += "u:" + gTables[table][i] + "\n"; + } + } + do_print("Returning update response: " + response); + return response; +} + +// Set up the local whitelist. +function waitForUpdates() { + let deferred = Promise.defer(); + gHttpServer.registerPathHandler("/downloads", function(request, response) { + let blob = processUpdateRequest(); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(blob, blob.length); + }); + + let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"] + .getService(Ci.nsIUrlClassifierStreamUpdater); + + // Load up some update chunks for the safebrowsing server to serve. This + // particular chunk contains the hash of whitelisted.com/ and + // sb-ssl.google.com/safebrowsing/csd/certificate/. + registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk"); + + // Resolve the promise once processing the updates is complete. + function updateSuccess(aEvent) { + // Timeout of n:1000 is constructed in processUpdateRequest above and + // passed back in the callback in nsIUrlClassifierStreamUpdater on success. + do_check_eq("1000", aEvent); + do_print("All data processed"); + deferred.resolve(true); + } + // Just throw if we ever get an update or download error. + function handleError(aEvent) { + do_throw("We didn't download or update correctly: " + aEvent); + deferred.reject(); + } + streamUpdater.downloadUpdates( + "goog-downloadwhite-digest256", + "goog-downloadwhite-digest256;\n", + true, + "http://localhost:4444/downloads", + updateSuccess, handleError, handleError); + return deferred.promise; +} + +function promiseQueryReputation(query, expectedShouldBlock) { + let deferred = Promise.defer(); + function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_eq(aShouldBlock, expectedShouldBlock); + deferred.resolve(true); + } + gAppRep.queryReputation(query, onComplete); + return deferred.promise; +} + +add_task(function* () +{ + // Wait for Safebrowsing local list updates to complete. + yield waitForUpdates(); +}); + +add_task(function* test_blocked_binary() +{ + // We should reach the remote server for a verdict. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // evil.com should return a malware verdict from the remote server. + yield promiseQueryReputation({sourceURI: createURI("http://evil.com"), + suggestedFileName: "noop.bat", + fileSize: 12}, true); +}); + +add_task(function* test_non_binary() +{ + // We should not reach the remote server for a verdict for non-binary files. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/throw"); + yield promiseQueryReputation({sourceURI: createURI("http://evil.com"), + suggestedFileName: "noop.txt", + fileSize: 12}, false); +}); + +add_task(function* test_good_binary() +{ + // We should reach the remote server for a verdict. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // mozilla.com should return a not-guilty verdict from the remote server. + yield promiseQueryReputation({sourceURI: createURI("http://mozilla.com"), + suggestedFileName: "noop.bat", + fileSize: 12}, false); +}); + +add_task(function* test_disabled() +{ + // Explicitly disable remote checks + Services.prefs.setBoolPref(remoteEnabledPref, + false); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/throw"); + let query = {sourceURI: createURI("http://example.com"), + suggestedFileName: "noop.bat", + fileSize: 12}; + let deferred = Promise.defer(); + gAppRep.queryReputation(query, + function onComplete(aShouldBlock, aStatus) { + // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled + do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus); + do_check_false(aShouldBlock); + deferred.resolve(true); + } + ); + yield deferred.promise; +}); + +add_task(function* test_disabled_through_lists() +{ + Services.prefs.setBoolPref(remoteEnabledPref, + false); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + Services.prefs.setCharPref("urlclassifier.downloadBlockTable", ""); + let query = {sourceURI: createURI("http://example.com"), + suggestedFileName: "noop.bat", + fileSize: 12}; + let deferred = Promise.defer(); + gAppRep.queryReputation(query, + function onComplete(aShouldBlock, aStatus) { + // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled + do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus); + do_check_false(aShouldBlock); + deferred.resolve(true); + } + ); + yield deferred.promise; +}); +add_task(function* test_teardown() +{ + gStillRunning = false; +}); diff --git a/toolkit/components/downloads/test/unit/test_app_rep_windows.js b/toolkit/components/downloads/test/unit/test_app_rep_windows.js new file mode 100644 index 000000000..4ff772e61 --- /dev/null +++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js @@ -0,0 +1,434 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * This file tests signature extraction using Windows Authenticode APIs of + * downloaded files. + */ + +// Globals + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", + "resource://gre/modules/FileUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", + "resource://gre/modules/NetUtil.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); + +const BackgroundFileSaverOutputStream = Components.Constructor( + "@mozilla.org/network/background-file-saver;1?mode=outputstream", + "nsIBackgroundFileSaver"); + +const StringInputStream = Components.Constructor( + "@mozilla.org/io/string-input-stream;1", + "nsIStringInputStream", + "setData"); + +const TEST_FILE_NAME_1 = "test-backgroundfilesaver-1.txt"; + +const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"]. + getService(Ci.nsIApplicationReputationService); +var gStillRunning = true; +var gTables = {}; +var gHttpServer = null; + +const appRepURLPref = "browser.safebrowsing.downloads.remote.url"; +const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled"; + +/** + * Returns a reference to a temporary file. If the file is then created, it + * will be removed when tests in this file finish. + */ +function getTempFile(aLeafName) { + let file = FileUtils.getFile("TmpD", [aLeafName]); + do_register_cleanup(function GTF_cleanup() { + if (file.exists()) { + file.remove(false); + } + }); + return file; +} + +function readFileToString(aFilename) { + let f = do_get_file(aFilename); + let stream = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + stream.init(f, -1, 0, 0); + let buf = NetUtil.readInputStreamToString(stream, stream.available()); + return buf; +} + +/** + * Waits for the given saver object to complete. + * + * @param aSaver + * The saver, with the output stream or a stream listener implementation. + * @param aOnTargetChangeFn + * Optional callback invoked with the target file name when it changes. + * + * @return {Promise} + * @resolves When onSaveComplete is called with a success code. + * @rejects With an exception, if onSaveComplete is called with a failure code. + */ +function promiseSaverComplete(aSaver, aOnTargetChangeFn) { + let deferred = Promise.defer(); + aSaver.observer = { + onTargetChange: function BFSO_onSaveComplete(unused, aTarget) + { + if (aOnTargetChangeFn) { + aOnTargetChangeFn(aTarget); + } + }, + onSaveComplete: function BFSO_onSaveComplete(unused, aStatus) + { + if (Components.isSuccessCode(aStatus)) { + deferred.resolve(); + } else { + deferred.reject(new Components.Exception("Saver failed.", aStatus)); + } + }, + }; + return deferred.promise; +} + +/** + * Feeds a string to a BackgroundFileSaverOutputStream. + * + * @param aSourceString + * The source data to copy. + * @param aSaverOutputStream + * The BackgroundFileSaverOutputStream to feed. + * @param aCloseWhenDone + * If true, the output stream will be closed when the copy finishes. + * + * @return {Promise} + * @resolves When the copy completes with a success code. + * @rejects With an exception, if the copy fails. + */ +function promiseCopyToSaver(aSourceString, aSaverOutputStream, aCloseWhenDone) { + let deferred = Promise.defer(); + let inputStream = new StringInputStream(aSourceString, aSourceString.length); + let copier = Cc["@mozilla.org/network/async-stream-copier;1"] + .createInstance(Ci.nsIAsyncStreamCopier); + copier.init(inputStream, aSaverOutputStream, null, false, true, 0x8000, true, + aCloseWhenDone); + copier.asyncCopy({ + onStartRequest: function () { }, + onStopRequest: function (aRequest, aContext, aStatusCode) + { + if (Components.isSuccessCode(aStatusCode)) { + deferred.resolve(); + } else { + deferred.reject(new Components.Exception(aResult)); + } + }, + }, null); + return deferred.promise; +} + +// Registers a table for which to serve update chunks. +function registerTableUpdate(aTable, aFilename) { + // If we haven't been given an update for this table yet, add it to the map + if (!(aTable in gTables)) { + gTables[aTable] = []; + } + + // The number of chunks associated with this table. + let numChunks = gTables[aTable].length + 1; + let redirectPath = "/" + aTable + "-" + numChunks; + let redirectUrl = "localhost:4444" + redirectPath; + + // Store redirect url for that table so we can return it later when we + // process an update request. + gTables[aTable].push(redirectUrl); + + gHttpServer.registerPathHandler(redirectPath, function(request, response) { + do_print("Mock safebrowsing server handling request for " + redirectPath); + let contents = readFileToString(aFilename); + do_print("Length of " + aFilename + ": " + contents.length); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(contents, contents.length); + }); +} + +// Tests + +function run_test() +{ + run_next_test(); +} + +add_task(function* test_setup() +{ + // Wait 10 minutes, that is half of the external xpcshell timeout. + do_timeout(10 * 60 * 1000, function() { + if (gStillRunning) { + do_throw("Test timed out."); + } + }); + // Set up a local HTTP server to return bad verdicts. + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // Ensure safebrowsing is enabled for this test, even if the app + // doesn't have it enabled. + Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true); + Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true); + // Set block and allow tables explicitly, since the allowlist is normally + // disabled on comm-central. + Services.prefs.setCharPref("urlclassifier.downloadBlockTable", + "goog-badbinurl-shavar"); + Services.prefs.setCharPref("urlclassifier.downloadAllowTable", + "goog-downloadwhite-digest256"); + // SendRemoteQueryInternal needs locale preference. + let locale = Services.prefs.getCharPref("general.useragent.locale"); + Services.prefs.setCharPref("general.useragent.locale", "en-US"); + + do_register_cleanup(function() { + Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled"); + Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled"); + Services.prefs.clearUserPref("urlclassifier.downloadBlockTable"); + Services.prefs.clearUserPref("urlclassifier.downloadAllowTable"); + Services.prefs.setCharPref("general.useragent.locale", locale); + }); + + gHttpServer = new HttpServer(); + gHttpServer.registerDirectory("/", do_get_cwd()); + + function createVerdict(aShouldBlock) { + // We can't programmatically create a protocol buffer here, so just + // hardcode some already serialized ones. + let blob = String.fromCharCode(parseInt(0x08, 16)); + if (aShouldBlock) { + // A safe_browsing::ClientDownloadRequest with a DANGEROUS verdict + blob += String.fromCharCode(parseInt(0x01, 16)); + } else { + // A safe_browsing::ClientDownloadRequest with a SAFE verdict + blob += String.fromCharCode(parseInt(0x00, 16)); + } + return blob; + } + + gHttpServer.registerPathHandler("/throw", function(request, response) { + do_throw("We shouldn't be getting here"); + }); + + gHttpServer.registerPathHandler("/download", function(request, response) { + do_print("Querying remote server for verdict"); + response.setHeader("Content-Type", "application/octet-stream", false); + let buf = NetUtil.readInputStreamToString( + request.bodyInputStream, + request.bodyInputStream.available()); + do_print("Request length: " + buf.length); + // A garbage response. By default this produces NS_CANNOT_CONVERT_DATA as + // the callback status. + let blob = "this is not a serialized protocol buffer (the length doesn't match our hard-coded values)"; + // We can't actually parse the protocol buffer here, so just switch on the + // length instead of inspecting the contents. + if (buf.length == 67) { + // evil.com + blob = createVerdict(true); + } else if (buf.length == 73) { + // mozilla.com + blob = createVerdict(false); + } + response.bodyOutputStream.write(blob, blob.length); + }); + + gHttpServer.start(4444); +}); + +// Construct a response with redirect urls. +function processUpdateRequest() { + let response = "n:1000\n"; + for (let table in gTables) { + response += "i:" + table + "\n"; + for (let i = 0; i < gTables[table].length; ++i) { + response += "u:" + gTables[table][i] + "\n"; + } + } + do_print("Returning update response: " + response); + return response; +} + +// Set up the local whitelist. +function waitForUpdates() { + let deferred = Promise.defer(); + gHttpServer.registerPathHandler("/downloads", function(request, response) { + let blob = processUpdateRequest(); + response.setHeader("Content-Type", + "application/vnd.google.safebrowsing-update", false); + response.setStatusLine(request.httpVersion, 200, "OK"); + response.bodyOutputStream.write(blob, blob.length); + }); + + let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"] + .getService(Ci.nsIUrlClassifierStreamUpdater); + + // Load up some update chunks for the safebrowsing server to serve. This + // particular chunk contains the hash of whitelisted.com/ and + // sb-ssl.google.com/safebrowsing/csd/certificate/. + registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk"); + + // Resolve the promise once processing the updates is complete. + function updateSuccess(aEvent) { + // Timeout of n:1000 is constructed in processUpdateRequest above and + // passed back in the callback in nsIUrlClassifierStreamUpdater on success. + do_check_eq("1000", aEvent); + do_print("All data processed"); + deferred.resolve(true); + } + // Just throw if we ever get an update or download error. + function handleError(aEvent) { + do_throw("We didn't download or update correctly: " + aEvent); + deferred.reject(); + } + streamUpdater.downloadUpdates( + "goog-downloadwhite-digest256", + "goog-downloadwhite-digest256;\n", + true, + "http://localhost:4444/downloads", + updateSuccess, handleError, handleError); + return deferred.promise; +} + +function promiseQueryReputation(query, expectedShouldBlock) { + let deferred = Promise.defer(); + function onComplete(aShouldBlock, aStatus) { + do_check_eq(Cr.NS_OK, aStatus); + do_check_eq(aShouldBlock, expectedShouldBlock); + deferred.resolve(true); + } + gAppRep.queryReputation(query, onComplete); + return deferred.promise; +} + +add_task(function* () +{ + // Wait for Safebrowsing local list updates to complete. + yield waitForUpdates(); +}); + +add_task(function* test_signature_whitelists() +{ + // We should never get to the remote server. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/throw"); + + // Use BackgroundFileSaver to extract the signature on Windows. + let destFile = getTempFile(TEST_FILE_NAME_1); + + let data = readFileToString("data/signed_win.exe"); + let saver = new BackgroundFileSaverOutputStream(); + let completionPromise = promiseSaverComplete(saver); + saver.enableSignatureInfo(); + saver.setTarget(destFile, false); + yield promiseCopyToSaver(data, saver, true); + + saver.finish(Cr.NS_OK); + yield completionPromise; + + // Clean up. + destFile.remove(false); + + // evil.com is not on the allowlist, but this binary is signed by an entity + // whose certificate information is on the allowlist. + yield promiseQueryReputation({sourceURI: createURI("http://evil.com"), + signatureInfo: saver.signatureInfo, + fileSize: 12}, false); +}); + +add_task(function* test_blocked_binary() +{ + // We should reach the remote server for a verdict. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // evil.com should return a malware verdict from the remote server. + yield promiseQueryReputation({sourceURI: createURI("http://evil.com"), + suggestedFileName: "noop.bat", + fileSize: 12}, true); +}); + +add_task(function* test_non_binary() +{ + // We should not reach the remote server for a verdict for non-binary files. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/throw"); + yield promiseQueryReputation({sourceURI: createURI("http://evil.com"), + suggestedFileName: "noop.txt", + fileSize: 12}, false); +}); + +add_task(function* test_good_binary() +{ + // We should reach the remote server for a verdict. + Services.prefs.setBoolPref(remoteEnabledPref, + true); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + // mozilla.com should return a not-guilty verdict from the remote server. + yield promiseQueryReputation({sourceURI: createURI("http://mozilla.com"), + suggestedFileName: "noop.bat", + fileSize: 12}, false); +}); + +add_task(function* test_disabled() +{ + // Explicitly disable remote checks + Services.prefs.setBoolPref(remoteEnabledPref, + false); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/throw"); + let query = {sourceURI: createURI("http://example.com"), + suggestedFileName: "noop.bat", + fileSize: 12}; + let deferred = Promise.defer(); + gAppRep.queryReputation(query, + function onComplete(aShouldBlock, aStatus) { + // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled + do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus); + do_check_false(aShouldBlock); + deferred.resolve(true); + } + ); + yield deferred.promise; +}); + +add_task(function* test_disabled_through_lists() +{ + Services.prefs.setBoolPref(remoteEnabledPref, + false); + Services.prefs.setCharPref(appRepURLPref, + "http://localhost:4444/download"); + Services.prefs.setCharPref("urlclassifier.downloadBlockTable", ""); + let query = {sourceURI: createURI("http://example.com"), + suggestedFileName: "noop.bat", + fileSize: 12}; + let deferred = Promise.defer(); + gAppRep.queryReputation(query, + function onComplete(aShouldBlock, aStatus) { + // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled + do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus); + do_check_false(aShouldBlock); + deferred.resolve(true); + } + ); + yield deferred.promise; +}); +add_task(function* test_teardown() +{ + gStillRunning = false; +}); diff --git a/toolkit/components/downloads/test/unit/xpcshell.ini b/toolkit/components/downloads/test/unit/xpcshell.ini new file mode 100644 index 000000000..68b6e1fc3 --- /dev/null +++ b/toolkit/components/downloads/test/unit/xpcshell.ini @@ -0,0 +1,14 @@ +[DEFAULT] +head = head_download_manager.js +tail = tail_download_manager.js +skip-if = toolkit == 'android' +support-files = + data/digest.chunk + data/block_digest.chunk + data/signed_win.exe + +[test_app_rep.js] +[test_app_rep_windows.js] +skip-if = os != "win" +[test_app_rep_maclinux.js] +skip-if = os == "win" |