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

Side by Side Diff: third_party/WebKit/Source/modules/websockets/DOMWebSocket.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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return true; 182 return true;
183 } 183 }
184 184
185 static String encodeSubprotocolString(const String& protocol) 185 static String encodeSubprotocolString(const String& protocol)
186 { 186 {
187 StringBuilder builder; 187 StringBuilder builder;
188 for (size_t i = 0; i < protocol.length(); i++) { 188 for (size_t i = 0; i < protocol.length(); i++) {
189 if (protocol[i] < 0x20 || protocol[i] > 0x7E) 189 if (protocol[i] < 0x20 || protocol[i] > 0x7E)
190 builder.append(String::format("\\u%04X", protocol[i])); 190 builder.append(String::format("\\u%04X", protocol[i]));
191 else if (protocol[i] == 0x5c) 191 else if (protocol[i] == 0x5c)
192 builder.appendLiteral("\\\\"); 192 builder.append("\\\\");
193 else 193 else
194 builder.append(protocol[i]); 194 builder.append(protocol[i]);
195 } 195 }
196 return builder.toString(); 196 return builder.toString();
197 } 197 }
198 198
199 static String joinStrings(const Vector<String>& strings, const char* separator) 199 static String joinStrings(const Vector<String>& strings, const char* separator)
200 { 200 {
201 StringBuilder builder; 201 StringBuilder builder;
202 for (size_t i = 0; i < strings.size(); ++i) { 202 for (size_t i = 0; i < strings.size(); ++i) {
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 DEFINE_TRACE(DOMWebSocket) 714 DEFINE_TRACE(DOMWebSocket)
715 { 715 {
716 visitor->trace(m_channel); 716 visitor->trace(m_channel);
717 visitor->trace(m_eventQueue); 717 visitor->trace(m_eventQueue);
718 WebSocketChannelClient::trace(visitor); 718 WebSocketChannelClient::trace(visitor);
719 EventTargetWithInlineData::trace(visitor); 719 EventTargetWithInlineData::trace(visitor);
720 ActiveDOMObject::trace(visitor); 720 ActiveDOMObject::trace(visitor);
721 } 721 }
722 722
723 } // namespace blink 723 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp ('k') | third_party/WebKit/Source/platform/Decimal.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698