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

Side by Side Diff: Source/core/inspector/InspectorFrontendHost.cpp

Issue 180113008: Use less conservative condition when detecting noncharacter unicode symbols (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void InspectorFrontendHost::copyText(const String& text) 158 void InspectorFrontendHost::copyText(const String& text)
159 { 159 {
160 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar tReplace); 160 Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmar tReplace);
161 } 161 }
162 162
163 static String escapeUnicodeNonCharacters(const String& str) 163 static String escapeUnicodeNonCharacters(const String& str)
164 { 164 {
165 StringBuilder dst; 165 StringBuilder dst;
166 for (unsigned i = 0; i < str.length(); ++i) { 166 for (unsigned i = 0; i < str.length(); ++i) {
167 UChar c = str[i]; 167 UChar c = str[i];
168 if (c > 126) { 168 if (c >= 0xD800) {
169 unsigned symbol = static_cast<unsigned>(c); 169 unsigned symbol = static_cast<unsigned>(c);
170 String symbolCode = String::format("\\u%04X", symbol); 170 String symbolCode = String::format("\\u%04X", symbol);
171 dst.append(symbolCode); 171 dst.append(symbolCode);
172 } else { 172 } else {
173 dst.append(c); 173 dst.append(c);
174 } 174 }
175 175
176 } 176 }
177 return dst.toString(); 177 return dst.toString();
178 } 178 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 { 215 {
216 return RenderTheme::theme().activeSelectionForegroundColor().serialized(); 216 return RenderTheme::theme().activeSelectionForegroundColor().serialized();
217 } 217 }
218 218
219 bool InspectorFrontendHost::isUnderTest() 219 bool InspectorFrontendHost::isUnderTest()
220 { 220 {
221 return m_client && m_client->isUnderTest(); 221 return m_client && m_client->isUnderTest();
222 } 222 }
223 223
224 } // namespace WebCore 224 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698