mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 04:27:37 +00:00
Merge mozilla-central to mozilla-inbound
This commit is contained in:
commit
7a91942ed3
@ -271,13 +271,6 @@ DeviceStorageStatics::DumpDirs()
|
||||
nullptr
|
||||
};
|
||||
|
||||
const char* ptStr;
|
||||
if (XRE_IsParentProcess()) {
|
||||
ptStr = "parent";
|
||||
} else {
|
||||
ptStr = "child";
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < TYPE_COUNT; ++i) {
|
||||
MOZ_ASSERT(storageTypes[i]);
|
||||
|
||||
@ -285,8 +278,8 @@ DeviceStorageStatics::DumpDirs()
|
||||
if (mDirs[i]) {
|
||||
mDirs[i]->GetPath(path);
|
||||
}
|
||||
DS_LOG_INFO("(%s) %s: '%s'",
|
||||
ptStr, storageTypes[i], NS_LossyConvertUTF16toASCII(path).get());
|
||||
DS_LOG_INFO("%s: '%s'",
|
||||
storageTypes[i], NS_LossyConvertUTF16toASCII(path).get());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -304,47 +297,6 @@ DeviceStorageStatics::Shutdown()
|
||||
Preferences::RemoveObserver(this, kPrefWritableName);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
DeviceStorageStatics::GetDeviceStorageAreasForIPC(
|
||||
DeviceStorageAreaInfo& aAreaInfo)
|
||||
{
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
InitializeDirs();
|
||||
|
||||
GetDirPath(TYPE_APPS, aAreaInfo.apps());
|
||||
GetDirPath(TYPE_CRASHES, aAreaInfo.crashes());
|
||||
GetDirPath(TYPE_PICTURES, aAreaInfo.pictures());
|
||||
GetDirPath(TYPE_VIDEOS, aAreaInfo.videos());
|
||||
GetDirPath(TYPE_MUSIC, aAreaInfo.music());
|
||||
GetDirPath(TYPE_SDCARD, aAreaInfo.sdcard());
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
DeviceStorageStatics::RecvDeviceStorageAreasFromParent(
|
||||
const DeviceStorageAreaInfo& aAreaInfo)
|
||||
{
|
||||
if (XRE_IsParentProcess()) {
|
||||
// We are the parent. Therefore our info is already correct.
|
||||
return;
|
||||
}
|
||||
|
||||
StaticMutexAutoLock lock(sMutex);
|
||||
if (NS_WARN_IF(!sInstance)) {
|
||||
return;
|
||||
}
|
||||
|
||||
NS_NewLocalFile(aAreaInfo.apps(), true, getter_AddRefs(sInstance->mDirs[TYPE_APPS]));
|
||||
NS_NewLocalFile(aAreaInfo.crashes(), true, getter_AddRefs(sInstance->mDirs[TYPE_CRASHES]));
|
||||
NS_NewLocalFile(aAreaInfo.pictures(), true, getter_AddRefs(sInstance->mDirs[TYPE_PICTURES]));
|
||||
NS_NewLocalFile(aAreaInfo.videos(), true, getter_AddRefs(sInstance->mDirs[TYPE_VIDEOS]));
|
||||
NS_NewLocalFile(aAreaInfo.music(), true, getter_AddRefs(sInstance->mDirs[TYPE_MUSIC]));
|
||||
NS_NewLocalFile(aAreaInfo.sdcard(), true, getter_AddRefs(sInstance->mDirs[TYPE_SDCARD]));
|
||||
|
||||
sInstance->mInitialized = true;
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<nsIFile>
|
||||
DeviceStorageStatics::GetDir(DeviceStorageType aType)
|
||||
{
|
||||
@ -380,16 +332,6 @@ DeviceStorageStatics::GetDir(DeviceStorageType aType)
|
||||
return file.forget();
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
DeviceStorageStatics::GetDirPath(DeviceStorageType aType, nsString& aDirPath)
|
||||
{
|
||||
aDirPath.Truncate();
|
||||
nsCOMPtr<nsIFile> file = GetDir(aType);
|
||||
if (file) {
|
||||
file->GetPath(aDirPath);
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
DeviceStorageStatics::HasOverrideRootDir()
|
||||
{
|
||||
|
@ -8,12 +8,7 @@
|
||||
#define mozilla_dom_devicestorage_DeviceStorageStatics_h
|
||||
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/StaticMutex.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsArrayUtils.h"
|
||||
|
||||
class nsString;
|
||||
class nsDOMDeviceStorage;
|
||||
class DeviceStorageFile;
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
@ -40,9 +35,6 @@ public:
|
||||
static void GetWritableName(nsString& aName);
|
||||
static void SetWritableName(const nsAString& aName);
|
||||
|
||||
static void GetDeviceStorageAreasForIPC(DeviceStorageAreaInfo& aAreaInfo);
|
||||
static void RecvDeviceStorageAreasFromParent(const DeviceStorageAreaInfo& aAreaInfo);
|
||||
|
||||
static bool HasOverrideRootDir();
|
||||
static already_AddRefed<nsIFile> GetAppsDir();
|
||||
static already_AddRefed<nsIFile> GetCrashesDir();
|
||||
@ -64,7 +56,6 @@ private:
|
||||
};
|
||||
|
||||
static already_AddRefed<nsIFile> GetDir(DeviceStorageType aType);
|
||||
static void GetDirPath(DeviceStorageType aType, nsString& aString);
|
||||
|
||||
DeviceStorageStatics();
|
||||
virtual ~DeviceStorageStatics();
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "BlobChild.h"
|
||||
#include "CrashReporterChild.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "DeviceStorageStatics.h"
|
||||
#include "TabChild.h"
|
||||
#include "HandlerServiceChild.h"
|
||||
|
||||
@ -2595,15 +2594,6 @@ ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvDeviceStorageAreas(const DeviceStorageAreaInfo& areaInfo)
|
||||
{
|
||||
#if !defined(MOZ_WIDGET_GONK)
|
||||
DeviceStorageStatics::RecvDeviceStorageAreasFromParent(areaInfo);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvFilePathUpdate(const nsString& aStorageType,
|
||||
const nsString& aStorageName,
|
||||
|
@ -383,7 +383,6 @@ public:
|
||||
virtual bool RecvLastPrivateDocShellDestroyed() override;
|
||||
|
||||
virtual bool RecvVolumes(InfallibleTArray<VolumeInfo>&& aVolumes) override;
|
||||
virtual bool RecvDeviceStorageAreas(const DeviceStorageAreaInfo& areaInfo) override;
|
||||
virtual bool RecvFilePathUpdate(const nsString& aStorageType,
|
||||
const nsString& aStorageName,
|
||||
const nsString& aPath,
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "AudioChannelService.h"
|
||||
#include "BlobParent.h"
|
||||
#include "CrashReporterParent.h"
|
||||
#include "DeviceStorageStatics.h"
|
||||
#include "GMPServiceParent.h"
|
||||
#include "HandlerServiceParent.h"
|
||||
#include "IHistory.h"
|
||||
@ -1607,10 +1606,6 @@ ContentParent::ForwardKnownInfo()
|
||||
vs->GetVolumesForIPC(&volumeInfo);
|
||||
Unused << SendVolumes(volumeInfo);
|
||||
}
|
||||
#else
|
||||
DeviceStorageAreaInfo areaInfo;
|
||||
DeviceStorageStatics::GetDeviceStorageAreasForIPC(areaInfo);
|
||||
Unused << SendDeviceStorageAreas(areaInfo);
|
||||
#endif /* MOZ_WIDGET_GONK */
|
||||
|
||||
nsCOMPtr<nsISystemMessagesInternal> systemMessenger =
|
||||
|
@ -364,15 +364,6 @@ struct VolumeInfo {
|
||||
bool isHotSwappable;
|
||||
};
|
||||
|
||||
struct DeviceStorageAreaInfo {
|
||||
nsString music;
|
||||
nsString pictures;
|
||||
nsString videos;
|
||||
nsString sdcard;
|
||||
nsString apps;
|
||||
nsString crashes;
|
||||
};
|
||||
|
||||
struct ClipboardCapabilities {
|
||||
bool supportsSelectionClipboard;
|
||||
bool supportsFindClipboard;
|
||||
@ -604,8 +595,6 @@ child:
|
||||
|
||||
Volumes(VolumeInfo[] volumes);
|
||||
|
||||
DeviceStorageAreas(DeviceStorageAreaInfo areaInfo);
|
||||
|
||||
FlushMemory(nsString reason);
|
||||
|
||||
GarbageCollect();
|
||||
|
Loading…
Reference in New Issue
Block a user