1999-11-08 00:55:12 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsJARURI_h__
|
|
|
|
#define nsJARURI_h__
|
|
|
|
|
|
|
|
#include "nsIJARURI.h"
|
2001-07-31 23:05:34 +04:00
|
|
|
#include "nsISerializable.h"
|
1999-11-08 00:55:12 +03:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
Bit checkin for bug 68045, r/sr=waterson&shaver, second attempt. It all works
for me on optimized and debug gcc2.96, rh7.1.
- Better failure codes from nsXULPrototypeScript::Deserialize.
- Call nsXULDocument::AbortFastLoads after nsXULPrototypeScript::Serialize
failure, instead of just nulling the FastLoad service's output stream.
- Expose nsXULDocument::AbortFastLoads via nsIXULPrototypeCache, for use from
nsChromeProtocolHandler.cpp. AbortFastLoads flushes the XUL cache now, for
good measure.
- The needless "Current" adjective in nsIFastLoadService attribute and method
names is no more.
- Add a do_GetFastLoadService() helper, to use CID instead of contractid, and
to let the compiler consolidate the static inline CID.
- Add "nglayout.debug.checksum_xul_fastload_file" pref so people can do without
the checksum verification step when reading a FastLoad file.
- Verify the FastLoad file checksum, by default. Also, cache it in the FastLoad
service so we don't recompute it when re-opening the FastLoad file as mailnews
and other top-levels start up. Fill the checksum cache in EndFastLoad, when
the last pseudo-concurrent top-level finishes loading.
My hope to compute the checksum while writing the FastLoad file ran afoul of
misordered writes. The old code to checksum the in-memory nsFastLoadHeader
also was broken on little endian platforms. Now all checksumming is done via
a separate read pass over the complete file, save for the header's checksum
field, which is summed as if it contained zero.
- Track and check FastLoad file dependencies. This required groveling with a
bunch of Necko interfaces in nsChromeProtocolHandler::NewChannel -- read it
and weep. Dependency checking, as well as checksum access and computation,
use better-factored nsIFastLoad{File,Read,Write}Control interfaces.
- nsBufferedStream::Seek wasn't flushing the buffer when seeking backward
within the buffer, but it must, because mCursor bounds the amount to write
if the buffer contains the end of file.
- Add an unbufferedStream readonly attribute to nsIStreamBufferAccess, so we
don't have to screw around with the bufferying layer when checksumming. Also
implement nsIStreamBufferAccess in nsBufferedOutputStream.
- nsISeekableOutputStream was bogus, based on a bad state I had put the
nsBufferedOutputStream code in on its way from being completely broken when
you seek backwards outside of the buffer. Removing this interface required
using nsIFastLoadFileIO in nsFastLoadFileWriter, and it also required careful
ordering of Close calls (the Reader must close after the Writer or Updater,
so that the Reader's underlying, unbuffered input stream can be read by
nsFastLoadFileWriter::Close to compute the checksum.
- Miscellaneous tab/indentation, comment typo, bracing, if( => if ( style,
nsnull vs. 0, useless variable elimination, tortured control flow,
AutoString instead of String, and gratuitous ; after nsISupportsUtils.h
macro call cleanups.
2001-08-22 00:51:34 +04:00
|
|
|
#define NS_JARURI_CID \
|
1999-11-08 00:55:12 +03:00
|
|
|
{ /* 0xc7e410d7-0x85f2-11d3-9f63-006008a6efe9 */ \
|
|
|
|
0xc7e410d7, \
|
|
|
|
0x85f2, \
|
|
|
|
0x11d3, \
|
|
|
|
{0x9f, 0x63, 0x00, 0x60, 0x08, 0xa6, 0xef, 0xe9} \
|
|
|
|
}
|
|
|
|
|
2001-07-31 23:05:34 +04:00
|
|
|
class nsJARURI : public nsIJARURI, nsISerializable
|
1999-11-08 00:55:12 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIURI
|
|
|
|
NS_DECL_NSIJARURI
|
2001-07-31 23:05:34 +04:00
|
|
|
NS_DECL_NSISERIALIZABLE
|
1999-11-08 00:55:12 +03:00
|
|
|
|
|
|
|
// nsJARURI
|
|
|
|
nsJARURI();
|
|
|
|
virtual ~nsJARURI();
|
|
|
|
|
|
|
|
static NS_METHOD
|
|
|
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
|
|
|
|
|
|
|
nsresult Init();
|
2000-01-27 11:57:14 +03:00
|
|
|
nsresult FormatSpec(const char* entryPath, char* *result);
|
1999-11-08 00:55:12 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIURI> mJARFile;
|
|
|
|
char *mJAREntry;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsJARURI_h__
|