michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIUrlClassifierDBService.idl" michael@0: michael@0: /** michael@0: * This is a class to manage large table updates from the server. Rather than michael@0: * downloading the whole update and then updating the sqlite database, we michael@0: * update tables as the data is streaming in. michael@0: */ michael@0: [scriptable, uuid(79e6b710-ce68-4639-ac6b-7d293af424a1)] michael@0: interface nsIUrlClassifierStreamUpdater : nsISupports michael@0: { michael@0: /** michael@0: * The Url to download from. Should be plain ascii text. michael@0: */ michael@0: attribute ACString updateUrl; michael@0: michael@0: /** michael@0: * Try to download updates from updateUrl. Only one instance of this michael@0: * runs at a time, so we return false if another instance is already michael@0: * running. michael@0: * This is used in nsIUrlListManager as well as in testing. michael@0: * @param aRequestTables Comma-separated list of tables included in this michael@0: * update. michael@0: * @param aRequestBody The body for the request. michael@0: * @param aSuccessCallback Called after a successful update. michael@0: * @param aUpdateErrorCallback Called for problems applying the update michael@0: * @param aDownloadErrorCallback Called if we get an http error or a michael@0: * connection refused error. michael@0: */ michael@0: boolean downloadUpdates(in ACString aRequestTables, michael@0: in ACString aRequestBody, michael@0: in nsIUrlClassifierCallback aSuccessCallback, michael@0: in nsIUrlClassifierCallback aUpdateErrorCallback, michael@0: in nsIUrlClassifierCallback aDownloadErrorCallback); michael@0: };