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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLToken.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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) 2013 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2013 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef HTMLToken_h 26 #ifndef HTMLToken_h
27 #define HTMLToken_h 27 #define HTMLToken_h
28 28
29 #include "core/dom/Attribute.h" 29 #include "core/dom/Attribute.h"
30 #include "core/html/parser/HTMLParserIdioms.h" 30 #include "core/html/parser/HTMLParserIdioms.h"
31 #include "wtf/Forward.h" 31 #include "wtf/Forward.h"
32 #include "wtf/PassOwnPtr.h" 32 #include "wtf/PtrUtil.h"
33 #include <memory>
33 34
34 namespace blink { 35 namespace blink {
35 36
36 class DoctypeData { 37 class DoctypeData {
37 USING_FAST_MALLOC(DoctypeData); 38 USING_FAST_MALLOC(DoctypeData);
38 WTF_MAKE_NONCOPYABLE(DoctypeData); 39 WTF_MAKE_NONCOPYABLE(DoctypeData);
39 public: 40 public:
40 DoctypeData() 41 DoctypeData()
41 : m_hasPublicIdentifier(false) 42 : m_hasPublicIdentifier(false)
42 , m_hasSystemIdentifier(false) 43 , m_hasSystemIdentifier(false)
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void setForceQuirks() 193 void setForceQuirks()
193 { 194 {
194 ASSERT(m_type == DOCTYPE); 195 ASSERT(m_type == DOCTYPE);
195 m_doctypeData->m_forceQuirks = true; 196 m_doctypeData->m_forceQuirks = true;
196 } 197 }
197 198
198 void beginDOCTYPE() 199 void beginDOCTYPE()
199 { 200 {
200 ASSERT(m_type == Uninitialized); 201 ASSERT(m_type == Uninitialized);
201 m_type = DOCTYPE; 202 m_type = DOCTYPE;
202 m_doctypeData = adoptPtr(new DoctypeData); 203 m_doctypeData = wrapUnique(new DoctypeData);
203 } 204 }
204 205
205 void beginDOCTYPE(UChar character) 206 void beginDOCTYPE(UChar character)
206 { 207 {
207 ASSERT(character); 208 ASSERT(character);
208 beginDOCTYPE(); 209 beginDOCTYPE();
209 m_data.append(character); 210 m_data.append(character);
210 m_orAllData |= character; 211 m_orAllData |= character;
211 } 212 }
212 213
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 248 }
248 249
249 void appendToSystemIdentifier(UChar character) 250 void appendToSystemIdentifier(UChar character)
250 { 251 {
251 ASSERT(character); 252 ASSERT(character);
252 ASSERT(m_type == DOCTYPE); 253 ASSERT(m_type == DOCTYPE);
253 ASSERT(m_doctypeData->m_hasSystemIdentifier); 254 ASSERT(m_doctypeData->m_hasSystemIdentifier);
254 m_doctypeData->m_systemIdentifier.append(character); 255 m_doctypeData->m_systemIdentifier.append(character);
255 } 256 }
256 257
257 PassOwnPtr<DoctypeData> releaseDoctypeData() 258 std::unique_ptr<DoctypeData> releaseDoctypeData()
258 { 259 {
259 return std::move(m_doctypeData); 260 return std::move(m_doctypeData);
260 } 261 }
261 262
262 /* Start/End Tag Tokens */ 263 /* Start/End Tag Tokens */
263 264
264 bool selfClosing() const 265 bool selfClosing() const
265 { 266 {
266 ASSERT(m_type == StartTag || m_type == EndTag); 267 ASSERT(m_type == StartTag || m_type == EndTag);
267 return m_selfClosing; 268 return m_selfClosing;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 UChar m_orAllData; 466 UChar m_orAllData;
466 467
467 // For StartTag and EndTag 468 // For StartTag and EndTag
468 bool m_selfClosing; 469 bool m_selfClosing;
469 AttributeList m_attributes; 470 AttributeList m_attributes;
470 471
471 // A pointer into m_attributes used during lexing. 472 // A pointer into m_attributes used during lexing.
472 Attribute* m_currentAttribute; 473 Attribute* m_currentAttribute;
473 474
474 // For DOCTYPE 475 // For DOCTYPE
475 OwnPtr<DoctypeData> m_doctypeData; 476 std::unique_ptr<DoctypeData> m_doctypeData;
476 }; 477 };
477 478
478 } // namespace blink 479 } // namespace blink
479 480
480 #endif 481 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698