зеркало из https://github.com/mozilla/gecko-dev.git
Bug 35816. Minimize size of serialized RDF/XML and improve its quality. Break parser and serializer into XPConnect-addressable components. r=hyatt, sr=shaver
This commit is contained in:
Родитель
b1fd88de8e
Коммит
01b9da0e26
|
@ -38,6 +38,7 @@
|
|||
#include "nsIRDFDataSource.h"
|
||||
#include "nsIRDFObserver.h"
|
||||
#include "nsIRDFRemoteDataSource.h"
|
||||
#include "nsIRDFXMLSink.h"
|
||||
#include "nsCRT.h"
|
||||
#include "rdf.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -979,6 +980,13 @@ NS_IMETHODIMP nsChromeRegistry::LoadDataSource(const nsCString &aFileName,
|
|||
(void**) aResult);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Seed the datasource with the ``chrome'' namespace
|
||||
nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(*aResult);
|
||||
if (sink) {
|
||||
nsCOMPtr<nsIAtom> prefix = getter_AddRefs(NS_NewAtom("c"));
|
||||
sink->AddNameSpace(prefix, NS_ConvertASCIItoUCS2(CHROME_URI));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(*aResult);
|
||||
if (! remote)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
|
|
@ -9,5 +9,7 @@ nsIRDFPurgeableDataSource.idl
|
|||
nsIRDFRemoteDataSource.idl
|
||||
nsIRDFResource.idl
|
||||
nsIRDFService.idl
|
||||
nsIRDFXMLParser.idl
|
||||
nsIRDFXMLSerializer.idl
|
||||
nsIRDFXMLSink.idl
|
||||
nsIRDFXMLSource.idl
|
||||
|
|
|
@ -41,6 +41,8 @@ XPIDLSRCS = \
|
|||
nsIRDFRemoteDataSource.idl \
|
||||
nsIRDFResource.idl \
|
||||
nsIRDFService.idl \
|
||||
nsIRDFXMLParser.idl \
|
||||
nsIRDFXMLSerializer.idl \
|
||||
nsIRDFXMLSink.idl \
|
||||
nsIRDFXMLSource.idl \
|
||||
$(NULL)
|
||||
|
|
|
@ -34,6 +34,8 @@ XPIDLSRCS= .\nsIRDFNode.idl \
|
|||
.\nsIRDFDelegateFactory.idl \
|
||||
.\nsIRDFPurgeableDataSource.idl \
|
||||
.\nsIRDFRemoteDataSource.idl \
|
||||
.\nsIRDFXMLParser.idl \
|
||||
.\nsIRDFXMLSerializer.idl \
|
||||
.\nsIRDFXMLSink.idl \
|
||||
.\nsIRDFXMLSource.idl \
|
||||
$(NULL)
|
||||
|
|
|
@ -21,16 +21,17 @@
|
|||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
// XXX Until this gets scriptable
|
||||
[ptr] native nsIOutputStreamPtr(nsIOutputStream);
|
||||
%{C++
|
||||
class nsIOutputStream;
|
||||
%}
|
||||
#include "nsIOutputStream.idl"
|
||||
|
||||
[uuid(4DA56F10-99FE-11d2-8EBB-00805F29F370)]
|
||||
interface nsIRDFXMLSource : nsISupports
|
||||
{
|
||||
void Serialize(in nsIOutputStreamPtr aStream);
|
||||
/**
|
||||
* Serialize the contents of the datasource to aStream.
|
||||
* @param aStream the output stream the will recieve the
|
||||
* RDF/XML. Currently, the output stream need only
|
||||
* implement the |write()| method.
|
||||
*/
|
||||
void Serialize(in nsIOutputStream aStream);
|
||||
};
|
||||
|
||||
|
|
|
@ -35,12 +35,15 @@ CPPSRCS = \
|
|||
nsContainerEnumerator.cpp \
|
||||
nsDefaultResourceFactory.cpp \
|
||||
nsInMemoryDataSource.cpp \
|
||||
nsNameSpaceMap.cpp \
|
||||
nsRDFContentSink.cpp \
|
||||
nsRDFContainer.cpp \
|
||||
nsRDFContainerUtils.cpp \
|
||||
nsRDFParserUtils.cpp \
|
||||
nsRDFService.cpp \
|
||||
nsRDFXMLDataSource.cpp \
|
||||
nsRDFXMLParser.cpp \
|
||||
nsRDFXMLSerializer.cpp \
|
||||
rdfutil.cpp \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -31,12 +31,15 @@ CPP_OBJS=\
|
|||
.\$(OBJDIR)\nsContainerEnumerator.obj \
|
||||
.\$(OBJDIR)\nsDefaultResourceFactory.obj \
|
||||
.\$(OBJDIR)\nsInMemoryDataSource.obj \
|
||||
.\$(OBJDIR)\nsNameSpaceMap.obj \
|
||||
.\$(OBJDIR)\nsRDFContentSink.obj \
|
||||
.\$(OBJDIR)\nsRDFContainer.obj \
|
||||
.\$(OBJDIR)\nsRDFContainerUtils.obj \
|
||||
.\$(OBJDIR)\nsRDFParserUtils.obj \
|
||||
.\$(OBJDIR)\nsRDFService.obj \
|
||||
.\$(OBJDIR)\nsRDFXMLDataSource.obj \
|
||||
.\$(OBJDIR)\nsRDFXMLParser.obj \
|
||||
.\$(OBJDIR)\nsRDFXMLSerializer.obj \
|
||||
.\$(OBJDIR)\rdfutil.obj \
|
||||
$(NULL)
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -82,5 +82,12 @@
|
|||
#define NS_RDFCONTAINER_CID \
|
||||
{ 0xd4214e93, 0xfb94, 0x11d2, { 0xbd, 0xd8, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
|
||||
|
||||
// {0032d852-1dd2-11b2-95f7-e0a1910ed2da}
|
||||
#define NS_RDFXMLSERIALIZER_CID \
|
||||
{ 0x0032d852, 0x1dd2, 0x11b2, { 0x95, 0xf7, 0xe0, 0xa1, 0x91, 0x0e, 0xd2, 0xda } }
|
||||
|
||||
// {a4048e94-1dd1-11b2-a676-8a06c086cc7d}
|
||||
#define NS_RDFXMLPARSER_CID \
|
||||
{ 0xa4048e94, 0x1dd1, 0x11b2, { 0xa6, 0x76, 0x8a, 0x06, 0xc0, 0x86, 0xcc, 0x7d } }
|
||||
|
||||
#endif // nsRDFCID_h__
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include "rdf.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsILocalStore.h"
|
||||
#include "nsRDFXMLParser.h"
|
||||
#include "nsRDFXMLSerializer.h"
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
@ -146,6 +148,18 @@ static nsModuleComponentInfo components[] =
|
|||
CreateNewRDFService
|
||||
},
|
||||
|
||||
{ "RDF/XML Parser",
|
||||
NS_RDFXMLPARSER_CID,
|
||||
NS_RDF_CONTRACTID "/xml-parser;1",
|
||||
nsRDFXMLParser::Create
|
||||
},
|
||||
|
||||
{ "RDF/XML Serializer",
|
||||
NS_RDFXMLSERIALIZER_CID,
|
||||
NS_RDF_CONTRACTID "/xml-serializer;1",
|
||||
nsRDFXMLSerializer::Create
|
||||
},
|
||||
|
||||
// XXX move this to XPFE at some point.
|
||||
{ "Local Store", NS_LOCALSTORE_CID,
|
||||
NS_LOCALSTORE_CONTRACTID, NS_NewLocalStore },
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nsIRDFDataSource.h"
|
||||
#include "nsIRDFObserver.h"
|
||||
#include "nsIRDFRemoteDataSource.h"
|
||||
#include "nsIRDFXMLSink.h"
|
||||
#include "nsCRT.h"
|
||||
#include "rdf.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -979,6 +980,13 @@ NS_IMETHODIMP nsChromeRegistry::LoadDataSource(const nsCString &aFileName,
|
|||
(void**) aResult);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Seed the datasource with the ``chrome'' namespace
|
||||
nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(*aResult);
|
||||
if (sink) {
|
||||
nsCOMPtr<nsIAtom> prefix = getter_AddRefs(NS_NewAtom("c"));
|
||||
sink->AddNameSpace(prefix, NS_ConvertASCIItoUCS2(CHROME_URI));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIRDFRemoteDataSource> remote = do_QueryInterface(*aResult);
|
||||
if (! remote)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
|
Двоичные данные
rdf/macbuild/RDFIDL.mcp
Двоичные данные
rdf/macbuild/RDFIDL.mcp
Двоичный файл не отображается.
Двоичные данные
rdf/macbuild/rdf.mcp
Двоичные данные
rdf/macbuild/rdf.mcp
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче