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

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

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, 2007, 2008, 2009, 2013 Apple Inc. All 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All
5 * rights reserved. 5 * rights 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 23 matching lines...) Expand all
34 #include "core/inspector/InspectorInstrumentation.h" 34 #include "core/inspector/InspectorInstrumentation.h"
35 #include "wtf/CheckedNumeric.h" 35 #include "wtf/CheckedNumeric.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 void CharacterData::atomize() { 39 void CharacterData::atomize() {
40 m_data = AtomicString(m_data); 40 m_data = AtomicString(m_data);
41 } 41 }
42 42
43 void CharacterData::setData(const String& data) { 43 void CharacterData::setData(const String& data) {
44 const String& nonNullData = !data.isNull() ? data : emptyString(); 44 const String& nonNullData = !data.isNull() ? data : emptyString;
45 if (m_data == nonNullData) 45 if (m_data == nonNullData)
46 return; 46 return;
47 47
48 unsigned oldLength = length(); 48 unsigned oldLength = length();
49 49
50 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length(), 50 setDataAndUpdate(nonNullData, 0, oldLength, nonNullData.length(),
51 UpdateFromNonParser); 51 UpdateFromNonParser);
52 document().didRemoveText(this, 0, oldLength); 52 document().didRemoveText(this, 0, oldLength);
53 } 53 }
54 54
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 dispatchSubtreeModifiedEvent(); 222 dispatchSubtreeModifiedEvent();
223 } 223 }
224 InspectorInstrumentation::characterDataModified(this); 224 InspectorInstrumentation::characterDataModified(this);
225 } 225 }
226 226
227 int CharacterData::maxCharacterOffset() const { 227 int CharacterData::maxCharacterOffset() const {
228 return static_cast<int>(length()); 228 return static_cast<int>(length());
229 } 229 }
230 230
231 } // namespace blink 231 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CharacterData.h ('k') | third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698