1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/startupcache/nsIStartupCache.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsIInputStream.idl" 1.11 +#include "nsISupports.idl" 1.12 +#include "nsIObserver.idl" 1.13 +#include "nsIObjectOutputStream.idl" 1.14 + 1.15 +[uuid(25957820-90a1-428c-8739-b0845d3cc534)] 1.16 +interface nsIStartupCache : nsISupports 1.17 +{ 1.18 + 1.19 + /** This interface is provided for testing purposes only, basically 1.20 + * just to solve link vagaries. See docs in StartupCache.h 1.21 + * GetBuffer, PutBuffer, and InvalidateCache act as described 1.22 + * in that file. */ 1.23 + 1.24 + uint32_t getBuffer(in string aID, out charPtr aBuffer); 1.25 + void putBuffer(in string aID, in string aBuffer, 1.26 + in uint32_t aLength); 1.27 + 1.28 + void invalidateCache(); 1.29 + 1.30 + void ignoreDiskCache(); 1.31 + 1.32 + /** In debug builds, wraps this object output stream with a stream that will 1.33 + * detect and prevent the write of a multiply-referenced non-singleton object 1.34 + * during serialization. In non-debug, returns an add-ref'd pointer to 1.35 + * original stream, unwrapped. */ 1.36 + nsIObjectOutputStream getDebugObjectOutputStream(in nsIObjectOutputStream aStream); 1.37 + 1.38 + /* Allows clients to check whether the one-time writeout after startup 1.39 + * has finished yet, and also to set this variable as needed (so test 1.40 + * code can fire mulitple startup writes if needed). 1.41 + */ 1.42 + boolean startupWriteComplete(); 1.43 + void resetStartupWriteTimer(); 1.44 + 1.45 + /* Instruct clients to always post cache ages to Telemetry, even in 1.46 + cases where it would not normally make sense. */ 1.47 + void recordAgesAlways(); 1.48 + 1.49 + /* Allows clients to simulate the behavior of ObserverService. */ 1.50 + readonly attribute nsIObserver observer; 1.51 +}; 1.52 +