Bug 1289211 - Rename InfallibleTArray to nsTArray in dom/storage/ r=Ehsan
authorBarret Rennie <barret@brennie.ca>
Wed, 10 Jul 2019 03:27:55 +0000
changeset 542706 36fbc4aa6b371684f15769b93a0c5aee7cd29e20
parent 542705 a8c019af4626f20b44724c74460f4950b860953b
child 542707 53e6d3ba6047480f864e7d03ad15cc4791edda1a
push id11848
push userffxbld-merge
push dateMon, 26 Aug 2019 19:26:25 +0000
treeherdermozilla-beta@9b31bfdfac10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1289211
milestone70.0a1
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
Bug 1289211 - Rename InfallibleTArray to nsTArray in dom/storage/ r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D36949
dom/storage/StorageDBThread.cpp
dom/storage/StorageDBThread.h
dom/storage/StorageIPC.cpp
dom/storage/StorageIPC.h
--- a/dom/storage/StorageDBThread.cpp
+++ b/dom/storage/StorageDBThread.cpp
@@ -308,18 +308,17 @@ void StorageDBThread::AsyncFlush() {
   monitor.Notify();
 }
 
 bool StorageDBThread::ShouldPreloadOrigin(const nsACString& aOrigin) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
   return mOriginsHavingData.Contains(aOrigin);
 }
 
-void StorageDBThread::GetOriginsHavingData(
-    InfallibleTArray<nsCString>* aOrigins) {
+void StorageDBThread::GetOriginsHavingData(nsTArray<nsCString>* aOrigins) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
   for (auto iter = mOriginsHavingData.Iter(); !iter.Done(); iter.Next()) {
     aOrigins->AppendElement(iter.Get()->GetKey());
   }
 }
 
 nsresult StorageDBThread::InsertDBOp(StorageDBThread::DBOperation* aOperation) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
--- a/dom/storage/StorageDBThread.h
+++ b/dom/storage/StorageDBThread.h
@@ -373,17 +373,17 @@ class StorageDBThread final {
                                aPattern));
   }
 
   virtual void AsyncFlush();
 
   virtual bool ShouldPreloadOrigin(const nsACString& aOrigin);
 
   // Get the complete list of scopes having data.
-  void GetOriginsHavingData(InfallibleTArray<nsCString>* aOrigins);
+  void GetOriginsHavingData(nsTArray<nsCString>* aOrigins);
 
  private:
   nsCOMPtr<nsIFile> mDatabaseFile;
   PRThread* mThread;
 
   // Used to observe runnables dispatched to our thread and to monitor it.
   RefPtr<ThreadObserver> mThreadObserver;
 
--- a/dom/storage/StorageIPC.cpp
+++ b/dom/storage/StorageIPC.cpp
@@ -247,17 +247,17 @@ void StorageDBChild::SyncPreload(LocalSt
     aCache->LoadDone(NS_ERROR_UNEXPECTED);
     return;
   }
 
   // There is no way to put the child process to a wait state to receive all
   // incoming async responses from the parent, hence we have to do a sync
   // preload instead.  We are smart though, we only demand keys that are left to
   // load in case the async preload has already loaded some keys.
-  InfallibleTArray<nsString> keys, values;
+  nsTArray<nsString> keys, values;
   nsresult rv;
   SendPreload(aCache->OriginSuffix(), aCache->OriginNoSuffix(),
               aCache->LoadedCount(), &keys, &values, &rv);
 
   for (uint32_t i = 0; i < keys.Length(); ++i) {
     aCache->LoadItem(keys[i], values[i]);
   }
 
@@ -616,17 +616,17 @@ void StorageDBParent::Init() {
 
   if (BackgroundParent::IsOtherProcessActor(actor)) {
     mObserverSink = new ObserverSink(this);
     mObserverSink->Start();
   }
 
   StorageDBThread* storageThread = StorageDBThread::Get();
   if (storageThread) {
-    InfallibleTArray<nsCString> scopes;
+    nsTArray<nsCString> scopes;
     storageThread->GetOriginsHavingData(&scopes);
     mozilla::Unused << SendOriginsHavingData(scopes);
   }
 }
 
 StorageDBParent::CacheParentBridge* StorageDBParent::NewCache(
     const nsACString& aOriginSuffix, const nsACString& aOriginNoSuffix) {
   return new CacheParentBridge(this, aOriginSuffix, aOriginNoSuffix);
@@ -681,19 +681,18 @@ namespace {
 // We need another implementation of LocalStorageCacheBridge to do
 // synchronous IPC preload.  This class just receives Load* notifications
 // and fills the returning arguments of RecvPreload with the database
 // values for us.
 class SyncLoadCacheHelper : public LocalStorageCacheBridge {
  public:
   SyncLoadCacheHelper(const nsCString& aOriginSuffix,
                       const nsCString& aOriginNoSuffix,
-                      uint32_t aAlreadyLoadedCount,
-                      InfallibleTArray<nsString>* aKeys,
-                      InfallibleTArray<nsString>* aValues, nsresult* rv)
+                      uint32_t aAlreadyLoadedCount, nsTArray<nsString>* aKeys,
+                      nsTArray<nsString>* aValues, nsresult* rv)
       : mMonitor("DOM Storage SyncLoad IPC"),
         mSuffix(aOriginSuffix),
         mOrigin(aOriginNoSuffix),
         mKeys(aKeys),
         mValues(aValues),
         mRv(rv),
         mLoaded(false),
         mLoadedCount(aAlreadyLoadedCount) {
@@ -740,29 +739,29 @@ class SyncLoadCacheHelper : public Local
     while (!mLoaded) {
       monitor.Wait();
     }
   }
 
  private:
   Monitor mMonitor;
   nsCString mSuffix, mOrigin;
-  InfallibleTArray<nsString>* mKeys;
-  InfallibleTArray<nsString>* mValues;
+  nsTArray<nsString>* mKeys;
+  nsTArray<nsString>* mValues;
   nsresult* mRv;
   bool mLoaded;
   uint32_t mLoadedCount;
 };
 
 }  // namespace
 
 mozilla::ipc::IPCResult StorageDBParent::RecvPreload(
     const nsCString& aOriginSuffix, const nsCString& aOriginNoSuffix,
-    const uint32_t& aAlreadyLoadedCount, InfallibleTArray<nsString>* aKeys,
-    InfallibleTArray<nsString>* aValues, nsresult* aRv) {
+    const uint32_t& aAlreadyLoadedCount, nsTArray<nsString>* aKeys,
+    nsTArray<nsString>* aValues, nsresult* aRv) {
   StorageDBThread* storageThread = StorageDBThread::GetOrCreate(mProfilePath);
   if (!storageThread) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   RefPtr<SyncLoadCacheHelper> cache(
       new SyncLoadCacheHelper(aOriginSuffix, aOriginNoSuffix,
                               aAlreadyLoadedCount, aKeys, aValues, aRv));
--- a/dom/storage/StorageIPC.h
+++ b/dom/storage/StorageIPC.h
@@ -338,18 +338,18 @@ class StorageDBParent final : public PBa
   mozilla::ipc::IPCResult RecvDeleteMe() override;
 
   mozilla::ipc::IPCResult RecvAsyncPreload(const nsCString& aOriginSuffix,
                                            const nsCString& aOriginNoSuffix,
                                            const bool& aPriority) override;
   mozilla::ipc::IPCResult RecvPreload(const nsCString& aOriginSuffix,
                                       const nsCString& aOriginNoSuffix,
                                       const uint32_t& aAlreadyLoadedCount,
-                                      InfallibleTArray<nsString>* aKeys,
-                                      InfallibleTArray<nsString>* aValues,
+                                      nsTArray<nsString>* aKeys,
+                                      nsTArray<nsString>* aValues,
                                       nsresult* aRv) override;
   mozilla::ipc::IPCResult RecvAsyncGetUsage(
       const nsCString& aOriginNoSuffix) override;
   mozilla::ipc::IPCResult RecvAsyncAddItem(const nsCString& aOriginSuffix,
                                            const nsCString& aOriginNoSuffix,
                                            const nsString& aKey,
                                            const nsString& aValue) override;
   mozilla::ipc::IPCResult RecvAsyncUpdateItem(const nsCString& aOriginSuffix,