nsIStorageActivityService.idl (1846B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 "domstubs.idl" 7 8 interface nsIArray; 9 interface nsIPrincipal; 10 11 /** 12 * nsIStorageActivityService is a service that can be used to know which 13 * origins have been active in a time range. This information can be used to 14 * implement "Clear Recent History" or similar features. 15 * 16 * If you are implementing a new Storage component, you should use 17 * QuotaManager. But if you don't do it, remember to call 18 * StorageActivityService methods in order to inform this service about 19 * 'writing' operations executed by origins. 20 */ 21 [scriptable, builtinclass, uuid(fd1310ba-d1be-4327-988e-92b39fcff6f4)] 22 interface nsIStorageActivityService : nsISupports 23 { 24 // This returns an array of nsIPrincipals, active between |from| and |to| 25 // timestamps. Note activities older than 1 day are forgotten. 26 // Activity details are not persisted, so this only covers activity since 27 // Firefox was started. All content principals are logged, which includes 28 // non-system principals like "moz-extension://ID", "moz-safe-about:home", 29 // "about:newtab", so principals may need to be filtered before being used. 30 nsIArray getActiveOrigins(in PRTime from, in PRTime to); 31 32 // NOTE: This method is meant to be used for testing only. 33 // The activity of |origin| is moved to the specified timestamp |when|. 34 void moveOriginInTime(in nsIPrincipal origin, in PRTime when); 35 36 // TEST-ONLY method to support clearing all previously known activity. 37 void testOnlyReset(); 38 }; 39 40 %{ C++ 41 #define STORAGE_ACTIVITY_SERVICE_CONTRACTID "@mozilla.org/storage/activity-service;1" 42 %}