mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1276328 - Remove private browsing flags r=baku
--HG-- extra : rebase_source : e13f6b834ae22986776ca7cc3dd0cee3fc945992
This commit is contained in:
parent
e7758d8a8c
commit
7c273b3eb3
@ -71,14 +71,12 @@ class InitializeRunnable final : public WorkerMainThreadRunnable
|
||||
{
|
||||
public:
|
||||
InitializeRunnable(WorkerPrivate* aWorkerPrivate, nsACString& aOrigin,
|
||||
PrincipalInfo& aPrincipalInfo, bool& aPrivateBrowsing,
|
||||
ErrorResult& aRv)
|
||||
PrincipalInfo& aPrincipalInfo, ErrorResult& aRv)
|
||||
: WorkerMainThreadRunnable(aWorkerPrivate,
|
||||
NS_LITERAL_CSTRING("BroadcastChannel :: Initialize"))
|
||||
, mWorkerPrivate(GetCurrentThreadWorkerPrivate())
|
||||
, mOrigin(aOrigin)
|
||||
, mPrincipalInfo(aPrincipalInfo)
|
||||
, mPrivateBrowsing(aPrivateBrowsing)
|
||||
, mRv(aRv)
|
||||
{
|
||||
MOZ_ASSERT(mWorkerPrivate);
|
||||
@ -127,11 +125,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
nsIDocument* doc = window->GetExtantDoc();
|
||||
if (doc) {
|
||||
mPrivateBrowsing = nsContentUtils::IsInPrivateBrowsing(doc);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -139,7 +132,6 @@ private:
|
||||
WorkerPrivate* mWorkerPrivate;
|
||||
nsACString& mOrigin;
|
||||
PrincipalInfo& mPrincipalInfo;
|
||||
bool& mPrivateBrowsing;
|
||||
ErrorResult& mRv;
|
||||
};
|
||||
|
||||
@ -306,14 +298,12 @@ private:
|
||||
BroadcastChannel::BroadcastChannel(nsPIDOMWindowInner* aWindow,
|
||||
const PrincipalInfo& aPrincipalInfo,
|
||||
const nsACString& aOrigin,
|
||||
const nsAString& aChannel,
|
||||
bool aPrivateBrowsing)
|
||||
const nsAString& aChannel)
|
||||
: DOMEventTargetHelper(aWindow)
|
||||
, mWorkerFeature(nullptr)
|
||||
, mPrincipalInfo(new PrincipalInfo(aPrincipalInfo))
|
||||
, mOrigin(aOrigin)
|
||||
, mChannel(aChannel)
|
||||
, mPrivateBrowsing(aPrivateBrowsing)
|
||||
, mIsKeptAlive(false)
|
||||
, mInnerID(0)
|
||||
, mState(StateActive)
|
||||
@ -344,7 +334,6 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
|
||||
|
||||
nsAutoCString origin;
|
||||
PrincipalInfo principalInfo;
|
||||
bool privateBrowsing = false;
|
||||
WorkerPrivate* workerPrivate = nullptr;
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
@ -381,19 +370,13 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = window->GetExtantDoc();
|
||||
if (doc) {
|
||||
privateBrowsing = nsContentUtils::IsInPrivateBrowsing(doc);
|
||||
}
|
||||
} else {
|
||||
JSContext* cx = aGlobal.Context();
|
||||
workerPrivate = GetWorkerPrivateFromContext(cx);
|
||||
MOZ_ASSERT(workerPrivate);
|
||||
|
||||
RefPtr<InitializeRunnable> runnable =
|
||||
new InitializeRunnable(workerPrivate, origin, principalInfo,
|
||||
privateBrowsing, aRv);
|
||||
new InitializeRunnable(workerPrivate, origin, principalInfo, aRv);
|
||||
runnable->Dispatch(aRv);
|
||||
}
|
||||
|
||||
@ -402,8 +385,7 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
|
||||
}
|
||||
|
||||
RefPtr<BroadcastChannel> bc =
|
||||
new BroadcastChannel(window, principalInfo, origin, aChannel,
|
||||
privateBrowsing);
|
||||
new BroadcastChannel(window, principalInfo, origin, aChannel);
|
||||
|
||||
// Register this component to PBackground.
|
||||
PBackgroundChild* actor = BackgroundChild::GetForCurrentThread();
|
||||
@ -522,8 +504,7 @@ BroadcastChannel::ActorCreated(PBackgroundChild* aActor)
|
||||
}
|
||||
|
||||
PBroadcastChannelChild* actor =
|
||||
aActor->SendPBroadcastChannelConstructor(*mPrincipalInfo, mOrigin, mChannel,
|
||||
mPrivateBrowsing);
|
||||
aActor->SendPBroadcastChannelConstructor(*mPrincipalInfo, mOrigin, mChannel);
|
||||
|
||||
mActor = static_cast<BroadcastChannelChild*>(actor);
|
||||
MOZ_ASSERT(mActor);
|
||||
|
@ -88,8 +88,7 @@ private:
|
||||
BroadcastChannel(nsPIDOMWindowInner* aWindow,
|
||||
const PrincipalInfo& aPrincipalInfo,
|
||||
const nsACString& aOrigin,
|
||||
const nsAString& aChannel,
|
||||
bool aPrivateBrowsing);
|
||||
const nsAString& aChannel);
|
||||
|
||||
~BroadcastChannel();
|
||||
|
||||
@ -116,7 +115,6 @@ private:
|
||||
|
||||
nsCString mOrigin;
|
||||
nsString mChannel;
|
||||
bool mPrivateBrowsing;
|
||||
|
||||
bool mIsKeptAlive;
|
||||
|
||||
|
@ -276,8 +276,7 @@ BackgroundChildImpl::DeallocPUDPSocketChild(PUDPSocketChild* child)
|
||||
dom::PBroadcastChannelChild*
|
||||
BackgroundChildImpl::AllocPBroadcastChannelChild(const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& aOrigin,
|
||||
const nsString& aChannel,
|
||||
const bool& aPrivateBrowsing)
|
||||
const nsString& aChannel)
|
||||
{
|
||||
RefPtr<dom::BroadcastChannelChild> agent =
|
||||
new dom::BroadcastChannelChild(aOrigin);
|
||||
|
@ -104,8 +104,7 @@ protected:
|
||||
virtual PBroadcastChannelChild*
|
||||
AllocPBroadcastChannelChild(const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& aOrigin,
|
||||
const nsString& aChannel,
|
||||
const bool& aPrivateBrowsing) override;
|
||||
const nsString& aChannel) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPBroadcastChannelChild(PBroadcastChannelChild* aActor) override;
|
||||
|
@ -467,8 +467,7 @@ mozilla::dom::PBroadcastChannelParent*
|
||||
BackgroundParentImpl::AllocPBroadcastChannelParent(
|
||||
const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& aOrigin,
|
||||
const nsString& aChannel,
|
||||
const bool& aPrivateBrowsing)
|
||||
const nsString& aChannel)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
@ -476,15 +475,11 @@ BackgroundParentImpl::AllocPBroadcastChannelParent(
|
||||
nsString originChannelKey;
|
||||
|
||||
// The format of originChannelKey is:
|
||||
// <channelName>|pb={true,false}|<origin+OriginAttributes>
|
||||
// <channelName>|<origin+OriginAttributes>
|
||||
|
||||
originChannelKey.Assign(aChannel);
|
||||
|
||||
if (aPrivateBrowsing) {
|
||||
originChannelKey.AppendLiteral("|pb=true|");
|
||||
} else {
|
||||
originChannelKey.AppendLiteral("|pb=false|");
|
||||
}
|
||||
originChannelKey.AppendLiteral("|");
|
||||
|
||||
originChannelKey.Append(NS_ConvertUTF8toUTF16(aOrigin));
|
||||
|
||||
@ -648,8 +643,7 @@ BackgroundParentImpl::RecvPBroadcastChannelConstructor(
|
||||
PBroadcastChannelParent* actor,
|
||||
const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& aOrigin,
|
||||
const nsString& aChannel,
|
||||
const bool& aPrivateBrowsing)
|
||||
const nsString& aChannel)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
|
@ -90,15 +90,13 @@ protected:
|
||||
virtual PBroadcastChannelParent*
|
||||
AllocPBroadcastChannelParent(const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& aOrigin,
|
||||
const nsString& aChannel,
|
||||
const bool& aPrivateBrowsing) override;
|
||||
const nsString& aChannel) override;
|
||||
|
||||
virtual bool
|
||||
RecvPBroadcastChannelConstructor(PBroadcastChannelParent* actor,
|
||||
const PrincipalInfo& aPrincipalInfo,
|
||||
const nsCString& origin,
|
||||
const nsString& channel,
|
||||
const bool& aPrivateBrowsing) override;
|
||||
const nsString& channel) override;
|
||||
|
||||
virtual bool
|
||||
DeallocPBroadcastChannelParent(PBroadcastChannelParent* aActor) override;
|
||||
|
@ -79,8 +79,7 @@ parent:
|
||||
async PCameras();
|
||||
|
||||
async PUDPSocket(OptionalPrincipalInfo pInfo, nsCString filter);
|
||||
async PBroadcastChannel(PrincipalInfo pInfo, nsCString origin, nsString channel,
|
||||
bool privateBrowsing);
|
||||
async PBroadcastChannel(PrincipalInfo pInfo, nsCString origin, nsString channel);
|
||||
|
||||
async PServiceWorkerManager();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user