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

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

Issue 2353903002: {CSS,XSL}StyleSheetResource should mark their clients as finished on checkNotify (Closed)
Patch Set: yhirano style Created 4 years, 3 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 m_didNotifyFirstData = true; 113 m_didNotifyFirstData = true;
114 } 114 }
115 115
116 void CSSStyleSheetResource::checkNotify() 116 void CSSStyleSheetResource::checkNotify()
117 { 117 {
118 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify() 118 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify()
119 if (data()) 119 if (data())
120 m_decodedSheetText = decodedText(); 120 m_decodedSheetText = decodedText();
121 121
122 ResourceClientWalker<StyleSheetResourceClient> w(clients()); 122 ResourceClientWalker<StyleSheetResourceClient> w(clients());
123 while (StyleSheetResourceClient* c = w.next()) 123 while (StyleSheetResourceClient* c = w.next()) {
124 markClientFinished(c);
124 c->setCSSStyleSheet(resourceRequest().url(), response().url(), encoding( ), this); 125 c->setCSSStyleSheet(resourceRequest().url(), response().url(), encoding( ), this);
126 }
125 // Clear the decoded text as it is unlikely to be needed immediately again a nd is cheap to regenerate. 127 // Clear the decoded text as it is unlikely to be needed immediately again a nd is cheap to regenerate.
126 m_decodedSheetText = String(); 128 m_decodedSheetText = String();
127 } 129 }
128 130
129 void CSSStyleSheetResource::destroyDecodedDataIfPossible() 131 void CSSStyleSheetResource::destroyDecodedDataIfPossible()
130 { 132 {
131 if (!m_parsedStyleSheetCache) 133 if (!m_parsedStyleSheetCache)
132 return; 134 return;
133 135
134 setParsedStyleSheetCache(nullptr); 136 setParsedStyleSheetCache(nullptr);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // This stylesheet resource did conflict with another resource and was 185 // This stylesheet resource did conflict with another resource and was
184 // not added to the cache. 186 // not added to the cache.
185 setParsedStyleSheetCache(nullptr); 187 setParsedStyleSheetCache(nullptr);
186 return; 188 return;
187 } 189 }
188 setParsedStyleSheetCache(sheet); 190 setParsedStyleSheetCache(sheet);
189 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); 191 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
190 } 192 }
191 193
192 } // namespace blink 194 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698