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

Side by Side Diff: Source/core/css/CSSSelector.h

Issue 19804005: Remove AtomicStringImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/css/CSSSelector.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 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * 1999 Waldo Bastian (bastian@kde.org) 3 * 1999 Waldo Bastian (bastian@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 unsigned m_relationIsForShadowDistributed : 1; 248 unsigned m_relationIsForShadowDistributed : 1;
249 249
250 unsigned specificityForOneSelector() const; 250 unsigned specificityForOneSelector() const;
251 unsigned specificityForPage() const; 251 unsigned specificityForPage() const;
252 void extractPseudoType() const; 252 void extractPseudoType() const;
253 253
254 // Hide. 254 // Hide.
255 CSSSelector& operator=(const CSSSelector&); 255 CSSSelector& operator=(const CSSSelector&);
256 256
257 struct RareData : public RefCounted<RareData> { 257 struct RareData : public RefCounted<RareData> {
258 static PassRefPtr<RareData> create(PassRefPtr<AtomicStringImpl> valu e) { return adoptRef(new RareData(value)); } 258 static PassRefPtr<RareData> create(PassRefPtr<StringImpl> value) { r eturn adoptRef(new RareData(value)); }
259 ~RareData(); 259 ~RareData();
260 260
261 bool parseNth(); 261 bool parseNth();
262 bool matchNth(int count); 262 bool matchNth(int count);
263 263
264 AtomicStringImpl* m_value; // Plain pointer to keep things uniform w ith the union. 264 StringImpl* m_value; // Plain pointer to keep things uniform with th e union.
265 int m_a; // Used for :nth-* 265 int m_a; // Used for :nth-*
266 int m_b; // Used for :nth-* 266 int m_b; // Used for :nth-*
267 QualifiedName m_attribute; // used for attribute selector 267 QualifiedName m_attribute; // used for attribute selector
268 AtomicString m_argument; // Used for :contains, :lang and :nth-* 268 AtomicString m_argument; // Used for :contains, :lang and :nth-*
269 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and :not 269 OwnPtr<CSSSelectorList> m_selectorList; // Used for :-webkit-any and :not
270 270
271 private: 271 private:
272 RareData(PassRefPtr<AtomicStringImpl> value); 272 RareData(PassRefPtr<StringImpl> value);
273 }; 273 };
274 void createRareData(); 274 void createRareData();
275 275
276 union DataUnion { 276 union DataUnion {
277 DataUnion() : m_value(0) { } 277 DataUnion() : m_value(0) { }
278 AtomicStringImpl* m_value; 278 StringImpl* m_value;
279 QualifiedName::QualifiedNameImpl* m_tagQName; 279 QualifiedName::QualifiedNameImpl* m_tagQName;
280 RareData* m_rareData; 280 RareData* m_rareData;
281 } m_data; 281 } m_data;
282 }; 282 };
283 283
284 inline const QualifiedName& CSSSelector::attribute() const 284 inline const QualifiedName& CSSSelector::attribute() const
285 { 285 {
286 ASSERT(isAttributeSelector()); 286 ASSERT(isAttributeSelector());
287 ASSERT(m_hasRareData); 287 ASSERT(m_hasRareData);
288 return m_data.m_rareData->m_attribute; 288 return m_data.m_rareData->m_attribute;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 inline const QualifiedName& CSSSelector::tagQName() const 424 inline const QualifiedName& CSSSelector::tagQName() const
425 { 425 {
426 ASSERT(m_match == Tag); 426 ASSERT(m_match == Tag);
427 return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName); 427 return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName);
428 } 428 }
429 429
430 inline const AtomicString& CSSSelector::value() const 430 inline const AtomicString& CSSSelector::value() const
431 { 431 {
432 ASSERT(m_match != Tag); 432 ASSERT(m_match != Tag);
433 // AtomicString is really just an AtomicStringImpl* so the cast below is saf e. 433 // AtomicString is really just a StringImpl* so the cast below is safe.
434 // FIXME: Perhaps call sites could be changed to accept AtomicStringImpl? 434 // FIXME: Perhaps call sites could be changed to accept StringImpl?
435 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare Data->m_value : &m_data.m_value); 435 return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rare Data->m_value : &m_data.m_value);
436 } 436 }
437 437
438 438
439 } // namespace WebCore 439 } // namespace WebCore
440 440
441 #endif // CSSSelector_h 441 #endif // CSSSelector_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8WindowShell.cpp ('k') | Source/core/css/CSSSelector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698