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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 1781783002: Implement support for link type serviceworker in link elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 27 matching lines...) Expand all
38 #include "core/fetch/CSSStyleSheetResource.h" 38 #include "core/fetch/CSSStyleSheetResource.h"
39 #include "core/fetch/FetchRequest.h" 39 #include "core/fetch/FetchRequest.h"
40 #include "core/fetch/ResourceFetcher.h" 40 #include "core/fetch/ResourceFetcher.h"
41 #include "core/frame/FrameView.h" 41 #include "core/frame/FrameView.h"
42 #include "core/frame/LocalFrame.h" 42 #include "core/frame/LocalFrame.h"
43 #include "core/frame/SubresourceIntegrity.h" 43 #include "core/frame/SubresourceIntegrity.h"
44 #include "core/frame/UseCounter.h" 44 #include "core/frame/UseCounter.h"
45 #include "core/frame/csp/ContentSecurityPolicy.h" 45 #include "core/frame/csp/ContentSecurityPolicy.h"
46 #include "core/html/CrossOriginAttribute.h" 46 #include "core/html/CrossOriginAttribute.h"
47 #include "core/html/LinkManifest.h" 47 #include "core/html/LinkManifest.h"
48 #include "core/html/LinkServiceWorker.h"
48 #include "core/html/imports/LinkImport.h" 49 #include "core/html/imports/LinkImport.h"
49 #include "core/inspector/ConsoleMessage.h" 50 #include "core/inspector/ConsoleMessage.h"
50 #include "core/loader/FrameLoader.h" 51 #include "core/loader/FrameLoader.h"
51 #include "core/loader/FrameLoaderClient.h" 52 #include "core/loader/FrameLoaderClient.h"
52 #include "core/loader/NetworkHintsInterface.h" 53 #include "core/loader/NetworkHintsInterface.h"
53 #include "core/style/StyleInheritedData.h" 54 #include "core/style/StyleInheritedData.h"
54 #include "platform/ContentType.h" 55 #include "platform/ContentType.h"
55 #include "platform/Histogram.h" 56 #include "platform/Histogram.h"
56 #include "platform/MIMETypeRegistry.h" 57 #include "platform/MIMETypeRegistry.h"
57 #include "platform/RuntimeEnabledFeatures.h" 58 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 m_type = value; 187 m_type = value;
187 process(); 188 process();
188 } else if (name == asAttr) { 189 } else if (name == asAttr) {
189 m_as = value; 190 m_as = value;
190 process(); 191 process();
191 } else if (name == sizesAttr) { 192 } else if (name == sizesAttr) {
192 m_sizes->setValue(value); 193 m_sizes->setValue(value);
193 } else if (name == mediaAttr) { 194 } else if (name == mediaAttr) {
194 m_media = value.lower(); 195 m_media = value.lower();
195 process(); 196 process();
197 } else if (name == scopeAttr) {
198 m_scope = value;
199 process();
196 } else if (name == disabledAttr) { 200 } else if (name == disabledAttr) {
197 UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled); 201 UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled);
198 if (LinkStyle* link = linkStyle()) 202 if (LinkStyle* link = linkStyle())
199 link->setDisabledState(!value.isNull()); 203 link->setDisabledState(!value.isNull());
200 } else { 204 } else {
201 if (name == titleAttr) { 205 if (name == titleAttr) {
202 if (LinkStyle* link = linkStyle()) 206 if (LinkStyle* link = linkStyle())
203 link->setSheetTitle(value); 207 link->setSheetTitle(value);
204 } 208 }
205 209
(...skipping 17 matching lines...) Expand all
223 if (!visible) { 227 if (!visible) {
224 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); 228 ASSERT(!linkStyle() || !linkStyle()->hasSheet());
225 return nullptr; 229 return nullptr;
226 } 230 }
227 231
228 if (!m_link) { 232 if (!m_link) {
229 if (m_relAttribute.isImport()) { 233 if (m_relAttribute.isImport()) {
230 m_link = LinkImport::create(this); 234 m_link = LinkImport::create(this);
231 } else if (m_relAttribute.isManifest()) { 235 } else if (m_relAttribute.isManifest()) {
232 m_link = LinkManifest::create(this); 236 m_link = LinkManifest::create(this);
237 } else if (RuntimeEnabledFeatures::linkServiceworkerEnabled() && m_relAt tribute.isServiceWorker()) {
238 m_link = LinkServiceWorker::create(this);
233 } else { 239 } else {
Yoav Weiss 2016/03/17 11:21:13 Unrelated to this CL but we really need to clean t
Marijn Kruisselbrink 2016/03/17 19:53:34 Agreed, although it's not trivial to do so and sta
234 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this); 240 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this);
235 if (fastHasAttribute(disabledAttr)) { 241 if (fastHasAttribute(disabledAttr)) {
236 UseCounter::count(document(), UseCounter::HTMLLinkElementDisable d); 242 UseCounter::count(document(), UseCounter::HTMLLinkElementDisable d);
237 link->setDisabledState(true); 243 link->setDisabledState(true);
238 } 244 }
239 m_link = link.release(); 245 m_link = link.release();
240 } 246 }
241 } 247 }
242 248
243 return m_link.get(); 249 return m_link.get();
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 792 }
787 793
788 DEFINE_TRACE(LinkStyle) 794 DEFINE_TRACE(LinkStyle)
789 { 795 {
790 visitor->trace(m_sheet); 796 visitor->trace(m_sheet);
791 LinkResource::trace(visitor); 797 LinkResource::trace(visitor);
792 ResourceOwner<StyleSheetResource>::trace(visitor); 798 ResourceOwner<StyleSheetResource>::trace(visitor);
793 } 799 }
794 800
795 } // namespace blink 801 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698