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

Side by Side Diff: third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008, 2009 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 16 matching lines...) Expand all
27 #include "core/dom/IncrementLoadEventDelayCount.h" 27 #include "core/dom/IncrementLoadEventDelayCount.h"
28 #include "core/dom/StyleEngine.h" 28 #include "core/dom/StyleEngine.h"
29 #include "core/fetch/CSSStyleSheetResource.h" 29 #include "core/fetch/CSSStyleSheetResource.h"
30 #include "core/fetch/FetchInitiatorTypeNames.h" 30 #include "core/fetch/FetchInitiatorTypeNames.h"
31 #include "core/fetch/FetchRequest.h" 31 #include "core/fetch/FetchRequest.h"
32 #include "core/fetch/ResourceFetcher.h" 32 #include "core/fetch/ResourceFetcher.h"
33 #include "core/fetch/XSLStyleSheetResource.h" 33 #include "core/fetch/XSLStyleSheetResource.h"
34 #include "core/xml/DocumentXSLT.h" 34 #include "core/xml/DocumentXSLT.h"
35 #include "core/xml/XSLStyleSheet.h" 35 #include "core/xml/XSLStyleSheet.h"
36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes() 36 #include "core/xml/parser/XMLDocumentParser.h" // for parseAttributes()
37 #include <memory>
38 37
39 namespace blink { 38 namespace blink {
40 39
41 inline ProcessingInstruction::ProcessingInstruction(Document& document, const St ring& target, const String& data) 40 inline ProcessingInstruction::ProcessingInstruction(Document& document, const St ring& target, const String& data)
42 : CharacterData(document, data, CreateOther) 41 : CharacterData(document, data, CreateOther)
43 , m_target(target) 42 , m_target(target)
44 , m_loading(false) 43 , m_loading(false)
45 , m_alternate(false) 44 , m_alternate(false)
46 , m_isCSS(false) 45 , m_isCSS(false)
47 , m_isXSL(false) 46 , m_isXSL(false)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 217
219 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas eURL, const String& sheet) 218 void ProcessingInstruction::setXSLStyleSheet(const String& href, const KURL& bas eURL, const String& sheet)
220 { 219 {
221 if (!inShadowIncludingDocument()) { 220 if (!inShadowIncludingDocument()) {
222 DCHECK(!m_sheet); 221 DCHECK(!m_sheet);
223 return; 222 return;
224 } 223 }
225 224
226 DCHECK(m_isXSL); 225 DCHECK(m_isXSL);
227 m_sheet = XSLStyleSheet::create(this, href, baseURL); 226 m_sheet = XSLStyleSheet::create(this, href, baseURL);
228 std::unique_ptr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDela yCount::create(document()); 227 OwnPtr<IncrementLoadEventDelayCount> delay = IncrementLoadEventDelayCount::c reate(document());
229 parseStyleSheet(sheet); 228 parseStyleSheet(sheet);
230 } 229 }
231 230
232 void ProcessingInstruction::parseStyleSheet(const String& sheet) 231 void ProcessingInstruction::parseStyleSheet(const String& sheet)
233 { 232 {
234 if (m_isCSS) 233 if (m_isCSS)
235 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet); 234 toCSSStyleSheet(m_sheet.get())->contents()->parseString(sheet);
236 else if (m_isXSL) 235 else if (m_isXSL)
237 toXSLStyleSheet(m_sheet.get())->parseString(sheet); 236 toXSLStyleSheet(m_sheet.get())->parseString(sheet);
238 237
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 294
296 DEFINE_TRACE(ProcessingInstruction) 295 DEFINE_TRACE(ProcessingInstruction)
297 { 296 {
298 visitor->trace(m_sheet); 297 visitor->trace(m_sheet);
299 visitor->trace(m_listenerForXSLT); 298 visitor->trace(m_listenerForXSLT);
300 CharacterData::trace(visitor); 299 CharacterData::trace(visitor);
301 ResourceOwner<StyleSheetResource>::trace(visitor); 300 ResourceOwner<StyleSheetResource>::trace(visitor);
302 } 301 }
303 302
304 } // namespace blink 303 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NthIndexCacheTest.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698