summaryrefslogtreecommitdiffstats
path: root/dom/ipc
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-06 15:53:52 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-06 15:53:52 +0200
commit941e54654eabed0a3568f7fefe424a45aa02eddb (patch)
tree49aa02b174c428962d99142d8061267bfcd79e69 /dom/ipc
parentad9ee72dcd7981bc47b3844a224d69fadfdfd8ef (diff)
parent0daa12376295d5d796256a116eb2a348a3a9273f (diff)
downloadUXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar
UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.gz
UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.lz
UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.tar.xz
UXP-941e54654eabed0a3568f7fefe424a45aa02eddb.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into _testBranch_test_1
Diffstat (limited to 'dom/ipc')
-rw-r--r--dom/ipc/ContentChild.cpp330
-rw-r--r--dom/ipc/ContentChild.h36
-rw-r--r--dom/ipc/ContentParent.cpp373
-rw-r--r--dom/ipc/ContentParent.h36
-rw-r--r--dom/ipc/ContentProcess.cpp113
-rw-r--r--dom/ipc/ContentProcess.h8
-rw-r--r--dom/ipc/CrashReporterChild.cpp42
-rw-r--r--dom/ipc/CrashReporterChild.h32
-rw-r--r--dom/ipc/CrashReporterParent.cpp63
-rw-r--r--dom/ipc/CrashReporterParent.h70
-rw-r--r--dom/ipc/DatePickerParent.cpp87
-rw-r--r--dom/ipc/DatePickerParent.h61
-rw-r--r--dom/ipc/PBrowser.ipdl8
-rw-r--r--dom/ipc/PContent.ipdl17
-rw-r--r--dom/ipc/PCrashReporter.ipdl31
-rw-r--r--dom/ipc/PDatePicker.ipdl27
-rw-r--r--dom/ipc/StructuredCloneData.cpp4
-rw-r--r--dom/ipc/StructuredCloneData.h23
-rw-r--r--dom/ipc/TabChild.cpp16
-rw-r--r--dom/ipc/TabChild.h4
-rw-r--r--dom/ipc/TabContext.cpp7
-rw-r--r--dom/ipc/TabParent.cpp15
-rw-r--r--dom/ipc/TabParent.h4
-rw-r--r--dom/ipc/moz.build23
-rw-r--r--dom/ipc/tests/test_cpow_cookies.html3
25 files changed, 47 insertions, 1386 deletions
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index 75678ca96..fc288e2c5 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -11,7 +11,6 @@
#include "ContentChild.h"
#include "BlobChild.h"
-#include "CrashReporterChild.h"
#include "GeckoProfiler.h"
#include "TabChild.h"
#include "HandlerServiceChild.h"
@@ -32,7 +31,6 @@
#include "mozilla/dom/ExternalHelperAppChild.h"
#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/GetFilesHelper.h"
-#include "mozilla/dom/PCrashReporterChild.h"
#include "mozilla/dom/ProcessGlobal.h"
#include "mozilla/dom/PushNotifier.h"
#include "mozilla/dom/workers/ServiceWorkerManager.h"
@@ -65,21 +63,6 @@
#include "imgLoader.h"
#include "GMPServiceChild.h"
-#if defined(MOZ_CONTENT_SANDBOX)
-#if defined(XP_WIN)
-#define TARGET_SANDBOX_EXPORTS
-#include "mozilla/sandboxTarget.h"
-#elif defined(XP_LINUX)
-#include "mozilla/Sandbox.h"
-#include "mozilla/SandboxInfo.h"
-
-// Remove this include with Bug 1104619
-#include "CubebUtils.h"
-#elif defined(XP_MACOSX)
-#include "mozilla/Sandbox.h"
-#endif
-#endif
-
#include "mozilla/Unused.h"
#include "mozInlineSpellChecker.h"
@@ -152,12 +135,6 @@
#include "APKOpen.h"
#endif
-#if defined(MOZ_WIDGET_GONK)
-#include "nsVolume.h"
-#include "nsVolumeService.h"
-#include "SpeakerManagerService.h"
-#endif
-
#ifdef XP_WIN
#include <process.h>
#define getpid _getpid
@@ -211,9 +188,6 @@ using namespace mozilla::net;
using namespace mozilla::jsipc;
using namespace mozilla::psm;
using namespace mozilla::widget;
-#if defined(MOZ_WIDGET_GONK)
-using namespace mozilla::system;
-#endif
using namespace mozilla::widget;
namespace mozilla {
@@ -559,8 +533,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
NS_ASSERTION(!sSingleton, "only one ContentChild per child");
// Once we start sending IPC messages, we need the thread manager to be
- // initialized so we can deal with the responses. Do that here before we
- // try to construct the crash reporter.
+ // initialized so we can deal with the responses. Do that here.
nsresult rv = nsThreadManager::get().Init();
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
@@ -600,15 +573,7 @@ ContentChild::Init(MessageLoop* aIOLoop,
void
ContentChild::InitProcessAttributes()
{
-#ifdef MOZ_WIDGET_GONK
- if (mIsForApp && !mIsForBrowser) {
- SetProcessName(NS_LITERAL_STRING("(Preallocated app)"), false);
- } else {
- SetProcessName(NS_LITERAL_STRING("Browser"), false);
- }
-#else
SetProcessName(NS_LITERAL_STRING("Web Content"), true);
-#endif
}
void
@@ -1250,192 +1215,11 @@ ContentChild::AllocPProcessHangMonitorChild(Transport* aTransport,
return CreateHangMonitorChild(aTransport, aOtherProcess);
}
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-
-#include <stdlib.h>
-
-static bool
-GetAppPaths(nsCString &aAppPath, nsCString &aAppBinaryPath, nsCString &aAppDir)
-{
- nsAutoCString appPath;
- nsAutoCString appBinaryPath(
- (CommandLine::ForCurrentProcess()->argv()[0]).c_str());
-
- nsAutoCString::const_iterator start, end;
- appBinaryPath.BeginReading(start);
- appBinaryPath.EndReading(end);
- if (RFindInReadable(NS_LITERAL_CSTRING(".app/Contents/MacOS/"), start, end)) {
- end = start;
- ++end; ++end; ++end; ++end;
- appBinaryPath.BeginReading(start);
- appPath.Assign(Substring(start, end));
- } else {
- return false;
- }
-
- nsCOMPtr<nsIFile> app, appBinary;
- nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(appPath),
- true, getter_AddRefs(app));
- if (NS_FAILED(rv)) {
- return false;
- }
- rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(appBinaryPath),
- true, getter_AddRefs(appBinary));
- if (NS_FAILED(rv)) {
- return false;
- }
-
- nsCOMPtr<nsIFile> appDir;
- nsCOMPtr<nsIProperties> dirSvc =
- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
- if (!dirSvc) {
- return false;
- }
- rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
- NS_GET_IID(nsIFile), getter_AddRefs(appDir));
- if (NS_FAILED(rv)) {
- return false;
- }
- bool exists;
- rv = appDir->Exists(&exists);
- if (NS_FAILED(rv) || !exists) {
- return false;
- }
-
- bool isLink;
- app->IsSymlink(&isLink);
- if (isLink) {
- app->GetNativeTarget(aAppPath);
- } else {
- app->GetNativePath(aAppPath);
- }
- appBinary->IsSymlink(&isLink);
- if (isLink) {
- appBinary->GetNativeTarget(aAppBinaryPath);
- } else {
- appBinary->GetNativePath(aAppBinaryPath);
- }
- appDir->IsSymlink(&isLink);
- if (isLink) {
- appDir->GetNativeTarget(aAppDir);
- } else {
- appDir->GetNativePath(aAppDir);
- }
-
- return true;
-}
-
-static bool
-StartMacOSContentSandbox()
-{
- int sandboxLevel = Preferences::GetInt("security.sandbox.content.level");
- if (sandboxLevel < 1) {
- return false;
- }
-
- nsAutoCString appPath, appBinaryPath, appDir;
- if (!GetAppPaths(appPath, appBinaryPath, appDir)) {
- MOZ_CRASH("Error resolving child process path");
- }
-
- // During sandboxed content process startup, before reaching
- // this point, NS_OS_TEMP_DIR is modified to refer to a sandbox-
- // writable temporary directory
- nsCOMPtr<nsIFile> tempDir;
- nsresult rv = nsDirectoryService::gService->Get(NS_OS_TEMP_DIR,
- NS_GET_IID(nsIFile), getter_AddRefs(tempDir));
- if (NS_FAILED(rv)) {
- MOZ_CRASH("Failed to get NS_OS_TEMP_DIR");
- }
-
- nsAutoCString tempDirPath;
- tempDir->Normalize();
- rv = tempDir->GetNativePath(tempDirPath);
- if (NS_FAILED(rv)) {
- MOZ_CRASH("Failed to get NS_OS_TEMP_DIR path");
- }
-
- nsCOMPtr<nsIFile> profileDir;
- ContentChild::GetSingleton()->GetProfileDir(getter_AddRefs(profileDir));
- nsCString profileDirPath;
- if (profileDir) {
- rv = profileDir->GetNativePath(profileDirPath);
- if (NS_FAILED(rv) || profileDirPath.IsEmpty()) {
- MOZ_CRASH("Failed to get profile path");
- }
- }
-
- MacSandboxInfo info;
- info.type = MacSandboxType_Content;
- info.level = info.level = sandboxLevel;
- info.appPath.assign(appPath.get());
- info.appBinaryPath.assign(appBinaryPath.get());
- info.appDir.assign(appDir.get());
- info.appTempDir.assign(tempDirPath.get());
-
- if (profileDir) {
- info.hasSandboxedProfile = true;
- info.profileDir.assign(profileDirPath.get());
- } else {
- info.hasSandboxedProfile = false;
- }
-
- std::string err;
- if (!mozilla::StartMacSandbox(info, err)) {
- NS_WARNING(err.c_str());
- MOZ_CRASH("sandbox_init() failed");
- }
-
- return true;
-}
-#endif
-
bool
ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
{
// We may want to move the sandbox initialization somewhere else
// at some point; see bug 880808.
-#if defined(MOZ_CONTENT_SANDBOX)
- bool sandboxEnabled = true;
-#if defined(XP_LINUX)
-#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 19
- // For B2G >= KitKat, sandboxing is mandatory; this has already
- // been enforced by ContentParent::StartUp().
- MOZ_ASSERT(SandboxInfo::Get().CanSandboxContent());
-#else
- // Otherwise, sandboxing is best-effort.
- if (!SandboxInfo::Get().CanSandboxContent()) {
- sandboxEnabled = false;
- } else {
- // This triggers the initialization of cubeb, which needs to happen
- // before seccomp is enabled (Bug 1259508). It also increases the startup
- // time of the content process, because cubeb is usually initialized
- // when it is actually needed. This call here is no longer required
- // once Bug 1104619 (remoting audio) is resolved.
- Unused << CubebUtils::GetCubebContext();
- }
-
-#endif /* MOZ_WIDGET_GONK && ANDROID_VERSION >= 19 */
- if (sandboxEnabled) {
- int brokerFd = -1;
- if (aBroker.type() == MaybeFileDesc::TFileDescriptor) {
- auto fd = aBroker.get_FileDescriptor().ClonePlatformHandle();
- brokerFd = fd.release();
- // brokerFd < 0 means to allow direct filesystem access, so
- // make absolutely sure that doesn't happen if the parent
- // didn't intend it.
- MOZ_RELEASE_ASSERT(brokerFd >= 0);
- }
- sandboxEnabled = SetContentProcessSandbox(brokerFd);
- }
-#elif defined(XP_WIN)
- mozilla::SandboxTarget::Instance()->StartSandbox();
-#elif defined(XP_MACOSX)
- sandboxEnabled = StartMacOSContentSandbox();
-#endif
-
-#endif /* MOZ_CONTENT_SANDBOX */
-
return true;
}
@@ -1453,15 +1237,6 @@ ContentChild::RecvNotifyLayerAllocated(const dom::TabId& aTabId, const uint64_t&
bool
ContentChild::RecvSpeakerManagerNotify()
{
-#ifdef MOZ_WIDGET_GONK
- // Only notify the process which has the SpeakerManager instance.
- RefPtr<SpeakerManagerService> service =
- SpeakerManagerService::GetSpeakerManagerService();
- if (service) {
- service->Notify();
- }
- return true;
-#endif
return false;
}
@@ -1719,19 +1494,6 @@ ContentChild::RecvNotifyEmptyHTTPCache()
return true;
}
-PCrashReporterChild*
-ContentChild::AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
- const uint32_t& processType)
-{
- return nullptr;
-}
-
-bool
-ContentChild::DeallocPCrashReporterChild(PCrashReporterChild* crashreporter)
-{
- delete crashreporter;
- return true;
-}
PHalChild*
ContentChild::AllocPHalChild()
@@ -2480,12 +2242,6 @@ ContentChild::RecvLastPrivateDocShellDestroyed()
bool
ContentChild::RecvVolumes(nsTArray<VolumeInfo>&& aVolumes)
{
-#ifdef MOZ_WIDGET_GONK
- RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
- if (vs) {
- vs->RecvVolumesFromParent(aVolumes);
- }
-#endif
return true;
}
@@ -2502,17 +2258,6 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
const bool& aIsRemovable,
const bool& aIsHotSwappable)
{
-#ifdef MOZ_WIDGET_GONK
- RefPtr<nsVolume> volume = new nsVolume(aFsName, aVolumeName, aState,
- aMountGeneration, aIsMediaPresent,
- aIsSharing, aIsFormatting, aIsFake,
- aIsUnmounting, aIsRemovable, aIsHotSwappable);
-
- RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
- if (vs) {
- vs->UpdateVolume(volume);
- }
-#else
// Remove warnings about unused arguments
Unused << aFsName;
Unused << aVolumeName;
@@ -2525,22 +2270,15 @@ ContentChild::RecvFileSystemUpdate(const nsString& aFsName,
Unused << aIsUnmounting;
Unused << aIsRemovable;
Unused << aIsHotSwappable;
-#endif
+
return true;
}
bool
ContentChild::RecvVolumeRemoved(const nsString& aFsName)
{
-#ifdef MOZ_WIDGET_GONK
- RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
- if (vs) {
- vs->RemoveVolumeByName(aFsName);
- }
-#else
// Remove warnings about unused arguments
Unused << aFsName;
-#endif
return true;
}
@@ -2666,61 +2404,6 @@ ContentChild::DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* actor)
}
bool
-ContentChild::RecvStartProfiler(const ProfilerInitParams& params)
-{
- nsTArray<const char*> featureArray;
- for (size_t i = 0; i < params.features().Length(); ++i) {
- featureArray.AppendElement(params.features()[i].get());
- }
-
- nsTArray<const char*> threadNameFilterArray;
- for (size_t i = 0; i < params.threadFilters().Length(); ++i) {
- threadNameFilterArray.AppendElement(params.threadFilters()[i].get());
- }
-
- profiler_start(params.entries(), params.interval(),
- featureArray.Elements(), featureArray.Length(),
- threadNameFilterArray.Elements(),
- threadNameFilterArray.Length());
-
- return true;
-}
-
-bool
-ContentChild::RecvStopProfiler()
-{
- profiler_stop();
- return true;
-}
-
-bool
-ContentChild::RecvPauseProfiler(const bool& aPause)
-{
- if (aPause) {
- profiler_pause();
- } else {
- profiler_resume();
- }
-
- return true;
-}
-
-bool
-ContentChild::RecvGatherProfile()
-{
- nsCString profileCString;
- UniquePtr<char[]> profile = profiler_get_profile();
- if (profile) {
- profileCString = nsCString(profile.get(), strlen(profile.get()));
- } else {
- profileCString = EmptyCString();
- }
-
- Unused << SendProfile(profileCString);
- return true;
-}
-
-bool
ContentChild::RecvLoadPluginResult(const uint32_t& aPluginId,
const bool& aResult)
{
@@ -2874,15 +2557,6 @@ ContentChild::RecvShutdown()
GetIPCChannel()->SetAbortOnError(false);
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (profiler_is_active()) {
- // We're shutting down while we were profiling. Send the
- // profile up to the parent so that we don't lose this
- // information.
- Unused << RecvGatherProfile();
- }
-#endif
-
// Start a timer that will insure we quickly exit after a reasonable
// period of time. Prevents shutdown hangs after our connection to the
// parent closes.
diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h
index cb718aff9..ba590b58e 100644
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -21,10 +21,6 @@
#include "nsWeakPtr.h"
#include "nsIWindowProvider.h"
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-#include "nsIFile.h"
-#endif
-
struct ChromePackage;
class nsIObserver;
struct SubstitutionMapping;
@@ -118,19 +114,6 @@ public:
void GetProcessName(nsACString& aName) const;
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
- void GetProfileDir(nsIFile** aProfileDir) const
- {
- *aProfileDir = mProfileDir;
- NS_IF_ADDREF(*aProfileDir);
- }
-
- void SetProfileDir(nsIFile* aProfileDir)
- {
- mProfileDir = aProfileDir;
- }
-#endif
-
bool IsAlive() const;
bool IsShuttingDown() const;
@@ -203,13 +186,6 @@ public:
virtual bool DeallocPBlobChild(PBlobChild* aActor) override;
- virtual PCrashReporterChild*
- AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
- const uint32_t& processType) override;
-
- virtual bool
- DeallocPCrashReporterChild(PCrashReporterChild*) override;
-
virtual PHalChild* AllocPHalChild() override;
virtual bool DeallocPHalChild(PHalChild*) override;
@@ -478,14 +454,6 @@ public:
virtual bool RecvUpdateWindow(const uintptr_t& aChildId) override;
- virtual bool RecvStartProfiler(const ProfilerInitParams& params) override;
-
- virtual bool RecvPauseProfiler(const bool& aPause) override;
-
- virtual bool RecvStopProfiler() override;
-
- virtual bool RecvGatherProfile() override;
-
virtual bool RecvDomainSetChanged(const uint32_t& aSetType,
const uint32_t& aChangeType,
const OptionalURIParams& aDomain) override;
@@ -679,10 +647,6 @@ private:
nsCOMPtr<nsIDomainPolicy> mPolicy;
nsCOMPtr<nsITimer> mForceKillTimer;
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
- nsCOMPtr<nsIFile> mProfileDir;
-#endif
-
// Hashtable to keep track of the pending GetFilesHelper objects.
// This GetFilesHelperChild objects are removed when RecvGetFilesResponse is
// received.
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index 73621df22..0a07147bf 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -16,18 +16,12 @@
# include <sys/resource.h>
#endif
-#ifdef MOZ_WIDGET_GONK
-#include <sys/types.h>
-#include <sys/wait.h>
-#endif
-
#include "chrome/common/process_watcher.h"
#include "mozilla/a11y/PDocAccessible.h"
#include "AppProcessChecker.h"
#include "AudioChannelService.h"
#include "BlobParent.h"
-#include "CrashReporterParent.h"
#include "GMPServiceParent.h"
#include "HandlerServiceParent.h"
#include "IHistory.h"
@@ -87,9 +81,6 @@
#include "mozilla/Preferences.h"
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/ProcessHangMonitorIPC.h"
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "mozilla/ProfileGatherer.h"
-#endif
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPtr.h"
@@ -210,14 +201,6 @@
# include "AndroidBridge.h"
#endif
-#ifdef MOZ_WIDGET_GONK
-#include "nsIVolume.h"
-#include "nsVolumeService.h"
-#include "nsIVolumeService.h"
-#include "SpeakerManagerService.h"
-using namespace mozilla::system;
-#endif
-
#ifdef MOZ_WIDGET_GTK
#include <gdk/gdk.h>
#endif
@@ -230,21 +213,10 @@ using namespace mozilla::system;
#include "mozilla/dom/SpeechSynthesisParent.h"
#endif
-#if defined(MOZ_CONTENT_SANDBOX) && defined(XP_LINUX)
-#include "mozilla/SandboxInfo.h"
-#include "mozilla/SandboxBroker.h"
-#include "mozilla/SandboxBrokerPolicyFactory.h"
-#endif
-
#ifdef MOZ_TOOLKIT_SEARCH
#include "nsIBrowserSearchService.h"
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
-#include "nsIProfiler.h"
-#include "nsIProfileSaveEvent.h"
-#endif
-
#ifdef XP_WIN
#include "mozilla/widget/AudioSession.h"
#endif
@@ -265,9 +237,6 @@ extern const char* kForceEnableE10sPref;
using base::ChildPrivileges;
using base::KillProcess;
-#ifdef MOZ_ENABLE_PROFILER_SPS
-using mozilla::ProfileGatherer;
-#endif
using namespace mozilla::dom::power;
using namespace mozilla::media;
@@ -503,9 +472,6 @@ nsTArray<ContentParent*>* ContentParent::sNonAppContentParents;
nsTArray<ContentParent*>* ContentParent::sLargeAllocationContentParents;
nsTArray<ContentParent*>* ContentParent::sPrivateContent;
StaticAutoPtr<LinkedList<ContentParent> > ContentParent::sContentParents;
-#if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
-UniquePtr<SandboxBrokerPolicyFactory> ContentParent::sSandboxBrokerPolicyFactory;
-#endif
// This is true when subprocess launching is enabled. This is the
// case between StartUp() and ShutDown() or JoinAllSubprocesses().
@@ -535,22 +501,9 @@ static const char* sObserverTopics[] = {
"child-mmu-request",
"last-pb-context-exited",
"file-watcher-update",
-#ifdef MOZ_WIDGET_GONK
- NS_VOLUME_STATE_CHANGED,
- NS_VOLUME_REMOVED,
- "phone-state-changed",
-#endif
#ifdef ACCESSIBILITY
"a11y-init-or-shutdown",
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- "profiler-started",
- "profiler-stopped",
- "profiler-paused",
- "profiler-resumed",
- "profiler-subprocess-gather",
- "profiler-subprocess",
-#endif
"cacheservice:empty-cache",
};
@@ -637,18 +590,6 @@ ContentParent::StartUp()
return;
}
-#if defined(MOZ_CONTENT_SANDBOX) && defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 19
- // Require sandboxing on B2G >= KitKat. This condition must stay
- // in sync with ContentChild::RecvSetProcessSandbox.
- if (!SandboxInfo::Get().CanSandboxContent()) {
- // MOZ_CRASH strings are only for debug builds; make sure the
- // message is clear on non-debug builds as well:
- printf_stderr("Sandboxing support is required on this platform. "
- "Recompile kernel with CONFIG_SECCOMP_FILTER=y\n");
- MOZ_CRASH("Sandboxing support is required on this platform.");
- }
-#endif
-
// Note: This reporter measures all ContentParents.
RegisterStrongMemoryReporter(new ContentParentsMemoryReporter());
@@ -662,10 +603,6 @@ ContentParent::StartUp()
PreallocatedProcessManager::AllocateAfterDelay();
sDisableUnsafeCPOWWarnings = PR_GetEnv("DISABLE_UNSAFE_CPOW_WARNINGS");
-
-#if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
- sSandboxBrokerPolicyFactory = MakeUnique<SandboxBrokerPolicyFactory>();
-#endif
}
/*static*/ void
@@ -674,10 +611,6 @@ ContentParent::ShutDown()
// No-op for now. We rely on normal process shutdown and
// ClearOnShutdown() to clean up our state.
sCanLaunchSubprocesses = false;
-
-#if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
- sSandboxBrokerPolicyFactory = nullptr;
-#endif
}
/*static*/ void
@@ -1353,26 +1286,6 @@ ContentParent::Init()
}
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- bool profilerActive = false;
- DebugOnly<nsresult> rv = profiler->IsActive(&profilerActive);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- if (profilerActive) {
- nsCOMPtr<nsIProfilerStartParams> currentProfilerParams;
- rv = profiler->GetStartParams(getter_AddRefs(currentProfilerParams));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- nsCOMPtr<nsISupports> gatherer;
- rv = profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-
- StartProfiler(currentProfilerParams);
- }
-#endif
-
RefPtr<GeckoMediaPluginServiceParent> gmps(GeckoMediaPluginServiceParent::GetSingleton());
gmps->UpdateContentProcessGMPCapabilities();
}
@@ -1384,14 +1297,6 @@ ContentParent::ForwardKnownInfo()
if (!mMetamorphosed) {
return;
}
-#ifdef MOZ_WIDGET_GONK
- InfallibleTArray<VolumeInfo> volumeInfo;
- RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
- if (vs) {
- vs->GetVolumesForIPC(&volumeInfo);
- Unused << SendVolumes(volumeInfo);
- }
-#endif /* MOZ_WIDGET_GONK */
}
namespace {
@@ -1439,23 +1344,6 @@ bool
ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority)
{
ProcessPriorityManager::SetProcessPriority(this, aPriority);
-
- // Now that we've set this process's priority, check whether the process is
- // still alive. Hopefully we've set the priority to FOREGROUND*, so the
- // process won't unexpectedly crash after this point!
- //
- // Bug 943174: use waitid() with WNOWAIT so that, if the process
- // did exit, we won't consume its zombie and confuse the
- // GeckoChildProcessHost dtor.
-#ifdef MOZ_WIDGET_GONK
- siginfo_t info;
- info.si_pid = 0;
- if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0
- && info.si_pid != 0) {
- return false;
- }
-#endif
-
return true;
}
@@ -1824,12 +1712,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
mConsoleService = nullptr;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (mGatherer && !mProfile.IsEmpty()) {
- mGatherer->OOPExitProfile(mProfile);
- }
-#endif
-
if (obs) {
RefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
@@ -2106,7 +1988,7 @@ ContentParent::ContentParent(mozIApplication* aApp,
// PID along with the warning.
nsDebugImpl::SetMultiprocessMode("Parent");
-#if defined(XP_WIN) && !defined(MOZ_B2G)
+#if defined(XP_WIN)
// Request Windows message deferral behavior on our side of the PContent
// channel. Generally only applies to the situation where we get caught in
// a deadlock with the plugin process when sending CPOWs.
@@ -2244,37 +2126,6 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
}
}
-#ifdef MOZ_CONTENT_SANDBOX
- bool shouldSandbox = true;
- MaybeFileDesc brokerFd = void_t();
-#ifdef XP_LINUX
- // XXX: Checking the pref here makes it possible to enable/disable sandboxing
- // during an active session. Currently the pref is only used for testing
- // purpose. If the decision is made to permanently rely on the pref, this
- // should be changed so that it is required to restart firefox for the change
- // of value to take effect.
- shouldSandbox = (Preferences::GetInt("security.sandbox.content.level") > 0) &&
- !PR_GetEnv("MOZ_DISABLE_CONTENT_SANDBOX");
-
- if (shouldSandbox) {
- MOZ_ASSERT(!mSandboxBroker);
- UniquePtr<SandboxBroker::Policy> policy =
- sSandboxBrokerPolicyFactory->GetContentPolicy(Pid());
- if (policy) {
- brokerFd = FileDescriptor();
- mSandboxBroker = SandboxBroker::Create(Move(policy), Pid(), brokerFd);
- if (!mSandboxBroker) {
- KillHard("SandboxBroker::Create failed");
- return;
- }
- MOZ_ASSERT(static_cast<const FileDescriptor&>(brokerFd).IsValid());
- }
- }
-#endif
- if (shouldSandbox && !SendSetProcessSandbox(brokerFd)) {
- KillHard("SandboxInitFailed");
- }
-#endif
#if defined(XP_WIN)
// Send the info needed to join the browser process's audio session.
nsID id;
@@ -2660,27 +2511,6 @@ ContentParent::Observe(nsISupports* aSubject,
NS_ASSERTION(!mSubprocess, "Close should have nulled mSubprocess");
}
-#ifdef MOZ_ENABLE_PROFILER_SPS
- // Need to do this before the mIsAlive check to avoid missing profiles.
- if (!strcmp(aTopic, "profiler-subprocess-gather")) {
- if (mGatherer) {
- mGatherer->WillGatherOOPProfile();
- if (mIsAlive && mSubprocess) {
- Unused << SendGatherProfile();
- }
- }
- }
- else if (!strcmp(aTopic, "profiler-subprocess")) {
- nsCOMPtr<nsIProfileSaveEvent> pse = do_QueryInterface(aSubject);
- if (pse) {
- if (!mProfile.IsEmpty()) {
- pse->AddSubProfile(mProfile.get());
- mProfile.Truncate();
- }
- }
- }
-#endif
-
if (!mIsAlive || !mSubprocess)
return NS_OK;
@@ -2746,50 +2576,6 @@ ContentParent::Observe(nsISupports* aSubject,
else if (!strcmp(aTopic, "last-pb-context-exited")) {
Unused << SendLastPrivateDocShellDestroyed();
}
-#ifdef MOZ_WIDGET_GONK
- else if(!strcmp(aTopic, NS_VOLUME_STATE_CHANGED)) {
- nsCOMPtr<nsIVolume> vol = do_QueryInterface(aSubject);
- if (!vol) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsString volName;
- nsString mountPoint;
- int32_t state;
- int32_t mountGeneration;
- bool isMediaPresent;
- bool isSharing;
- bool isFormatting;
- bool isFake;
- bool isUnmounting;
- bool isRemovable;
- bool isHotSwappable;
-
- vol->GetName(volName);
- vol->GetMountPoint(mountPoint);
- vol->GetState(&state);
- vol->GetMountGeneration(&mountGeneration);
- vol->GetIsMediaPresent(&isMediaPresent);
- vol->GetIsSharing(&isSharing);
- vol->GetIsFormatting(&isFormatting);
- vol->GetIsFake(&isFake);
- vol->GetIsUnmounting(&isUnmounting);
- vol->GetIsRemovable(&isRemovable);
- vol->GetIsHotSwappable(&isHotSwappable);
-
- Unused << SendFileSystemUpdate(volName, mountPoint, state,
- mountGeneration, isMediaPresent,
- isSharing, isFormatting, isFake,
- isUnmounting, isRemovable, isHotSwappable);
- } else if (!strcmp(aTopic, "phone-state-changed")) {
- nsString state(aData);
- Unused << SendNotifyPhoneStateChange(state);
- }
- else if(!strcmp(aTopic, NS_VOLUME_REMOVED)) {
- nsString volName(aData);
- Unused << SendVolumeRemoved(volName);
- }
-#endif
#ifdef ACCESSIBILITY
else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) {
if (*aData == '1') {
@@ -2811,22 +2597,6 @@ ContentParent::Observe(nsISupports* aSubject,
}
}
#endif
-#ifdef MOZ_ENABLE_PROFILER_SPS
- else if (!strcmp(aTopic, "profiler-started")) {
- nsCOMPtr<nsIProfilerStartParams> params(do_QueryInterface(aSubject));
- StartProfiler(params);
- }
- else if (!strcmp(aTopic, "profiler-stopped")) {
- mGatherer = nullptr;
- Unused << SendStopProfiler();
- }
- else if (!strcmp(aTopic, "profiler-paused")) {
- Unused << SendPauseProfiler(true);
- }
- else if (!strcmp(aTopic, "profiler-resumed")) {
- Unused << SendPauseProfiler(false);
- }
-#endif
else if (!strcmp(aTopic, "cacheservice:empty-cache")) {
Unused << SendNotifyEmptyHTTPCache();
}
@@ -3100,29 +2870,6 @@ ContentParent::FriendlyName(nsAString& aName, bool aAnonymize)
}
}
-PCrashReporterParent*
-ContentParent::AllocPCrashReporterParent(const NativeThreadId& tid,
- const uint32_t& processType)
-{
- return nullptr;
-}
-
-bool
-ContentParent::RecvPCrashReporterConstructor(PCrashReporterParent* actor,
- const NativeThreadId& tid,
- const uint32_t& processType)
-{
- static_cast<CrashReporterParent*>(actor)->SetChildData(tid, processType);
- return true;
-}
-
-bool
-ContentParent::DeallocPCrashReporterParent(PCrashReporterParent* crashreporter)
-{
- delete crashreporter;
- return true;
-}
-
hal_sandbox::PHalParent*
ContentParent::AllocPHalParent()
{
@@ -3224,11 +2971,15 @@ PPrintingParent*
ContentParent::AllocPPrintingParent()
{
#ifdef NS_PRINTING
- MOZ_ASSERT(!mPrintingParent,
- "Only one PrintingParent should be created per process.");
+ MOZ_RELEASE_ASSERT(!mPrintingParent,
+ "Only one PrintingParent should be created per process.");
// Create the printing singleton for this process.
mPrintingParent = new PrintingParent();
+
+ // Take another reference for IPDL code.
+ mPrintingParent.get()->AddRef();
+
return mPrintingParent.get();
#else
MOZ_ASSERT_UNREACHABLE("Should never be created if no printing.");
@@ -3240,8 +2991,11 @@ bool
ContentParent::DeallocPPrintingParent(PPrintingParent* printing)
{
#ifdef NS_PRINTING
- MOZ_ASSERT(mPrintingParent == printing,
- "Only one PrintingParent should have been created per process.");
+ MOZ_RELEASE_ASSERT(mPrintingParent == printing,
+ "Only one PrintingParent should have been created per process.");
+
+ // Release reference taken for IPDL code.
+ static_cast<PrintingParent*>(printing)->Release();
mPrintingParent = nullptr;
#else
@@ -3451,29 +3205,12 @@ ContentParent::RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor)
bool
ContentParent::RecvSpeakerManagerGetSpeakerStatus(bool* aValue)
{
-#ifdef MOZ_WIDGET_GONK
- *aValue = false;
- RefPtr<SpeakerManagerService> service =
- SpeakerManagerService::GetOrCreateSpeakerManagerService();
- MOZ_ASSERT(service);
-
- *aValue = service->GetSpeakerStatus();
- return true;
-#endif
return false;
}
bool
ContentParent::RecvSpeakerManagerForceSpeaker(const bool& aEnable)
{
-#ifdef MOZ_WIDGET_GONK
- RefPtr<SpeakerManagerService> service =
- SpeakerManagerService::GetOrCreateSpeakerManagerService();
- MOZ_ASSERT(service);
- service->ForceSpeaker(aEnable, mChildID);
-
- return true;
-#endif
return false;
}
@@ -3636,13 +3373,13 @@ ContentParent::RecvIsSecureURI(const uint32_t& type,
}
bool
-ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive, const bool& aHSTSPriming)
+ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive)
{
nsCOMPtr<nsIURI> ourURI = DeserializeURI(aURI);
if (!ourURI) {
return false;
}
- nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive, aHSTSPriming);
+ nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive);
return true;
}
@@ -4029,49 +3766,22 @@ bool
ContentParent::RecvCreateFakeVolume(const nsString& fsName,
const nsString& mountPoint)
{
-#ifdef MOZ_WIDGET_GONK
- nsresult rv;
- nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
- if (vs) {
- vs->CreateFakeVolume(fsName, mountPoint);
- }
- return true;
-#else
- NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined");
+ NS_WARNING("ContentParent::RecvCreateFakeVolume shouldn't be called");
return false;
-#endif
}
bool
ContentParent::RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState)
{
-#ifdef MOZ_WIDGET_GONK
- nsresult rv;
- nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
- if (vs) {
- vs->SetFakeVolumeState(fsName, fsState);
- }
- return true;
-#else
- NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called when MOZ_WIDGET_GONK is not defined");
+ NS_WARNING("ContentParent::RecvSetFakeVolumeState shouldn't be called");
return false;
-#endif
}
bool
ContentParent::RecvRemoveFakeVolume(const nsString& fsName)
{
-#ifdef MOZ_WIDGET_GONK
- nsresult rv;
- nsCOMPtr<nsIVolumeService> vs = do_GetService(NS_VOLUMESERVICE_CONTRACTID, &rv);
- if (vs) {
- vs->RemoveFakeVolume(fsName);
- }
- return true;
-#else
- NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called when MOZ_WIDGET_GONK is not defined");
+ NS_WARNING("ContentParent::RecvRemoveFakeVolume shouldn't be called");
return false;
-#endif
}
bool
@@ -4765,19 +4475,6 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
}
bool
-ContentParent::RecvProfile(const nsCString& aProfile)
-{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (NS_WARN_IF(!mGatherer)) {
- return true;
- }
- mProfile = aProfile;
- mGatherer->GatheredOOPProfile();
-#endif
- return true;
-}
-
-bool
ContentParent::RecvGetGraphicsDeviceInitData(ContentDeviceData* aOut)
{
gfxPlatform::GetPlatform()->BuildContentDeviceData(aOut);
@@ -4863,34 +4560,6 @@ ContentParent::RecvNotifyBenchmarkResult(const nsString& aCodecName,
return true;
}
-void
-ContentParent::StartProfiler(nsIProfilerStartParams* aParams)
-{
-#ifdef MOZ_ENABLE_PROFILER_SPS
- if (NS_WARN_IF(!aParams)) {
- return;
- }
-
- ProfilerInitParams ipcParams;
-
- ipcParams.enabled() = true;
- aParams->GetEntries(&ipcParams.entries());
- aParams->GetInterval(&ipcParams.interval());
- ipcParams.features() = aParams->GetFeatures();
- ipcParams.threadFilters() = aParams->GetThreadFilterNames();
-
- Unused << SendStartProfiler(ipcParams);
-
- nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
- if (NS_WARN_IF(!profiler)) {
- return;
- }
- nsCOMPtr<nsISupports> gatherer;
- profiler->GetProfileGatherer(getter_AddRefs(gatherer));
- mGatherer = static_cast<ProfileGatherer*>(gatherer.get());
-#endif
-}
-
bool
ContentParent::RecvNotifyPushObservers(const nsCString& aScope,
const IPC::Principal& aPrincipal,
@@ -5052,6 +4721,14 @@ ContentParent::RecvGetFilesRequest(const nsID& aUUID,
{
MOZ_ASSERT(!mGetFilesPendingRequests.GetWeak(aUUID));
+ if (!mozilla::Preferences::GetBool("dom.filesystem.pathcheck.disabled", false)) {
+ RefPtr<FileSystemSecurity> fss = FileSystemSecurity::Get();
+ if (NS_WARN_IF(!fss ||
+ !fss->ContentProcessHasAccessTo(ChildID(), aDirectoryPath))) {
+ return false;
+ }
+ }
+
ErrorResult rv;
RefPtr<GetFilesHelper> helper =
GetFilesHelperParent::Create(aUUID, aDirectoryPath, aRecursiveFlag, this,
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index a3750de1a..abcea0b65 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -42,14 +42,6 @@ class nsIWidget;
namespace mozilla {
class PRemoteSpellcheckEngineParent;
-#ifdef MOZ_ENABLE_PROFILER_SPS
-class ProfileGatherer;
-#endif
-
-#if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
-class SandboxBroker;
-class SandboxBrokerPolicyFactory;
-#endif
namespace embedding {
class PrintingParent;
@@ -377,15 +369,6 @@ public:
virtual void OnChannelError() override;
- virtual PCrashReporterParent*
- AllocPCrashReporterParent(const NativeThreadId& tid,
- const uint32_t& processType) override;
-
- virtual bool
- RecvPCrashReporterConstructor(PCrashReporterParent* actor,
- const NativeThreadId& tid,
- const uint32_t& processType) override;
-
virtual PNeckoParent* AllocPNeckoParent() override;
virtual bool RecvPNeckoConstructor(PNeckoParent* aActor) override
@@ -740,9 +723,6 @@ private:
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;
- virtual bool
- DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override;
-
virtual bool RecvNSSU2FTokenIsCompatibleVersion(const nsString& aVersion,
bool* aIsCompatible) override;
@@ -762,8 +742,7 @@ private:
const uint32_t& aFlags, bool* aIsSecureURI) override;
virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI,
- const bool& aActive,
- const bool& aHSTSPriming) override;
+ const bool& aActive) override;
virtual bool DeallocPHalParent(PHalParent*) override;
@@ -1035,12 +1014,8 @@ private:
virtual bool RecvUpdateDropEffect(const uint32_t& aDragAction,
const uint32_t& aDropEffect) override;
- virtual bool RecvProfile(const nsCString& aProfile) override;
-
virtual bool RecvGetGraphicsDeviceInitData(ContentDeviceData* aOut) override;
- void StartProfiler(nsIProfilerStartParams* aParams);
-
virtual bool RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo) override;
virtual bool RecvNotifyBenchmarkResult(const nsString& aCodecName,
@@ -1145,19 +1120,10 @@ private:
PProcessHangMonitorParent* mHangMonitorActor;
-#ifdef MOZ_ENABLE_PROFILER_SPS
- RefPtr<mozilla::ProfileGatherer> mGatherer;
-#endif
nsCString mProfile;
UniquePtr<gfx::DriverCrashGuard> mDriverCrashGuard;
-#if defined(XP_LINUX) && defined(MOZ_CONTENT_SANDBOX)
- mozilla::UniquePtr<SandboxBroker> mSandboxBroker;
- static mozilla::UniquePtr<SandboxBrokerPolicyFactory>
- sSandboxBrokerPolicyFactory;
-#endif
-
#ifdef NS_PRINTING
RefPtr<embedding::PrintingParent> mPrintingParent;
#endif
diff --git a/dom/ipc/ContentProcess.cpp b/dom/ipc/ContentProcess.cpp
index 2413d8808..986617f55 100644
--- a/dom/ipc/ContentProcess.cpp
+++ b/dom/ipc/ContentProcess.cpp
@@ -8,122 +8,17 @@
#include "ContentProcess.h"
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-#include <stdlib.h>
-#endif
-
-#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
-#include "mozilla/Preferences.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsDirectoryService.h"
-#include "nsDirectoryServiceDefs.h"
-#endif
-
using mozilla::ipc::IOThreadChild;
namespace mozilla {
namespace dom {
-#if defined(XP_WIN) && defined(MOZ_CONTENT_SANDBOX)
-static bool
-IsSandboxTempDirRequired()
-{
- // On Windows, a sandbox-writable temp directory is only used
- // when sandbox pref level >= 1.
- return Preferences::GetInt("security.sandbox.content.level") >= 1;
-}
-
-static void
-SetTmpEnvironmentVariable(nsIFile* aValue)
-{
- // Save the TMP environment variable so that is is picked up by GetTempPath().
- // Note that we specifically write to the TMP variable, as that is the first
- // variable that is checked by GetTempPath() to determine its output.
- nsAutoString fullTmpPath;
- nsresult rv = aValue->GetPath(fullTmpPath);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return;
- }
- Unused << NS_WARN_IF(!SetEnvironmentVariableW(L"TMP", fullTmpPath.get()));
- // We also set TEMP in case there is naughty third-party code that is
- // referencing the environment variable directly.
- Unused << NS_WARN_IF(!SetEnvironmentVariableW(L"TEMP", fullTmpPath.get()));
-}
-#endif
-
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-static bool
-IsSandboxTempDirRequired()
-{
- // On OSX, use the sandbox-writable temp when the pref level >= 1.
- return (Preferences::GetInt("security.sandbox.content.level") >= 1);
-}
-
-static void
-SetTmpEnvironmentVariable(nsIFile* aValue)
-{
- nsAutoCString fullTmpPath;
- nsresult rv = aValue->GetNativePath(fullTmpPath);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return;
- }
- Unused << NS_WARN_IF(setenv("TMPDIR", fullTmpPath.get(), 1) != 0);
-}
-#endif
-
-#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
-static void
-SetUpSandboxEnvironment()
-{
- MOZ_ASSERT(nsDirectoryService::gService,
- "SetUpSandboxEnvironment relies on nsDirectoryService being initialized");
-
- if (!IsSandboxTempDirRequired()) {
- return;
- }
-
- nsCOMPtr<nsIFile> sandboxedContentTemp;
- nsresult rv =
- nsDirectoryService::gService->Get(NS_APP_CONTENT_PROCESS_TEMP_DIR,
- NS_GET_IID(nsIFile),
- getter_AddRefs(sandboxedContentTemp));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return;
- }
-
- // Change the gecko defined temp directory to our sandbox-writable one.
- // Undefine returns a failure if the property is not already set.
- Unused << nsDirectoryService::gService->Undefine(NS_OS_TEMP_DIR);
- rv = nsDirectoryService::gService->Set(NS_OS_TEMP_DIR, sandboxedContentTemp);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return;
- }
-
- SetTmpEnvironmentVariable(sandboxedContentTemp);
-}
-#endif
-
void
ContentProcess::SetAppDir(const nsACString& aPath)
{
mXREEmbed.SetAppDir(aPath);
}
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
-void
-ContentProcess::SetProfile(const nsACString& aProfile)
-{
- bool flag;
- nsresult rv =
- XRE_GetFileFromPath(aProfile.BeginReading(), getter_AddRefs(mProfileDir));
- if (NS_FAILED(rv) ||
- NS_FAILED(mProfileDir->Exists(&flag)) || !flag) {
- NS_WARNING("Invalid profile directory passed to content process.");
- mProfileDir = nullptr;
- }
-}
-#endif
-
bool
ContentProcess::Init()
{
@@ -134,14 +29,6 @@ ContentProcess::Init()
mContent.InitXPCOM();
mContent.InitGraphicsDeviceData();
-#if (defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
- mContent.SetProfileDir(mProfileDir);
-#endif
-
-#if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_CONTENT_SANDBOX)
- SetUpSandboxEnvironment();
-#endif
-
return true;
}
diff --git a/dom/ipc/ContentProcess.h b/dom/ipc/ContentProcess.h
index bf9968f8c..3950368bd 100644
--- a/dom/ipc/ContentProcess.h
+++ b/dom/ipc/ContentProcess.h
@@ -39,18 +39,10 @@ public:
void SetAppDir(const nsACString& aPath);
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
- void SetProfile(const nsACString& aProfile);
-#endif
-
private:
ContentChild mContent;
mozilla::ipc::ScopedXREEmbed mXREEmbed;
-#if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
- nsCOMPtr<nsIFile> mProfileDir;
-#endif
-
#if defined(XP_WIN)
// This object initializes and configures COM.
mozilla::mscom::MainThreadRuntime mCOMRuntime;
diff --git a/dom/ipc/CrashReporterChild.cpp b/dom/ipc/CrashReporterChild.cpp
deleted file mode 100644
index 8174452e7..000000000
--- a/dom/ipc/CrashReporterChild.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-#include "mozilla/plugins/PluginModuleChild.h"
-#include "ContentChild.h"
-#include "CrashReporterChild.h"
-#include "nsXULAppAPI.h"
-
-using mozilla::plugins::PluginModuleChild;
-
-namespace mozilla {
-namespace dom {
-
-/*static*/
-PCrashReporterChild*
-CrashReporterChild::GetCrashReporter()
-{
- const ManagedContainer<PCrashReporterChild>* reporters = nullptr;
- switch (XRE_GetProcessType()) {
- case GeckoProcessType_Content: {
- ContentChild* child = ContentChild::GetSingleton();
- reporters = &child->ManagedPCrashReporterChild();
- break;
- }
- case GeckoProcessType_Plugin: {
- PluginModuleChild* child = PluginModuleChild::GetChrome();
- reporters = &child->ManagedPCrashReporterChild();
- break;
- }
- default:
- break;
- }
- if (!reporters) {
- return nullptr;
- }
- return LoneManagedOrNullAsserts(*reporters);
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/ipc/CrashReporterChild.h b/dom/ipc/CrashReporterChild.h
deleted file mode 100644
index 96355ca11..000000000
--- a/dom/ipc/CrashReporterChild.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_CrashReporterChild_h
-#define mozilla_dom_CrashReporterChild_h
-
-#include "mozilla/dom/PCrashReporterChild.h"
-
-namespace mozilla {
-namespace dom {
-
-class CrashReporterChild :
- public PCrashReporterChild
-{
-public:
- CrashReporterChild() {
- MOZ_COUNT_CTOR(CrashReporterChild);
- }
- ~CrashReporterChild() {
- MOZ_COUNT_DTOR(CrashReporterChild);
- }
-
- static PCrashReporterChild* GetCrashReporter();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_CrashReporterChild_h
diff --git a/dom/ipc/CrashReporterParent.cpp b/dom/ipc/CrashReporterParent.cpp
deleted file mode 100644
index 677b29670..000000000
--- a/dom/ipc/CrashReporterParent.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-#include "CrashReporterParent.h"
-#include "mozilla/Sprintf.h"
-#include "mozilla/dom/ContentParent.h"
-#include "mozilla/ipc/CrashReporterHost.h"
-#include "nsAutoPtr.h"
-#include "nsXULAppAPI.h"
-#include <time.h>
-
-#include "mozilla/Telemetry.h"
-
-namespace mozilla {
-namespace dom {
-
-using namespace mozilla::ipc;
-
-void
-CrashReporterParent::AnnotateCrashReport(const nsCString& key,
- const nsCString& data)
-{
-}
-
-void
-CrashReporterParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- // Implement me! Bug 1005155
-}
-
-bool
-CrashReporterParent::RecvAppendAppNotes(const nsCString& data)
-{
- mAppNotes.Append(data);
- return true;
-}
-
-CrashReporterParent::CrashReporterParent()
- :
- mStartTime(::time(nullptr))
- , mInitialized(false)
-{
- MOZ_COUNT_CTOR(CrashReporterParent);
-}
-
-CrashReporterParent::~CrashReporterParent()
-{
- MOZ_COUNT_DTOR(CrashReporterParent);
-}
-
-void
-CrashReporterParent::SetChildData(const NativeThreadId& tid,
- const uint32_t& processType)
-{
- mInitialized = true;
- mMainThread = tid;
- mProcessType = GeckoProcessType(processType);
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/ipc/CrashReporterParent.h b/dom/ipc/CrashReporterParent.h
deleted file mode 100644
index 71896c5c1..000000000
--- a/dom/ipc/CrashReporterParent.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_CrashReporterParent_h
-#define mozilla_dom_CrashReporterParent_h
-
-#include "mozilla/dom/PCrashReporterParent.h"
-#include "mozilla/dom/TabMessageUtils.h"
-#include "nsIFile.h"
-
-namespace mozilla {
-namespace dom {
-
-class CrashReporterParent : public PCrashReporterParent
-{
-public:
- CrashReporterParent();
- virtual ~CrashReporterParent();
-
- /*
- * Initialize this reporter with data from the child process.
- */
- void
- SetChildData(const NativeThreadId& id, const uint32_t& processType);
-
- /*
- * Returns the ID of the child minidump.
- * GeneratePairedMinidump or GenerateCrashReport must be called first.
- */
- const nsString& ChildDumpID() const {
- return mChildDumpID;
- }
-
- /*
- * Add an annotation to our internally tracked list of annotations.
- * Callers must apply these notes using GenerateChildData otherwise
- * the notes will get dropped.
- */
- void
- AnnotateCrashReport(const nsCString& aKey, const nsCString& aData);
-
- protected:
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool RecvAnnotateCrashReport(const nsCString& aKey,
- const nsCString& aData) override
- {
- AnnotateCrashReport(aKey, aData);
- return true;
- }
-
- virtual bool RecvAppendAppNotes(const nsCString& aData) override;
-
- nsCString mAppNotes;
- nsString mChildDumpID;
- // stores the child main thread id
- NativeThreadId mMainThread;
- time_t mStartTime;
- // stores the child process type
- GeckoProcessType mProcessType;
- bool mInitialized;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_CrashReporterParent_h
diff --git a/dom/ipc/DatePickerParent.cpp b/dom/ipc/DatePickerParent.cpp
deleted file mode 100644
index 509944ddd..000000000
--- a/dom/ipc/DatePickerParent.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "DatePickerParent.h"
-#include "nsComponentManagerUtils.h"
-#include "nsIDocument.h"
-#include "nsIDOMWindow.h"
-#include "mozilla/Unused.h"
-#include "mozilla/dom/Element.h"
-#include "mozilla/dom/TabParent.h"
-
-using mozilla::Unused;
-using namespace mozilla::dom;
-
-NS_IMPL_ISUPPORTS(DatePickerParent::DatePickerShownCallback,
- nsIDatePickerShownCallback);
-
-NS_IMETHODIMP
-DatePickerParent::DatePickerShownCallback::Cancel()
-{
- if (mDatePickerParent) {
- Unused << mDatePickerParent->SendCancel();
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DatePickerParent::DatePickerShownCallback::Done(const nsAString& aDate)
-{
- if (mDatePickerParent) {
- Unused << mDatePickerParent->Send__delete__(mDatePickerParent,
- nsString(aDate));
- }
- return NS_OK;
-}
-
-void
-DatePickerParent::DatePickerShownCallback::Destroy()
-{
- mDatePickerParent = nullptr;
-}
-
-bool
-DatePickerParent::CreateDatePicker()
-{
- mPicker = do_CreateInstance("@mozilla.org/datepicker;1");
- if (!mPicker) {
- return false;
- }
-
- Element* ownerElement = TabParent::GetFrom(Manager())->GetOwnerElement();
- if (!ownerElement) {
- return false;
- }
-
- nsCOMPtr<mozIDOMWindowProxy> window = do_QueryInterface(ownerElement->OwnerDoc()->GetWindow());
- if (!window) {
- return false;
- }
-
- return NS_SUCCEEDED(mPicker->Init(window, mTitle, mInitialDate));
-}
-
-bool
-DatePickerParent::RecvOpen()
-{
- if (!CreateDatePicker()) {
- Unused << Send__delete__(this, mInitialDate);
- return true;
- }
-
- mCallback = new DatePickerShownCallback(this);
-
- mPicker->Open(mCallback);
- return true;
-};
-
-void
-DatePickerParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- if (mCallback) {
- mCallback->Destroy();
- }
-}
diff --git a/dom/ipc/DatePickerParent.h b/dom/ipc/DatePickerParent.h
deleted file mode 100644
index 73b66f96c..000000000
--- a/dom/ipc/DatePickerParent.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_DatePickerParent_h
-#define mozilla_dom_DatePickerParent_h
-
-#include "mozilla/dom/PDatePickerParent.h"
-#include "nsIDatePicker.h"
-
-namespace mozilla {
-namespace dom {
-
-class DatePickerParent : public PDatePickerParent
-{
- public:
- DatePickerParent(const nsString& aTitle,
- const nsString& aInitialDate)
- : mTitle(aTitle)
- , mInitialDate(aInitialDate)
- {}
-
- virtual bool RecvOpen() override;
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
- class DatePickerShownCallback final
- : public nsIDatePickerShownCallback
- {
- public:
- explicit DatePickerShownCallback(DatePickerParent* aDatePickerParnet)
- : mDatePickerParent(aDatePickerParnet)
- {}
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIDATEPICKERSHOWNCALLBACK
-
- void Destroy();
-
- private:
- ~DatePickerShownCallback() {}
- DatePickerParent* mDatePickerParent;
- };
-
- private:
- virtual ~DatePickerParent() {}
-
- bool CreateDatePicker();
-
- RefPtr<DatePickerShownCallback> mCallback;
- nsCOMPtr<nsIDatePicker> mPicker;
-
- nsString mTitle;
- nsString mInitialDate;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_DatePickerParent_h
diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl
index 9dfccbc5c..f09e484ee 100644
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -9,7 +9,6 @@ include protocol PBlob;
include protocol PColorPicker;
include protocol PContent;
include protocol PContentBridge;
-include protocol PDatePicker;
include protocol PDocAccessible;
include protocol PFilePicker;
include protocol PIndexedDBPermissionRequest;
@@ -116,7 +115,6 @@ nested(upto inside_cpow) sync protocol PBrowser
manager PContent or PContentBridge;
manages PColorPicker;
- manages PDatePicker;
manages PDocAccessible;
manages PFilePicker;
manages PIndexedDBPermissionRequest;
@@ -441,12 +439,6 @@ parent:
*/
async PColorPicker(nsString title, nsString initialColor);
- /**
- * Create an asynchronous date picker on the parent side,
- * but don't open it yet.
- */
- async PDatePicker(nsString title, nsString initialDate);
-
async PFilePicker(nsString aTitle, int16_t aMode);
/**
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index d436c19fe..c01ad59c1 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -11,7 +11,6 @@ include protocol PCompositorBridge;
include protocol PContentBridge;
include protocol PContentPermissionRequest;
include protocol PCycleCollectWithLogs;
-include protocol PCrashReporter;
include protocol PPSMContentDownloader;
include protocol PExternalHelperApp;
include protocol PHandlerService;
@@ -243,7 +242,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PBlob;
manages PBrowser;
manages PContentPermissionRequest;
- manages PCrashReporter;
manages PCycleCollectWithLogs;
manages PPSMContentDownloader;
manages PExternalHelperApp;
@@ -466,15 +464,6 @@ child:
*/
async LoadPluginResult(uint32_t aPluginId, bool aResult);
- /**
- * Control the Gecko Profiler in the child process.
- */
- async StartProfiler(ProfilerInitParams params);
- async StopProfiler();
- async PauseProfiler(bool aPause);
-
- async GatherProfile();
-
async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action);
async EndDragSession(bool aDoneDrag, bool aUserCancelled,
@@ -625,8 +614,6 @@ parent:
async PRemoteSpellcheckEngine();
- sync PCrashReporter(NativeThreadId tid, uint32_t processType);
-
/**
* Is this token compatible with the provided version?
*
@@ -674,7 +661,7 @@ parent:
sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
returns (bool isSecureURI);
- async AccumulateMixedContentHSTS(URIParams uri, bool active, bool hasHSTSPriming);
+ async AccumulateMixedContentHSTS(URIParams uri, bool active);
sync GetLookAndFeelCache()
returns (LookAndFeelInt[] lookAndFeelIntCache);
@@ -962,8 +949,6 @@ parent:
async PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
TabId tabId);
- async Profile(nsCString aProfile);
-
/**
* Request graphics initialization information from the parent.
*/
diff --git a/dom/ipc/PCrashReporter.ipdl b/dom/ipc/PCrashReporter.ipdl
deleted file mode 100644
index 8f965f2ee..000000000
--- a/dom/ipc/PCrashReporter.ipdl
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set sw=4 ts=8 et tw=80 :
- * 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/. */
-
-include protocol PContent;
-include protocol PPluginModule;
-include protocol PGMP;
-
-namespace mozilla {
-namespace dom {
-
-struct Mapping {
- nsCString library_name;
- nsCString file_id;
- uintptr_t start_address;
- size_t mapping_length;
- size_t file_offset;
-};
-
-async protocol PCrashReporter {
- manager PContent or PPluginModule or PGMP;
-parent:
- async AnnotateCrashReport(nsCString key, nsCString data);
- async AppendAppNotes(nsCString data);
- async __delete__();
-};
-
-}
-}
diff --git a/dom/ipc/PDatePicker.ipdl b/dom/ipc/PDatePicker.ipdl
deleted file mode 100644
index 90a2654bb..000000000
--- a/dom/ipc/PDatePicker.ipdl
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
-
-/* 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/. */
-
-include protocol PBrowser;
-
-namespace mozilla {
-namespace dom {
-
-protocol PDatePicker
-{
- manager PBrowser;
-
-parent:
- async Open();
-
-child:
- async Cancel();
-
- async __delete__(nsString color);
-};
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/ipc/StructuredCloneData.cpp b/dom/ipc/StructuredCloneData.cpp
index 98f56904f..2c1fff2ac 100644
--- a/dom/ipc/StructuredCloneData.cpp
+++ b/dom/ipc/StructuredCloneData.cpp
@@ -88,7 +88,7 @@ StructuredCloneData::Write(JSContext* aCx,
return;
}
- JSStructuredCloneData data;
+ JSStructuredCloneData data(mBuffer->scope());
mBuffer->abandon();
mBuffer->steal(&data);
mBuffer = nullptr;
@@ -107,7 +107,7 @@ StructuredCloneData::ReadIPCParams(const IPC::Message* aMsg,
PickleIterator* aIter)
{
MOZ_ASSERT(!mInitialized);
- JSStructuredCloneData data;
+ JSStructuredCloneData data(JS::StructuredCloneScope::DifferentProcess);
if (!ReadParam(aMsg, aIter, &data)) {
return false;
}
diff --git a/dom/ipc/StructuredCloneData.h b/dom/ipc/StructuredCloneData.h
index 9e427e938..64cfd1935 100644
--- a/dom/ipc/StructuredCloneData.h
+++ b/dom/ipc/StructuredCloneData.h
@@ -31,8 +31,8 @@ public:
static already_AddRefed<SharedJSAllocatedData>
CreateFromExternalData(const char* aData, size_t aDataLength)
{
- JSStructuredCloneData buf;
- buf.WriteBytes(aData, aDataLength);
+ JSStructuredCloneData buf(JS::StructuredCloneScope::DifferentProcess);
+ buf.AppendBytes(aData, aDataLength);
RefPtr<SharedJSAllocatedData> sharedData =
new SharedJSAllocatedData(Move(buf));
return sharedData.forget();
@@ -41,12 +41,8 @@ public:
static already_AddRefed<SharedJSAllocatedData>
CreateFromExternalData(const JSStructuredCloneData& aData)
{
- JSStructuredCloneData buf;
- auto iter = aData.Iter();
- while (!iter.Done()) {
- buf.WriteBytes(iter.Data(), iter.RemainingInSegment());
- iter.Advance(aData, iter.RemainingInSegment());
- }
+ JSStructuredCloneData buf(aData.scope());
+ buf.Append(aData);
RefPtr<SharedJSAllocatedData> sharedData =
new SharedJSAllocatedData(Move(buf));
return sharedData.forget();
@@ -70,6 +66,7 @@ public:
: StructuredCloneHolder(StructuredCloneHolder::CloningSupported,
StructuredCloneHolder::TransferringSupported,
StructuredCloneHolder::StructuredCloneScope::DifferentProcess)
+ , mExternalData(StructuredCloneHolder::StructuredCloneScope::DifferentProcess)
, mInitialized(false)
{}
@@ -113,10 +110,9 @@ public:
bool UseExternalData(const JSStructuredCloneData& aData)
{
- auto iter = aData.Iter();
+ auto iter = aData.Start();
bool success = false;
- mExternalData =
- aData.Borrow<js::SystemAllocPolicy>(iter, aData.Size(), &success);
+ mExternalData = aData.Borrow(iter, aData.Size(), &success);
mInitialized = true;
return success;
}
@@ -133,6 +129,11 @@ public:
return mSharedData ? mSharedData->Data() : mExternalData;
}
+ void InitScope(JS::StructuredCloneScope aScope)
+ {
+ Data().initScope(aScope);
+ }
+
size_t DataLength() const
{
return mSharedData ? mSharedData->DataLength() : mExternalData.Size();
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index c8a0c6e3f..705799c54 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -96,7 +96,6 @@
#include "LayersLogging.h"
#include "nsDOMClassInfoID.h"
#include "nsColorPickerProxy.h"
-#include "nsDatePickerProxy.h"
#include "nsContentPermissionHelper.h"
#include "nsPresShell.h"
#include "nsIAppsService.h"
@@ -2013,21 +2012,6 @@ TabChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker)
return true;
}
-PDatePickerChild*
-TabChild::AllocPDatePickerChild(const nsString&, const nsString&)
-{
- NS_RUNTIMEABORT("unused");
- return nullptr;
-}
-
-bool
-TabChild::DeallocPDatePickerChild(PDatePickerChild* aDatePicker)
-{
- nsDatePickerProxy* picker = static_cast<nsDatePickerProxy*>(aDatePicker);
- NS_RELEASE(picker);
- return true;
-}
-
PFilePickerChild*
TabChild::AllocPFilePickerChild(const nsString&, const int16_t&)
{
diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h
index 2232ffeaf..d9988a596 100644
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -451,10 +451,6 @@ public:
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
- virtual PDatePickerChild*
- AllocPDatePickerChild(const nsString& title, const nsString& initialDate) override;
- virtual bool DeallocPDatePickerChild(PDatePickerChild* actor) override;
-
virtual PFilePickerChild*
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
diff --git a/dom/ipc/TabContext.cpp b/dom/ipc/TabContext.cpp
index b36dbc5eb..362bce3a4 100644
--- a/dom/ipc/TabContext.cpp
+++ b/dom/ipc/TabContext.cpp
@@ -358,12 +358,7 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
case IPCTabContext::TUnsafeIPCTabContext: {
// XXXcatalinb: This used *only* by ServiceWorkerClients::OpenWindow.
// It is meant as a temporary solution until service workers can
- // provide a TabChild equivalent. Don't allow this on b2g since
- // it might be used to escalate privileges.
-#ifdef MOZ_B2G
- mInvalidReason = "ServiceWorkerClients::OpenWindow is not supported.";
- return;
-#endif
+ // provide a TabChild equivalent.
if (!Preferences::GetBool("dom.serviceWorkers.enabled", false)) {
mInvalidReason = "ServiceWorkers should be enabled.";
return;
diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp
index 8e98de3ce..0f190708f 100644
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -80,7 +80,6 @@
#include "PermissionMessageUtils.h"
#include "StructuredCloneData.h"
#include "ColorPickerParent.h"
-#include "DatePickerParent.h"
#include "FilePickerParent.h"
#include "TabChild.h"
#include "LoadContext.h"
@@ -2424,20 +2423,6 @@ TabParent::DeallocPColorPickerParent(PColorPickerParent* actor)
return true;
}
-PDatePickerParent*
-TabParent::AllocPDatePickerParent(const nsString& aTitle,
- const nsString& aInitialDate)
-{
- return new DatePickerParent(aTitle, aInitialDate);
-}
-
-bool
-TabParent::DeallocPDatePickerParent(PDatePickerParent* actor)
-{
- delete actor;
- return true;
-}
-
PRenderFrameParent*
TabParent::AllocPRenderFrameParent()
{
diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h
index 09bb999f3..3624ce320 100644
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -347,10 +347,6 @@ public:
virtual bool
DeallocPColorPickerParent(PColorPickerParent* aColorPicker) override;
- virtual PDatePickerParent*
- AllocPDatePickerParent(const nsString& aTitle, const nsString& aInitialDate) override;
- virtual bool DeallocPDatePickerParent(PDatePickerParent* aDatePicker) override;
-
virtual PDocAccessibleParent*
AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&,
const uint32_t&, const IAccessibleHolder&) override;
diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build
index ff3880bc2..5629ab2c6 100644
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -26,8 +26,6 @@ EXPORTS.mozilla.dom += [
'ContentProcess.h',
'ContentProcessManager.h',
'CPOWManagerGetter.h',
- 'CrashReporterChild.h',
- 'CrashReporterParent.h',
'FilePickerParent.h',
'nsIContentChild.h',
'nsIContentParent.h',
@@ -54,8 +52,6 @@ UNIFIED_SOURCES += [
'ContentParent.cpp',
'ContentProcess.cpp',
'ContentProcessManager.cpp',
- 'CrashReporterParent.cpp',
- 'DatePickerParent.cpp',
'FilePickerParent.cpp',
'nsIContentChild.cpp',
'nsIContentParent.cpp',
@@ -71,13 +67,10 @@ UNIFIED_SOURCES += [
]
# Blob.cpp cannot be compiled in unified mode because it triggers a fatal gcc warning.
-# CrashReporterChild.cpp cannot be compiled in unified mode because of name clashes
-# in OS X headers.
# ContentChild.cpp cannot be compiled in unified mode on linux due to Time conflict
SOURCES += [
'Blob.cpp',
'ContentChild.cpp',
- 'CrashReporterChild.cpp',
'ProcessHangMonitor.cpp',
]
@@ -93,9 +86,7 @@ IPDL_SOURCES += [
'PContentBridge.ipdl',
'PContentPermission.ipdlh',
'PContentPermissionRequest.ipdl',
- 'PCrashReporter.ipdl',
'PCycleCollectWithLogs.ipdl',
- 'PDatePicker.ipdl',
'PFilePicker.ipdl',
'PMemoryReportRequest.ipdl',
'PPluginWidget.ipdl',
@@ -114,11 +105,6 @@ if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin':
'mozsandbox',
]
-if CONFIG['MOZ_CONTENT_SANDBOX'] and CONFIG['OS_ARCH'] == 'Linux':
- USE_LIBS += [
- 'mozsandbox',
- ]
-
LOCAL_INCLUDES += [
'/caps',
'/chrome',
@@ -139,7 +125,6 @@ LOCAL_INCLUDES += [
'/layout/base',
'/media/webrtc',
'/netwerk/base',
- '/toolkit/crashreporter',
'/toolkit/xre',
'/uriloader/exthandler',
'/widget',
@@ -147,12 +132,6 @@ LOCAL_INCLUDES += [
'/xpcom/threads',
]
-if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
- LOCAL_INCLUDES += [
- '/security/sandbox/chromium',
- '/security/sandbox/chromium-shim',
- ]
-
if CONFIG['OS_ARCH'] != 'WINNT':
LOCAL_INCLUDES += [
'/modules/libjar',
@@ -160,7 +139,7 @@ if CONFIG['OS_ARCH'] != 'WINNT':
DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gonk'):
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2'):
DEFINES['MOZ_ENABLE_FREETYPE'] = True
if CONFIG['MOZ_TOOLKIT_SEARCH']:
diff --git a/dom/ipc/tests/test_cpow_cookies.html b/dom/ipc/tests/test_cpow_cookies.html
index 1e55d3878..d8f87cced 100644
--- a/dom/ipc/tests/test_cpow_cookies.html
+++ b/dom/ipc/tests/test_cpow_cookies.html
@@ -81,7 +81,8 @@
["dom.ipc.browser_frames.oop_by_default", true],
["dom.mozBrowserFramesEnabled", true],
["network.disable.ipc.security", true],
- ["browser.pagethumbnails.capturing_disabled", true]
+ ["browser.pagethumbnails.capturing_disabled", true],
+ ["security.data_uri.block_toplevel_data_uri_navigations", false],
]
}, runTests);
});