haikuwebkit/Source/WebCore/page/PerformanceServerTiming.cpp

47 lines
2.0 KiB
C++
Raw Permalink Normal View History

Runtime feature flag for Server-Timing https://bugs.webkit.org/show_bug.cgi?id=184758 Patch by Charles Vazac <cvazac@gmail.com> on 2018-05-11 Reviewed by Youenn Fablet. Source/WebCore: * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl. * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl. * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp. * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl. * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming. * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member. * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute. * Source/WebCore/page/PerformanceServerTiming.cpp: Added. * Source/WebCore/page/PerformanceServerTiming.h: Added. * Source/WebCore/page/PerformanceServerTiming.idl: Added. Source/WebKit: * Shared/WebPreferences.yaml: Added ServerTimingEnabled. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetServerTimingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled. * WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled. Source/WebKitLegacy: * mac/WebView/WebPreferenceKeysPrivate.h: Added server-timing preference. * mac/WebView/WebPreferences.mm: (WebKit::WebPreferences::serverTimingEnabled): (WebKit::WebPreferences::setServerTimingEnabled): * mac/WebView/WebPreferencesPrivate.h: (WebKit::WebPreferences::setServerTimingEnabled): (WebKit::WebPreferences::serverTimingEnabled): * mac/WebView/WebView.mm: Set runtime enabled feature based on preference. * win/Interfaces/IWebPreferencesPrivate.idl: define serverTimingEnabled and setServerTimingEnabled. * win/WebPreferenceKeysPrivate.h: Added server-timing preference. * win/WebPreferences.cpp: Initialize server-timing as false and define setter and getter. (WebKit::WebPreferences::serverTimingEnabled): (WebKit::WebPreferences::setServerTimingEnabled): * win/WebPreferences.h: Define serverTimingEnabled and setServerTimingEnabled. * win/WebView.cpp: Set runtime enabled feature based on preference. Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: added ENABLE_SERVER_TIMING. * DumpRenderTree/win/DumpRenderTree.cpp: enable Server Timing LayoutTests: * imported/w3c/resources/import-expectations.json: Import server-timing tests. * imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html: Added. * imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt: Added. * platform/ios-wk1/TestExpectations: Skip service-worker test. * platform/mac-wk1/TestExpectations: Skip service-worker test. * platform/win/TestExpectations: Skip service-worker test. Canonical link: https://commits.webkit.org/201041@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-11 18:33:43 +00:00
/*
* Copyright 2017 The Chromium Authors. All rights reserved.
* Copyright (C) 2018 Akamai Technologies Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "PerformanceServerTiming.h"
namespace WebCore {
Ref<PerformanceServerTiming> PerformanceServerTiming::create(String&& name, double duration, String&& description)
{
return adoptRef(*new PerformanceServerTiming(WTFMove(name), duration, WTFMove(description)));
}
PerformanceServerTiming::PerformanceServerTiming(String&& name, double duration, String&& description)
: m_name(WTFMove(name))
, m_duration(duration)
, m_description(WTFMove(description))
{
}
PerformanceServerTiming::~PerformanceServerTiming() = default;
} // namespace WebCore