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