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

Side by Side Diff: third_party/WebKit/Source/web/WebDocument.cpp

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: fix fuzzer compile again Created 3 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
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp ('k') | no next file » | 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 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 WebElement WebDocument::focusedElement() const { 181 WebElement WebDocument::focusedElement() const {
182 return WebElement(constUnwrap<Document>()->focusedElement()); 182 return WebElement(constUnwrap<Document>()->focusedElement());
183 } 183 }
184 184
185 void WebDocument::insertStyleSheet(const WebString& sourceCode) { 185 void WebDocument::insertStyleSheet(const WebString& sourceCode) {
186 Document* document = unwrap<Document>(); 186 Document* document = unwrap<Document>();
187 DCHECK(document); 187 DCHECK(document);
188 StyleSheetContents* parsedSheet = 188 StyleSheetContents* parsedSheet =
189 StyleSheetContents::create(CSSParserContext(*document, nullptr)); 189 StyleSheetContents::create(CSSParserContext::create(*document));
190 parsedSheet->parseString(sourceCode); 190 parsedSheet->parseString(sourceCode);
191 document->styleEngine().injectAuthorSheet(parsedSheet); 191 document->styleEngine().injectAuthorSheet(parsedSheet);
192 } 192 }
193 193
194 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) { 194 void WebDocument::watchCSSSelectors(const WebVector<WebString>& webSelectors) {
195 Document* document = unwrap<Document>(); 195 Document* document = unwrap<Document>();
196 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document); 196 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*document);
197 if (!watch && webSelectors.isEmpty()) 197 if (!watch && webSelectors.isEmpty())
198 return; 198 return;
199 Vector<String> selectors; 199 Vector<String> selectors;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 WebDocument& WebDocument::operator=(Document* elem) { 296 WebDocument& WebDocument::operator=(Document* elem) {
297 m_private = elem; 297 m_private = elem;
298 return *this; 298 return *this;
299 } 299 }
300 300
301 WebDocument::operator Document*() const { 301 WebDocument::operator Document*() const {
302 return toDocument(m_private.get()); 302 return toDocument(m_private.get());
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698