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

Side by Side Diff: third_party/WebKit/Source/wtf/InstanceCounter.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 StringBuilder builder; 126 StringBuilder builder;
127 127
128 builder.append('{'); 128 builder.append('{');
129 HashMap<String, int>::iterator it = m_counterMap.begin(); 129 HashMap<String, int>::iterator it = m_counterMap.begin();
130 HashMap<String, int>::iterator itEnd = m_counterMap.end(); 130 HashMap<String, int>::iterator itEnd = m_counterMap.end();
131 for (; it != itEnd; ++it) { 131 for (; it != itEnd; ++it) {
132 if (it != m_counterMap.begin()) 132 if (it != m_counterMap.begin())
133 builder.append(','); 133 builder.append(',');
134 builder.append('"'); 134 builder.append('"');
135 builder.append(it->key); 135 builder.append(it->key);
136 builder.appendLiteral("\": "); 136 builder.append("\": ");
137 builder.appendNumber(it->value); 137 builder.appendNumber(it->value);
138 } 138 }
139 builder.append('}'); 139 builder.append('}');
140 140
141 return builder.toString(); 141 return builder.toString();
142 } 142 }
143 143
144 #else 144 #else
145 145
146 String dumpRefCountedInstanceCounts() 146 String dumpRefCountedInstanceCounts()
147 { 147 {
148 return String("{}"); 148 return String("{}");
149 } 149 }
150 150
151 #endif // ENABLE(INSTANCE_COUNTER) 151 #endif // ENABLE(INSTANCE_COUNTER)
152 152
153 } // namespace WTF 153 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/DateMath.cpp ('k') | third_party/WebKit/Source/wtf/text/StringBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698