summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/InterceptedChannel.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 11:49:50 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 11:49:50 +0200
commite040ed925030f899f845d458c226f7e439f4ec8b (patch)
tree797edf76896b10a38446171aa341da8dfef8ca08 /netwerk/protocol/http/InterceptedChannel.cpp
parentaff03b0a67c41cf7af5df9c9eef715a8b27a2667 (diff)
downloadUXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar
UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.gz
UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.lz
UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.xz
UXP-e040ed925030f899f845d458c226f7e439f4ec8b.zip
moebius#158: The Performance Resource Timing (added support for "workerStart")
https://github.com/MoonchildProductions/moebius/pull/158
Diffstat (limited to 'netwerk/protocol/http/InterceptedChannel.cpp')
-rw-r--r--netwerk/protocol/http/InterceptedChannel.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/netwerk/protocol/http/InterceptedChannel.cpp b/netwerk/protocol/http/InterceptedChannel.cpp
index 9e38e2734..2dadbe760 100644
--- a/netwerk/protocol/http/InterceptedChannel.cpp
+++ b/netwerk/protocol/http/InterceptedChannel.cpp
@@ -10,6 +10,7 @@
#include "nsInputStreamPump.h"
#include "nsIPipe.h"
#include "nsIStreamListener.h"
+#include "nsITimedChannel.h"
#include "nsHttpChannel.h"
#include "HttpChannelChild.h"
#include "nsHttpResponseHead.h"
@@ -134,6 +135,40 @@ InterceptedChannelBase::SetReleaseHandle(nsISupports* aHandle)
return NS_OK;
}
+NS_IMETHODIMP
+InterceptedChannelBase::SaveTimeStampsToUnderlyingChannel()
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsCOMPtr<nsIChannel> underlyingChannel;
+ nsresult rv = GetChannel(getter_AddRefs(underlyingChannel));
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ nsCOMPtr<nsITimedChannel> timedChannel =
+ do_QueryInterface(underlyingChannel);
+ MOZ_ASSERT(timedChannel);
+
+ rv = timedChannel->SetLaunchServiceWorkerStart(mLaunchServiceWorkerStart);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ rv = timedChannel->SetLaunchServiceWorkerEnd(mLaunchServiceWorkerEnd);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ rv = timedChannel->SetDispatchFetchEventStart(mDispatchFetchEventStart);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ rv = timedChannel->SetDispatchFetchEventEnd(mDispatchFetchEventEnd);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ rv = timedChannel->SetHandleFetchEventStart(mHandleFetchEventStart);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ rv = timedChannel->SetHandleFetchEventEnd(mHandleFetchEventEnd);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+
+ return rv;
+}
+
/* static */
already_AddRefed<nsIURI>
InterceptedChannelBase::SecureUpgradeChannelURI(nsIChannel* aChannel)