toolkit/components/url-classifier/nsIUrlClassifierStreamUpdater.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/url-classifier/nsIUrlClassifierStreamUpdater.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +#include "nsIUrlClassifierDBService.idl"
    1.11 +
    1.12 +/**
    1.13 + * This is a class to manage large table updates from the server.  Rather than
    1.14 + * downloading the whole update and then updating the sqlite database, we
    1.15 + * update tables as the data is streaming in.
    1.16 + */
    1.17 +[scriptable, uuid(79e6b710-ce68-4639-ac6b-7d293af424a1)]
    1.18 +interface nsIUrlClassifierStreamUpdater : nsISupports
    1.19 +{
    1.20 +  /**
    1.21 +   * The Url to download from.  Should be plain ascii text.
    1.22 +   */
    1.23 +  attribute ACString updateUrl;
    1.24 +
    1.25 +  /**
    1.26 +   * Try to download updates from updateUrl.  Only one instance of this
    1.27 +   * runs at a time, so we return false if another instance is already
    1.28 +   * running.
    1.29 +   * This is used in nsIUrlListManager as well as in testing.
    1.30 +   * @param aRequestTables Comma-separated list of tables included in this
    1.31 +   *        update.
    1.32 +   * @param aRequestBody The body for the request.
    1.33 +   * @param aSuccessCallback Called after a successful update.
    1.34 +   * @param aUpdateErrorCallback Called for problems applying the update
    1.35 +   * @param aDownloadErrorCallback Called if we get an http error or a
    1.36 +   *        connection refused error.
    1.37 +   */
    1.38 +  boolean downloadUpdates(in ACString aRequestTables,
    1.39 +                          in ACString aRequestBody,
    1.40 +                          in nsIUrlClassifierCallback aSuccessCallback,
    1.41 +                          in nsIUrlClassifierCallback aUpdateErrorCallback,
    1.42 +                          in nsIUrlClassifierCallback aDownloadErrorCallback);
    1.43 +};

mercurial