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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 7 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 28 matching lines...) Expand all
39 #include "core/html/imports/LinkImport.h" 39 #include "core/html/imports/LinkImport.h"
40 #include "core/inspector/ConsoleMessage.h" 40 #include "core/inspector/ConsoleMessage.h"
41 #include "core/loader/NetworkHintsInterface.h" 41 #include "core/loader/NetworkHintsInterface.h"
42 #include "core/origin_trials/OriginTrials.h" 42 #include "core/origin_trials/OriginTrials.h"
43 #include "platform/weborigin/SecurityPolicy.h" 43 #include "platform/weborigin/SecurityPolicy.h"
44 #include "public/platform/WebIconSizesParser.h" 44 #include "public/platform/WebIconSizesParser.h"
45 #include "public/platform/WebSize.h" 45 #include "public/platform/WebSize.h"
46 46
47 namespace blink { 47 namespace blink {
48 48
49 namespace {
50 WebServiceWorkerUpdateViaCache ParseUpdateViaCache(const AtomicString& value) {
51 if (value == "imports")
52 return WebServiceWorkerUpdateViaCache::kImports;
53 if (value == "all")
54 return WebServiceWorkerUpdateViaCache::kAll;
55 if (value == "none")
56 return WebServiceWorkerUpdateViaCache::kNone;
57 // Default value
58 return WebServiceWorkerUpdateViaCache::kImports;
59 }
60 } // namespace
61
49 using namespace HTMLNames; 62 using namespace HTMLNames;
50 63
51 inline HTMLLinkElement::HTMLLinkElement(Document& document, 64 inline HTMLLinkElement::HTMLLinkElement(Document& document,
52 bool created_by_parser) 65 bool created_by_parser)
53 : HTMLElement(linkTag, document), 66 : HTMLElement(linkTag, document),
54 link_loader_(LinkLoader::Create(this)), 67 link_loader_(LinkLoader::Create(this)),
55 sizes_(DOMTokenList::Create(*this, HTMLNames::sizesAttr)), 68 sizes_(DOMTokenList::Create(*this, HTMLNames::sizesAttr)),
56 rel_list_(this, RelList::Create(this)), 69 rel_list_(this, RelList::Create(this)),
57 created_by_parser_(created_by_parser) {} 70 created_by_parser_(created_by_parser) {}
58 71
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 icon_sizes_.resize(web_icon_sizes.size()); 109 icon_sizes_.resize(web_icon_sizes.size());
97 for (size_t i = 0; i < web_icon_sizes.size(); ++i) 110 for (size_t i = 0; i < web_icon_sizes.size(); ++i)
98 icon_sizes_[i] = web_icon_sizes[i]; 111 icon_sizes_[i] = web_icon_sizes[i];
99 Process(); 112 Process();
100 } else if (name == mediaAttr) { 113 } else if (name == mediaAttr) {
101 media_ = value.DeprecatedLower(); 114 media_ = value.DeprecatedLower();
102 Process(); 115 Process();
103 } else if (name == scopeAttr) { 116 } else if (name == scopeAttr) {
104 scope_ = value; 117 scope_ = value;
105 Process(); 118 Process();
119 } else if (name == updateviacacheAttr) {
120 update_via_cache_ = ParseUpdateViaCache(value);
121 Process();
106 } else if (name == disabledAttr) { 122 } else if (name == disabledAttr) {
107 UseCounter::Count(GetDocument(), WebFeature::kHTMLLinkElementDisabled); 123 UseCounter::Count(GetDocument(), WebFeature::kHTMLLinkElementDisabled);
108 if (LinkStyle* link = GetLinkStyle()) 124 if (LinkStyle* link = GetLinkStyle())
109 link->SetDisabledState(!value.IsNull()); 125 link->SetDisabledState(!value.IsNull());
110 } else { 126 } else {
111 if (name == titleAttr) { 127 if (name == titleAttr) {
112 if (LinkStyle* link = GetLinkStyle()) 128 if (LinkStyle* link = GetLinkStyle())
113 link->SetSheetTitle(value); 129 link->SetSheetTitle(value);
114 } 130 }
115 131
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 HTMLElement::Trace(visitor); 385 HTMLElement::Trace(visitor);
370 LinkLoaderClient::Trace(visitor); 386 LinkLoaderClient::Trace(visitor);
371 } 387 }
372 388
373 DEFINE_TRACE_WRAPPERS(HTMLLinkElement) { 389 DEFINE_TRACE_WRAPPERS(HTMLLinkElement) {
374 visitor->TraceWrappers(rel_list_); 390 visitor->TraceWrappers(rel_list_);
375 HTMLElement::TraceWrappers(visitor); 391 HTMLElement::TraceWrappers(visitor);
376 } 392 }
377 393
378 } // namespace blink 394 } // namespace blink
OLDNEW
« 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