Skip to content

Commit 1092aef

Browse files
committed
Bug 1968644 - Part 8: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for WebSocket requests. r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D252510
1 parent af47058 commit 1092aef

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

netwerk/protocol/websocket/BaseWebSocketChannel.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
#include "WebSocketLog.h"
88
#include "BaseWebSocketChannel.h"
9+
#include "mozilla/dom/Document.h"
910
#include "MainThreadUtils.h"
11+
#include "nsContentUtils.h"
12+
#include "nsIClassifiedChannel.h"
1013
#include "nsILoadGroup.h"
1114
#include "nsINode.h"
1215
#include "nsIInterfaceRequestor.h"
@@ -226,6 +229,17 @@ BaseWebSocketChannel::InitLoadInfoNative(
226229
if (aCookieJarSettings) {
227230
mLoadInfo->SetCookieJarSettings(aCookieJarSettings);
228231
}
232+
233+
if (aLoadingNode) {
234+
RefPtr<dom::Document> doc = aLoadingNode->OwnerDoc();
235+
if (doc) {
236+
ClassificationFlags flags = doc->GetScriptTrackingFlags();
237+
mLoadInfo->SetTriggeringFirstPartyClassificationFlags(
238+
flags.firstPartyFlags);
239+
mLoadInfo->SetTriggeringThirdPartyClassificationFlags(
240+
flags.thirdPartyFlags);
241+
}
242+
}
229243
return NS_OK;
230244
}
231245

0 commit comments

Comments
 (0)