Backed out 2 changesets (bug 1618735, bug 1618753) for bustages on nsZipArchive.h . CLOSED TREE

Backed out changeset 5eae5c3e54bf (bug 1618753)
Backed out changeset e58f6c24816c (bug 1618735)
This commit is contained in:
Narcis Beleuzu 2020-02-29 04:06:12 +02:00
Родитель 0c17906777
Коммит dbd979419a
11 изменённых файлов: 30 добавлений и 29 удалений

Просмотреть файл

@ -8,7 +8,7 @@
#include "jsfriendapi.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsJSNPRuntime.h"
#include "nsNPAPIPlugin.h"
@ -280,7 +280,7 @@ static void DelayedReleaseGCCallback(JSGCStatus status) {
if (JSGC_END == status) {
// Take ownership of sDelayedReleases and null it out now. The
// _releaseobject call below can reenter GC and double-free these objects.
UniquePtr<nsTArray<NPObject*>> delayedReleases(sDelayedReleases);
nsAutoPtr<nsTArray<NPObject*>> delayedReleases(sDelayedReleases);
sDelayedReleases = nullptr;
if (delayedReleases) {

Просмотреть файл

@ -11,7 +11,6 @@
#include "PluginMessageUtils.h"
#include "npapi.h"
#include "base/timer.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {
namespace plugins {
@ -32,9 +31,7 @@ class ChildTimer {
class IDComparator {
public:
bool Equals(const UniquePtr<ChildTimer>& t, uint32_t id) const {
return t->ID() == id;
}
bool Equals(ChildTimer* t, uint32_t id) const { return t->ID() == id; }
};
private:

Просмотреть файл

@ -35,7 +35,7 @@ class FunctionBrokerChild : public PFunctionBrokerChild {
void ShutdownOnDispatchThread();
void Bind(Endpoint<PFunctionBrokerChild>&& aEndpoint);
UniquePtr<FunctionBrokerThread> mThread;
nsAutoPtr<FunctionBrokerThread> mThread;
// True if tasks on the FunctionBrokerThread have completed
bool mShutdownDone;

Просмотреть файл

@ -56,7 +56,7 @@ class FunctionBrokerParent : public PFunctionBrokerParent {
static mozilla::SandboxPermissions sSandboxPermissions;
#endif // defined(XP_WIN) && defined(MOZ_SANDBOX)
UniquePtr<FunctionBrokerThread> mThread;
nsAutoPtr<FunctionBrokerThread> mThread;
Monitor mMonitor;
bool mShutdownDone;
};

Просмотреть файл

@ -4029,7 +4029,7 @@ void PluginInstanceChild::Destroy() {
ClearAllSurfaces();
mDirectBitmaps.Clear();
mDeletingHash = MakeUnique<nsTHashtable<DeletingObjectEntry>>();
mDeletingHash = new nsTHashtable<DeletingObjectEntry>;
PluginScriptableObjectChild::NotifyOfInstanceShutdown(this);
InvalidateObjects(*mDeletingHash);

Просмотреть файл

@ -24,7 +24,7 @@
#endif
#include "npfunctions.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "ChildTimer.h"
#include "nsRect.h"
@ -387,14 +387,14 @@ class PluginInstanceChild : public PPluginInstanceChild {
#if defined(OS_WIN)
nsTArray<FlashThrottleMsg*> mPendingFlashThrottleMsgs;
#endif
nsTArray<UniquePtr<ChildTimer> > mTimers;
nsTArray<nsAutoPtr<ChildTimer> > mTimers;
/**
* During destruction we enumerate all remaining scriptable objects and
* invalidate/delete them. Enumeration can re-enter, so maintain a
* hash separate from PluginModuleChild.mObjectMap.
*/
UniquePtr<nsTHashtable<DeletingObjectEntry> > mDeletingHash;
nsAutoPtr<nsTHashtable<DeletingObjectEntry> > mDeletingHash;
#if defined(MOZ_WIDGET_COCOA)
private:

Просмотреть файл

@ -26,7 +26,7 @@
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsCRT.h"
#include "nsIFile.h"
#include "nsICrashService.h"
@ -351,7 +351,7 @@ void mozilla::plugins::TerminatePlugin(uint32_t aPluginId,
PluginLibrary* PluginModuleContentParent::LoadModule(uint32_t aPluginId,
nsPluginTag* aPluginTag) {
PluginModuleMapping::NotifyLoadingModule loadingModule;
UniquePtr<PluginModuleMapping> mapping(new PluginModuleMapping(aPluginId));
nsAutoPtr<PluginModuleMapping> mapping(new PluginModuleMapping(aPluginId));
MOZ_ASSERT(XRE_IsContentProcess());
@ -378,7 +378,7 @@ PluginLibrary* PluginModuleContentParent::LoadModule(uint32_t aPluginId,
// mapping is linked into PluginModuleMapping::sModuleListHead and is
// needed later, so since this function is returning successfully we
// forget it here.
Unused << mapping.release();
mapping.forget();
}
parent->mPluginId = aPluginId;
@ -390,7 +390,7 @@ PluginLibrary* PluginModuleContentParent::LoadModule(uint32_t aPluginId,
/* static */
void PluginModuleContentParent::Initialize(
Endpoint<PPluginModuleParent>&& aEndpoint) {
UniquePtr<PluginModuleMapping> moduleMapping(
nsAutoPtr<PluginModuleMapping> moduleMapping(
PluginModuleMapping::Resolve(aEndpoint.OtherPid()));
MOZ_ASSERT(moduleMapping);
PluginModuleContentParent* parent = moduleMapping->GetModule();
@ -414,7 +414,7 @@ void PluginModuleContentParent::Initialize(
// moduleMapping is linked into PluginModuleMapping::sModuleListHead and is
// needed later, so since this function is returning successfully we
// forget it here.
Unused << moduleMapping.release();
moduleMapping.forget();
}
// static
@ -423,10 +423,9 @@ PluginLibrary* PluginModuleChromeParent::LoadModule(const char* aFilePath,
nsPluginTag* aPluginTag) {
PLUGIN_LOG_DEBUG_FUNCTION;
UniquePtr<PluginModuleChromeParent> parent(new PluginModuleChromeParent(
nsAutoPtr<PluginModuleChromeParent> parent(new PluginModuleChromeParent(
aFilePath, aPluginId, aPluginTag->mSandboxLevel));
UniquePtr<LaunchCompleteTask> onLaunchedRunnable(
new LaunchedTask(parent.get()));
UniquePtr<LaunchCompleteTask> onLaunchedRunnable(new LaunchedTask(parent));
bool launched = parent->mSubprocess->Launch(
std::move(onLaunchedRunnable), aPluginTag->mSandboxLevel,
aPluginTag->mIsSandboxLoggingEnabled);
@ -462,7 +461,7 @@ PluginLibrary* PluginModuleChromeParent::LoadModule(const char* aFilePath,
Unused << parent->SendInitPluginFunctionBroker(std::move(brokerChildEnd));
}
#endif
return parent.release();
return parent.forget();
}
static const char* gCallbackPrefs[] = {

Просмотреть файл

@ -10,7 +10,7 @@
#endif
#include "mozilla/plugins/PPluginWidgetParent.h"
#include "mozilla/UniquePtr.h"
#include "nsAutoPtr.h"
#include "nsIWidget.h"
#include "nsCOMPtr.h"

Просмотреть файл

@ -234,7 +234,7 @@ nsresult nsZipHandle::Init(nsZipArchive* zip, const char* entry,
RefPtr<nsZipHandle> handle = new nsZipHandle();
if (!handle) return NS_ERROR_OUT_OF_MEMORY;
handle->mBuf = MakeUnique<nsZipItemPtr<uint8_t>>(zip, entry);
handle->mBuf = new nsZipItemPtr<uint8_t>(zip, entry);
if (!handle->mBuf) return NS_ERROR_OUT_OF_MEMORY;
if (!handle->mBuf->Buffer()) return NS_ERROR_UNEXPECTED;

Просмотреть файл

@ -14,6 +14,7 @@
#include "zlib.h"
#include "zipstruct.h"
#include "nsAutoPtr.h"
#include "nsIFile.h"
#include "nsISupportsImpl.h" // For mozilla::ThreadSafeAutoRefCnt
#include "mozilla/ArenaAllocator.h"
@ -402,7 +403,7 @@ class nsZipHandle final {
PRFileMap* mMap; /* nspr datastructure for mmap */
mozilla::AutoFDClose mNSPRFileDesc;
UniquePtr<nsZipItemPtr<uint8_t> > mBuf;
nsAutoPtr<nsZipItemPtr<uint8_t> > mBuf;
mozilla::ThreadSafeAutoRefCnt mRefCnt; /* ref count */
NS_DECL_OWNINGTHREAD

Просмотреть файл

@ -45,6 +45,7 @@
#include "mozilla/Variant.h"
#include "mozilla/Vector.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsAutoPtr.h"
#include "nsCategoryManagerUtils.h"
#include "nsClassHashtable.h"
#include "nsCOMArray.h"
@ -4300,14 +4301,16 @@ static nsresult pref_ReadPrefFromJar(nsZipArchive* aJarReader,
static nsresult pref_ReadDefaultPrefs(const RefPtr<nsZipArchive> jarReader,
const char* path) {
UniquePtr<nsZipFind> find;
nsZipFind* findPtr;
nsAutoPtr<nsZipFind> find;
nsTArray<nsCString> prefEntries;
const char* entryName;
uint16_t entryNameLen;
nsresult rv = jarReader->FindInit(path, getter_Transfers(find));
nsresult rv = jarReader->FindInit(path, &findPtr);
NS_ENSURE_SUCCESS(rv, rv);
find = findPtr;
while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
prefEntries.AppendElement(Substring(entryName, entryNameLen));
}
@ -4470,7 +4473,8 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
// preferences from omni.jar, whether or not `$app == $gre`.
nsresult rv = NS_ERROR_FAILURE;
UniquePtr<nsZipFind> find;
nsZipFind* findPtr;
nsAutoPtr<nsZipFind> find;
nsTArray<nsCString> prefEntries;
const char* entryName;
uint16_t entryNameLen;
@ -4566,9 +4570,9 @@ nsresult Preferences::InitInitialObjects(bool aIsStartup) {
}
if (appJarReader) {
rv = appJarReader->FindInit("defaults/preferences/*.js$",
getter_Transfers(find));
rv = appJarReader->FindInit("defaults/preferences/*.js$", &findPtr);
NS_ENSURE_SUCCESS(rv, rv);
find = findPtr;
prefEntries.Clear();
while (NS_SUCCEEDED(find->FindNext(&entryName, &entryNameLen))) {
prefEntries.AppendElement(Substring(entryName, entryNameLen));