Bug 837199 - Write interface to query application reputation (r=paolo,sr=mossop)
authorMonica Chew <mmc@mozilla.com>
Thu, 25 Jul 2013 21:25:43 -0700
changeset 140154 68062bad2d33
parent 140153 b75af0939fea
child 140155 d08133d025b3
push id25016
push userryanvm@gmail.com
push date2013-07-27 02:25 +0000
treeherdermozilla-central@fb48c7d58b8b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo, mossop
bugs837199
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 837199 - Write interface to query application reputation (r=paolo,sr=mossop)
browser/app/profile/firefox.js
toolkit/components/build/nsToolkitCompsCID.h
toolkit/components/build/nsToolkitCompsModule.cpp
toolkit/components/downloads/ApplicationReputation.cpp
toolkit/components/downloads/ApplicationReputation.h
toolkit/components/downloads/Makefile.in
toolkit/components/downloads/csd.pb.cc
toolkit/components/downloads/csd.pb.h
toolkit/components/downloads/generate_csd.sh
toolkit/components/downloads/moz.build
toolkit/components/downloads/nsIApplicationReputation.idl
toolkit/components/downloads/test/unit/tail_download_manager.js
toolkit/components/downloads/test/unit/test_app_rep.js
toolkit/components/downloads/test/unit/xpcshell.ini
toolkit/components/protobuf/Makefile.in
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -758,16 +758,22 @@ pref("browser.safebrowsing.reportURL", "
 pref("browser.safebrowsing.reportGenericURL", "http://%LOCALE%.phish-generic.mozilla.com/?hl=%LOCALE%");
 pref("browser.safebrowsing.reportErrorURL", "http://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%");
 pref("browser.safebrowsing.reportPhishURL", "http://%LOCALE%.phish-report.mozilla.com/?hl=%LOCALE%");
 pref("browser.safebrowsing.reportMalwareURL", "http://%LOCALE%.malware-report.mozilla.com/?hl=%LOCALE%");
 pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-error.mozilla.com/?hl=%LOCALE%");
 
 pref("browser.safebrowsing.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/phishing-protection/");
 pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
+// Since the application reputation query isn't hooked in anywhere yet, this
+// preference does not matter. To be extra safe, don't turn this preference on
+// for official builds without whitelisting (bug 842828).
+#ifndef MOZILLA_OFFICIAL
+pref("browser.safebrowsing.appRepURL", "https://sb-ssl.google.com/safebrowsing/clientreport/download");
+#endif
 
 #ifdef MOZILLA_OFFICIAL
 // Normally the "client ID" sent in updates is appinfo.name, but for
 // official Firefox releases from Mozilla we use a special identifier.
 pref("browser.safebrowsing.id", "navclient-auto-ffox");
 #endif
 
 // Name of the about: page contributed by safebrowsing to handle display of error
--- a/toolkit/components/build/nsToolkitCompsCID.h
+++ b/toolkit/components/build/nsToolkitCompsCID.h
@@ -163,8 +163,20 @@
 
 #define NS_FAVICONSERVICE_CID \
 { 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } }
 
 #if defined(USE_MOZ_UPDATER)
 #define NS_UPDATEPROCESSOR_CID \
 { 0xf3dcf644, 0x79e8, 0x4f59, { 0xa1, 0xbb, 0x87, 0x84, 0x54, 0x48, 0x8e, 0xf9 } }
 #endif
+
+#define NS_APPLICATION_REPUTATION_QUERY_CONTRACTID \
+  "@mozilla.org/downloads/application-reputation-query;1"
+
+#define NS_APPLICATION_REPUTATION_QUERY_CID \
+{ 0x857da2c0, 0xcfe5, 0x11e2, { 0x8b, 0x8b, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
+
+#define NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID \
+  "@mozilla.org/downloads/application-reputation-service;1"
+
+#define NS_APPLICATION_REPUTATION_SERVICE_CID \
+{ 0x8576c950, 0xf4a2, 0x11e2, { 0xb7, 0x78, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
--- a/toolkit/components/build/nsToolkitCompsModule.cpp
+++ b/toolkit/components/build/nsToolkitCompsModule.cpp
@@ -27,31 +27,32 @@
 #ifdef MOZ_URL_CLASSIFIER
 #include "nsUrlClassifierDBService.h"
 #include "nsUrlClassifierStreamUpdater.h"
 #include "nsUrlClassifierUtils.h"
 #include "nsUrlClassifierPrefixSet.h"
 #endif
 
 #include "nsBrowserStatusFilter.h"
+#include "ApplicationReputation.h"
 
 /////////////////////////////////////////////////////////////////////////////
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFindService)
 
 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsServiceWin)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDownloadManager,
-                                         nsDownloadManager::GetSingleton) 
+                                         nsDownloadManager::GetSingleton)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
 
 #ifdef MOZ_URL_CLASSIFIER
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierPrefixSet)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils, Init)
@@ -71,21 +72,26 @@ nsUrlClassifierDBServiceConstructor(nsIS
     /* NS_ADDREF(inst); */
     rv = inst->QueryInterface(aIID, aResult);
     NS_RELEASE(inst);
 
     return rv;
 }
 #endif
 
+NS_GENERIC_FACTORY_CONSTRUCTOR(ApplicationReputationQuery)
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ApplicationReputationService,
+                                         ApplicationReputationService::GetSingleton)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
 #if defined(USE_MOZ_UPDATER)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUpdateProcessor)
 #endif
 
+NS_DEFINE_NAMED_CID(NS_APPLICATION_REPUTATION_QUERY_CID);
+NS_DEFINE_NAMED_CID(NS_APPLICATION_REPUTATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_TOOLKIT_APPSTARTUP_CID);
 NS_DEFINE_NAMED_CID(NS_USERINFO_CID);
 NS_DEFINE_NAMED_CID(NS_ALERTSSERVICE_CID);
 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
 NS_DEFINE_NAMED_CID(NS_PARENTALCONTROLSSERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_DOWNLOADMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_DOWNLOAD_CID);
@@ -99,16 +105,18 @@ NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTIL
 #endif
 NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
 NS_DEFINE_NAMED_CID(NS_CHARSETMENU_CID);
 #if defined(USE_MOZ_UPDATER)
 NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
 #endif
 
 static const mozilla::Module::CIDEntry kToolkitCIDs[] = {
+  { &kNS_APPLICATION_REPUTATION_QUERY_CID, false, NULL, ApplicationReputationQueryConstructor },
+  { &kNS_APPLICATION_REPUTATION_SERVICE_CID, false, NULL, ApplicationReputationServiceConstructor },
   { &kNS_TOOLKIT_APPSTARTUP_CID, false, NULL, nsAppStartupConstructor },
   { &kNS_USERINFO_CID, false, NULL, nsUserInfoConstructor },
   { &kNS_ALERTSSERVICE_CID, false, NULL, nsAlertsServiceConstructor },
 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
   { &kNS_PARENTALCONTROLSSERVICE_CID, false, NULL, nsParentalControlsServiceWinConstructor },
 #endif
   { &kNS_DOWNLOADMANAGER_CID, false, NULL, nsDownloadManagerConstructor },
   { &kNS_DOWNLOAD_CID, false, NULL, nsDownloadProxyConstructor },
@@ -124,16 +132,18 @@ static const mozilla::Module::CIDEntry k
   { &kNS_CHARSETMENU_CID, false, NULL, NS_NewCharsetMenu },
 #if defined(USE_MOZ_UPDATER)
   { &kNS_UPDATEPROCESSOR_CID, false, NULL, nsUpdateProcessorConstructor },
 #endif
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kToolkitContracts[] = {
+  { NS_APPLICATION_REPUTATION_QUERY_CONTRACTID, &kNS_APPLICATION_REPUTATION_QUERY_CID },
+  { NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID, &kNS_APPLICATION_REPUTATION_SERVICE_CID },
   { NS_APPSTARTUP_CONTRACTID, &kNS_TOOLKIT_APPSTARTUP_CID },
   { NS_USERINFO_CONTRACTID, &kNS_USERINFO_CID },
   { NS_ALERTSERVICE_CONTRACTID, &kNS_ALERTSSERVICE_CID },
 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
   { NS_PARENTALCONTROLSSERVICE_CONTRACTID, &kNS_PARENTALCONTROLSSERVICE_CID },
 #endif
   { NS_DOWNLOADMANAGER_CONTRACTID, &kNS_DOWNLOADMANAGER_CID },
   { NS_TRANSFER_CONTRACTID, &kNS_DOWNLOAD_CID },
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -0,0 +1,339 @@
+/* -*- 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 "ApplicationReputation.h"
+#include "csd.pb.h"
+
+#include "nsIApplicationReputation.h"
+#include "nsIChannel.h"
+#include "nsIHttpChannel.h"
+#include "nsIIOService.h"
+#include "nsIObserverService.h"
+#include "nsIPrefService.h"
+#include "nsIStreamListener.h"
+#include "nsIStringStream.h"
+#include "nsIUploadChannel2.h"
+#include "nsIURI.h"
+
+#include "mozilla/Preferences.h"
+#include "mozilla/Services.h"
+
+#include "nsCOMPtr.h"
+#include "nsDebug.h"
+#include "nsError.h"
+#include "nsNetCID.h"
+#include "nsServiceManagerUtils.h"
+#include "nsString.h"
+#include "nsThreadUtils.h"
+#include "nsXPCOMStrings.h"
+
+using mozilla::Preferences;
+
+// Preferences that we need to initialize the query. We may need another
+// preference than browser.safebrowsing.malware.enabled, or simply use
+// browser.safebrowsing.appRepURL. See bug 887041.
+#define PREF_SB_APP_REP_URL "browser.safebrowsing.appRepURL"
+#define PREF_SB_MALWARE_ENABLED "browser.safebrowsing.malware.enabled"
+#define PREF_GENERAL_LOCALE "general.useragent.locale"
+
+NS_IMPL_ISUPPORTS1(ApplicationReputationService, nsIApplicationReputationService)
+
+ApplicationReputationService* ApplicationReputationService::gApplicationReputationService = nullptr;
+
+ApplicationReputationService *
+ApplicationReputationService::GetSingleton()
+{
+  if (gApplicationReputationService) {
+    NS_ADDREF(gApplicationReputationService);
+    return gApplicationReputationService;
+  }
+
+  gApplicationReputationService = new ApplicationReputationService();
+  if (gApplicationReputationService) {
+    NS_ADDREF(gApplicationReputationService);
+  }
+
+  return gApplicationReputationService;
+}
+
+ApplicationReputationService::ApplicationReputationService() { }
+ApplicationReputationService::~ApplicationReputationService() { }
+
+NS_IMETHODIMP
+ApplicationReputationService::QueryReputation(
+  nsIApplicationReputationQuery* aQuery,
+  nsIApplicationReputationCallback* aCallback) {
+  NS_ENSURE_ARG_POINTER(aQuery);
+  NS_ENSURE_ARG_POINTER(aCallback);
+
+  nsresult rv = QueryReputationInternal(aQuery, aCallback);
+  if (NS_FAILED(rv)) {
+    aCallback->OnComplete(false, rv);
+    aCallback = nullptr;
+  }
+  return NS_OK;
+}
+
+nsresult
+ApplicationReputationService::QueryReputationInternal(
+  nsIApplicationReputationQuery* aQuery,
+  nsIApplicationReputationCallback* aCallback) {
+  nsresult rv;
+  aQuery->SetCallback(aCallback);
+
+  // 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 there is no service URL for querying application reputation, abort.
+  nsCString serviceUrl;
+  NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_SB_APP_REP_URL, &serviceUrl),
+                    NS_ERROR_NOT_AVAILABLE);
+  if (serviceUrl.EqualsLiteral("")) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
+  safe_browsing::ClientDownloadRequest req;
+
+  nsCString spec;
+  nsCOMPtr<nsIURI> aURI;
+  rv = aQuery->GetSourceURI(getter_AddRefs(aURI));
+  NS_ENSURE_SUCCESS(rv, rv);
+  // If the URI hasn't been set, bail
+  NS_ENSURE_STATE(aURI);
+  rv = aURI->GetSpec(spec);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  req.set_url(spec.get());
+  uint32_t fileSize;
+  rv = aQuery->GetFileSize(&fileSize);
+  NS_ENSURE_SUCCESS(rv, rv);
+  req.set_length(fileSize);
+  // We have no way of knowing whether or not a user initiated the download.
+  req.set_user_initiated(false);
+
+  nsCString locale;
+  NS_ENSURE_SUCCESS(Preferences::GetCString(PREF_GENERAL_LOCALE, &locale),
+                    NS_ERROR_NOT_AVAILABLE);
+  req.set_locale(locale.get());
+  nsCString sha256Hash;
+  rv = aQuery->GetSha256Hash(sha256Hash);
+  NS_ENSURE_SUCCESS(rv, rv);
+  req.mutable_digests()->set_sha256(sha256Hash.Data());
+  nsString fileName;
+  rv = aQuery->GetSuggestedFileName(fileName);
+  NS_ENSURE_SUCCESS(rv, rv);
+  req.set_file_basename(NS_ConvertUTF16toUTF8(fileName).get());
+
+  // 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 (!req.SerializeToString(&serialized)) {
+    return NS_ERROR_UNEXPECTED;
+  }
+
+  // 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);
+
+  nsCOMPtr<nsIIOService> ios = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Set up the channel to transmit the request to the service.
+  nsCOMPtr<nsIChannel> channel;
+  rv = ios->NewChannel(serviceUrl, nullptr, nullptr, getter_AddRefs(channel));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel, &rv));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // See bug 887044 for finalizing the user agent.
+  const nsCString userAgent = NS_LITERAL_CSTRING("CsdTesting/Mozilla");
+  rv = httpChannel->SetRequestHeader(
+    NS_LITERAL_CSTRING("User-Agent"), userAgent, false);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Upload the protobuf to the application reputation service.
+  nsCOMPtr<nsIUploadChannel2> uploadChannel = do_QueryInterface(channel, &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);
+
+  nsCOMPtr<nsIStreamListener> listener = do_QueryInterface(aQuery, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = channel->AsyncOpen(listener, nullptr);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  return NS_OK;
+}
+
+NS_IMPL_ISUPPORTS3(ApplicationReputationQuery,
+                   nsIApplicationReputationQuery,
+                   nsIStreamListener,
+                   nsIRequestObserver)
+
+ApplicationReputationQuery::ApplicationReputationQuery() :
+  mURI(nullptr),
+  mFileSize(0),
+  mCallback(nullptr) {
+}
+
+ApplicationReputationQuery::~ApplicationReputationQuery() {
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::GetSourceURI(nsIURI** aURI) {
+  *aURI = mURI;
+  NS_IF_ADDREF(*aURI);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::SetSourceURI(nsIURI* aURI) {
+  mURI = aURI;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::GetSuggestedFileName(
+  nsAString& aSuggestedFileName) {
+  aSuggestedFileName = mSuggestedFileName;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::SetSuggestedFileName(
+  const nsAString& aSuggestedFileName) {
+  mSuggestedFileName = aSuggestedFileName;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::GetFileSize(uint32_t* aFileSize) {
+  *aFileSize = mFileSize;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::SetFileSize(uint32_t aFileSize) {
+  mFileSize = aFileSize;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::GetSha256Hash(nsACString& aSha256Hash) {
+  aSha256Hash = mSha256Hash;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::SetSha256Hash(const nsACString& aSha256Hash) {
+  mSha256Hash = aSha256Hash;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::GetCallback(
+  nsIApplicationReputationCallback** aCallback) {
+  *aCallback = mCallback;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::SetCallback(
+  nsIApplicationReputationCallback* aCallback) {
+  mCallback = aCallback;
+  return NS_OK;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//// nsIStreamListener
+
+static NS_METHOD
+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
+ApplicationReputationQuery::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
+ApplicationReputationQuery::OnStartRequest(nsIRequest *aRequest,
+                                      nsISupports *aContext) {
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+ApplicationReputationQuery::OnStopRequest(nsIRequest *aRequest,
+                                          nsISupports *aContext,
+                                          nsresult aResult) {
+  NS_ENSURE_STATE(mCallback);
+
+  bool shouldBlock = false;
+  nsresult rv = OnStopRequestInternal(aRequest, aContext, aResult,
+                                      &shouldBlock);
+  mCallback->OnComplete(shouldBlock, rv);
+  mCallback = nullptr;
+  return rv;
+}
+
+nsresult
+ApplicationReputationQuery::OnStopRequestInternal(nsIRequest *aRequest,
+                                                  nsISupports *aContext,
+                                                  nsresult aResult,
+                                                  bool* aShouldBlock) {
+  *aShouldBlock = false;
+  nsresult rv;
+  nsCOMPtr<nsIHttpChannel> channel = do_QueryInterface(aRequest, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  uint32_t status = 0;
+  rv = channel->GetResponseStatus(&status);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (status != 200) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
+  std::string buf(mResponse.Data(), mResponse.Length());
+  safe_browsing::ClientDownloadResponse response;
+  if (!response.ParseFromString(buf)) {
+    NS_WARNING("Could not parse protocol buffer");
+    return NS_ERROR_CANNOT_CONVERT_DATA;
+  }
+
+  // There are several more verdicts, but we only respect one for now and treat
+  // everything else as SAFE.
+  if (response.verdict() == safe_browsing::ClientDownloadResponse::DANGEROUS) {
+    *aShouldBlock = true;
+  }
+
+  return NS_OK;
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/ApplicationReputation.h
@@ -0,0 +1,98 @@
+/* -*- 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"
+
+class nsIApplicationReputationListener;
+class nsIChannel;
+class nsIObserverService;
+class nsIRequest;
+class PRLogModuleInfo;
+
+class ApplicationReputationService MOZ_FINAL :
+  public nsIApplicationReputationService {
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSIAPPLICATIONREPUTATIONSERVICE
+
+public:
+  static ApplicationReputationService* GetSingleton();
+
+private:
+  /**
+   * Global singleton object for holding this factory service.
+   */
+  static ApplicationReputationService* gApplicationReputationService;
+
+  ApplicationReputationService();
+  ~ApplicationReputationService();
+
+  /**
+   * Wrapper function for QueryReputation that makes it easier to ensure the
+   * callback is called.
+   */
+  nsresult QueryReputationInternal(nsIApplicationReputationQuery* aQuery,
+                                   nsIApplicationReputationCallback* aCallback);
+};
+
+/**
+ * This class implements nsIApplicationReputation. See the
+ * nsIApplicationReputation.idl for details. ApplicationReputation also
+ * implements nsIStreamListener because it calls nsIChannel->AsyncOpen.
+ */
+class ApplicationReputationQuery MOZ_FINAL :
+  public nsIApplicationReputationQuery,
+  public nsIStreamListener {
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSIREQUESTOBSERVER
+  NS_DECL_NSISTREAMLISTENER
+  NS_DECL_NSIAPPLICATIONREPUTATIONQUERY
+
+  ApplicationReputationQuery();
+  ~ApplicationReputationQuery();
+
+private:
+  /**
+   * Corresponding member variables for the attributes in the IDL.
+   */
+  nsString mSuggestedFileName;
+  nsCOMPtr<nsIURI> mURI;
+  uint32_t mFileSize;
+  nsCString mSha256Hash;
+
+  /**
+   * The callback for the request.
+   */
+  nsCOMPtr<nsIApplicationReputationCallback> mCallback;
+
+  /**
+   * 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;
+
+  /**
+   * Wrapper function for nsIStreamListener.onStopRequest to make it easy to
+   * guarantee calling the callback
+   */
+  nsresult OnStopRequestInternal(nsIRequest *aRequest,
+                                 nsISupports *aContext,
+                                 nsresult aResult,
+                                 bool* aShouldBlock);
+};
+
+#endif /* ApplicationReputation_h__ */
--- a/toolkit/components/downloads/Makefile.in
+++ b/toolkit/components/downloads/Makefile.in
@@ -11,9 +11,13 @@ VPATH = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME = download_s
 LIBXUL_LIBRARY = 1
 FAIL_ON_WARNINGS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-CXXFLAGS += $(TK_CFLAGS)
+CXXFLAGS += $(TK_CFLAGS) -DGOOGLE_PROTOBUF_NO_RTTI
+
+LOCAL_INCLUDES += \
+  -I$(srcdir)/../protobuf \
+  $(NULL)
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/csd.pb.cc
@@ -0,0 +1,4309 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+
+#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
+#include "csd.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+// @@protoc_insertion_point(includes)
+
+namespace safe_browsing {
+
+void protobuf_ShutdownFile_csd_2eproto() {
+  delete ClientPhishingRequest::default_instance_;
+  delete ClientPhishingRequest_Feature::default_instance_;
+  delete ClientPhishingResponse::default_instance_;
+  delete ClientMalwareRequest::default_instance_;
+  delete ClientMalwareRequest_Feature::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_SignatureInfo::default_instance_;
+  delete ClientDownloadResponse::default_instance_;
+  delete ClientDownloadResponse_MoreInfo::default_instance_;
+  delete ClientDownloadReport::default_instance_;
+  delete ClientDownloadReport_UserInformation::default_instance_;
+  delete ClientUploadResponse::default_instance_;
+}
+
+void protobuf_AddDesc_csd_2eproto() {
+  static bool already_here = false;
+  if (already_here) return;
+  already_here = true;
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  ClientPhishingRequest::default_instance_ = new ClientPhishingRequest();
+  ClientPhishingRequest_Feature::default_instance_ = new ClientPhishingRequest_Feature();
+  ClientPhishingResponse::default_instance_ = new ClientPhishingResponse();
+  ClientMalwareRequest::default_instance_ = new ClientMalwareRequest();
+  ClientMalwareRequest_Feature::default_instance_ = new ClientMalwareRequest_Feature();
+  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_SignatureInfo::default_instance_ = new ClientDownloadRequest_SignatureInfo();
+  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();
+  ClientPhishingRequest::default_instance_->InitAsDefaultInstance();
+  ClientPhishingRequest_Feature::default_instance_->InitAsDefaultInstance();
+  ClientPhishingResponse::default_instance_->InitAsDefaultInstance();
+  ClientMalwareRequest::default_instance_->InitAsDefaultInstance();
+  ClientMalwareRequest_Feature::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_SignatureInfo::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();
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_csd_2eproto);
+}
+
+// Force AddDescriptors() to be called at static initialization time.
+struct StaticDescriptorInitializer_csd_2eproto {
+  StaticDescriptorInitializer_csd_2eproto() {
+    protobuf_AddDesc_csd_2eproto();
+  }
+} static_descriptor_initializer_csd_2eproto_;
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int ClientPhishingRequest_Feature::kNameFieldNumber;
+const int ClientPhishingRequest_Feature::kValueFieldNumber;
+#endif  // !_MSC_VER
+
+ClientPhishingRequest_Feature::ClientPhishingRequest_Feature()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientPhishingRequest_Feature::InitAsDefaultInstance() {
+}
+
+ClientPhishingRequest_Feature::ClientPhishingRequest_Feature(const ClientPhishingRequest_Feature& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientPhishingRequest_Feature::SharedCtor() {
+  _cached_size_ = 0;
+  name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  value_ = 0;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientPhishingRequest_Feature::~ClientPhishingRequest_Feature() {
+  SharedDtor();
+}
+
+void ClientPhishingRequest_Feature::SharedDtor() {
+  if (name_ != &::google::protobuf::internal::kEmptyString) {
+    delete name_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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] & (0xffu << (0 % 32))) {
+    if (has_name()) {
+      if (name_ != &::google::protobuf::internal::kEmptyString) {
+        name_->clear();
+      }
+    }
+    value_ = 0;
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientPhishingRequest_Feature::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string name = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_name()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(17)) goto parse_value;
+        break;
+      }
+      
+      // required double value = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+         parse_value:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, &value_)));
+          set_has_value();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientPhishingRequest_Feature::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string name = 1;
+  if (has_name()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->name(), output);
+  }
+  
+  // required double value = 2;
+  if (has_value()) {
+    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output);
+  }
+  
+}
+
+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;
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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;
+#endif  // !_MSC_VER
+
+ClientPhishingRequest::ClientPhishingRequest()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientPhishingRequest::InitAsDefaultInstance() {
+}
+
+ClientPhishingRequest::ClientPhishingRequest(const ClientPhishingRequest& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientPhishingRequest::SharedCtor() {
+  _cached_size_ = 0;
+  url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  client_score_ = 0;
+  is_phishing_ = false;
+  model_version_ = 0;
+  obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientPhishingRequest::~ClientPhishingRequest() {
+  SharedDtor();
+}
+
+void ClientPhishingRequest::SharedDtor() {
+  if (url_ != &::google::protobuf::internal::kEmptyString) {
+    delete url_;
+  }
+  if (obsolete_hash_prefix_ != &::google::protobuf::internal::kEmptyString) {
+    delete obsolete_hash_prefix_;
+  }
+  if (obsolete_referrer_url_ != &::google::protobuf::internal::kEmptyString) {
+    delete obsolete_referrer_url_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void ClientPhishingRequest::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientPhishingRequest& ClientPhishingRequest::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientPhishingRequest* ClientPhishingRequest::default_instance_ = NULL;
+
+ClientPhishingRequest* ClientPhishingRequest::New() const {
+  return new ClientPhishingRequest;
+}
+
+void ClientPhishingRequest::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_url()) {
+      if (url_ != &::google::protobuf::internal::kEmptyString) {
+        url_->clear();
+      }
+    }
+    if (has_obsolete_hash_prefix()) {
+      if (obsolete_hash_prefix_ != &::google::protobuf::internal::kEmptyString) {
+        obsolete_hash_prefix_->clear();
+      }
+    }
+    client_score_ = 0;
+    is_phishing_ = false;
+    model_version_ = 0;
+    if (has_obsolete_referrer_url()) {
+      if (obsolete_referrer_url_ != &::google::protobuf::internal::kEmptyString) {
+        obsolete_referrer_url_->clear();
+      }
+    }
+  }
+  feature_map_.Clear();
+  non_model_feature_map_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientPhishingRequest::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional string url = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(21)) goto parse_client_score;
+        break;
+      }
+      
+      // required float client_score = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
+         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_uninterpreted;
+        }
+        if (input->ExpectTag(32)) goto parse_is_phishing;
+        break;
+      }
+      
+      // optional bool is_phishing = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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_uninterpreted;
+        }
+        if (input->ExpectTag(42)) goto parse_feature_map;
+        break;
+      }
+      
+      // repeated .safe_browsing.ClientPhishingRequest.Feature feature_map = 5;
+      case 5: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_feature_map:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_feature_map()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        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 (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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_uninterpreted;
+        }
+        if (input->ExpectTag(66)) goto parse_non_model_feature_map;
+        break;
+      }
+      
+      // repeated .safe_browsing.ClientPhishingRequest.Feature non_model_feature_map = 8;
+      case 8: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_non_model_feature_map:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_non_model_feature_map()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        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 (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_OBSOLETE_referrer_url:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_obsolete_referrer_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(82)) goto parse_OBSOLETE_hash_prefix;
+        break;
+      }
+      
+      // optional bytes OBSOLETE_hash_prefix = 10;
+      case 10: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_OBSOLETE_hash_prefix:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_obsolete_hash_prefix()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientPhishingRequest::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional string url = 1;
+  if (has_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      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::WriteString(
+      9, this->obsolete_referrer_url(), output);
+  }
+  
+  // optional bytes OBSOLETE_hash_prefix = 10;
+  if (has_obsolete_hash_prefix()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      10, this->obsolete_hash_prefix(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  // 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));
+  }
+  
+  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_);
+  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());
+    }
+  }
+}
+
+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;
+  
+  for (int i = 0; i < feature_map_size(); i++) {
+    if (!this->feature_map(i).IsInitialized()) return false;
+  }
+  for (int i = 0; i < non_model_feature_map_size(); i++) {
+    if (!this->non_model_feature_map(i).IsInitialized()) 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_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    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();
+}
+
+void ClientPhishingResponse::InitAsDefaultInstance() {
+}
+
+ClientPhishingResponse::ClientPhishingResponse(const ClientPhishingResponse& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientPhishingResponse::SharedCtor() {
+  _cached_size_ = 0;
+  phishy_ = false;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientPhishingResponse::~ClientPhishingResponse() {
+  SharedDtor();
+}
+
+void ClientPhishingResponse::SharedDtor() {
+  if (this != default_instance_) {
+  }
+}
+
+void ClientPhishingResponse::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientPhishingResponse& ClientPhishingResponse::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientPhishingResponse* ClientPhishingResponse::default_instance_ = NULL;
+
+ClientPhishingResponse* ClientPhishingResponse::New() const {
+  return new ClientPhishingResponse;
+}
+
+void ClientPhishingResponse::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    phishy_ = false;
+  }
+  obsolete_whitelist_expression_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientPhishingResponse::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required bool phishy = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+                 input, &phishy_)));
+          set_has_phishy();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression;
+        break;
+      }
+      
+      // repeated string OBSOLETE_whitelist_expression = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_OBSOLETE_whitelist_expression:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->add_obsolete_whitelist_expression()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_OBSOLETE_whitelist_expression;
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientPhishingResponse::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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);
+  }
+  
+}
+
+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));
+  }
+  
+  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());
+    }
+  }
+}
+
+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]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ClientPhishingResponse::GetTypeName() const {
+  return "safe_browsing.ClientPhishingResponse";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int ClientMalwareRequest_Feature::kNameFieldNumber;
+const int ClientMalwareRequest_Feature::kValueFieldNumber;
+const int ClientMalwareRequest_Feature::kMetainfoFieldNumber;
+#endif  // !_MSC_VER
+
+ClientMalwareRequest_Feature::ClientMalwareRequest_Feature()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientMalwareRequest_Feature::InitAsDefaultInstance() {
+}
+
+ClientMalwareRequest_Feature::ClientMalwareRequest_Feature(const ClientMalwareRequest_Feature& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientMalwareRequest_Feature::SharedCtor() {
+  _cached_size_ = 0;
+  name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  value_ = 0;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientMalwareRequest_Feature::~ClientMalwareRequest_Feature() {
+  SharedDtor();
+}
+
+void ClientMalwareRequest_Feature::SharedDtor() {
+  if (name_ != &::google::protobuf::internal::kEmptyString) {
+    delete name_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void ClientMalwareRequest_Feature::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientMalwareRequest_Feature& ClientMalwareRequest_Feature::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientMalwareRequest_Feature* ClientMalwareRequest_Feature::default_instance_ = NULL;
+
+ClientMalwareRequest_Feature* ClientMalwareRequest_Feature::New() const {
+  return new ClientMalwareRequest_Feature;
+}
+
+void ClientMalwareRequest_Feature::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_name()) {
+      if (name_ != &::google::protobuf::internal::kEmptyString) {
+        name_->clear();
+      }
+    }
+    value_ = 0;
+  }
+  metainfo_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientMalwareRequest_Feature::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string name = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_name()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(17)) goto parse_value;
+        break;
+      }
+      
+      // required double value = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+         parse_value:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, &value_)));
+          set_has_value();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_metainfo;
+        break;
+      }
+      
+      // repeated string metainfo = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_metainfo:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->add_metainfo()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_metainfo;
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientMalwareRequest_Feature::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string name = 1;
+  if (has_name()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->name(), output);
+  }
+  
+  // required double value = 2;
+  if (has_value()) {
+    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->value(), output);
+  }
+  
+  // repeated string metainfo = 3;
+  for (int i = 0; i < this->metainfo_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      3, this->metainfo(i), output);
+  }
+  
+}
+
+int ClientMalwareRequest_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;
+    }
+    
+  }
+  // repeated string metainfo = 3;
+  total_size += 1 * this->metainfo_size();
+  for (int i = 0; i < this->metainfo_size(); i++) {
+    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
+      this->metainfo(i));
+  }
+  
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void ClientMalwareRequest_Feature::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const ClientMalwareRequest_Feature*>(&from));
+}
+
+void ClientMalwareRequest_Feature::MergeFrom(const ClientMalwareRequest_Feature& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  metainfo_.MergeFrom(from.metainfo_);
+  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());
+    }
+  }
+}
+
+void ClientMalwareRequest_Feature::CopyFrom(const ClientMalwareRequest_Feature& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool ClientMalwareRequest_Feature::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+  
+  return true;
+}
+
+void ClientMalwareRequest_Feature::Swap(ClientMalwareRequest_Feature* other) {
+  if (other != this) {
+    std::swap(name_, other->name_);
+    std::swap(value_, other->value_);
+    metainfo_.Swap(&other->metainfo_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ClientMalwareRequest_Feature::GetTypeName() const {
+  return "safe_browsing.ClientMalwareRequest.Feature";
+}
+
+
+// -------------------------------------------------------------------
+
+#ifndef _MSC_VER
+const int ClientMalwareRequest::kUrlFieldNumber;
+const int ClientMalwareRequest::kFeatureMapFieldNumber;
+const int ClientMalwareRequest::kReferrerUrlFieldNumber;
+#endif  // !_MSC_VER
+
+ClientMalwareRequest::ClientMalwareRequest()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientMalwareRequest::InitAsDefaultInstance() {
+}
+
+ClientMalwareRequest::ClientMalwareRequest(const ClientMalwareRequest& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientMalwareRequest::SharedCtor() {
+  _cached_size_ = 0;
+  url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientMalwareRequest::~ClientMalwareRequest() {
+  SharedDtor();
+}
+
+void ClientMalwareRequest::SharedDtor() {
+  if (url_ != &::google::protobuf::internal::kEmptyString) {
+    delete url_;
+  }
+  if (referrer_url_ != &::google::protobuf::internal::kEmptyString) {
+    delete referrer_url_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void ClientMalwareRequest::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientMalwareRequest& ClientMalwareRequest::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientMalwareRequest* ClientMalwareRequest::default_instance_ = NULL;
+
+ClientMalwareRequest* ClientMalwareRequest::New() const {
+  return new ClientMalwareRequest;
+}
+
+void ClientMalwareRequest::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_url()) {
+      if (url_ != &::google::protobuf::internal::kEmptyString) {
+        url_->clear();
+      }
+    }
+    if (has_referrer_url()) {
+      if (referrer_url_ != &::google::protobuf::internal::kEmptyString) {
+        referrer_url_->clear();
+      }
+    }
+  }
+  feature_map_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientMalwareRequest::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string url = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_feature_map;
+        break;
+      }
+      
+      // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_feature_map:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_feature_map()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_feature_map;
+        if (input->ExpectTag(34)) goto parse_referrer_url;
+        break;
+      }
+      
+      // optional string referrer_url = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_referrer_url:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_referrer_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientMalwareRequest::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string url = 1;
+  if (has_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->url(), output);
+  }
+  
+  // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
+  for (int i = 0; i < this->feature_map_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      2, this->feature_map(i), output);
+  }
+  
+  // optional string referrer_url = 4;
+  if (has_referrer_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      4, this->referrer_url(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
+  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));
+  }
+  
+  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);
+  feature_map_.MergeFrom(from.feature_map_);
+  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());
+    }
+  }
+}
+
+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;
+  
+  for (int i = 0; i < feature_map_size(); i++) {
+    if (!this->feature_map(i).IsInitialized()) return false;
+  }
+  return true;
+}
+
+void ClientMalwareRequest::Swap(ClientMalwareRequest* other) {
+  if (other != this) {
+    std::swap(url_, other->url_);
+    feature_map_.Swap(&other->feature_map_);
+    std::swap(referrer_url_, other->referrer_url_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    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;
+#endif  // !_MSC_VER
+
+ClientMalwareResponse::ClientMalwareResponse()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientMalwareResponse::InitAsDefaultInstance() {
+}
+
+ClientMalwareResponse::ClientMalwareResponse(const ClientMalwareResponse& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientMalwareResponse::SharedCtor() {
+  _cached_size_ = 0;
+  blacklist_ = false;
+  bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientMalwareResponse::~ClientMalwareResponse() {
+  SharedDtor();
+}
+
+void ClientMalwareResponse::SharedDtor() {
+  if (bad_ip_ != &::google::protobuf::internal::kEmptyString) {
+    delete bad_ip_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void ClientMalwareResponse::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientMalwareResponse& ClientMalwareResponse::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientMalwareResponse* ClientMalwareResponse::default_instance_ = NULL;
+
+ClientMalwareResponse* ClientMalwareResponse::New() const {
+  return new ClientMalwareResponse;
+}
+
+void ClientMalwareResponse::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    blacklist_ = false;
+    if (has_bad_ip()) {
+      if (bad_ip_ != &::google::protobuf::internal::kEmptyString) {
+        bad_ip_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientMalwareResponse::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required bool blacklist = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+                 input, &blacklist_)));
+          set_has_blacklist();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_bad_ip;
+        break;
+      }
+      
+      // optional string bad_ip = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_bad_ip:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_bad_ip()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientMalwareResponse::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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::WriteString(
+      2, this->bad_ip(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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(_has_bits_[0], other->_has_bits_[0]);
+    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:
+      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::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:
+      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::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();
+}
+
+void ClientDownloadRequest_Digests::InitAsDefaultInstance() {
+}
+
+ClientDownloadRequest_Digests::ClientDownloadRequest_Digests(const ClientDownloadRequest_Digests& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest_Digests::SharedCtor() {
+  _cached_size_ = 0;
+  sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest_Digests::~ClientDownloadRequest_Digests() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest_Digests::SharedDtor() {
+  if (sha256_ != &::google::protobuf::internal::kEmptyString) {
+    delete sha256_;
+  }
+  if (sha1_ != &::google::protobuf::internal::kEmptyString) {
+    delete sha1_;
+  }
+  if (md5_ != &::google::protobuf::internal::kEmptyString) {
+    delete md5_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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] & (0xffu << (0 % 32))) {
+    if (has_sha256()) {
+      if (sha256_ != &::google::protobuf::internal::kEmptyString) {
+        sha256_->clear();
+      }
+    }
+    if (has_sha1()) {
+      if (sha1_ != &::google::protobuf::internal::kEmptyString) {
+        sha1_->clear();
+      }
+    }
+    if (has_md5()) {
+      if (md5_ != &::google::protobuf::internal::kEmptyString) {
+        md5_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadRequest_Digests::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional bytes sha256 = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_sha256()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_sha1;
+        break;
+      }
+      
+      // optional bytes sha1 = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_sha1:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_sha1()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_md5;
+        break;
+      }
+      
+      // optional bytes md5 = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_md5:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_md5()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest_Digests::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional bytes sha256 = 1;
+  if (has_sha256()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      1, this->sha256(), output);
+  }
+  
+  // optional bytes sha1 = 2;
+  if (has_sha1()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      2, this->sha1(), output);
+  }
+  
+  // optional bytes md5 = 3;
+  if (has_md5()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      3, this->md5(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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();
+}
+
+void ClientDownloadRequest_Resource::InitAsDefaultInstance() {
+}
+
+ClientDownloadRequest_Resource::ClientDownloadRequest_Resource(const ClientDownloadRequest_Resource& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest_Resource::SharedCtor() {
+  _cached_size_ = 0;
+  url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  type_ = 0;
+  remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest_Resource::~ClientDownloadRequest_Resource() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest_Resource::SharedDtor() {
+  if (url_ != &::google::protobuf::internal::kEmptyString) {
+    delete url_;
+  }
+  if (remote_ip_ != &::google::protobuf::internal::kEmptyString) {
+    delete remote_ip_;
+  }
+  if (referrer_ != &::google::protobuf::internal::kEmptyString) {
+    delete referrer_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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] & (0xffu << (0 % 32))) {
+    if (has_url()) {
+      if (url_ != &::google::protobuf::internal::kEmptyString) {
+        url_->clear();
+      }
+    }
+    type_ = 0;
+    if (has_remote_ip()) {
+      if (remote_ip_ != &::google::protobuf::internal::kEmptyString) {
+        remote_ip_->clear();
+      }
+    }
+    if (has_referrer()) {
+      if (referrer_ != &::google::protobuf::internal::kEmptyString) {
+        referrer_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadRequest_Resource::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string url = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(16)) goto parse_type;
+        break;
+      }
+      
+      // required .safe_browsing.ClientDownloadRequest.ResourceType type = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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 {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_remote_ip;
+        break;
+      }
+      
+      // optional bytes remote_ip = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_remote_ip:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_remote_ip()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(34)) goto parse_referrer;
+        break;
+      }
+      
+      // optional string referrer = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_referrer:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_referrer()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest_Resource::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string url = 1;
+  if (has_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      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::WriteBytes(
+      3, this->remote_ip(), output);
+  }
+  
+  // optional string referrer = 4;
+  if (has_referrer()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      4, this->referrer(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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();
+}
+
+void ClientDownloadRequest_CertificateChain_Element::InitAsDefaultInstance() {
+}
+
+ClientDownloadRequest_CertificateChain_Element::ClientDownloadRequest_CertificateChain_Element(const ClientDownloadRequest_CertificateChain_Element& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest_CertificateChain_Element::SharedCtor() {
+  _cached_size_ = 0;
+  certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest_CertificateChain_Element::~ClientDownloadRequest_CertificateChain_Element() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest_CertificateChain_Element::SharedDtor() {
+  if (certificate_ != &::google::protobuf::internal::kEmptyString) {
+    delete certificate_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_certificate()) {
+      if (certificate_ != &::google::protobuf::internal::kEmptyString) {
+        certificate_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadRequest_CertificateChain_Element::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional bytes certificate = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_certificate()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest_CertificateChain_Element::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional bytes certificate = 1;
+  if (has_certificate()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      1, this->certificate(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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();
+}
+
+void ClientDownloadRequest_CertificateChain::InitAsDefaultInstance() {
+}
+
+ClientDownloadRequest_CertificateChain::ClientDownloadRequest_CertificateChain(const ClientDownloadRequest_CertificateChain& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest_CertificateChain::SharedCtor() {
+  _cached_size_ = 0;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest_CertificateChain::~ClientDownloadRequest_CertificateChain() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest_CertificateChain::SharedDtor() {
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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_));
+}
+
+bool ClientDownloadRequest_CertificateChain::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // repeated .safe_browsing.ClientDownloadRequest.CertificateChain.Element element = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_element:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_element()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(10)) goto parse_element;
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest_CertificateChain::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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);
+  }
+  
+}
+
+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));
+  }
+  
+  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_);
+}
+
+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]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ClientDownloadRequest_CertificateChain::GetTypeName() const {
+  return "safe_browsing.ClientDownloadRequest.CertificateChain";
+}
+
+
+// -------------------------------------------------------------------
+
+#ifndef _MSC_VER
+const int ClientDownloadRequest_SignatureInfo::kCertificateChainFieldNumber;
+const int ClientDownloadRequest_SignatureInfo::kTrustedFieldNumber;
+#endif  // !_MSC_VER
+
+ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientDownloadRequest_SignatureInfo::InitAsDefaultInstance() {
+}
+
+ClientDownloadRequest_SignatureInfo::ClientDownloadRequest_SignatureInfo(const ClientDownloadRequest_SignatureInfo& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest_SignatureInfo::SharedCtor() {
+  _cached_size_ = 0;
+  trusted_ = false;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest_SignatureInfo::~ClientDownloadRequest_SignatureInfo() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest_SignatureInfo::SharedDtor() {
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::default_instance_ = NULL;
+
+ClientDownloadRequest_SignatureInfo* ClientDownloadRequest_SignatureInfo::New() const {
+  return new ClientDownloadRequest_SignatureInfo;
+}
+
+void ClientDownloadRequest_SignatureInfo::Clear() {
+  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    trusted_ = false;
+  }
+  certificate_chain_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadRequest_SignatureInfo::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // repeated .safe_browsing.ClientDownloadRequest.CertificateChain certificate_chain = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_certificate_chain:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_certificate_chain()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(10)) goto parse_certificate_chain;
+        if (input->ExpectTag(16)) goto parse_trusted;
+        break;
+      }
+      
+      // optional bool trusted = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_trusted:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
+                 input, &trusted_)));
+          set_has_trusted();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest_SignatureInfo::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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);
+  }
+  
+}
+
+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));
+  }
+  
+  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_);
+  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    if (from.has_trusted()) {
+      set_trusted(from.trusted());
+    }
+  }
+}
+
+void ClientDownloadRequest_SignatureInfo::CopyFrom(const ClientDownloadRequest_SignatureInfo& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool ClientDownloadRequest_SignatureInfo::IsInitialized() const {
+  
+  return true;
+}
+
+void ClientDownloadRequest_SignatureInfo::Swap(ClientDownloadRequest_SignatureInfo* other) {
+  if (other != this) {
+    certificate_chain_.Swap(&other->certificate_chain_);
+    std::swap(trusted_, other->trusted_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ClientDownloadRequest_SignatureInfo::GetTypeName() const {
+  return "safe_browsing.ClientDownloadRequest.SignatureInfo";
+}
+
+
+// -------------------------------------------------------------------
+
+#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;
+#endif  // !_MSC_VER
+
+ClientDownloadRequest::ClientDownloadRequest()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+}
+
+void ClientDownloadRequest::InitAsDefaultInstance() {
+  digests_ = const_cast< ::safe_browsing::ClientDownloadRequest_Digests*>(&::safe_browsing::ClientDownloadRequest_Digests::default_instance());
+  signature_ = const_cast< ::safe_browsing::ClientDownloadRequest_SignatureInfo*>(&::safe_browsing::ClientDownloadRequest_SignatureInfo::default_instance());
+}
+
+ClientDownloadRequest::ClientDownloadRequest(const ClientDownloadRequest& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadRequest::SharedCtor() {
+  _cached_size_ = 0;
+  url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  digests_ = NULL;
+  length_ = GOOGLE_LONGLONG(0);
+  signature_ = NULL;
+  user_initiated_ = false;
+  file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  download_type_ = 0;
+  locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadRequest::~ClientDownloadRequest() {
+  SharedDtor();
+}
+
+void ClientDownloadRequest::SharedDtor() {
+  if (url_ != &::google::protobuf::internal::kEmptyString) {
+    delete url_;
+  }
+  if (file_basename_ != &::google::protobuf::internal::kEmptyString) {
+    delete file_basename_;
+  }
+  if (locale_ != &::google::protobuf::internal::kEmptyString) {
+    delete locale_;
+  }
+  if (this != default_instance_) {
+    delete digests_;
+    delete signature_;
+  }
+}
+
+void ClientDownloadRequest::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientDownloadRequest& ClientDownloadRequest::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientDownloadRequest* ClientDownloadRequest::default_instance_ = NULL;
+
+ClientDownloadRequest* ClientDownloadRequest::New() const {
+  return new ClientDownloadRequest;
+}
+
+void ClientDownloadRequest::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_url()) {
+      if (url_ != &::google::protobuf::internal::kEmptyString) {
+        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();
+    }
+    user_initiated_ = false;
+    if (has_file_basename()) {
+      if (file_basename_ != &::google::protobuf::internal::kEmptyString) {
+        file_basename_->clear();
+      }
+    }
+    download_type_ = 0;
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    if (has_locale()) {
+      if (locale_ != &::google::protobuf::internal::kEmptyString) {
+        locale_->clear();
+      }
+    }
+  }
+  resources_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadRequest::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string url = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_digests;
+        break;
+      }
+      
+      // required .safe_browsing.ClientDownloadRequest.Digests digests = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_digests:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_digests()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(24)) goto parse_length;
+        break;
+      }
+      
+      // required int64 length = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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_uninterpreted;
+        }
+        if (input->ExpectTag(34)) goto parse_resources;
+        break;
+      }
+      
+      // repeated .safe_browsing.ClientDownloadRequest.Resource resources = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_resources:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_resources()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        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 (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_signature:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_signature()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(48)) goto parse_user_initiated;
+        break;
+      }
+      
+      // optional bool user_initiated = 6;
+      case 6: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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_uninterpreted;
+        }
+        if (input->ExpectTag(74)) goto parse_file_basename;
+        break;
+      }
+      
+      // optional string file_basename = 9;
+      case 9: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_file_basename:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_file_basename()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(80)) goto parse_download_type;
+        break;
+      }
+      
+      // optional .safe_browsing.ClientDownloadRequest.DownloadType download_type = 10 [default = WIN_EXECUTABLE];
+      case 10: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         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 {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(90)) goto parse_locale;
+        break;
+      }
+      
+      // optional string locale = 11;
+      case 11: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_locale:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_locale()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadRequest::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string url = 1;
+  if (has_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      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::WriteString(
+      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::WriteString(
+      11, this->locale(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  // 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));
+  }
+  
+  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_);
+  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());
+    }
+  }
+}
+
+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;
+  
+  for (int i = 0; i < resources_size(); i++) {
+    if (!this->resources(i).IsInitialized()) 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(_has_bits_[0], other->_has_bits_[0]);
+    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:
+      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::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();
+}
+
+void ClientDownloadResponse_MoreInfo::InitAsDefaultInstance() {
+}
+
+ClientDownloadResponse_MoreInfo::ClientDownloadResponse_MoreInfo(const ClientDownloadResponse_MoreInfo& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadResponse_MoreInfo::SharedCtor() {
+  _cached_size_ = 0;
+  description_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadResponse_MoreInfo::~ClientDownloadResponse_MoreInfo() {
+  SharedDtor();
+}
+
+void ClientDownloadResponse_MoreInfo::SharedDtor() {
+  if (description_ != &::google::protobuf::internal::kEmptyString) {
+    delete description_;
+  }
+  if (url_ != &::google::protobuf::internal::kEmptyString) {
+    delete url_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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] & (0xffu << (0 % 32))) {
+    if (has_description()) {
+      if (description_ != &::google::protobuf::internal::kEmptyString) {
+        description_->clear();
+      }
+    }
+    if (has_url()) {
+      if (url_ != &::google::protobuf::internal::kEmptyString) {
+        url_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadResponse_MoreInfo::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional string description = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_description()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_url;
+        break;
+      }
+      
+      // optional string url = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_url:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_url()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadResponse_MoreInfo::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional string description = 1;
+  if (has_description()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->description(), output);
+  }
+  
+  // optional string url = 2;
+  if (has_url()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      2, this->url(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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();
+}
+
+void ClientDownloadResponse::InitAsDefaultInstance() {
+  more_info_ = const_cast< ::safe_browsing::ClientDownloadResponse_MoreInfo*>(&::safe_browsing::ClientDownloadResponse_MoreInfo::default_instance());
+}
+
+ClientDownloadResponse::ClientDownloadResponse(const ClientDownloadResponse& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadResponse::SharedCtor() {
+  _cached_size_ = 0;
+  verdict_ = 0;
+  more_info_ = NULL;
+  token_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadResponse::~ClientDownloadResponse() {
+  SharedDtor();
+}
+
+void ClientDownloadResponse::SharedDtor() {
+  if (token_ != &::google::protobuf::internal::kEmptyString) {
+    delete token_;
+  }
+  if (this != default_instance_) {
+    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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientDownloadResponse* ClientDownloadResponse::default_instance_ = NULL;
+
+ClientDownloadResponse* ClientDownloadResponse::New() const {
+  return new ClientDownloadResponse;
+}
+
+void ClientDownloadResponse::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    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::kEmptyString) {
+        token_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadResponse::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          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 {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_more_info;
+        break;
+      }
+      
+      // optional .safe_browsing.ClientDownloadResponse.MoreInfo more_info = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_more_info:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_more_info()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_token;
+        break;
+      }
+      
+      // optional bytes token = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_token:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_token()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadResponse::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
+  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::WriteBytes(
+      3, this->token(), output);
+  }
+  
+}
+
+int ClientDownloadResponse::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
+    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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+void ClientDownloadResponse::CopyFrom(const ClientDownloadResponse& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool ClientDownloadResponse::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+  
+  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]);
+    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();
+}
+
+void ClientDownloadReport_UserInformation::InitAsDefaultInstance() {
+}
+
+ClientDownloadReport_UserInformation::ClientDownloadReport_UserInformation(const ClientDownloadReport_UserInformation& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadReport_UserInformation::SharedCtor() {
+  _cached_size_ = 0;
+  email_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadReport_UserInformation::~ClientDownloadReport_UserInformation() {
+  SharedDtor();
+}
+
+void ClientDownloadReport_UserInformation::SharedDtor() {
+  if (email_ != &::google::protobuf::internal::kEmptyString) {
+    delete email_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  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_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_email()) {
+      if (email_ != &::google::protobuf::internal::kEmptyString) {
+        email_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadReport_UserInformation::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional string email = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_email()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadReport_UserInformation::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional string email = 1;
+  if (has_email()) {
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->email(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    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();
+}
+
+void ClientDownloadReport::InitAsDefaultInstance() {
+  download_request_ = const_cast< ::safe_browsing::ClientDownloadRequest*>(&::safe_browsing::ClientDownloadRequest::default_instance());
+  user_information_ = const_cast< ::safe_browsing::ClientDownloadReport_UserInformation*>(&::safe_browsing::ClientDownloadReport_UserInformation::default_instance());
+  download_response_ = const_cast< ::safe_browsing::ClientDownloadResponse*>(&::safe_browsing::ClientDownloadResponse::default_instance());
+}
+
+ClientDownloadReport::ClientDownloadReport(const ClientDownloadReport& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientDownloadReport::SharedCtor() {
+  _cached_size_ = 0;
+  reason_ = 0;
+  download_request_ = NULL;
+  user_information_ = NULL;
+  comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  download_response_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientDownloadReport::~ClientDownloadReport() {
+  SharedDtor();
+}
+
+void ClientDownloadReport::SharedDtor() {
+  if (comment_ != &::google::protobuf::internal::kEmptyString) {
+    delete comment_;
+  }
+  if (this != default_instance_) {
+    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() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientDownloadReport* ClientDownloadReport::default_instance_ = NULL;
+
+ClientDownloadReport* ClientDownloadReport::New() const {
+  return new ClientDownloadReport;
+}
+
+void ClientDownloadReport::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    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::kEmptyString) {
+        comment_->clear();
+      }
+    }
+    if (has_download_response()) {
+      if (download_response_ != NULL) download_response_->::safe_browsing::ClientDownloadResponse::Clear();
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientDownloadReport::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional .safe_browsing.ClientDownloadReport.Reason reason = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          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 {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_download_request;
+        break;
+      }
+      
+      // optional .safe_browsing.ClientDownloadRequest download_request = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_download_request:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_download_request()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(26)) goto parse_user_information;
+        break;
+      }
+      
+      // optional .safe_browsing.ClientDownloadReport.UserInformation user_information = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_user_information:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_user_information()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(34)) goto parse_comment;
+        break;
+      }
+      
+      // optional bytes comment = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_comment:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_comment()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(42)) goto parse_download_response;
+        break;
+      }
+      
+      // optional .safe_browsing.ClientDownloadResponse download_response = 5;
+      case 5: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_download_response:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_download_response()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientDownloadReport::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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::WriteBytes(
+      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);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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;
+  }
+  if (has_download_response()) {
+    if (!this->download_response().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]);
+    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();
+}
+
+void ClientUploadResponse::InitAsDefaultInstance() {
+}
+
+ClientUploadResponse::ClientUploadResponse(const ClientUploadResponse& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void ClientUploadResponse::SharedCtor() {
+  _cached_size_ = 0;
+  status_ = 0;
+  permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+ClientUploadResponse::~ClientUploadResponse() {
+  SharedDtor();
+}
+
+void ClientUploadResponse::SharedDtor() {
+  if (permalink_ != &::google::protobuf::internal::kEmptyString) {
+    delete permalink_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void ClientUploadResponse::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ClientUploadResponse& ClientUploadResponse::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_csd_2eproto();  return *default_instance_;
+}
+
+ClientUploadResponse* ClientUploadResponse::default_instance_ = NULL;
+
+ClientUploadResponse* ClientUploadResponse::New() const {
+  return new ClientUploadResponse;
+}
+
+void ClientUploadResponse::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    status_ = 0;
+    if (has_permalink()) {
+      if (permalink_ != &::google::protobuf::internal::kEmptyString) {
+        permalink_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+bool ClientUploadResponse::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional .safe_browsing.ClientUploadResponse.UploadStatus status = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+          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 {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_permalink;
+        break;
+      }
+      
+      // optional string permalink = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_permalink:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_permalink()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void ClientUploadResponse::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // 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::WriteString(
+      2, this->permalink(), output);
+  }
+  
+}
+
+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());
+    }
+    
+  }
+  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());
+    }
+  }
+}
+
+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]);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string ClientUploadResponse::GetTypeName() const {
+  return "safe_browsing.ClientUploadResponse";
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace safe_browsing
+
+// @@protoc_insertion_point(global_scope)
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/csd.pb.h
@@ -0,0 +1,4077 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: csd.proto
+
+#ifndef PROTOBUF_csd_2eproto__INCLUDED
+#define PROTOBUF_csd_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2004000
+#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 2004001 < 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/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_csd_2eproto();
+void protobuf_AssignDesc_csd_2eproto();
+void protobuf_ShutdownFile_csd_2eproto();
+
+class ClientPhishingRequest;
+class ClientPhishingRequest_Feature;
+class ClientPhishingResponse;
+class ClientMalwareRequest;
+class ClientMalwareRequest_Feature;
+class ClientMalwareResponse;
+class ClientDownloadRequest;
+class ClientDownloadRequest_Digests;
+class ClientDownloadRequest_Resource;
+class ClientDownloadRequest_CertificateChain;
+class ClientDownloadRequest_CertificateChain_Element;
+class ClientDownloadRequest_SignatureInfo;
+class ClientDownloadResponse;
+class ClientDownloadResponse_MoreInfo;
+class ClientDownloadReport;
+class ClientDownloadReport_UserInformation;
+class ClientUploadResponse;
+
+enum ClientDownloadRequest_ResourceType {
+  ClientDownloadRequest_ResourceType_DOWNLOAD_URL = 0,
+  ClientDownloadRequest_ResourceType_DOWNLOAD_REDIRECT = 1,
+  ClientDownloadRequest_ResourceType_TAB_URL = 2,
+  ClientDownloadRequest_ResourceType_TAB_REDIRECT = 3
+};
+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_TAB_REDIRECT;
+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
+};
+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_ZIPPED_EXECUTABLE;
+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
+};
+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_DANGEROUS_HOST;
+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;
+
+// ===================================================================
+
+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;
+  }
+  
+  static const ClientPhishingRequest_Feature& default_instance();
+  
+  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;
+  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();
+  
+  // 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* name_;
+  double value_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientPhishingRequest& default_instance();
+  
+  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;
+  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();
+  
+  // 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();
+  
+  // 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();
+  
+  // @@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();
+  
+  ::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::int32 model_version_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientPhishingResponse& default_instance();
+  
+  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;
+  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();
+  
+  ::google::protobuf::RepeatedPtrField< ::std::string> obsolete_whitelist_expression_;
+  bool phishy_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ClientPhishingResponse* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class ClientMalwareRequest_Feature : public ::google::protobuf::MessageLite {
+ public:
+  ClientMalwareRequest_Feature();
+  virtual ~ClientMalwareRequest_Feature();
+  
+  ClientMalwareRequest_Feature(const ClientMalwareRequest_Feature& from);
+  
+  inline ClientMalwareRequest_Feature& operator=(const ClientMalwareRequest_Feature& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  static const ClientMalwareRequest_Feature& default_instance();
+  
+  void Swap(ClientMalwareRequest_Feature* other);
+  
+  // implements Message ----------------------------------------------
+  
+  ClientMalwareRequest_Feature* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const ClientMalwareRequest_Feature& from);
+  void MergeFrom(const ClientMalwareRequest_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;
+  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();
+  
+  // 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);
+  
+  // repeated string metainfo = 3;
+  inline int metainfo_size() const;
+  inline void clear_metainfo();
+  static const int kMetainfoFieldNumber = 3;
+  inline const ::std::string& metainfo(int index) const;
+  inline ::std::string* mutable_metainfo(int index);
+  inline void set_metainfo(int index, const ::std::string& value);
+  inline void set_metainfo(int index, const char* value);
+  inline void set_metainfo(int index, const char* value, size_t size);
+  inline ::std::string* add_metainfo();
+  inline void add_metainfo(const ::std::string& value);
+  inline void add_metainfo(const char* value);
+  inline void add_metainfo(const char* value, size_t size);
+  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& metainfo() const;
+  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_metainfo();
+  
+  // @@protoc_insertion_point(class_scope:safe_browsing.ClientMalwareRequest.Feature)
+ private:
+  inline void set_has_name();
+  inline void clear_has_name();
+  inline void set_has_value();
+  inline void clear_has_value();
+  
+  ::std::string* name_;
+  double value_;
+  ::google::protobuf::RepeatedPtrField< ::std::string> metainfo_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ClientMalwareRequest_Feature* 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;
+  }
+  
+  static const ClientMalwareRequest& default_instance();
+  
+  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;
+  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_Feature Feature;
+  
+  // 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();
+  
+  // repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
+  inline int feature_map_size() const;
+  inline void clear_feature_map();
+  static const int kFeatureMapFieldNumber = 2;
+  inline const ::safe_browsing::ClientMalwareRequest_Feature& feature_map(int index) const;
+  inline ::safe_browsing::ClientMalwareRequest_Feature* mutable_feature_map(int index);
+  inline ::safe_browsing::ClientMalwareRequest_Feature* add_feature_map();
+  inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_Feature >&
+      feature_map() const;
+  inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_Feature >*
+      mutable_feature_map();
+  
+  // 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();
+  
+  // @@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();
+  
+  ::std::string* url_;
+  ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_Feature > feature_map_;
+  ::std::string* referrer_url_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientMalwareResponse& default_instance();
+  
+  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;
+  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();
+  
+  // @@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();
+  
+  ::std::string* bad_ip_;
+  bool blacklist_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadRequest_Digests& default_instance();
+  
+  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;
+  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();
+  
+  // 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();
+  
+  // 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();
+  
+  // @@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* sha256_;
+  ::std::string* sha1_;
+  ::std::string* md5_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadRequest_Resource& default_instance();
+  
+  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;
+  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();
+  
+  // 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();
+  
+  // 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();
+  
+  // @@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* url_;
+  ::std::string* remote_ip_;
+  ::std::string* referrer_;
+  int type_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadRequest_CertificateChain_Element& default_instance();
+  
+  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;
+  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();
+  
+  // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.CertificateChain.Element)
+ private:
+  inline void set_has_certificate();
+  inline void clear_has_certificate();
+  
+  ::std::string* certificate_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadRequest_CertificateChain& default_instance();
+  
+  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;
+  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:
+  
+  ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element > element_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ClientDownloadRequest_CertificateChain* 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;
+  }
+  
+  static const ClientDownloadRequest_SignatureInfo& default_instance();
+  
+  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;
+  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);
+  
+  // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadRequest.SignatureInfo)
+ private:
+  inline void set_has_trusted();
+  inline void clear_has_trusted();
+  
+  ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain > certificate_chain_;
+  bool trusted_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ClientDownloadRequest_SignatureInfo* 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;
+  }
+  
+  static const ClientDownloadRequest& default_instance();
+  
+  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;
+  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_SignatureInfo SignatureInfo;
+  
+  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 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 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();
+  
+  // 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();
+  
+  // 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();
+  
+  // 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();
+  
+  // 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();
+  
+  // @@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();
+  
+  ::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_;
+  bool user_initiated_;
+  int download_type_;
+  ::std::string* locale_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(9 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadResponse_MoreInfo& default_instance();
+  
+  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;
+  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();
+  
+  // 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();
+  
+  // @@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* description_;
+  ::std::string* url_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadResponse& default_instance();
+  
+  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;
+  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 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 -------------------------------------------------------
+  
+  // required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
+  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();
+  
+  // 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();
+  
+  // @@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();
+  
+  ::safe_browsing::ClientDownloadResponse_MoreInfo* more_info_;
+  ::std::string* token_;
+  int verdict_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadReport_UserInformation& default_instance();
+  
+  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;
+  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();
+  
+  // @@protoc_insertion_point(class_scope:safe_browsing.ClientDownloadReport.UserInformation)
+ private:
+  inline void set_has_email();
+  inline void clear_has_email();
+  
+  ::std::string* email_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientDownloadReport& default_instance();
+  
+  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;
+  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();
+  
+  // 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();
+  
+  // 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();
+  
+  // 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();
+  
+  // @@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();
+  
+  ::safe_browsing::ClientDownloadRequest* download_request_;
+  ::safe_browsing::ClientDownloadReport_UserInformation* user_information_;
+  ::std::string* comment_;
+  ::safe_browsing::ClientDownloadResponse* download_response_;
+  int reason_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_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;
+  }
+  
+  static const ClientUploadResponse& default_instance();
+  
+  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;
+  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();
+  
+  // @@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* permalink_;
+  int status_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_csd_2eproto();
+  friend void protobuf_AssignDesc_csd_2eproto();
+  friend void protobuf_ShutdownFile_csd_2eproto();
+  
+  void InitAsDefaultInstance();
+  static ClientUploadResponse* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// 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::kEmptyString) {
+    name_->clear();
+  }
+  clear_has_name();
+}
+inline const ::std::string& ClientPhishingRequest_Feature::name() const {
+  return *name_;
+}
+inline void ClientPhishingRequest_Feature::set_name(const ::std::string& value) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(value);
+}
+inline void ClientPhishingRequest_Feature::set_name(const char* value) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(value);
+}
+inline void ClientPhishingRequest_Feature::set_name(const char* value, size_t size) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientPhishingRequest_Feature::mutable_name() {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  return name_;
+}
+inline ::std::string* ClientPhishingRequest_Feature::release_name() {
+  clear_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = name_;
+    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return value_;
+}
+inline void ClientPhishingRequest_Feature::set_value(double value) {
+  set_has_value();
+  value_ = 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::kEmptyString) {
+    url_->clear();
+  }
+  clear_has_url();
+}
+inline const ::std::string& ClientPhishingRequest::url() const {
+  return *url_;
+}
+inline void ClientPhishingRequest::set_url(const ::std::string& value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientPhishingRequest::set_url(const char* value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientPhishingRequest::set_url(const char* value, size_t size) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientPhishingRequest::mutable_url() {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  return url_;
+}
+inline ::std::string* ClientPhishingRequest::release_url() {
+  clear_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = url_;
+    url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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::kEmptyString) {
+    obsolete_hash_prefix_->clear();
+  }
+  clear_has_obsolete_hash_prefix();
+}
+inline const ::std::string& ClientPhishingRequest::obsolete_hash_prefix() const {
+  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::kEmptyString) {
+    obsolete_hash_prefix_ = new ::std::string;
+  }
+  obsolete_hash_prefix_->assign(value);
+}
+inline void ClientPhishingRequest::set_obsolete_hash_prefix(const char* value) {
+  set_has_obsolete_hash_prefix();
+  if (obsolete_hash_prefix_ == &::google::protobuf::internal::kEmptyString) {
+    obsolete_hash_prefix_ = new ::std::string;
+  }
+  obsolete_hash_prefix_->assign(value);
+}
+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::kEmptyString) {
+    obsolete_hash_prefix_ = new ::std::string;
+  }
+  obsolete_hash_prefix_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientPhishingRequest::mutable_obsolete_hash_prefix() {
+  set_has_obsolete_hash_prefix();
+  if (obsolete_hash_prefix_ == &::google::protobuf::internal::kEmptyString) {
+    obsolete_hash_prefix_ = new ::std::string;
+  }
+  return obsolete_hash_prefix_;
+}
+inline ::std::string* ClientPhishingRequest::release_obsolete_hash_prefix() {
+  clear_has_obsolete_hash_prefix();
+  if (obsolete_hash_prefix_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = obsolete_hash_prefix_;
+    obsolete_hash_prefix_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return client_score_;
+}
+inline void ClientPhishingRequest::set_client_score(float value) {
+  set_has_client_score();
+  client_score_ = value;
+}
+
+// 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 {
+  return is_phishing_;
+}
+inline void ClientPhishingRequest::set_is_phishing(bool value) {
+  set_has_is_phishing();
+  is_phishing_ = value;
+}
+
+// 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 {
+  return feature_map_.Get(index);
+}
+inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::mutable_feature_map(int index) {
+  return feature_map_.Mutable(index);
+}
+inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::add_feature_map() {
+  return feature_map_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >&
+ClientPhishingRequest::feature_map() const {
+  return feature_map_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >*
+ClientPhishingRequest::mutable_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 {
+  return model_version_;
+}
+inline void ClientPhishingRequest::set_model_version(::google::protobuf::int32 value) {
+  set_has_model_version();
+  model_version_ = value;
+}
+
+// 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 {
+  return non_model_feature_map_.Get(index);
+}
+inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::mutable_non_model_feature_map(int index) {
+  return non_model_feature_map_.Mutable(index);
+}
+inline ::safe_browsing::ClientPhishingRequest_Feature* ClientPhishingRequest::add_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 {
+  return non_model_feature_map_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientPhishingRequest_Feature >*
+ClientPhishingRequest::mutable_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::kEmptyString) {
+    obsolete_referrer_url_->clear();
+  }
+  clear_has_obsolete_referrer_url();
+}
+inline const ::std::string& ClientPhishingRequest::obsolete_referrer_url() const {
+  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::kEmptyString) {
+    obsolete_referrer_url_ = new ::std::string;
+  }
+  obsolete_referrer_url_->assign(value);
+}
+inline void ClientPhishingRequest::set_obsolete_referrer_url(const char* value) {
+  set_has_obsolete_referrer_url();
+  if (obsolete_referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    obsolete_referrer_url_ = new ::std::string;
+  }
+  obsolete_referrer_url_->assign(value);
+}
+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::kEmptyString) {
+    obsolete_referrer_url_ = new ::std::string;
+  }
+  obsolete_referrer_url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientPhishingRequest::mutable_obsolete_referrer_url() {
+  set_has_obsolete_referrer_url();
+  if (obsolete_referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    obsolete_referrer_url_ = new ::std::string;
+  }
+  return obsolete_referrer_url_;
+}
+inline ::std::string* ClientPhishingRequest::release_obsolete_referrer_url() {
+  clear_has_obsolete_referrer_url();
+  if (obsolete_referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = obsolete_referrer_url_;
+    obsolete_referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return phishy_;
+}
+inline void ClientPhishingResponse::set_phishy(bool value) {
+  set_has_phishy();
+  phishy_ = value;
+}
+
+// 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 {
+  return obsolete_whitelist_expression_.Get(index);
+}
+inline ::std::string* ClientPhishingResponse::mutable_obsolete_whitelist_expression(int index) {
+  return obsolete_whitelist_expression_.Mutable(index);
+}
+inline void ClientPhishingResponse::set_obsolete_whitelist_expression(int index, const ::std::string& value) {
+  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);
+}
+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);
+}
+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);
+}
+inline void ClientPhishingResponse::add_obsolete_whitelist_expression(const char* value) {
+  obsolete_whitelist_expression_.Add()->assign(value);
+}
+inline void ClientPhishingResponse::add_obsolete_whitelist_expression(const char* value, size_t size) {
+  obsolete_whitelist_expression_.Add()->assign(reinterpret_cast<const char*>(value), size);
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+ClientPhishingResponse::obsolete_whitelist_expression() const {
+  return obsolete_whitelist_expression_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+ClientPhishingResponse::mutable_obsolete_whitelist_expression() {
+  return &obsolete_whitelist_expression_;
+}
+
+// -------------------------------------------------------------------
+
+// ClientMalwareRequest_Feature
+
+// required string name = 1;
+inline bool ClientMalwareRequest_Feature::has_name() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void ClientMalwareRequest_Feature::set_has_name() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void ClientMalwareRequest_Feature::clear_has_name() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void ClientMalwareRequest_Feature::clear_name() {
+  if (name_ != &::google::protobuf::internal::kEmptyString) {
+    name_->clear();
+  }
+  clear_has_name();
+}
+inline const ::std::string& ClientMalwareRequest_Feature::name() const {
+  return *name_;
+}
+inline void ClientMalwareRequest_Feature::set_name(const ::std::string& value) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(value);
+}
+inline void ClientMalwareRequest_Feature::set_name(const char* value) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(value);
+}
+inline void ClientMalwareRequest_Feature::set_name(const char* value, size_t size) {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  name_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientMalwareRequest_Feature::mutable_name() {
+  set_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    name_ = new ::std::string;
+  }
+  return name_;
+}
+inline ::std::string* ClientMalwareRequest_Feature::release_name() {
+  clear_has_name();
+  if (name_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = name_;
+    name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// required double value = 2;
+inline bool ClientMalwareRequest_Feature::has_value() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void ClientMalwareRequest_Feature::set_has_value() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void ClientMalwareRequest_Feature::clear_has_value() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void ClientMalwareRequest_Feature::clear_value() {
+  value_ = 0;
+  clear_has_value();
+}
+inline double ClientMalwareRequest_Feature::value() const {
+  return value_;
+}
+inline void ClientMalwareRequest_Feature::set_value(double value) {
+  set_has_value();
+  value_ = value;
+}
+
+// repeated string metainfo = 3;
+inline int ClientMalwareRequest_Feature::metainfo_size() const {
+  return metainfo_.size();
+}
+inline void ClientMalwareRequest_Feature::clear_metainfo() {
+  metainfo_.Clear();
+}
+inline const ::std::string& ClientMalwareRequest_Feature::metainfo(int index) const {
+  return metainfo_.Get(index);
+}
+inline ::std::string* ClientMalwareRequest_Feature::mutable_metainfo(int index) {
+  return metainfo_.Mutable(index);
+}
+inline void ClientMalwareRequest_Feature::set_metainfo(int index, const ::std::string& value) {
+  metainfo_.Mutable(index)->assign(value);
+}
+inline void ClientMalwareRequest_Feature::set_metainfo(int index, const char* value) {
+  metainfo_.Mutable(index)->assign(value);
+}
+inline void ClientMalwareRequest_Feature::set_metainfo(int index, const char* value, size_t size) {
+  metainfo_.Mutable(index)->assign(
+    reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientMalwareRequest_Feature::add_metainfo() {
+  return metainfo_.Add();
+}
+inline void ClientMalwareRequest_Feature::add_metainfo(const ::std::string& value) {
+  metainfo_.Add()->assign(value);
+}
+inline void ClientMalwareRequest_Feature::add_metainfo(const char* value) {
+  metainfo_.Add()->assign(value);
+}
+inline void ClientMalwareRequest_Feature::add_metainfo(const char* value, size_t size) {
+  metainfo_.Add()->assign(reinterpret_cast<const char*>(value), size);
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+ClientMalwareRequest_Feature::metainfo() const {
+  return metainfo_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+ClientMalwareRequest_Feature::mutable_metainfo() {
+  return &metainfo_;
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    url_->clear();
+  }
+  clear_has_url();
+}
+inline const ::std::string& ClientMalwareRequest::url() const {
+  return *url_;
+}
+inline void ClientMalwareRequest::set_url(const ::std::string& value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientMalwareRequest::set_url(const char* value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientMalwareRequest::set_url(const char* value, size_t size) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientMalwareRequest::mutable_url() {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  return url_;
+}
+inline ::std::string* ClientMalwareRequest::release_url() {
+  clear_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = url_;
+    url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// repeated .safe_browsing.ClientMalwareRequest.Feature feature_map = 2;
+inline int ClientMalwareRequest::feature_map_size() const {
+  return feature_map_.size();
+}
+inline void ClientMalwareRequest::clear_feature_map() {
+  feature_map_.Clear();
+}
+inline const ::safe_browsing::ClientMalwareRequest_Feature& ClientMalwareRequest::feature_map(int index) const {
+  return feature_map_.Get(index);
+}
+inline ::safe_browsing::ClientMalwareRequest_Feature* ClientMalwareRequest::mutable_feature_map(int index) {
+  return feature_map_.Mutable(index);
+}
+inline ::safe_browsing::ClientMalwareRequest_Feature* ClientMalwareRequest::add_feature_map() {
+  return feature_map_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_Feature >&
+ClientMalwareRequest::feature_map() const {
+  return feature_map_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientMalwareRequest_Feature >*
+ClientMalwareRequest::mutable_feature_map() {
+  return &feature_map_;
+}
+
+// optional string referrer_url = 4;
+inline bool ClientMalwareRequest::has_referrer_url() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void ClientMalwareRequest::set_has_referrer_url() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void ClientMalwareRequest::clear_has_referrer_url() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void ClientMalwareRequest::clear_referrer_url() {
+  if (referrer_url_ != &::google::protobuf::internal::kEmptyString) {
+    referrer_url_->clear();
+  }
+  clear_has_referrer_url();
+}
+inline const ::std::string& ClientMalwareRequest::referrer_url() const {
+  return *referrer_url_;
+}
+inline void ClientMalwareRequest::set_referrer_url(const ::std::string& value) {
+  set_has_referrer_url();
+  if (referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_url_ = new ::std::string;
+  }
+  referrer_url_->assign(value);
+}
+inline void ClientMalwareRequest::set_referrer_url(const char* value) {
+  set_has_referrer_url();
+  if (referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_url_ = new ::std::string;
+  }
+  referrer_url_->assign(value);
+}
+inline void ClientMalwareRequest::set_referrer_url(const char* value, size_t size) {
+  set_has_referrer_url();
+  if (referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_url_ = new ::std::string;
+  }
+  referrer_url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientMalwareRequest::mutable_referrer_url() {
+  set_has_referrer_url();
+  if (referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_url_ = new ::std::string;
+  }
+  return referrer_url_;
+}
+inline ::std::string* ClientMalwareRequest::release_referrer_url() {
+  clear_has_referrer_url();
+  if (referrer_url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = referrer_url_;
+    referrer_url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return blacklist_;
+}
+inline void ClientMalwareResponse::set_blacklist(bool value) {
+  set_has_blacklist();
+  blacklist_ = value;
+}
+
+// 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::kEmptyString) {
+    bad_ip_->clear();
+  }
+  clear_has_bad_ip();
+}
+inline const ::std::string& ClientMalwareResponse::bad_ip() const {
+  return *bad_ip_;
+}
+inline void ClientMalwareResponse::set_bad_ip(const ::std::string& value) {
+  set_has_bad_ip();
+  if (bad_ip_ == &::google::protobuf::internal::kEmptyString) {
+    bad_ip_ = new ::std::string;
+  }
+  bad_ip_->assign(value);
+}
+inline void ClientMalwareResponse::set_bad_ip(const char* value) {
+  set_has_bad_ip();
+  if (bad_ip_ == &::google::protobuf::internal::kEmptyString) {
+    bad_ip_ = new ::std::string;
+  }
+  bad_ip_->assign(value);
+}
+inline void ClientMalwareResponse::set_bad_ip(const char* value, size_t size) {
+  set_has_bad_ip();
+  if (bad_ip_ == &::google::protobuf::internal::kEmptyString) {
+    bad_ip_ = new ::std::string;
+  }
+  bad_ip_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientMalwareResponse::mutable_bad_ip() {
+  set_has_bad_ip();
+  if (bad_ip_ == &::google::protobuf::internal::kEmptyString) {
+    bad_ip_ = new ::std::string;
+  }
+  return bad_ip_;
+}
+inline ::std::string* ClientMalwareResponse::release_bad_ip() {
+  clear_has_bad_ip();
+  if (bad_ip_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = bad_ip_;
+    bad_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    sha256_->clear();
+  }
+  clear_has_sha256();
+}
+inline const ::std::string& ClientDownloadRequest_Digests::sha256() const {
+  return *sha256_;
+}
+inline void ClientDownloadRequest_Digests::set_sha256(const ::std::string& value) {
+  set_has_sha256();
+  if (sha256_ == &::google::protobuf::internal::kEmptyString) {
+    sha256_ = new ::std::string;
+  }
+  sha256_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_sha256(const char* value) {
+  set_has_sha256();
+  if (sha256_ == &::google::protobuf::internal::kEmptyString) {
+    sha256_ = new ::std::string;
+  }
+  sha256_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_sha256(const void* value, size_t size) {
+  set_has_sha256();
+  if (sha256_ == &::google::protobuf::internal::kEmptyString) {
+    sha256_ = new ::std::string;
+  }
+  sha256_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Digests::mutable_sha256() {
+  set_has_sha256();
+  if (sha256_ == &::google::protobuf::internal::kEmptyString) {
+    sha256_ = new ::std::string;
+  }
+  return sha256_;
+}
+inline ::std::string* ClientDownloadRequest_Digests::release_sha256() {
+  clear_has_sha256();
+  if (sha256_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = sha256_;
+    sha256_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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::kEmptyString) {
+    sha1_->clear();
+  }
+  clear_has_sha1();
+}
+inline const ::std::string& ClientDownloadRequest_Digests::sha1() const {
+  return *sha1_;
+}
+inline void ClientDownloadRequest_Digests::set_sha1(const ::std::string& value) {
+  set_has_sha1();
+  if (sha1_ == &::google::protobuf::internal::kEmptyString) {
+    sha1_ = new ::std::string;
+  }
+  sha1_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_sha1(const char* value) {
+  set_has_sha1();
+  if (sha1_ == &::google::protobuf::internal::kEmptyString) {
+    sha1_ = new ::std::string;
+  }
+  sha1_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_sha1(const void* value, size_t size) {
+  set_has_sha1();
+  if (sha1_ == &::google::protobuf::internal::kEmptyString) {
+    sha1_ = new ::std::string;
+  }
+  sha1_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Digests::mutable_sha1() {
+  set_has_sha1();
+  if (sha1_ == &::google::protobuf::internal::kEmptyString) {
+    sha1_ = new ::std::string;
+  }
+  return sha1_;
+}
+inline ::std::string* ClientDownloadRequest_Digests::release_sha1() {
+  clear_has_sha1();
+  if (sha1_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = sha1_;
+    sha1_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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::kEmptyString) {
+    md5_->clear();
+  }
+  clear_has_md5();
+}
+inline const ::std::string& ClientDownloadRequest_Digests::md5() const {
+  return *md5_;
+}
+inline void ClientDownloadRequest_Digests::set_md5(const ::std::string& value) {
+  set_has_md5();
+  if (md5_ == &::google::protobuf::internal::kEmptyString) {
+    md5_ = new ::std::string;
+  }
+  md5_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_md5(const char* value) {
+  set_has_md5();
+  if (md5_ == &::google::protobuf::internal::kEmptyString) {
+    md5_ = new ::std::string;
+  }
+  md5_->assign(value);
+}
+inline void ClientDownloadRequest_Digests::set_md5(const void* value, size_t size) {
+  set_has_md5();
+  if (md5_ == &::google::protobuf::internal::kEmptyString) {
+    md5_ = new ::std::string;
+  }
+  md5_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Digests::mutable_md5() {
+  set_has_md5();
+  if (md5_ == &::google::protobuf::internal::kEmptyString) {
+    md5_ = new ::std::string;
+  }
+  return md5_;
+}
+inline ::std::string* ClientDownloadRequest_Digests::release_md5() {
+  clear_has_md5();
+  if (md5_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = md5_;
+    md5_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    url_->clear();
+  }
+  clear_has_url();
+}
+inline const ::std::string& ClientDownloadRequest_Resource::url() const {
+  return *url_;
+}
+inline void ClientDownloadRequest_Resource::set_url(const ::std::string& value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_url(const char* value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_url(const char* value, size_t size) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Resource::mutable_url() {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  return url_;
+}
+inline ::std::string* ClientDownloadRequest_Resource::release_url() {
+  clear_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = url_;
+    url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return static_cast< ::safe_browsing::ClientDownloadRequest_ResourceType >(type_);
+}
+inline void ClientDownloadRequest_Resource::set_type(::safe_browsing::ClientDownloadRequest_ResourceType value) {
+  GOOGLE_DCHECK(::safe_browsing::ClientDownloadRequest_ResourceType_IsValid(value));
+  set_has_type();
+  type_ = value;
+}
+
+// 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::kEmptyString) {
+    remote_ip_->clear();
+  }
+  clear_has_remote_ip();
+}
+inline const ::std::string& ClientDownloadRequest_Resource::remote_ip() const {
+  return *remote_ip_;
+}
+inline void ClientDownloadRequest_Resource::set_remote_ip(const ::std::string& value) {
+  set_has_remote_ip();
+  if (remote_ip_ == &::google::protobuf::internal::kEmptyString) {
+    remote_ip_ = new ::std::string;
+  }
+  remote_ip_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_remote_ip(const char* value) {
+  set_has_remote_ip();
+  if (remote_ip_ == &::google::protobuf::internal::kEmptyString) {
+    remote_ip_ = new ::std::string;
+  }
+  remote_ip_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_remote_ip(const void* value, size_t size) {
+  set_has_remote_ip();
+  if (remote_ip_ == &::google::protobuf::internal::kEmptyString) {
+    remote_ip_ = new ::std::string;
+  }
+  remote_ip_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Resource::mutable_remote_ip() {
+  set_has_remote_ip();
+  if (remote_ip_ == &::google::protobuf::internal::kEmptyString) {
+    remote_ip_ = new ::std::string;
+  }
+  return remote_ip_;
+}
+inline ::std::string* ClientDownloadRequest_Resource::release_remote_ip() {
+  clear_has_remote_ip();
+  if (remote_ip_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = remote_ip_;
+    remote_ip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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::kEmptyString) {
+    referrer_->clear();
+  }
+  clear_has_referrer();
+}
+inline const ::std::string& ClientDownloadRequest_Resource::referrer() const {
+  return *referrer_;
+}
+inline void ClientDownloadRequest_Resource::set_referrer(const ::std::string& value) {
+  set_has_referrer();
+  if (referrer_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_ = new ::std::string;
+  }
+  referrer_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_referrer(const char* value) {
+  set_has_referrer();
+  if (referrer_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_ = new ::std::string;
+  }
+  referrer_->assign(value);
+}
+inline void ClientDownloadRequest_Resource::set_referrer(const char* value, size_t size) {
+  set_has_referrer();
+  if (referrer_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_ = new ::std::string;
+  }
+  referrer_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_Resource::mutable_referrer() {
+  set_has_referrer();
+  if (referrer_ == &::google::protobuf::internal::kEmptyString) {
+    referrer_ = new ::std::string;
+  }
+  return referrer_;
+}
+inline ::std::string* ClientDownloadRequest_Resource::release_referrer() {
+  clear_has_referrer();
+  if (referrer_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = referrer_;
+    referrer_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    certificate_->clear();
+  }
+  clear_has_certificate();
+}
+inline const ::std::string& ClientDownloadRequest_CertificateChain_Element::certificate() const {
+  return *certificate_;
+}
+inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const ::std::string& value) {
+  set_has_certificate();
+  if (certificate_ == &::google::protobuf::internal::kEmptyString) {
+    certificate_ = new ::std::string;
+  }
+  certificate_->assign(value);
+}
+inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const char* value) {
+  set_has_certificate();
+  if (certificate_ == &::google::protobuf::internal::kEmptyString) {
+    certificate_ = new ::std::string;
+  }
+  certificate_->assign(value);
+}
+inline void ClientDownloadRequest_CertificateChain_Element::set_certificate(const void* value, size_t size) {
+  set_has_certificate();
+  if (certificate_ == &::google::protobuf::internal::kEmptyString) {
+    certificate_ = new ::std::string;
+  }
+  certificate_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest_CertificateChain_Element::mutable_certificate() {
+  set_has_certificate();
+  if (certificate_ == &::google::protobuf::internal::kEmptyString) {
+    certificate_ = new ::std::string;
+  }
+  return certificate_;
+}
+inline ::std::string* ClientDownloadRequest_CertificateChain_Element::release_certificate() {
+  clear_has_certificate();
+  if (certificate_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = certificate_;
+    certificate_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return element_.Get(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain::mutable_element(int index) {
+  return element_.Mutable(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_CertificateChain_Element* ClientDownloadRequest_CertificateChain::add_element() {
+  return element_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >&
+ClientDownloadRequest_CertificateChain::element() const {
+  return element_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain_Element >*
+ClientDownloadRequest_CertificateChain::mutable_element() {
+  return &element_;
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return certificate_chain_.Get(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_CertificateChain* ClientDownloadRequest_SignatureInfo::mutable_certificate_chain(int index) {
+  return certificate_chain_.Mutable(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_CertificateChain* ClientDownloadRequest_SignatureInfo::add_certificate_chain() {
+  return certificate_chain_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >&
+ClientDownloadRequest_SignatureInfo::certificate_chain() const {
+  return certificate_chain_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_CertificateChain >*
+ClientDownloadRequest_SignatureInfo::mutable_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 {
+  return trusted_;
+}
+inline void ClientDownloadRequest_SignatureInfo::set_trusted(bool value) {
+  set_has_trusted();
+  trusted_ = value;
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    url_->clear();
+  }
+  clear_has_url();
+}
+inline const ::std::string& ClientDownloadRequest::url() const {
+  return *url_;
+}
+inline void ClientDownloadRequest::set_url(const ::std::string& value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadRequest::set_url(const char* value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadRequest::set_url(const char* value, size_t size) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest::mutable_url() {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  return url_;
+}
+inline ::std::string* ClientDownloadRequest::release_url() {
+  clear_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = url_;
+    url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return digests_ != NULL ? *digests_ : *default_instance_->digests_;
+}
+inline ::safe_browsing::ClientDownloadRequest_Digests* ClientDownloadRequest::mutable_digests() {
+  set_has_digests();
+  if (digests_ == NULL) digests_ = new ::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;
+}
+
+// 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 {
+  return length_;
+}
+inline void ClientDownloadRequest::set_length(::google::protobuf::int64 value) {
+  set_has_length();
+  length_ = value;
+}
+
+// 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 {
+  return resources_.Get(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_Resource* ClientDownloadRequest::mutable_resources(int index) {
+  return resources_.Mutable(index);
+}
+inline ::safe_browsing::ClientDownloadRequest_Resource* ClientDownloadRequest::add_resources() {
+  return resources_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >&
+ClientDownloadRequest::resources() const {
+  return resources_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::safe_browsing::ClientDownloadRequest_Resource >*
+ClientDownloadRequest::mutable_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 {
+  return signature_ != NULL ? *signature_ : *default_instance_->signature_;
+}
+inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest::mutable_signature() {
+  set_has_signature();
+  if (signature_ == NULL) signature_ = new ::safe_browsing::ClientDownloadRequest_SignatureInfo;
+  return signature_;
+}
+inline ::safe_browsing::ClientDownloadRequest_SignatureInfo* ClientDownloadRequest::release_signature() {
+  clear_has_signature();
+  ::safe_browsing::ClientDownloadRequest_SignatureInfo* temp = signature_;
+  signature_ = NULL;
+  return temp;
+}
+
+// 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 {
+  return user_initiated_;
+}
+inline void ClientDownloadRequest::set_user_initiated(bool value) {
+  set_has_user_initiated();
+  user_initiated_ = value;
+}
+
+// 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::kEmptyString) {
+    file_basename_->clear();
+  }
+  clear_has_file_basename();
+}
+inline const ::std::string& ClientDownloadRequest::file_basename() const {
+  return *file_basename_;
+}
+inline void ClientDownloadRequest::set_file_basename(const ::std::string& value) {
+  set_has_file_basename();
+  if (file_basename_ == &::google::protobuf::internal::kEmptyString) {
+    file_basename_ = new ::std::string;
+  }
+  file_basename_->assign(value);
+}
+inline void ClientDownloadRequest::set_file_basename(const char* value) {
+  set_has_file_basename();
+  if (file_basename_ == &::google::protobuf::internal::kEmptyString) {
+    file_basename_ = new ::std::string;
+  }
+  file_basename_->assign(value);
+}
+inline void ClientDownloadRequest::set_file_basename(const char* value, size_t size) {
+  set_has_file_basename();
+  if (file_basename_ == &::google::protobuf::internal::kEmptyString) {
+    file_basename_ = new ::std::string;
+  }
+  file_basename_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest::mutable_file_basename() {
+  set_has_file_basename();
+  if (file_basename_ == &::google::protobuf::internal::kEmptyString) {
+    file_basename_ = new ::std::string;
+  }
+  return file_basename_;
+}
+inline ::std::string* ClientDownloadRequest::release_file_basename() {
+  clear_has_file_basename();
+  if (file_basename_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = file_basename_;
+    file_basename_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return static_cast< ::safe_browsing::ClientDownloadRequest_DownloadType >(download_type_);
+}
+inline void ClientDownloadRequest::set_download_type(::safe_browsing::ClientDownloadRequest_DownloadType value) {
+  GOOGLE_DCHECK(::safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value));
+  set_has_download_type();
+  download_type_ = value;
+}
+
+// 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::kEmptyString) {
+    locale_->clear();
+  }
+  clear_has_locale();
+}
+inline const ::std::string& ClientDownloadRequest::locale() const {
+  return *locale_;
+}
+inline void ClientDownloadRequest::set_locale(const ::std::string& value) {
+  set_has_locale();
+  if (locale_ == &::google::protobuf::internal::kEmptyString) {
+    locale_ = new ::std::string;
+  }
+  locale_->assign(value);
+}
+inline void ClientDownloadRequest::set_locale(const char* value) {
+  set_has_locale();
+  if (locale_ == &::google::protobuf::internal::kEmptyString) {
+    locale_ = new ::std::string;
+  }
+  locale_->assign(value);
+}
+inline void ClientDownloadRequest::set_locale(const char* value, size_t size) {
+  set_has_locale();
+  if (locale_ == &::google::protobuf::internal::kEmptyString) {
+    locale_ = new ::std::string;
+  }
+  locale_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadRequest::mutable_locale() {
+  set_has_locale();
+  if (locale_ == &::google::protobuf::internal::kEmptyString) {
+    locale_ = new ::std::string;
+  }
+  return locale_;
+}
+inline ::std::string* ClientDownloadRequest::release_locale() {
+  clear_has_locale();
+  if (locale_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = locale_;
+    locale_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    description_->clear();
+  }
+  clear_has_description();
+}
+inline const ::std::string& ClientDownloadResponse_MoreInfo::description() const {
+  return *description_;
+}
+inline void ClientDownloadResponse_MoreInfo::set_description(const ::std::string& value) {
+  set_has_description();
+  if (description_ == &::google::protobuf::internal::kEmptyString) {
+    description_ = new ::std::string;
+  }
+  description_->assign(value);
+}
+inline void ClientDownloadResponse_MoreInfo::set_description(const char* value) {
+  set_has_description();
+  if (description_ == &::google::protobuf::internal::kEmptyString) {
+    description_ = new ::std::string;
+  }
+  description_->assign(value);
+}
+inline void ClientDownloadResponse_MoreInfo::set_description(const char* value, size_t size) {
+  set_has_description();
+  if (description_ == &::google::protobuf::internal::kEmptyString) {
+    description_ = new ::std::string;
+  }
+  description_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadResponse_MoreInfo::mutable_description() {
+  set_has_description();
+  if (description_ == &::google::protobuf::internal::kEmptyString) {
+    description_ = new ::std::string;
+  }
+  return description_;
+}
+inline ::std::string* ClientDownloadResponse_MoreInfo::release_description() {
+  clear_has_description();
+  if (description_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = description_;
+    description_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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::kEmptyString) {
+    url_->clear();
+  }
+  clear_has_url();
+}
+inline const ::std::string& ClientDownloadResponse_MoreInfo::url() const {
+  return *url_;
+}
+inline void ClientDownloadResponse_MoreInfo::set_url(const ::std::string& value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadResponse_MoreInfo::set_url(const char* value) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(value);
+}
+inline void ClientDownloadResponse_MoreInfo::set_url(const char* value, size_t size) {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  url_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadResponse_MoreInfo::mutable_url() {
+  set_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    url_ = new ::std::string;
+  }
+  return url_;
+}
+inline ::std::string* ClientDownloadResponse_MoreInfo::release_url() {
+  clear_has_url();
+  if (url_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = url_;
+    url_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// ClientDownloadResponse
+
+// required .safe_browsing.ClientDownloadResponse.Verdict verdict = 1;
+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 {
+  return static_cast< ::safe_browsing::ClientDownloadResponse_Verdict >(verdict_);
+}
+inline void ClientDownloadResponse::set_verdict(::safe_browsing::ClientDownloadResponse_Verdict value) {
+  GOOGLE_DCHECK(::safe_browsing::ClientDownloadResponse_Verdict_IsValid(value));
+  set_has_verdict();
+  verdict_ = value;
+}
+
+// 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 {
+  return more_info_ != NULL ? *more_info_ : *default_instance_->more_info_;
+}
+inline ::safe_browsing::ClientDownloadResponse_MoreInfo* ClientDownloadResponse::mutable_more_info() {
+  set_has_more_info();
+  if (more_info_ == NULL) more_info_ = new ::safe_browsing::ClientDownloadResponse_MoreInfo;
+  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;
+}
+
+// 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::kEmptyString) {
+    token_->clear();
+  }
+  clear_has_token();
+}
+inline const ::std::string& ClientDownloadResponse::token() const {
+  return *token_;
+}
+inline void ClientDownloadResponse::set_token(const ::std::string& value) {
+  set_has_token();
+  if (token_ == &::google::protobuf::internal::kEmptyString) {
+    token_ = new ::std::string;
+  }
+  token_->assign(value);
+}
+inline void ClientDownloadResponse::set_token(const char* value) {
+  set_has_token();
+  if (token_ == &::google::protobuf::internal::kEmptyString) {
+    token_ = new ::std::string;
+  }
+  token_->assign(value);
+}
+inline void ClientDownloadResponse::set_token(const void* value, size_t size) {
+  set_has_token();
+  if (token_ == &::google::protobuf::internal::kEmptyString) {
+    token_ = new ::std::string;
+  }
+  token_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadResponse::mutable_token() {
+  set_has_token();
+  if (token_ == &::google::protobuf::internal::kEmptyString) {
+    token_ = new ::std::string;
+  }
+  return token_;
+}
+inline ::std::string* ClientDownloadResponse::release_token() {
+  clear_has_token();
+  if (token_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = token_;
+    token_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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::kEmptyString) {
+    email_->clear();
+  }
+  clear_has_email();
+}
+inline const ::std::string& ClientDownloadReport_UserInformation::email() const {
+  return *email_;
+}
+inline void ClientDownloadReport_UserInformation::set_email(const ::std::string& value) {
+  set_has_email();
+  if (email_ == &::google::protobuf::internal::kEmptyString) {
+    email_ = new ::std::string;
+  }
+  email_->assign(value);
+}
+inline void ClientDownloadReport_UserInformation::set_email(const char* value) {
+  set_has_email();
+  if (email_ == &::google::protobuf::internal::kEmptyString) {
+    email_ = new ::std::string;
+  }
+  email_->assign(value);
+}
+inline void ClientDownloadReport_UserInformation::set_email(const char* value, size_t size) {
+  set_has_email();
+  if (email_ == &::google::protobuf::internal::kEmptyString) {
+    email_ = new ::std::string;
+  }
+  email_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadReport_UserInformation::mutable_email() {
+  set_has_email();
+  if (email_ == &::google::protobuf::internal::kEmptyString) {
+    email_ = new ::std::string;
+  }
+  return email_;
+}
+inline ::std::string* ClientDownloadReport_UserInformation::release_email() {
+  clear_has_email();
+  if (email_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = email_;
+    email_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return static_cast< ::safe_browsing::ClientDownloadReport_Reason >(reason_);
+}
+inline void ClientDownloadReport::set_reason(::safe_browsing::ClientDownloadReport_Reason value) {
+  GOOGLE_DCHECK(::safe_browsing::ClientDownloadReport_Reason_IsValid(value));
+  set_has_reason();
+  reason_ = value;
+}
+
+// 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 {
+  return download_request_ != NULL ? *download_request_ : *default_instance_->download_request_;
+}
+inline ::safe_browsing::ClientDownloadRequest* ClientDownloadReport::mutable_download_request() {
+  set_has_download_request();
+  if (download_request_ == NULL) download_request_ = new ::safe_browsing::ClientDownloadRequest;
+  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;
+}
+
+// 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 {
+  return user_information_ != NULL ? *user_information_ : *default_instance_->user_information_;
+}
+inline ::safe_browsing::ClientDownloadReport_UserInformation* ClientDownloadReport::mutable_user_information() {
+  set_has_user_information();
+  if (user_information_ == NULL) user_information_ = new ::safe_browsing::ClientDownloadReport_UserInformation;
+  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;
+}
+
+// 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::kEmptyString) {
+    comment_->clear();
+  }
+  clear_has_comment();
+}
+inline const ::std::string& ClientDownloadReport::comment() const {
+  return *comment_;
+}
+inline void ClientDownloadReport::set_comment(const ::std::string& value) {
+  set_has_comment();
+  if (comment_ == &::google::protobuf::internal::kEmptyString) {
+    comment_ = new ::std::string;
+  }
+  comment_->assign(value);
+}
+inline void ClientDownloadReport::set_comment(const char* value) {
+  set_has_comment();
+  if (comment_ == &::google::protobuf::internal::kEmptyString) {
+    comment_ = new ::std::string;
+  }
+  comment_->assign(value);
+}
+inline void ClientDownloadReport::set_comment(const void* value, size_t size) {
+  set_has_comment();
+  if (comment_ == &::google::protobuf::internal::kEmptyString) {
+    comment_ = new ::std::string;
+  }
+  comment_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientDownloadReport::mutable_comment() {
+  set_has_comment();
+  if (comment_ == &::google::protobuf::internal::kEmptyString) {
+    comment_ = new ::std::string;
+  }
+  return comment_;
+}
+inline ::std::string* ClientDownloadReport::release_comment() {
+  clear_has_comment();
+  if (comment_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = comment_;
+    comment_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// 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 {
+  return download_response_ != NULL ? *download_response_ : *default_instance_->download_response_;
+}
+inline ::safe_browsing::ClientDownloadResponse* ClientDownloadReport::mutable_download_response() {
+  set_has_download_response();
+  if (download_response_ == NULL) download_response_ = new ::safe_browsing::ClientDownloadResponse;
+  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;
+}
+
+// -------------------------------------------------------------------
+
+// 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 {
+  return static_cast< ::safe_browsing::ClientUploadResponse_UploadStatus >(status_);
+}
+inline void ClientUploadResponse::set_status(::safe_browsing::ClientUploadResponse_UploadStatus value) {
+  GOOGLE_DCHECK(::safe_browsing::ClientUploadResponse_UploadStatus_IsValid(value));
+  set_has_status();
+  status_ = value;
+}
+
+// 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::kEmptyString) {
+    permalink_->clear();
+  }
+  clear_has_permalink();
+}
+inline const ::std::string& ClientUploadResponse::permalink() const {
+  return *permalink_;
+}
+inline void ClientUploadResponse::set_permalink(const ::std::string& value) {
+  set_has_permalink();
+  if (permalink_ == &::google::protobuf::internal::kEmptyString) {
+    permalink_ = new ::std::string;
+  }
+  permalink_->assign(value);
+}
+inline void ClientUploadResponse::set_permalink(const char* value) {
+  set_has_permalink();
+  if (permalink_ == &::google::protobuf::internal::kEmptyString) {
+    permalink_ = new ::std::string;
+  }
+  permalink_->assign(value);
+}
+inline void ClientUploadResponse::set_permalink(const char* value, size_t size) {
+  set_has_permalink();
+  if (permalink_ == &::google::protobuf::internal::kEmptyString) {
+    permalink_ = new ::std::string;
+  }
+  permalink_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* ClientUploadResponse::mutable_permalink() {
+  set_has_permalink();
+  if (permalink_ == &::google::protobuf::internal::kEmptyString) {
+    permalink_ = new ::std::string;
+  }
+  return permalink_;
+}
+inline ::std::string* ClientUploadResponse::release_permalink() {
+  clear_has_permalink();
+  if (permalink_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = permalink_;
+    permalink_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace safe_browsing
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_csd_2eproto__INCLUDED
new file mode 100755
--- /dev/null
+++ b/toolkit/components/downloads/generate_csd.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# A script to generate toolkit/components/downloads/csd.pb.{cc,h} for use in
+# nsIApplicationReputationQuery. This script assumes you have downloaded and
+# installed the protocol buffer compiler.
+
+if [ -n $PROTOC_PATH ]; 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://code.google.com/p/protobuf/downloads/list"
+  exit 1
+fi
+
+# Get the protocol buffer and compile it
+CMD='wget http://src.chromium.org/chrome/trunk/src/chrome/common/safe_browsing/csd.proto -O csd.proto'
+OUTPUT_PATH=toolkit/components/downloads
+
+$CMD
+$PROTOC_PATH csd.proto --cpp_out=$OUTPUT_PATH
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -2,27 +2,30 @@
 # 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/.
 
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
+    'nsIApplicationReputation.idl',
     'nsIDownload.idl',
     'nsIDownloadManager.idl',
     'nsIDownloadManagerUI.idl',
     'nsIDownloadProgressListener.idl',
 ]
 
 MODULE = 'downloads'
 
 CPP_SOURCES += [
     'SQLFunctions.cpp',
     'nsDownloadManager.cpp',
+    'ApplicationReputation.cpp',
+    'csd.pb.cc'
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     CPP_SOURCES += [
         'nsDownloadScanner.cpp',
     ]
 
 # XXX - Until Suite builds off XULRunner we can't guarantee our implementation
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/nsIApplicationReputation.idl
@@ -0,0 +1,94 @@
+/* -*- 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 nsIURI;
+
+/*
+ * A service for asynchronously querying an application reputation service
+ * based on metadata of the downloaded file.
+ */
+[scriptable, uuid(9c12a510-eb1c-11e2-a98a-fa916188709b)]
+interface nsIApplicationReputationService : nsISupports {
+  /**
+   * 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(857da2c0-cfe5-11e2-8b8b-0800200c9a66)]
+interface nsIApplicationReputationQuery : nsISupports {
+  /*
+   * The nsIURI from which the file was downloaded. This may not be null.
+   */
+  attribute nsIURI sourceURI;
+
+  /*
+   * 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.
+   */
+  attribute AString suggestedFileName;
+
+  /*
+   * The size of the downloaded file in bytes.
+   */
+  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.
+   */
+  attribute ACString sha256Hash;
+
+  /**
+   * The callback object listening to this query.
+   */
+  attribute nsIApplicationReputationCallback callback;
+};
+
+[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.
+   */
+  void onComplete(in bool aShouldBlock,
+                  in nsresult aStatus);
+};
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/test/unit/tail_download_manager.js
@@ -0,0 +1,24 @@
+/* -*- 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/. */
+
+/**
+ * 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;
+});
+
new file mode 100644
--- /dev/null
+++ b/toolkit/components/downloads/test/unit/test_app_rep.js
@@ -0,0 +1,132 @@
+/* -*- 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/. */
+
+Cu.import('resource://gre/modules/NetUtil.jsm');
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+
+const ApplicationReputationQuery = Components.Constructor(
+      "@mozilla.org/downloads/application-reputation-query;1",
+      "nsIApplicationReputationQuery");
+
+const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"].
+                  getService(Ci.nsIApplicationReputationService);
+let gHttpServ = null;
+
+function run_test() {
+  // Set up a local HTTP server to return bad verdicts.
+  Services.prefs.setCharPref("browser.safebrowsing.appRepURL",
+                             "http://localhost:4444/download");
+  gHttpServ = new HttpServer();
+  gHttpServ.registerDirectory("/", do_get_cwd());
+
+  function createVerdict(aShouldBlock) {
+    // We can't programmatically create a protocol buffer here, so just
+    // hardcode some already serialized ones.
+    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;
+  }
+
+  gHttpServ.registerPathHandler("/download", function(request, response) {
+    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.
+    let blob = "this is not a serialized protocol buffer";
+    // We can't actually parse the protocol buffer here, so just switch on the
+    // length instead of inspecting the contents.
+    if (buf.length == 35) {
+      blob = createVerdict(true);
+    } else if (buf.length == 38) {
+      blob = createVerdict(false);
+    }
+    response.bodyOutputStream.write(blob, blob.length);
+  });
+
+  gHttpServ.start(4444);
+
+  run_next_test();
+}
+
+add_test(function test_shouldBlock() {
+  let query = new ApplicationReputationQuery();
+  query.sourceURI = createURI("http://evil.com");
+  query.fileSize = 12;
+
+  gAppRep.queryReputation(query, function onComplete(aShouldBlock, aStatus) {
+    do_check_true(aShouldBlock);
+    do_check_eq(Cr.NS_OK, aStatus);
+    run_next_test();
+  });
+});
+
+add_test(function test_shouldNotBlock() {
+  let query = new ApplicationReputationQuery();
+  query.sourceURI = createURI("http://mozilla.com");
+  query.fileSize = 12;
+
+  gAppRep.queryReputation(query, function onComplete(aShouldBlock, aStatus) {
+    do_check_eq(Cr.NS_OK, aStatus);
+    do_check_false(aShouldBlock);
+    run_next_test();
+  });
+});
+
+add_test(function test_garbage() {
+  let query = new ApplicationReputationQuery();
+  query.sourceURI = createURI("http://thisisagarbageurl.com");
+  query.fileSize = 12;
+
+  gAppRep.queryReputation(query, function onComplete(aShouldBlock, aStatus) {
+    // We should be getting the garbage response.
+    do_check_eq(Cr.NS_ERROR_CANNOT_CONVERT_DATA, aStatus);
+    do_check_false(aShouldBlock);
+    run_next_test();
+  });
+});
+
+add_test(function test_nullSourceURI() {
+  let query = new ApplicationReputationQuery();
+  query.fileSize = 12;
+  // No source URI
+  gAppRep.queryReputation(query, function onComplete(aShouldBlock, aStatus) {
+    do_check_eq(Cr.NS_ERROR_UNEXPECTED, aStatus);
+    do_check_false(aShouldBlock);
+    run_next_test();
+  });
+});
+
+add_test(function test_nullCallback() {
+  let query = new ApplicationReputationQuery();
+  query.fileSize = 12;
+  try {
+    gAppRep.queryReputation(query, null);
+    do_throw("Callback cannot be null");
+  } catch (ex if ex.result == Cr.NS_ERROR_INVALID_POINTER) {
+    run_next_test();
+  }
+});
+
+add_test(function test_disabled() {
+  Services.prefs.setCharPref("browser.safebrowsing.appRepURL", "");
+  let query = new ApplicationReputationQuery();
+  query.sourceURI = createURI("http://example.com");
+  query.fileSize = 12;
+  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);
+    run_next_test();
+  });
+});
--- a/toolkit/components/downloads/test/unit/xpcshell.ini
+++ b/toolkit/components/downloads/test/unit/xpcshell.ini
@@ -1,13 +1,14 @@
 [DEFAULT]
 head = head_download_manager.js
-tail =
+tail = tail_download_manager.js
 firefox-appdir = browser
 
+[test_app_rep.js]
 [test_bug_382825.js]
 [test_bug_384744.js]
 [test_bug_395092.js]
 [test_bug_401430.js]
 [test_bug_401582.js]
 [test_bug_406857.js]
 [test_bug_409179.js]
 [test_bug_420230.js]
--- a/toolkit/components/protobuf/Makefile.in
+++ b/toolkit/components/protobuf/Makefile.in
@@ -21,9 +21,9 @@ LIBRARY_NAME = protobuf_s
 FORCE_STATIC_LIB = 1
 
 LOCAL_INCLUDES = \
   -I$(srcdir) \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-CXXFLAGS += $(TK_CFLAGS)
+CXXFLAGS += $(TK_CFLAGS) -DGOOGLE_PROTOBUF_NO_RTTI