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

Side by Side Diff: Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 110843004: Replaced HTMLIdentifier with an atomized string factory function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 years 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 29 matching lines...) Expand all
40 40
41 namespace WebCore { 41 namespace WebCore {
42 42
43 using namespace HTMLNames; 43 using namespace HTMLNames;
44 44
45 static bool match(const StringImpl* impl, const QualifiedName& qName) 45 static bool match(const StringImpl* impl, const QualifiedName& qName)
46 { 46 {
47 return impl == qName.localName().impl(); 47 return impl == qName.localName().impl();
48 } 48 }
49 49
50 static bool match(const HTMLIdentifier& name, const QualifiedName& qName)
51 {
52 return match(name.asStringImpl(), qName);
53 }
54
55 static bool match(const AtomicString& name, const QualifiedName& qName) 50 static bool match(const AtomicString& name, const QualifiedName& qName)
56 { 51 {
57 ASSERT(isMainThread()); 52 ASSERT(isMainThread());
58 return qName.localName() == name; 53 return qName.localName() == name;
59 } 54 }
60 55
56 static bool match(const String& name, const QualifiedName& qName)
57 {
58 return threadSafeMatch(name, qName);
59 }
60
61 static const StringImpl* tagImplFor(const HTMLToken::DataVector& data) 61 static const StringImpl* tagImplFor(const HTMLToken::DataVector& data)
62 { 62 {
63 AtomicString tagName(data); 63 AtomicString tagName(data);
64 const StringImpl* result = tagName.impl(); 64 const StringImpl* result = tagName.impl();
65 if (result->isStatic()) 65 if (result->isStatic())
66 return result; 66 return result;
67 return 0; 67 return 0;
68 } 68 }
69 69
70 static const StringImpl* tagImplFor(const HTMLIdentifier& tagName) 70 static const StringImpl* tagImplFor(const String& tagName)
71 { 71 {
72 const StringImpl* result = tagName.asStringImpl(); 72 const StringImpl* result = tagName.impl();
73 if (result->isStatic()) 73 if (result->isStatic())
74 return result; 74 return result;
75 return 0; 75 return 0;
76 } 76 }
77 77
78 static String initiatorFor(const StringImpl* tagImpl) 78 static String initiatorFor(const StringImpl* tagImpl)
79 { 79 {
80 ASSERT(tagImpl); 80 ASSERT(tagImpl);
81 if (match(tagImpl, imgTag)) 81 if (match(tagImpl, imgTag))
82 return imgTag.localName(); 82 return imgTag.localName();
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 if (m_token.type() == HTMLToken::StartTag) 401 if (m_token.type() == HTMLToken::StartTag)
402 m_tokenizer->updateStateFor(AtomicString(m_token.name())); 402 m_tokenizer->updateStateFor(AtomicString(m_token.name()));
403 m_scanner.scan(m_token, m_source, requests); 403 m_scanner.scan(m_token, m_source, requests);
404 m_token.clear(); 404 m_token.clear();
405 } 405 }
406 406
407 preloader->takeAndPreload(requests); 407 preloader->takeAndPreload(requests);
408 } 408 }
409 409
410 } 410 }
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLParserIdioms.cpp ('k') | Source/core/html/parser/HTMLTreeBuilderSimulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698