Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | #include "nsIUrlClassifierDBService.idl" |
michael@0 | 8 | |
michael@0 | 9 | /** |
michael@0 | 10 | * This is a class to manage large table updates from the server. Rather than |
michael@0 | 11 | * downloading the whole update and then updating the sqlite database, we |
michael@0 | 12 | * update tables as the data is streaming in. |
michael@0 | 13 | */ |
michael@0 | 14 | [scriptable, uuid(79e6b710-ce68-4639-ac6b-7d293af424a1)] |
michael@0 | 15 | interface nsIUrlClassifierStreamUpdater : nsISupports |
michael@0 | 16 | { |
michael@0 | 17 | /** |
michael@0 | 18 | * The Url to download from. Should be plain ascii text. |
michael@0 | 19 | */ |
michael@0 | 20 | attribute ACString updateUrl; |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * Try to download updates from updateUrl. Only one instance of this |
michael@0 | 24 | * runs at a time, so we return false if another instance is already |
michael@0 | 25 | * running. |
michael@0 | 26 | * This is used in nsIUrlListManager as well as in testing. |
michael@0 | 27 | * @param aRequestTables Comma-separated list of tables included in this |
michael@0 | 28 | * update. |
michael@0 | 29 | * @param aRequestBody The body for the request. |
michael@0 | 30 | * @param aSuccessCallback Called after a successful update. |
michael@0 | 31 | * @param aUpdateErrorCallback Called for problems applying the update |
michael@0 | 32 | * @param aDownloadErrorCallback Called if we get an http error or a |
michael@0 | 33 | * connection refused error. |
michael@0 | 34 | */ |
michael@0 | 35 | boolean downloadUpdates(in ACString aRequestTables, |
michael@0 | 36 | in ACString aRequestBody, |
michael@0 | 37 | in nsIUrlClassifierCallback aSuccessCallback, |
michael@0 | 38 | in nsIUrlClassifierCallback aUpdateErrorCallback, |
michael@0 | 39 | in nsIUrlClassifierCallback aDownloadErrorCallback); |
michael@0 | 40 | }; |