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

Side by Side Diff: Source/core/dom/DOMSettableTokenList.cpp

Issue 112843002: Make calls to AtomicString(const String&) explicit in dom/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 { 51 {
52 return m_tokens.contains(token); 52 return m_tokens.contains(token);
53 } 53 }
54 54
55 void DOMSettableTokenList::add(const Vector<String>& tokens, ExceptionState& exc eptionState) 55 void DOMSettableTokenList::add(const Vector<String>& tokens, ExceptionState& exc eptionState)
56 { 56 {
57 DOMTokenList::add(tokens, exceptionState); 57 DOMTokenList::add(tokens, exceptionState);
58 58
59 for (size_t i = 0; i < tokens.size(); ++i) { 59 for (size_t i = 0; i < tokens.size(); ++i) {
60 if (m_tokens.isNull()) 60 if (m_tokens.isNull())
61 m_tokens.set(tokens[i], false); 61 m_tokens.set(AtomicString(tokens[i]), false);
62 else 62 else
63 m_tokens.add(tokens[i]); 63 m_tokens.add(AtomicString(tokens[i]));
64 } 64 }
65 } 65 }
66 66
67 void DOMSettableTokenList::addInternal(const AtomicString& token) 67 void DOMSettableTokenList::addInternal(const AtomicString& token)
68 { 68 {
69 DOMTokenList::addInternal(token); 69 DOMTokenList::addInternal(token);
70 if (m_tokens.isNull()) 70 if (m_tokens.isNull())
71 m_tokens.set(token, false); 71 m_tokens.set(token, false);
72 else 72 else
73 m_tokens.add(token); 73 m_tokens.add(token);
74 } 74 }
75 75
76 void DOMSettableTokenList::remove(const Vector<String>& tokens, ExceptionState& exceptionState) 76 void DOMSettableTokenList::remove(const Vector<String>& tokens, ExceptionState& exceptionState)
77 { 77 {
78 DOMTokenList::remove(tokens, exceptionState); 78 DOMTokenList::remove(tokens, exceptionState);
79 for (size_t i = 0; i < tokens.size(); ++i) 79 for (size_t i = 0; i < tokens.size(); ++i)
80 m_tokens.remove(tokens[i]); 80 m_tokens.remove(AtomicString(tokens[i]));
81 } 81 }
82 82
83 void DOMSettableTokenList::removeInternal(const AtomicString& token) 83 void DOMSettableTokenList::removeInternal(const AtomicString& token)
84 { 84 {
85 DOMTokenList::removeInternal(token); 85 DOMTokenList::removeInternal(token);
86 m_tokens.remove(token); 86 m_tokens.remove(token);
87 } 87 }
88 88
89 void DOMSettableTokenList::setValue(const AtomicString& value) 89 void DOMSettableTokenList::setValue(const AtomicString& value)
90 { 90 {
91 m_value = value; 91 m_value = value;
92 m_tokens.set(value, false); 92 m_tokens.set(value, false);
93 } 93 }
94 94
95 } // namespace WebCore 95 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698