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

Unified Diff: third_party/WebKit/Source/core/css/StyleSheetContents.cpp

Issue 2671173002: Change CSSParserContext to have a Document handle (vs UseCounter). (Closed)
Patch Set: comments 1 Created 3 years, 10 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/css/StyleSheetContents.cpp
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index 0e38ceab3898dbcb56d8971f303a46bbb436d259..ff289ed16b0cb378ed89c0c3f5a6698cf51746b6 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -39,6 +39,16 @@
namespace blink {
+// static
+const Document* StyleSheetContents::singleOwnerDocument(
+ const StyleSheetContents* styleSheetContents) {
+ // FIXME(https://crbug.com/242125): We may want to handle stylesheets that
haraken 2017/02/09 02:01:42 TODO
Bret 2017/02/09 02:08:18 Done.
+ // have multiple owners when this is used for UseCounter.
+ if (styleSheetContents && styleSheetContents->hasSingleOwnerNode())
+ return styleSheetContents->singleOwnerDocument();
+ return nullptr;
+}
+
// Rough size estimate for the memory cache.
unsigned StyleSheetContents::estimatedSizeInBytes() const {
// Note that this does not take into account size of the strings hanging from
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleSheetContents.h ('k') | third_party/WebKit/Source/core/css/parser/CSSAtRuleID.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698