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

Side by Side Diff: third_party/WebKit/Source/core/dom/CharacterData.h

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights 4 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void deleteData(unsigned offset, unsigned count, ExceptionState&); 51 void deleteData(unsigned offset, unsigned count, ExceptionState&);
52 52
53 bool containsOnlyWhitespace() const; 53 bool containsOnlyWhitespace() const;
54 54
55 StringImpl* dataImpl() { return m_data.impl(); } 55 StringImpl* dataImpl() { return m_data.impl(); }
56 56
57 void parserAppendData(const String&); 57 void parserAppendData(const String&);
58 58
59 protected: 59 protected:
60 CharacterData(TreeScope& treeScope, const String& text, ConstructionType type) 60 CharacterData(TreeScope& treeScope, const String& text, ConstructionType type)
61 : Node(&treeScope, type), m_data(!text.isNull() ? text : emptyString()) { 61 : Node(&treeScope, type), m_data(!text.isNull() ? text : emptyString) {
62 DCHECK(type == CreateOther || type == CreateText || 62 DCHECK(type == CreateOther || type == CreateText ||
63 type == CreateEditingText); 63 type == CreateEditingText);
64 } 64 }
65 65
66 void setDataWithoutUpdate(const String& data) { 66 void setDataWithoutUpdate(const String& data) {
67 DCHECK(!data.isNull()); 67 DCHECK(!data.isNull());
68 m_data = data; 68 m_data = data;
69 } 69 }
70 enum UpdateSource { 70 enum UpdateSource {
71 UpdateFromParser, 71 UpdateFromParser,
(...skipping 18 matching lines...) Expand all
90 delete; // This will catch anyone doing an unnecessary check. 90 delete; // This will catch anyone doing an unnecessary check.
91 bool isElementNode() const = 91 bool isElementNode() const =
92 delete; // This will catch anyone doing an unnecessary check. 92 delete; // This will catch anyone doing an unnecessary check.
93 }; 93 };
94 94
95 DEFINE_NODE_TYPE_CASTS(CharacterData, isCharacterDataNode()); 95 DEFINE_NODE_TYPE_CASTS(CharacterData, isCharacterDataNode());
96 96
97 } // namespace blink 97 } // namespace blink
98 98
99 #endif // CharacterData_h 99 #endif // CharacterData_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/AttrTest.cpp ('k') | third_party/WebKit/Source/core/dom/CharacterData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698