Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 09ab49e

Browse files
committed
Bug 1410471 - Remove StartupCacheWrapper and friends. r=froydnj
This class was needed for testing, but no longer. MozReview-Commit-ID: AIk0kKlbScs --HG-- extra : rebase_source : 35eed188e44dc4c9899479b35882461dd2cf4624
1 parent 5bbcc8e commit 09ab49e

6 files changed

Lines changed: 2 additions & 201 deletions

File tree

startupcache/StartupCache.cpp

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "nsIObserver.h"
2020
#include "nsIObserverService.h"
2121
#include "nsIOutputStream.h"
22-
#include "nsIStartupCache.h"
2322
#include "nsIStorageStream.h"
2423
#include "nsIStreamBufferAccess.h"
2524
#include "nsIStringStream.h"
@@ -696,78 +695,5 @@ StartupCacheDebugOutputStream::PutBuffer(char* aBuffer, uint32_t aLength)
696695
}
697696
#endif //DEBUG
698697

699-
StartupCacheWrapper* StartupCacheWrapper::gStartupCacheWrapper = nullptr;
700-
701-
NS_IMPL_ISUPPORTS(StartupCacheWrapper, nsIStartupCache)
702-
703-
StartupCacheWrapper::~StartupCacheWrapper()
704-
{
705-
MOZ_ASSERT(gStartupCacheWrapper == this);
706-
gStartupCacheWrapper = nullptr;
707-
}
708-
709-
already_AddRefed<StartupCacheWrapper> StartupCacheWrapper::GetSingleton()
710-
{
711-
if (!gStartupCacheWrapper)
712-
gStartupCacheWrapper = new StartupCacheWrapper();
713-
714-
return do_AddRef(gStartupCacheWrapper);
715-
}
716-
717-
nsresult
718-
StartupCacheWrapper::GetBuffer(const char* id, char** outbuf, uint32_t* length)
719-
{
720-
StartupCache* sc = StartupCache::GetSingleton();
721-
if (!sc) {
722-
return NS_ERROR_NOT_INITIALIZED;
723-
}
724-
UniquePtr<char[]> buf;
725-
nsresult rv = sc->GetBuffer(id, &buf, length);
726-
*outbuf = buf.release();
727-
return rv;
728-
}
729-
730-
nsresult
731-
StartupCacheWrapper::PutBuffer(const char* id, const char* inbuf, uint32_t length)
732-
{
733-
StartupCache* sc = StartupCache::GetSingleton();
734-
if (!sc) {
735-
return NS_ERROR_NOT_INITIALIZED;
736-
}
737-
return sc->PutBuffer(id, inbuf, length);
738-
}
739-
740-
nsresult
741-
StartupCacheWrapper::InvalidateCache()
742-
{
743-
StartupCache* sc = StartupCache::GetSingleton();
744-
if (!sc) {
745-
return NS_ERROR_NOT_INITIALIZED;
746-
}
747-
sc->InvalidateCache();
748-
return NS_OK;
749-
}
750-
751-
nsresult
752-
StartupCacheWrapper::GetDebugObjectOutputStream(nsIObjectOutputStream* stream,
753-
nsIObjectOutputStream** outStream)
754-
{
755-
StartupCache* sc = StartupCache::GetSingleton();
756-
if (!sc) {
757-
return NS_ERROR_NOT_INITIALIZED;
758-
}
759-
return sc->GetDebugObjectOutputStream(stream, outStream);
760-
}
761-
762-
nsresult
763-
StartupCacheWrapper::GetObserver(nsIObserver** obv) {
764-
StartupCache* sc = StartupCache::GetSingleton();
765-
if (!sc) {
766-
return NS_ERROR_NOT_INITIALIZED;
767-
}
768-
NS_ADDREF(*obv = sc->mListener);
769-
return NS_OK;
770-
}
771-
772698
} // namespace scache
773699
} // namespace mozilla

startupcache/StartupCache.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
#include "nsComponentManagerUtils.h"
1111
#include "nsTArray.h"
1212
#include "nsZipArchive.h"
13-
#include "nsIStartupCache.h"
1413
#include "nsITimer.h"
1514
#include "nsIMemoryReporter.h"
1615
#include "nsIObserverService.h"
1716
#include "nsIObserver.h"
17+
#include "nsIObjectOutputStream.h"
1818
#include "nsIOutputStream.h"
1919
#include "nsIFile.h"
2020
#include "mozilla/Attributes.h"
2121
#include "mozilla/MemoryReporting.h"
22-
#include "mozilla/StaticPtr.h"
2322
#include "mozilla/UniquePtr.h"
2423

2524
/**
@@ -104,7 +103,6 @@ class StartupCache : public nsIMemoryReporter
104103
{
105104

106105
friend class StartupCacheListener;
107-
friend class StartupCacheWrapper;
108106

109107
public:
110108
NS_DECL_THREADSAFE_ISUPPORTS
@@ -200,24 +198,6 @@ class StartupCacheDebugOutputStream final
200198
};
201199
#endif // DEBUG
202200

203-
// XPCOM wrapper interface provided for tests only.
204-
#define NS_STARTUPCACHE_CID \
205-
{0xae4505a9, 0x87ab, 0x477c, \
206-
{0xb5, 0x77, 0xf9, 0x23, 0x57, 0xed, 0xa8, 0x84}}
207-
// contract id: "@mozilla.org/startupcache/cache;1"
208-
209-
class StartupCacheWrapper final
210-
: public nsIStartupCache
211-
{
212-
~StartupCacheWrapper();
213-
214-
NS_DECL_THREADSAFE_ISUPPORTS
215-
NS_DECL_NSISTARTUPCACHE
216-
217-
static already_AddRefed<StartupCacheWrapper> GetSingleton();
218-
static StartupCacheWrapper *gStartupCacheWrapper;
219-
};
220-
221201
} // namespace scache
222202
} // namespace mozilla
223203

startupcache/StartupCacheModule.cpp

Lines changed: 0 additions & 45 deletions
This file was deleted.

startupcache/StartupCacheUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ NewObjectOutputWrappedStorageStream(nsIObjectOutputStream **wrapperStream,
3333

3434
// Creates a buffer for storing the stream into the cache. The buffer is
3535
// allocated with 'new []'. After calling this function, the caller would
36-
// typically call nsIStartupCache::PutBuffer with the returned buffer.
36+
// typically call StartupCache::PutBuffer with the returned buffer.
3737
nsresult
3838
NewBufferFromStorageStream(nsIStorageStream *storageStream,
3939
UniquePtr<char[]>* buffer, uint32_t* len);

startupcache/moz.build

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@ with Files("**"):
99

1010
TEST_DIRS += ['test']
1111

12-
XPIDL_SOURCES += [
13-
'nsIStartupCache.idl',
14-
]
15-
16-
XPIDL_MODULE = 'startupcache'
17-
1812
EXPORTS.mozilla.scache += [
1913
'StartupCache.h',
2014
'StartupCacheUtils.h',
2115
]
2216

2317
UNIFIED_SOURCES += [
2418
'StartupCache.cpp',
25-
'StartupCacheModule.cpp',
2619
'StartupCacheUtils.cpp',
2720
]
2821

startupcache/nsIStartupCache.idl

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)