Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1220)

Unified Diff: third_party/WebKit/Source/platform/network/ResourceError.cpp

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: check ERR_CACHE_MISS directly in ResourceError Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/network/ResourceError.cpp
diff --git a/third_party/WebKit/Source/platform/network/ResourceError.cpp b/third_party/WebKit/Source/platform/network/ResourceError.cpp
index 965065ed211dfb684fa3e23941383294599cb99b..4192904f5152cb2b8ec46e01b811a78a97171d53 100644
--- a/third_party/WebKit/Source/platform/network/ResourceError.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceError.cpp
@@ -26,6 +26,7 @@
#include "platform/network/ResourceError.h"
+#include "net/base/net_errors.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/Platform.h"
#include "public/platform/WebURL.h"
@@ -46,6 +47,13 @@ ResourceError ResourceError::cancelledDueToAccessCheckError(
return error;
}
+ResourceError ResourceError::cacheMissError() {
+ ResourceError error;
yhirano 2016/10/25 08:50:28 error.m_domain = String(net::kErrorDomain);
+ error.m_errorCode = net::ERR_CACHE_MISS;
+ error.m_isNull = false;
+ return error;
+}
+
ResourceError ResourceError::copy() const {
ResourceError errorCopy;
errorCopy.m_domain = m_domain.isolatedCopy();
@@ -61,6 +69,10 @@ ResourceError ResourceError::copy() const {
return errorCopy;
}
+bool ResourceError::isCacheMiss() const {
+ return m_errorCode == net::ERR_CACHE_MISS;
yhirano 2016/10/25 08:50:28 We need to check m_domain as well.
+}
+
bool ResourceError::compare(const ResourceError& a, const ResourceError& b) {
if (a.isNull() && b.isNull())
return true;

Powered by Google App Engine
This is Rietveld 408576698