author | Ryan VanderMeulen <ryanvm@gmail.com> |
Tue, 03 Dec 2013 18:47:39 -0500 | |
changeset 158685 | a683f61403a18a000e4184abba6ff520fe3c81e8 |
parent 158684 | a7c22bdbf800459aa6d0f9f0a0ee07a1636bb043 |
child 158686 | 72698dcafb4bcd744bc31e47e6d6e90e7afda1ff |
push id | 37053 |
push user | ryanvm@gmail.com |
push date | Tue, 03 Dec 2013 23:47:38 +0000 |
treeherder | mozilla-inbound@a683f61403a1 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 944961 |
milestone | 28.0a1 |
backs out | 58dbd2146e24df18ee5d1e9057b531093571de51 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/rdf/base/src/moz.build +++ b/rdf/base/src/moz.build @@ -1,15 +1,15 @@ # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # 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/. -UNIFIED_SOURCES += [ +SOURCES += [ 'nsCompositeDataSource.cpp', 'nsContainerEnumerator.cpp', 'nsDefaultResourceFactory.cpp', 'nsInMemoryDataSource.cpp', 'nsNameSpaceMap.cpp', 'nsRDFContainer.cpp', 'nsRDFContainerUtils.cpp', 'nsRDFContentSink.cpp',
--- a/rdf/base/src/nsCompositeDataSource.cpp +++ b/rdf/base/src/nsCompositeDataSource.cpp @@ -44,16 +44,18 @@ #ifdef DEBUG #include "prlog.h" #include "prprf.h" #include <stdio.h> PRLogModuleInfo* nsRDFLog = nullptr; #endif +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + //---------------------------------------------------------------------- // // CompositeDataSourceImpl // class CompositeEnumeratorImpl; class CompositeArcsInOutEnumeratorImpl; class CompositeAssertionEnumeratorImpl;
--- a/rdf/base/src/nsContainerEnumerator.cpp +++ b/rdf/base/src/nsContainerEnumerator.cpp @@ -31,16 +31,21 @@ #include "nsString.h" #include "nsXPIDLString.h" #include "prlog.h" #include "rdf.h" #include "rdfutil.h" //////////////////////////////////////////////////////////////////////// +static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); +static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); + +//////////////////////////////////////////////////////////////////////// + class ContainerEnumeratorImpl : public nsISimpleEnumerator { private: // pseudo-constants static nsrefcnt gRefCnt; static nsIRDFResource* kRDF_nextVal; static nsIRDFContainerUtils* gRDFC; nsCOMPtr<nsIRDFDataSource> mDataSource; @@ -74,28 +79,25 @@ ContainerEnumeratorImpl::ContainerEnumer { } nsresult ContainerEnumeratorImpl::Init() { if (gRefCnt++ == 0) { nsresult rv; - - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); nsCOMPtr<nsIRDFService> rdf = do_GetService(kRDFServiceCID); NS_ASSERTION(rdf != nullptr, "unable to acquire resource manager"); if (! rdf) return NS_ERROR_FAILURE; rv = rdf->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"), &kRDF_nextVal); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource"); if (NS_FAILED(rv)) return rv; - NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); rv = CallGetService(kRDFContainerUtilsCID, &gRDFC); if (NS_FAILED(rv)) return rv; } return NS_OK; }
--- a/rdf/base/src/nsInMemoryDataSource.cpp +++ b/rdf/base/src/nsInMemoryDataSource.cpp @@ -64,16 +64,21 @@ #include "pldhash.h" #include "plstr.h" #include "prlog.h" #include "rdf.h" #include "rdfIDataSource.h" #include "rdfITripleVisitor.h" +#ifdef PR_LOGGING +static PRLogModuleInfo* gLog = nullptr; +#endif + + // This struct is used as the slot value in the forward and reverse // arcs hash tables. // // Assertion objects are reference counted, because each Assertion's // ownership is shared between the datasource and any enumerators that // are currently iterating over the datasource. // class Assertion @@ -355,27 +360,18 @@ public: LogOperation(const char* aOperation, nsIRDFResource* asource, nsIRDFResource* aProperty, nsIRDFNode* aTarget, bool aTruthValue = true); #endif bool mPropagateChanges; - -private: -#ifdef PR_LOGGING - static PRLogModuleInfo* gLog; -#endif }; -#ifdef PR_LOGGING -PRLogModuleInfo* InMemoryDataSource::gLog; -#endif - //---------------------------------------------------------------------- // // InMemoryAssertionEnumeratorImpl // /** * InMemoryAssertionEnumeratorImpl */
--- a/rdf/base/src/nsRDFContainer.cpp +++ b/rdf/base/src/nsRDFContainer.cpp @@ -40,16 +40,20 @@ #include "nsIRDFPropagatableDataSource.h" #include "nsIRDFService.h" #include "nsIServiceManager.h" #include "nsRDFCID.h" #include "nsString.h" #include "nsXPIDLString.h" #include "rdf.h" +static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); +static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); +static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI; + #define RDF_SEQ_LIST_LIMIT 8 class RDFContainerImpl : public nsIRDFContainer { public: // nsISupports interface NS_DECL_ISUPPORTS @@ -372,28 +376,26 @@ RDFContainerImpl::RDFContainerImpl() nsresult RDFContainerImpl::Init() { if (gRefCnt++ == 0) { nsresult rv; - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); rv = CallGetService(kRDFServiceCID, &gRDFService); if (NS_FAILED(rv)) { NS_ERROR("unable to get RDF service"); return rv; } rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"), &kRDF_nextVal); if (NS_FAILED(rv)) return rv; - NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils); if (NS_FAILED(rv)) { NS_ERROR("unable to get RDF container utils service"); return rv; } } return NS_OK; @@ -681,17 +683,16 @@ RDFContainerImpl::GetNextValue(nsIRDFRes if (*p < '0' || *p > '9') break; nextVal *= 10; nextVal += *p - '0'; } } - static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI; char buf[sizeof(kRDFNameSpaceURI) + 16]; nsFixedCString nextValStr(buf, sizeof(buf), 0); nextValStr = kRDFNameSpaceURI; nextValStr.Append("_"); nextValStr.AppendInt(nextVal, 10); rv = gRDFService->GetResource(nextValStr, aResult); if (NS_FAILED(rv)) return rv;
--- a/rdf/base/src/nsRDFContainerUtils.cpp +++ b/rdf/base/src/nsRDFContainerUtils.cpp @@ -18,16 +18,19 @@ #include "nsRDFCID.h" #include "nsString.h" #include "nsXPIDLString.h" #include "plstr.h" #include "prprf.h" #include "rdf.h" #include "rdfutil.h" +static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); +static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI; + class RDFContainerUtilsImpl : public nsIRDFContainerUtils { public: // nsISupports interface NS_DECL_ISUPPORTS // nsIRDFContainerUtils interface NS_DECL_NSIRDFCONTAINERUTILS @@ -49,28 +52,27 @@ private: static int32_t gRefCnt; static nsIRDFService* gRDFService; static nsIRDFResource* kRDF_instanceOf; static nsIRDFResource* kRDF_nextVal; static nsIRDFResource* kRDF_Bag; static nsIRDFResource* kRDF_Seq; static nsIRDFResource* kRDF_Alt; static nsIRDFLiteral* kOne; - static const char kRDFNameSpaceURI[]; }; + int32_t RDFContainerUtilsImpl::gRefCnt = 0; nsIRDFService* RDFContainerUtilsImpl::gRDFService; nsIRDFResource* RDFContainerUtilsImpl::kRDF_instanceOf; nsIRDFResource* RDFContainerUtilsImpl::kRDF_nextVal; nsIRDFResource* RDFContainerUtilsImpl::kRDF_Bag; nsIRDFResource* RDFContainerUtilsImpl::kRDF_Seq; nsIRDFResource* RDFContainerUtilsImpl::kRDF_Alt; nsIRDFLiteral* RDFContainerUtilsImpl::kOne; -const char RDFContainerUtilsImpl::kRDFNameSpaceURI[] = RDF_NAMESPACE_URI; //////////////////////////////////////////////////////////////////////// // nsISupports interface NS_IMPL_ISUPPORTS1(RDFContainerUtilsImpl, nsIRDFContainerUtils) //////////////////////////////////////////////////////////////////////// // nsIRDFContainerUtils interface @@ -318,17 +320,16 @@ RDFContainerUtilsImpl::MakeAlt(nsIRDFDat //////////////////////////////////////////////////////////////////////// RDFContainerUtilsImpl::RDFContainerUtilsImpl() { if (gRefCnt++ == 0) { nsresult rv; - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); rv = CallGetService(kRDFServiceCID, &gRDFService); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service"); if (NS_SUCCEEDED(rv)) { gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "instanceOf"), &kRDF_instanceOf); gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"), &kRDF_nextVal);
--- a/rdf/base/src/nsRDFContentSink.cpp +++ b/rdf/base/src/nsRDFContentSink.cpp @@ -63,16 +63,35 @@ #include "nsCRT.h" #include "nsIAtom.h" #include "nsStaticAtom.h" #include "nsIScriptError.h" #include "nsIDTD.h" using namespace mozilla; +//////////////////////////////////////////////////////////////////////// +// XPCOM IIDs + +static NS_DEFINE_IID(kIContentSinkIID, NS_ICONTENT_SINK_IID); // XXX grr... +static NS_DEFINE_IID(kIExpatSinkIID, NS_IEXPATSINK_IID); +static NS_DEFINE_IID(kIRDFServiceIID, NS_IRDFSERVICE_IID); +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kIXMLContentSinkIID, NS_IXMLCONTENT_SINK_IID); +static NS_DEFINE_IID(kIRDFContentSinkIID, NS_IRDFCONTENTSINK_IID); + +static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); +static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); + +//////////////////////////////////////////////////////////////////////// + +#ifdef PR_LOGGING +static PRLogModuleInfo* gLog; +#endif + /////////////////////////////////////////////////////////////////////// enum RDFContentSinkState { eRDFContentSinkState_InProlog, eRDFContentSinkState_InDocumentElement, eRDFContentSinkState_InDescriptionElement, eRDFContentSinkState_InContainerElement, eRDFContentSinkState_InPropertyElement, @@ -220,37 +239,28 @@ protected: nsCOMPtr<nsIRDFResource> mResource; RDFContentSinkState mState; RDFContentSinkParseMode mParseMode; }; nsAutoTArray<RDFContextStackElement, 8>* mContextStack; nsIURI* mDocumentURL; - -private: -#ifdef PR_LOGGING - static PRLogModuleInfo* gLog; -#endif }; int32_t RDFContentSinkImpl::gRefCnt = 0; nsIRDFService* RDFContentSinkImpl::gRDFService; nsIRDFContainerUtils* RDFContentSinkImpl::gRDFContainerUtils; nsIRDFResource* RDFContentSinkImpl::kRDF_type; nsIRDFResource* RDFContentSinkImpl::kRDF_instanceOf; nsIRDFResource* RDFContentSinkImpl::kRDF_Alt; nsIRDFResource* RDFContentSinkImpl::kRDF_Bag; nsIRDFResource* RDFContentSinkImpl::kRDF_Seq; nsIRDFResource* RDFContentSinkImpl::kRDF_nextVal; -#ifdef PR_LOGGING -PRLogModuleInfo* RDFContentSinkImpl::gLog; -#endif - //////////////////////////////////////////////////////////////////////// #define RDF_ATOM(name_, value_) nsIAtom* RDFContentSinkImpl::name_; #include "nsRDFContentSinkAtomList.h" #undef RDF_ATOM #define RDF_ATOM(name_, value_) NS_STATIC_ATOM_BUFFER(name_##_buffer, value_) #include "nsRDFContentSinkAtomList.h" @@ -267,17 +277,16 @@ RDFContentSinkImpl::RDFContentSinkImpl() mTextLength(0), mTextSize(0), mState(eRDFContentSinkState_InProlog), mParseMode(eRDFContentSinkParseMode_Literal), mContextStack(nullptr), mDocumentURL(nullptr) { if (gRefCnt++ == 0) { - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); nsresult rv = CallGetService(kRDFServiceCID, &gRDFService); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service"); if (NS_SUCCEEDED(rv)) { rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "type"), &kRDF_type); rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "instanceOf"), &kRDF_instanceOf); @@ -286,17 +295,17 @@ RDFContentSinkImpl::RDFContentSinkImpl() rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "Bag"), &kRDF_Bag); rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "Seq"), &kRDF_Seq); rv = gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"), &kRDF_nextVal); } - NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID); + rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils); NS_RegisterStaticAtoms(rdf_atoms); } #ifdef PR_LOGGING if (! gLog) gLog = PR_NewLogModule("nsRDFContentSink"); @@ -367,22 +376,16 @@ NS_IMPL_RELEASE(RDFContentSinkImpl) NS_IMETHODIMP RDFContentSinkImpl::QueryInterface(REFNSIID iid, void** result) { NS_PRECONDITION(result, "null ptr"); if (! result) return NS_ERROR_NULL_POINTER; - NS_DEFINE_IID(kIContentSinkIID, NS_ICONTENT_SINK_IID); - NS_DEFINE_IID(kIExpatSinkIID, NS_IEXPATSINK_IID); - NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - NS_DEFINE_IID(kIXMLContentSinkIID, NS_IXMLCONTENT_SINK_IID); - NS_DEFINE_IID(kIRDFContentSinkIID, NS_IRDFCONTENTSINK_IID); - *result = nullptr; if (iid.Equals(kIRDFContentSinkIID) || iid.Equals(kIXMLContentSinkIID) || iid.Equals(kIContentSinkIID) || iid.Equals(kISupportsIID)) { *result = static_cast<nsIXMLContentSink*>(this); AddRef(); return NS_OK;
--- a/rdf/base/src/nsRDFService.cpp +++ b/rdf/base/src/nsRDFService.cpp @@ -65,16 +65,20 @@ static NS_DEFINE_CID(kRDFXMLDataSourceCI static NS_DEFINE_CID(kRDFDefaultResourceCID, NS_RDFDEFAULTRESOURCE_CID); static NS_DEFINE_IID(kIRDFLiteralIID, NS_IRDFLITERAL_IID); static NS_DEFINE_IID(kIRDFDateIID, NS_IRDFDATE_IID); static NS_DEFINE_IID(kIRDFIntIID, NS_IRDFINT_IID); static NS_DEFINE_IID(kIRDFNodeIID, NS_IRDFNODE_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +#ifdef PR_LOGGING +static PRLogModuleInfo* gLog = nullptr; +#endif + class BlobImpl; // These functions are copied from nsprpub/lib/ds/plhash.c, with one // change to free the key in DataSourceFreeEntry. // XXX sigh, why were DefaultAllocTable et. al. declared static, anyway? static void * DataSourceAllocTable(void *pool, size_t size) @@ -719,20 +723,16 @@ IntImpl::EqualsInt(nsIRDFInt* intValue, *result = (p == mValue); return NS_OK; } //////////////////////////////////////////////////////////////////////// // RDFServiceImpl -#ifdef PR_LOGGING -PRLogModuleInfo* RDFServiceImpl::gLog; -#endif - RDFServiceImpl* RDFServiceImpl::gRDFService; RDFServiceImpl::RDFServiceImpl() : mNamedDataSources(nullptr) { mResources.ops = nullptr; mLiterals.ops = nullptr;
--- a/rdf/base/src/nsRDFService.h +++ b/rdf/base/src/nsRDFService.h @@ -23,29 +23,24 @@ #include "nsIRDFService.h" #include "nsWeakReference.h" #include "nsIFactory.h" #include "nsCOMPtr.h" #include "pldhash.h" #include "nsString.h" struct PLHashTable; -struct PRLogModuleInfo; class nsIRDFLiteral; class nsIRDFInt; class nsIRDFDate; class BlobImpl; class RDFServiceImpl : public nsIRDFService, public nsSupportsWeakReference { -#ifdef PR_LOGGING - static PRLogModuleInfo* gLog; -#endif - protected: PLHashTable* mNamedDataSources; PLDHashTable mResources; PLDHashTable mLiterals; PLDHashTable mInts; PLDHashTable mDates; PLDHashTable mBlobs;
--- a/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/rdf/base/src/nsRDFXMLDataSource.cpp @@ -93,16 +93,25 @@ #include "nsIScriptSecurityManager.h" #include "nsIChannelEventSink.h" #include "nsIAsyncVerifyRedirectCallback.h" #include "nsNetUtil.h" #include "rdfIDataSource.h" //---------------------------------------------------------------------- + +static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID); +static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); + +#ifdef PR_LOGGING +static PRLogModuleInfo* gLog; +#endif + +//---------------------------------------------------------------------- // // RDFXMLDataSourceImpl // class RDFXMLDataSourceImpl : public nsIRDFDataSource, public nsIRDFRemoteDataSource, public nsIRDFXMLSink, public nsIRDFXMLSource, @@ -127,20 +136,16 @@ protected: nsCOMPtr<nsIURI> mURL; nsCOMPtr<nsIStreamListener> mListener; nsNameSpaceMap mNameSpaces; // pseudo-constants static int32_t gRefCnt; static nsIRDFService* gRDFService; -#ifdef PR_LOGGING - static PRLogModuleInfo* gLog; -#endif - nsresult Init(); RDFXMLDataSourceImpl(void); virtual ~RDFXMLDataSourceImpl(void); nsresult rdfXMLFlush(nsIURI *aURI); friend nsresult NS_NewRDFXMLDataSource(nsIRDFDataSource** aResult); @@ -353,20 +358,16 @@ public: protected: nsresult BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer); }; int32_t RDFXMLDataSourceImpl::gRefCnt = 0; nsIRDFService* RDFXMLDataSourceImpl::gRDFService; -#ifdef PR_LOGGING -PRLogModuleInfo* RDFXMLDataSourceImpl::gLog; -#endif - static const char kFileURIPrefix[] = "file:"; static const char kResourceURIPrefix[] = "resource:"; //---------------------------------------------------------------------- nsresult NS_NewRDFXMLDataSource(nsIRDFDataSource** aResult) @@ -404,22 +405,20 @@ RDFXMLDataSourceImpl::RDFXMLDataSourceIm #endif } nsresult RDFXMLDataSourceImpl::Init() { nsresult rv; - NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID); mInner = do_CreateInstance(kRDFInMemoryDataSourceCID, &rv); if (NS_FAILED(rv)) return rv; if (gRefCnt++ == 0) { - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); rv = CallGetService(kRDFServiceCID, &gRDFService); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service"); if (NS_FAILED(rv)) return rv; } return NS_OK; } @@ -738,17 +737,16 @@ RDFXMLDataSourceImpl::rdfXMLFlush(nsIURI nsresult rv; { // Quick and dirty check to see if we're in XPCOM shutdown. If // we are, we're screwed: it's too late to serialize because // many of the services that we'll need to acquire to properly // write the file will be unaquirable. - NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); nsCOMPtr<nsIRDFService> dummy = do_GetService(kRDFServiceCID, &rv); if (NS_FAILED(rv)) { NS_WARNING("unable to Flush() dirty datasource during XPCOM shutdown"); return rv; } } // Is it a file? If so, we can write to it. Some day, it'd be nice
--- a/rdf/datasource/src/moz.build +++ b/rdf/datasource/src/moz.build @@ -1,12 +1,12 @@ # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # 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/. -UNIFIED_SOURCES += [ +SOURCES += [ 'nsFileSystemDataSource.cpp', 'nsLocalStore.cpp', ] FINAL_LIBRARY = 'rdf'