forked from mirrors/gecko-dev
This patch implements UrlClassifierRemoteSettingsService to get SafeBrowsing data (protocol v2) from RemoteSettings instead of from the Shavar server. This is only used by data provided by Mozilla. To distinguish if the data should be coming from RemoteSettings or Shavar, We added a custom scheme "moz-sbrs" to denote that the data should be retrieved from Remote Setting. This is done by changing the value of pref "browser.safebrowsing.provider.mozilla.updateURL" to something like "moz-sbrf://tracking-protection-list". (Note that the hostname is not used at this point). The goal of this patch is to make the new architecture compatible with the original Safe Browsing design. So we don't notify Safe Browsing there is new data available (via "sync" event of RemoteSettings). We still follow how Safe Browsing periodically checks whether there is a newer version of list. Note. This patch changes the flow comparing with how we usualy receive SafeBrowsing response from Shavar. In Shavar case, the list data response usually comes with "n:21600\ni:listname1\nu:redirectURL1\ni:listname2\nu:redirectURL2 ..." first. And then we fetch the data again from the redirectURL for each list. But in the current implementation, responses don't contain redirectURL anymore (since we already have the data). So the mocked response will contain all the data needed in one response. For example: "n:21600\ni:listname1\n:chunkdata1\ni:listname2\n:chunkdata2...". Differential Revision: https://phabricator.services.mozilla.com/D135989
32 lines
984 B
Text
32 lines
984 B
Text
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
interface nsIStreamListener;
|
|
|
|
/**
|
|
* A service that serves Safe Browsing list data (V2 protocol) via
|
|
* Remote Settings.
|
|
*/
|
|
[scriptable, uuid(26a445a4-0d00-4b20-ba5f-1297d3344a25)]
|
|
interface nsIUrlClassifierRemoteSettingsService : nsISupports
|
|
{
|
|
/**
|
|
* Fetch the Safe Browsing list data from the service. The service
|
|
* returns the response data by simulating how the data is sent over a
|
|
* stream listener when a HTTP request is made.
|
|
*
|
|
*
|
|
* @param aPayload the request payload for list data request
|
|
* @param aListener An nsIStreamListener object
|
|
*/
|
|
void fetchList(in ACString aPayload, in nsIStreamListener aListener);
|
|
|
|
/**
|
|
* Clear all data in the service.
|
|
* This API is for testing only.
|
|
*/
|
|
void clear();
|
|
};
|