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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix IPC Created 3 years, 4 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/core/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 058fa55d1ca65e46813fab36f259e1bc5ea7c8c0..ebeaefb836070ba17bcf6d967b15f77db0adeda0 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -46,6 +46,19 @@
namespace blink {
+namespace {
+WebServiceWorkerUpdateViaCache ParseUpdateViaCache(const AtomicString& value) {
+ if (value == "imports")
+ return WebServiceWorkerUpdateViaCache::kImports;
+ if (value == "all")
+ return WebServiceWorkerUpdateViaCache::kAll;
+ if (value == "none")
+ return WebServiceWorkerUpdateViaCache::kNone;
+ // Default value
+ return WebServiceWorkerUpdateViaCache::kImports;
+}
+} // namespace
+
using namespace HTMLNames;
inline HTMLLinkElement::HTMLLinkElement(Document& document,
@@ -103,6 +116,9 @@ void HTMLLinkElement::ParseAttribute(
} else if (name == scopeAttr) {
scope_ = value;
Process();
+ } else if (name == updateviacacheAttr) {
+ update_via_cache_ = ParseUpdateViaCache(value);
+ Process();
} else if (name == disabledAttr) {
UseCounter::Count(GetDocument(), WebFeature::kHTMLLinkElementDisabled);
if (LinkStyle* link = GetLinkStyle())
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698