toolkit/components/downloads/ApplicationReputation.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/downloads/ApplicationReputation.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef ApplicationReputation_h__
    1.11 +#define ApplicationReputation_h__
    1.12 +
    1.13 +#include "nsIApplicationReputation.h"
    1.14 +#include "nsIRequestObserver.h"
    1.15 +#include "nsIStreamListener.h"
    1.16 +#include "nsISupports.h"
    1.17 +
    1.18 +#include "nsCOMPtr.h"
    1.19 +#include "nsString.h"
    1.20 +
    1.21 +class nsIRequest;
    1.22 +class PendingDBLookup;
    1.23 +class PendingLookup;
    1.24 +class PRLogModuleInfo;
    1.25 +
    1.26 +class ApplicationReputationService MOZ_FINAL :
    1.27 +  public nsIApplicationReputationService {
    1.28 +public:
    1.29 +  NS_DECL_ISUPPORTS
    1.30 +  NS_DECL_NSIAPPLICATIONREPUTATIONSERVICE
    1.31 +
    1.32 +public:
    1.33 +  static ApplicationReputationService* GetSingleton();
    1.34 +
    1.35 +private:
    1.36 +  friend class PendingLookup;
    1.37 +  friend class PendingDBLookup;
    1.38 +  /**
    1.39 +   * Global singleton object for holding this factory service.
    1.40 +   */
    1.41 +  static ApplicationReputationService* gApplicationReputationService;
    1.42 +  /**
    1.43 +   * NSPR_LOG_MODULES=ApplicationReputation:5
    1.44 +   */
    1.45 +  static PRLogModuleInfo* prlog;
    1.46 +  /**
    1.47 +   * This is a singleton, so disallow construction.
    1.48 +   */
    1.49 +  ApplicationReputationService();
    1.50 +  ~ApplicationReputationService();
    1.51 +  /**
    1.52 +   * Wrapper function for QueryReputation that makes it easier to ensure the
    1.53 +   * callback is called.
    1.54 +   */
    1.55 +  nsresult QueryReputationInternal(nsIApplicationReputationQuery* aQuery,
    1.56 +                                   nsIApplicationReputationCallback* aCallback);
    1.57 +};
    1.58 +#endif /* ApplicationReputation_h__ */

mercurial