/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
DOMHighResTimeStamp PerformanceNavigationTiming::UnloadEventStart() const {
DOMHighResTimeStamp rawValue = 0; /* * Per Navigation Timing Level 2, the value is 0 if * a. there is no previous document or * b. the same-origin-check fails. * * The same-origin-check is defined as: * 1. If the previous document exists and its origin is not same * origin as the current document's origin, return "fail". * 2. Let request be the current document's request. * 3. If request's redirect count is not zero, and all of request's * HTTP redirects have the same origin as the current document, * return "pass". * 4. Otherwise, return "fail".
*/ if (mTimingData->AllRedirectsSameOrigin()) { // same-origin-check:2/3 /* * GetUnloadEventStartHighRes returns 0 if * 1. there is no previous document (a, above) or * 2. the current URI does not have the same origin as * the previous document's URI. (same-origin-check:1)
*/
rawValue = mPerformance->GetDOMTiming()->GetUnloadEventStartHighRes();
}
// See comments in PerformanceNavigationTiming::UnloadEventEnd(). if (mTimingData->AllRedirectsSameOrigin()) {
rawValue = mPerformance->GetDOMTiming()->GetUnloadEventEndHighRes();
}
NavigationTimingType PerformanceNavigationTiming::Type() const { switch (mPerformance->GetDOMTiming()->GetType()) { case nsDOMNavigationTiming::TYPE_NAVIGATE: return NavigationTimingType::Navigate; break; case nsDOMNavigationTiming::TYPE_RELOAD: return NavigationTimingType::Reload; break; case nsDOMNavigationTiming::TYPE_BACK_FORWARD: return NavigationTimingType::Back_forward; break; default: // The type is TYPE_RESERVED or some other value that was later added. // We fallback to the default of Navigate. return NavigationTimingType::Navigate;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.