https://bugs.webkit.org/show_bug.cgi?id=172744
Reviewed by Saam Barati.
Source/WebCore:
Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
* fileapi/FileReader.cpp:
* inspector/InspectorOverlay.cpp:
* loader/CrossOriginPreflightResultCache.cpp:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime):
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::threadBody):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
* platform/network/CacheValidation.cpp:
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/CacheValidation.h:
Source/WebKit2:
Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
* NetworkProcess/cache/NetworkCache.cpp:
* NetworkProcess/cache/NetworkCacheFileSystem.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::computeRecordWorth):
* Shared/mac/RemoteLayerBackingStoreCollection.mm:
* WebProcess/Cookies/WebCookieManager.h:
Source/WTF:
We hates std::chrono. Don't include it everywhere to discourage use.
* wtf/StdLibExtras.h:
Tools:
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217603
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-05-31 Simon Fraser <simon.fraser@apple.com>
+
+ Get <chrono> out of StdLibExtras.h
+ https://bugs.webkit.org/show_bug.cgi?id=172744
+
+ Reviewed by Saam Barati.
+
+ We hates std::chrono. Don't include it everywhere to discourage use.
+
+ * wtf/StdLibExtras.h:
+
2017-05-30 Ryosuke Niwa <rniwa@webkit.org>
Only include DataDetectorsUI headers in iOS
#ifndef WTF_StdLibExtras_h
#define WTF_StdLibExtras_h
-#include <chrono>
#include <cstring>
#include <memory>
#include <type_traits>
using WTF::safeCast;
using WTF::tryBinarySearch;
-#if !COMPILER(CLANG) || __cplusplus >= 201400L
-// We normally don't want to bring in entire std namespaces, but literals are an exception.
-using namespace std::literals::chrono_literals;
-#endif
-
#endif // WTF_StdLibExtras_h
+2017-05-31 Simon Fraser <simon.fraser@apple.com>
+
+ Get <chrono> out of StdLibExtras.h
+ https://bugs.webkit.org/show_bug.cgi?id=172744
+
+ Reviewed by Saam Barati.
+
+ Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
+
+ * fileapi/FileReader.cpp:
+ * inspector/InspectorOverlay.cpp:
+ * loader/CrossOriginPreflightResultCache.cpp:
+ * loader/cache/CachedResource.cpp:
+ (WebCore::CachedResource::freshnessLifetime):
+ * page/ResourceUsageThread.cpp:
+ (WebCore::ResourceUsageThread::threadBody):
+ * page/cocoa/MemoryReleaseCocoa.mm:
+ (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
+ * platform/network/CacheValidation.cpp:
+ (WebCore::computeFreshnessLifetimeForHTTPFamily):
+ * platform/network/CacheValidation.h:
+
2017-05-31 Emilio Cobos Álvarez <ecobos@igalia.com>
Use the rare data's RenderStyle for display: contents.
namespace WebCore {
+using namespace std::literals::chrono_literals;
+
// Fire the progress event at least every 50ms.
static const auto progressNotificationInterval = 50ms;
#include <inspector/InspectorValues.h>
using namespace Inspector;
+using namespace std::literals::chrono_literals;
namespace WebCore {
#include "ResourceResponse.h"
#include <wtf/MainThread.h>
#include <wtf/NeverDestroyed.h>
-#include <wtf/StdLibExtras.h>
namespace WebCore {
+using namespace std::literals::chrono_literals;
+
// These values are at the discretion of the user agent.
static const auto defaultPreflightCacheTimeout = 5s;
static const auto maxPreflightCacheTimeout = 600s; // Should be short enough to minimize the risk of using a poisoned cache after switching to a secure network.
std::chrono::microseconds CachedResource::freshnessLifetime(const ResourceResponse& response) const
{
+ using namespace std::literals::chrono_literals;
+
if (!response.url().protocolIsInHTTPFamily()) {
StringView protocol = response.url().protocol();
if (!shouldCacheSchemeIndefinitely(protocol)) {
NO_RETURN void ResourceUsageThread::threadBody()
{
+ using namespace std::literals::chrono_literals;
+
while (true) {
// Only do work if we have observers.
waitUntilObservers();
void jettisonExpensiveObjectsOnTopLevelNavigation()
{
#if PLATFORM(IOS)
+ using namespace std::literals::chrono_literals;
+
// Protect against doing excessive jettisoning during repeated navigations.
const auto minimumTimeSinceNavigation = 2s;
namespace WebCore {
+using namespace std::literals::chrono_literals;
+
// These response headers are not copied from a revalidated response to the
// cached response headers. For compatibility, this list is based on Chromium's
// net/http/http_response_headers.cc.
std::chrono::microseconds computeFreshnessLifetimeForHTTPFamily(const ResourceResponse& response, std::chrono::system_clock::time_point responseTime)
{
using namespace std::chrono;
+
ASSERT(response.url().protocolIsInHTTPFamily());
// Freshness Lifetime:
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CacheValidation_h
-#define CacheValidation_h
+#pragma once
#include "PlatformExportMacros.h"
#include "SessionID.h"
+#include <chrono>
#include <wtf/Optional.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
WEBCORE_EXPORT bool isStatusCodePotentiallyCacheable(int statusCode);
}
-
-#endif
+2017-05-31 Simon Fraser <simon.fraser@apple.com>
+
+ Get <chrono> out of StdLibExtras.h
+ https://bugs.webkit.org/show_bug.cgi?id=172744
+
+ Reviewed by Saam Barati.
+
+ Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
+
+ * NetworkProcess/cache/NetworkCache.cpp:
+ * NetworkProcess/cache/NetworkCacheFileSystem.h:
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ * NetworkProcess/cache/NetworkCacheStorage.cpp:
+ (WebKit::NetworkCache::computeRecordWorth):
+ * Shared/mac/RemoteLayerBackingStoreCollection.mm:
+ * WebProcess/Cookies/WebCookieManager.h:
+
2017-05-31 Zan Dobersek <zdobersek@igalia.com>
CoordinatedLayerTreeHost: properly support async force repaints
#include <notify.h>
#endif
+using namespace std::literals::chrono_literals;
+
namespace WebKit {
namespace NetworkCache {
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef NetworkCacheFileSystem_h
-#define NetworkCacheFileSystem_h
+#pragma once
#if ENABLE(NETWORK_CACHE)
#include <WebCore/FileSystem.h>
+#include <chrono>
#include <functional>
namespace WebKit {
}
#endif
-
-#endif
-
namespace NetworkCache {
using namespace WebCore;
+using namespace std::literals::chrono_literals;
static const Seconds preloadedEntryLifetime { 10_s };
static double computeRecordWorth(FileTimes times)
{
using namespace std::chrono;
+ using namespace std::literals::chrono_literals;
+
auto age = system_clock::now() - times.creation;
// File modification time is updated manually on cache read. We don't use access time since OS may update it automatically.
auto accessAge = times.modification - times.creation;
#import "RemoteLayerBackingStore.h"
#import "RemoteLayerTreeContext.h"
+using namespace std::literals::chrono_literals;
+
const std::chrono::seconds volatileBackingStoreAgeThreshold = 1s;
const std::chrono::milliseconds volatileSecondaryBackingStoreAgeThreshold = 200ms;
const Seconds volatilityTimerInterval = 200_ms;
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebCookieManager_h
-#define WebCookieManager_h
+#pragma once
#include "HTTPCookieAcceptPolicy.h"
#include "MessageReceiver.h"
#include "NetworkProcessSupplement.h"
#include "WebProcessSupplement.h"
#include <WebCore/SessionID.h>
+#include <chrono>
#include <stdint.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
};
} // namespace WebKit
-
-#endif // WebCookieManager_h
+2017-05-31 Simon Fraser <simon.fraser@apple.com>
+
+ Get <chrono> out of StdLibExtras.h
+ https://bugs.webkit.org/show_bug.cgi?id=172744
+
+ Reviewed by Saam Barati.
+
+ * TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
+
2017-05-30 Tim Horton <timothy_horton@apple.com>
Keyboard autocorrections do not apply with an active selection (but keyboard acts like they did)
namespace TestWebKitAPI {
+using namespace std::literals::chrono_literals;
+
static const char* simpleTestLabel = "simpleTest";
static const char* longTestLabel = "longTest";
static const char* thirdTestLabel = "thirdTest";