import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1175413 - Cleanup usages of MOZ_ICU_CFLAGS. r=mshal (6d9b5f5be9)
- Bug 1201693 - Remove Files pattern in js/src/moz.build corresponding to a deleted file. r=bbouvier (da12fd6ff8)
- Bug 1185106 - Part 1: Exclude StoreBuffer.cpp from unified build to prevent build bustage. r=efaust (a40e13855c)
- Bug 1145744 - Update CacheStorage to use common StorageAllowedForWindow logic, r=bkelly (0f3f86339c)
- Bug 1147821 - Update IndexedDB to use common StorageAllowedForWindow logic, r=khuey (775734bee9)
- Bug 1177226 - Support User Timing API events in the Developer HUD. r=ehsan, r=jryans (6fb8a84a47)
- Bug 1184973 - Part 1: Add nsContentUtils::StorageAllowedForWindow as a unified mechanism for determining storage avaliability, r=ehsan, r=smaug (f4e6954cdb)
- Bug 1184973 - Part 2: Tests for new storage permissions model, r=ehsan, r=smaug (92b414cd78)
- Bug 1184607 P7.1 Move Cache schema SQL into separate constants. r=ehsan (ba543e589a)
- Bug 1184607 P7.2 Validate Cache schema in debug builds. r=ehsan (5edc1a2ee6)
- Bug 1184607 P7.4 Infrastructure for running Cache schema migrations. r=ehsan (f736d93955)
- Bug 1184607 P7.3 Rename Cache "max wipe version" constant to "first shipped version". r=ehsan (5af8cd0966)
- Bug 1184607 P7.5 Add RequestRedirect to Cache API schema with migration. r=ehsan (5737cb9897)
- Bug 1184607 P2 Update Request and Response DOM objects for new redirect model. r=nsm (97e5b8c912)
- Bug 1184607 P3 Add a RedirectMode flag to nsIHttpChannelInternal. r=nsm (ebf9145d09)
- Bug 1184607 P4 Handle the RequestRedirect mode during service worker interception. r=nsm (2edc748b4c)
- Bug 1184607 P5 Set RequestRedirect to "manual" for navigations. r=nsm (5484e78f2a)
- Bug 1196592: Make retargeting Fetch to another thread actually work. r=nsm (3dcf206438)
- Bug 1196524 - Add assertions to enforce that we don't attempt to perform a CORS preflight for fetches of no-cors requests; r=nsm (626b305328)
- Bug 1184607 P6 Set RequestRedirect and fix various redirect bugs in FetchDriver. r=nsm (420dbd1579)
- Bug 1193911 - Ensure synthetic Responses gets a valid channel info. r=ehsan (fa5158bc8f)
- Bug 1184607 P7.7 Allow new Response() to be used in xpcshell tests. r=ehsan (8d66046592)
- Bug 1184607 P7.8 Test Cache API schema verison migrations. r=ehsan (7d2a23e199)
- Bug 1184607 P8 Fix mochitests to store opaqueredirect responses in Cache for navigation URLs. r=nsm (b280d3e551)
- Bug 1184607 P9 Add wpt tests to verify service worker redirect logic. r=nsm (9ad92d5921)
- Bug 1184607 P10 Expose channel security info during e10s redirect. Support security info in redirecting interceptions. r=jduell (fae135001e)
- Bug 1171127 - Listeners are not released in OnStopRequest in e10s mode. r=jduell (0b63670825)
- Bug 1203680 P7 Fix e10s handling on interceptions resulting in redirect status codes. r=jdm (f2ff5c5953)
- Bug 1203680 P5 Make ServiceWorkerManager ensure channel upload stream is cloneable. r=nsm (c5459283d5)
- Bug 572151 - Remove calls to SetCookies from HttpChannelChild. r=jduell (67efa04159)
- Bug 1184607 P11 Fix fetch CORS tests to not expect same-origin requests that redirect to preflight. r=nsm (10df6003f7)
- Bug 1184607 P7.6 Expose CacheStorage .caches property on xpcshell global. r=smaug (5bf8d69439)
- Bug 1157468 - Avoid leaking the intercepting channel stream listener for redirected IPC channels. r=mayhemer (1b33a488cc)
- Bug 1199049 - Part 1: Move nsCORSListenerProxy.* to necko; r=jduell (8e2cc6361e)
- Bug 1199049 - Part 2: Add a channel API for requesting CORS preflights; r=jduell (bf417aa318)
This commit is contained in:
2022-03-23 13:19:07 +08:00
parent a312918fb4
commit 2d4b405bcc
105 changed files with 3705 additions and 384 deletions
+37 -3
View File
@@ -21,6 +21,7 @@
#include "PerformanceResourceTiming.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/PerformanceBinding.h"
#include "mozilla/dom/PerformanceEntryEvent.h"
#include "mozilla/dom/PerformanceTimingBinding.h"
#include "mozilla/dom/PerformanceNavigationBinding.h"
#include "mozilla/Preferences.h"
@@ -737,14 +738,24 @@ nsPerformance::InsertUserEntry(PerformanceEntry* aEntry)
{
MOZ_ASSERT(NS_IsMainThread());
if (nsContentUtils::IsUserTimingLoggingEnabled()) {
nsAutoCString uri;
nsAutoCString uri;
uint64_t markCreationEpoch = 0;
if (nsContentUtils::IsUserTimingLoggingEnabled() ||
nsContentUtils::SendPerformanceTimingNotifications()) {
nsresult rv = GetOwner()->GetDocumentURI()->GetHost(uri);
if(NS_FAILED(rv)) {
// If we have no URI, just put in "none".
uri.AssignLiteral("none");
}
PerformanceBase::LogEntry(aEntry, uri);
markCreationEpoch = static_cast<uint64_t>(PR_Now() / PR_USEC_PER_MSEC);
if (nsContentUtils::IsUserTimingLoggingEnabled()) {
PerformanceBase::LogEntry(aEntry, uri);
}
}
if (nsContentUtils::SendPerformanceTimingNotifications()) {
TimingNotification(aEntry, uri, markCreationEpoch);
}
PerformanceBase::InsertUserEntry(aEntry);
@@ -985,6 +996,29 @@ PerformanceBase::LogEntry(PerformanceEntry* aEntry, const nsACString& aOwner) co
static_cast<uint64_t>(PR_Now() / PR_USEC_PER_MSEC));
}
void
PerformanceBase::TimingNotification(PerformanceEntry* aEntry, const nsACString& aOwner, uint64_t aEpoch)
{
PerformanceEntryEventInit init;
init.mBubbles = false;
init.mCancelable = false;
init.mName = aEntry->GetName();
init.mEntryType = aEntry->GetEntryType();
init.mStartTime = aEntry->StartTime();
init.mDuration = aEntry->Duration();
init.mEpoch = aEpoch;
init.mOrigin = NS_ConvertUTF8toUTF16(aOwner.BeginReading());
nsRefPtr<PerformanceEntryEvent> perfEntryEvent =
PerformanceEntryEvent::Constructor(this, NS_LITERAL_STRING("performanceentry"), init);
nsCOMPtr<EventTarget> et = do_QueryInterface(GetOwner());
if (et) {
bool dummy = false;
et->DispatchEvent(perfEntryEvent, &dummy);
}
}
void
PerformanceBase::InsertUserEntry(PerformanceEntry* aEntry)
{