Quelle CacheablePerformanceTimingData.h
Sprache: unbekannt
/* -*- 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/. */
// The subset of PerformanceResourceTiming data that can be cached for the // subsequent requests from a compatible principal. // // This includes the data extracted from the server response, but doesn't // include any timing data. class CacheablePerformanceTimingData { public:
CacheablePerformanceTimingData() = default;
// Cached result of CheckBodyInfoAccessAllowedForOrigin.
nsITimedChannel::BodyInfoAccess BodyInfoAccessAllowed() const { return mBodyInfoAccessAllowed;
}
// Cached result of CheckTimingAllowedForOrigin. If false, security sensitive // attributes of the resourceTiming object will be set to 0 bool TimingAllowed() const { return mTimingAllowed; }
private: // Checks if the bodyInfo for Resource and Navigation Timing should be // kept opaque or exposed, per Fetch spec.
nsITimedChannel::BodyInfoAccess CheckBodyInfoAccessAllowedForOrigin(
nsIHttpChannel* aResourceChannel, nsITimedChannel* aChannel);
// Checks if the resource is either same origin as the page that started // the load, or if the response contains the Timing-Allow-Origin header // with a value of * or matching the domain of the loading Principal bool CheckTimingAllowedForOrigin(nsIHttpChannel* aResourceChannel,
nsITimedChannel* aChannel);