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

Side by Side Diff: third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp

Issue 1577073005: Add <link rel=preload> onload support for scripts and styles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed lifetime issue of LinkPreloadResourceClients Created 4 years, 11 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 { 113 {
114 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify() 114 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify()
115 if (m_data) 115 if (m_data)
116 m_decodedSheetText = decodedText(); 116 m_decodedSheetText = decodedText();
117 117
118 ResourceClientWalker<StyleSheetResourceClient> w(m_clients); 118 ResourceClientWalker<StyleSheetResourceClient> w(m_clients);
119 while (StyleSheetResourceClient* c = w.next()) 119 while (StyleSheetResourceClient* c = w.next())
120 c->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), encoding( ), this); 120 c->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), encoding( ), this);
121 // Clear the decoded text as it is unlikely to be needed immediately again a nd is cheap to regenerate. 121 // Clear the decoded text as it is unlikely to be needed immediately again a nd is cheap to regenerate.
122 m_decodedSheetText = String(); 122 m_decodedSheetText = String();
123 Resource::checkNotify();
Nate Chapin 2016/01/13 23:52:23 As long as CSSStyleSheetResource has its own speci
Yoav Weiss 2016/01/14 10:10:02 Previous iterations made me believe that this is n
123 } 124 }
124 125
125 bool CSSStyleSheetResource::isSafeToUnlock() const 126 bool CSSStyleSheetResource::isSafeToUnlock() const
126 { 127 {
127 return m_data->hasOneRef(); 128 return m_data->hasOneRef();
128 } 129 }
129 130
130 void CSSStyleSheetResource::destroyDecodedDataIfPossible() 131 void CSSStyleSheetResource::destroyDecodedDataIfPossible()
131 { 132 {
132 if (!m_parsedStyleSheetCache) 133 if (!m_parsedStyleSheetCache)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 184
184 if (m_parsedStyleSheetCache) 185 if (m_parsedStyleSheetCache)
185 m_parsedStyleSheetCache->removedFromMemoryCache(); 186 m_parsedStyleSheetCache->removedFromMemoryCache();
186 m_parsedStyleSheetCache = sheet; 187 m_parsedStyleSheetCache = sheet;
187 m_parsedStyleSheetCache->addedToMemoryCache(); 188 m_parsedStyleSheetCache->addedToMemoryCache();
188 189
189 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); 190 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
190 } 191 }
191 192
192 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698