2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2011-05-21 14:03:36 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2018-01-03 03:04:00 +03:00
|
|
|
interface nsIArray;
|
2014-05-15 09:26:07 +04:00
|
|
|
interface nsIPrincipal;
|
2011-05-21 14:03:36 +04:00
|
|
|
%{C++
|
|
|
|
namespace mozilla {
|
|
|
|
class TimeStamp;
|
|
|
|
}
|
2018-04-24 14:04:12 +03:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2011-05-21 14:03:36 +04:00
|
|
|
%}
|
|
|
|
|
|
|
|
native TimeStamp(mozilla::TimeStamp);
|
|
|
|
|
2018-01-03 03:04:00 +03:00
|
|
|
[scriptable, uuid(c2d9e95b-9cc9-4f47-9ef6-1de0cf7ebc75)]
|
|
|
|
interface nsIServerTiming : nsISupports {
|
|
|
|
[must_use] readonly attribute ACString name;
|
|
|
|
[must_use] readonly attribute double duration;
|
|
|
|
[must_use] readonly attribute ACString description;
|
|
|
|
};
|
|
|
|
|
2018-04-24 14:04:12 +03:00
|
|
|
[ref] native nsServerTimingArrayRef(nsTArray<nsCOMPtr<nsIServerTiming>>);
|
|
|
|
|
2011-05-21 14:03:36 +04:00
|
|
|
// All properties return zero if the value is not available
|
2014-05-15 09:26:07 +04:00
|
|
|
[scriptable, uuid(ca63784d-959c-4c3a-9a59-234a2a520de0)]
|
2011-05-21 14:03:36 +04:00
|
|
|
interface nsITimedChannel : nsISupports {
|
|
|
|
// Set this attribute to true to enable collection of timing data.
|
|
|
|
// channelCreationTime will be available even with this attribute set to
|
|
|
|
// false.
|
|
|
|
attribute boolean timingEnabled;
|
|
|
|
|
2013-10-16 05:35:44 +04:00
|
|
|
// The number of redirects
|
2017-10-06 19:04:54 +03:00
|
|
|
attribute uint8_t redirectCount;
|
|
|
|
attribute uint8_t internalRedirectCount;
|
2013-10-16 05:35:44 +04:00
|
|
|
|
2018-06-23 20:10:10 +03:00
|
|
|
// These properties should only be written externally when they must be
|
|
|
|
// propagated across an internal redirect. For example, when a service
|
|
|
|
// worker interception falls back to network we need to copy the original
|
|
|
|
// timing values to the new nsHttpChannel.
|
|
|
|
[noscript] attribute TimeStamp channelCreation;
|
|
|
|
[noscript] attribute TimeStamp asyncOpen;
|
2011-05-21 14:03:36 +04:00
|
|
|
|
2017-04-10 16:13:21 +03:00
|
|
|
// The following are only set when the request is intercepted by a service
|
|
|
|
// worker no matter the response is synthesized.
|
|
|
|
[noscript] attribute TimeStamp launchServiceWorkerStart;
|
|
|
|
[noscript] attribute TimeStamp launchServiceWorkerEnd;
|
|
|
|
[noscript] attribute TimeStamp dispatchFetchEventStart;
|
|
|
|
[noscript] attribute TimeStamp dispatchFetchEventEnd;
|
|
|
|
[noscript] attribute TimeStamp handleFetchEventStart;
|
|
|
|
[noscript] attribute TimeStamp handleFetchEventEnd;
|
|
|
|
|
2011-05-21 14:03:36 +04:00
|
|
|
// The following are only set when the document is not (only) read from the
|
|
|
|
// cache
|
2012-08-09 12:31:14 +04:00
|
|
|
[noscript] readonly attribute TimeStamp domainLookupStart;
|
|
|
|
[noscript] readonly attribute TimeStamp domainLookupEnd;
|
|
|
|
[noscript] readonly attribute TimeStamp connectStart;
|
2017-10-17 16:28:33 +03:00
|
|
|
[noscript] readonly attribute TimeStamp tcpConnectEnd;
|
2017-07-10 22:01:35 +03:00
|
|
|
[noscript] readonly attribute TimeStamp secureConnectionStart;
|
2012-08-09 12:31:14 +04:00
|
|
|
[noscript] readonly attribute TimeStamp connectEnd;
|
|
|
|
[noscript] readonly attribute TimeStamp requestStart;
|
|
|
|
[noscript] readonly attribute TimeStamp responseStart;
|
|
|
|
[noscript] readonly attribute TimeStamp responseEnd;
|
2011-05-21 14:03:36 +04:00
|
|
|
|
2013-10-16 05:35:44 +04:00
|
|
|
// The redirect attributes timings must be writeble, se we can transfer
|
|
|
|
// the data from one channel to the redirected channel.
|
|
|
|
[noscript] attribute TimeStamp redirectStart;
|
|
|
|
[noscript] attribute TimeStamp redirectEnd;
|
|
|
|
|
|
|
|
// The initiator type
|
|
|
|
[noscript] attribute AString initiatorType;
|
|
|
|
|
|
|
|
// This flag should be set to false only if a cross-domain redirect occurred
|
|
|
|
[noscript] attribute boolean allRedirectsSameOrigin;
|
2014-05-15 09:26:07 +04:00
|
|
|
// This flag is set to false if the timing allow check fails
|
|
|
|
[noscript] attribute boolean allRedirectsPassTimingAllowCheck;
|
|
|
|
// Implements the timing-allow-check to determine if we should report
|
|
|
|
// timing info for the resourceTiming object.
|
|
|
|
[noscript] boolean timingAllowCheck(in nsIPrincipal origin);
|
|
|
|
%{C++
|
|
|
|
inline bool TimingAllowCheck(nsIPrincipal* aOrigin) {
|
|
|
|
bool allowed = false;
|
|
|
|
return NS_SUCCEEDED(TimingAllowCheck(aOrigin, &allowed)) && allowed;
|
|
|
|
}
|
|
|
|
%}
|
2013-10-16 05:35:44 +04:00
|
|
|
|
2011-05-21 14:03:36 +04:00
|
|
|
// The following are only set if the document is (partially) read from the
|
|
|
|
// cache
|
2012-08-09 12:31:14 +04:00
|
|
|
[noscript] readonly attribute TimeStamp cacheReadStart;
|
|
|
|
[noscript] readonly attribute TimeStamp cacheReadEnd;
|
2011-05-21 14:03:36 +04:00
|
|
|
|
|
|
|
// All following are PRTime versions of the above.
|
|
|
|
readonly attribute PRTime channelCreationTime;
|
|
|
|
readonly attribute PRTime asyncOpenTime;
|
2017-04-10 16:13:21 +03:00
|
|
|
readonly attribute PRTime launchServiceWorkerStartTime;
|
|
|
|
readonly attribute PRTime launchServiceWorkerEndTime;
|
|
|
|
readonly attribute PRTime dispatchFetchEventStartTime;
|
|
|
|
readonly attribute PRTime dispatchFetchEventEndTime;
|
|
|
|
readonly attribute PRTime handleFetchEventStartTime;
|
|
|
|
readonly attribute PRTime handleFetchEventEndTime;
|
2011-05-21 14:03:36 +04:00
|
|
|
readonly attribute PRTime domainLookupStartTime;
|
|
|
|
readonly attribute PRTime domainLookupEndTime;
|
|
|
|
readonly attribute PRTime connectStartTime;
|
2017-10-17 16:28:33 +03:00
|
|
|
readonly attribute PRTime tcpConnectEndTime;
|
2017-07-10 22:01:35 +03:00
|
|
|
readonly attribute PRTime secureConnectionStartTime;
|
2011-05-21 14:03:36 +04:00
|
|
|
readonly attribute PRTime connectEndTime;
|
|
|
|
readonly attribute PRTime requestStartTime;
|
|
|
|
readonly attribute PRTime responseStartTime;
|
|
|
|
readonly attribute PRTime responseEndTime;
|
|
|
|
readonly attribute PRTime cacheReadStartTime;
|
|
|
|
readonly attribute PRTime cacheReadEndTime;
|
2013-10-16 05:35:44 +04:00
|
|
|
readonly attribute PRTime redirectStartTime;
|
|
|
|
readonly attribute PRTime redirectEndTime;
|
2017-11-07 18:58:31 +03:00
|
|
|
|
|
|
|
// If this attribute is false, this resource MUST NOT be reported in resource timing.
|
|
|
|
[noscript] attribute boolean reportResourceTiming;
|
2018-01-03 03:04:00 +03:00
|
|
|
|
|
|
|
readonly attribute nsIArray serverTiming;
|
2018-04-24 14:04:12 +03:00
|
|
|
nsServerTimingArrayRef getNativeServerTiming();
|
2011-05-21 14:03:36 +04:00
|
|
|
};
|