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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSStyleSheet.cpp

Issue 1807323002: [WeakMemoryCache 1a] Make Reference from Inspector to Resource weak, remove removedFromMemoryCache() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove some comments Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 m_contents->registerClient(this); 131 m_contents->registerClient(this);
132 } 132 }
133 133
134 CSSStyleSheet::~CSSStyleSheet() 134 CSSStyleSheet::~CSSStyleSheet()
135 { 135 {
136 } 136 }
137 137
138 void CSSStyleSheet::willMutateRules() 138 void CSSStyleSheet::willMutateRules()
139 { 139 {
140 // If we are the only client it is safe to mutate. 140 // If we are the only client it is safe to mutate.
141 if (m_contents->clientSize() <= 1 && !m_contents->isInMemoryCache()) { 141 if (m_contents->clientSize() <= 1 && !m_contents->isReferencedFromResource() ) {
142 m_contents->clearRuleSet(); 142 m_contents->clearRuleSet();
143 if (Document* document = ownerDocument()) 143 if (Document* document = ownerDocument())
144 m_contents->removeSheetFromCache(document); 144 m_contents->removeSheetFromCache(document);
145 m_contents->setMutable(); 145 m_contents->setMutable();
146 return; 146 return;
147 } 147 }
148 // Only cacheable stylesheets should have multiple clients. 148 // Only cacheable stylesheets should have multiple clients.
149 ASSERT(m_contents->isCacheable()); 149 ASSERT(m_contents->isCacheable());
150 150
151 // Copy-on-write. 151 // Copy-on-write.
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 visitor->trace(m_mediaQueries); 430 visitor->trace(m_mediaQueries);
431 visitor->trace(m_ownerNode); 431 visitor->trace(m_ownerNode);
432 visitor->trace(m_ownerRule); 432 visitor->trace(m_ownerRule);
433 visitor->trace(m_mediaCSSOMWrapper); 433 visitor->trace(m_mediaCSSOMWrapper);
434 visitor->trace(m_childRuleCSSOMWrappers); 434 visitor->trace(m_childRuleCSSOMWrappers);
435 visitor->trace(m_ruleListCSSOMWrapper); 435 visitor->trace(m_ruleListCSSOMWrapper);
436 StyleSheet::trace(visitor); 436 StyleSheet::trace(visitor);
437 } 437 }
438 438
439 } // namespace blink 439 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698