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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.h

Issue 2835183002: Provide a method to remove inserted style sheet (Closed)
Patch Set: review feedback Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/StyleEngine.h
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h
index 6b7206772724c3bbbfce8c77bf4964bafec46250..8ce8c9ba7d580553624b507126b02aee6d4ee6ab 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.h
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.h
@@ -31,6 +31,7 @@
#define StyleEngine_h
#include <memory>
+#include <utility>
#include "core/CoreExport.h"
#include "core/css/ActiveStyleSheets.h"
#include "core/css/CSSFontSelectorClient.h"
@@ -93,7 +94,7 @@ class CORE_EXPORT StyleEngine final
const HeapVector<TraceWrapperMember<StyleSheet>>&
StyleSheetsForStyleSheetList(TreeScope&);
- const HeapVector<TraceWrapperMember<CSSStyleSheet>>&
+ const HeapVector<std::pair<unsigned, TraceWrapperMember<CSSStyleSheet>>>&
InjectedAuthorStyleSheets() const {
return injected_author_style_sheets_;
}
@@ -112,7 +113,8 @@ class CORE_EXPORT StyleEngine final
void ViewportRulesChanged();
void HtmlImportAddedOrRemoved();
- void InjectAuthorSheet(StyleSheetContents* author_sheet);
+ unsigned InjectAuthorSheet(StyleSheetContents* author_sheet);
rune 2017/05/18 13:13:21 I think I would've used an stylesheet id type in t
limasdf 2017/05/18 14:32:26 Done.
+ void RemoveInjectedAuthorSheet(unsigned author_sheet_id);
CSSStyleSheet& EnsureInspectorStyleSheet();
RuleSet* WatchedSelectorsRuleSet() {
return global_rule_set_.WatchedSelectorsRuleSet();
@@ -344,7 +346,8 @@ class CORE_EXPORT StyleEngine final
int pending_render_blocking_stylesheets_ = 0;
int pending_body_stylesheets_ = 0;
- HeapVector<TraceWrapperMember<CSSStyleSheet>> injected_author_style_sheets_;
+ HeapVector<std::pair<unsigned, TraceWrapperMember<CSSStyleSheet>>>
+ injected_author_style_sheets_;
Member<CSSStyleSheet> inspector_style_sheet_;
TraceWrapperMember<DocumentStyleSheetCollection>
@@ -387,6 +390,8 @@ class CORE_EXPORT StyleEngine final
std::unique_ptr<StyleResolverStats> style_resolver_stats_;
unsigned style_for_element_count_ = 0;
+ unsigned injected_author_sheets_id_count_ = 0;
+
friend class StyleEngineTest;
};

Powered by Google App Engine
This is Rietveld 408576698