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

Side by Side Diff: Source/core/frame/FrameConsole.cpp

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/core/fileapi/FileReaderLoader.cpp ('k') | Source/core/html/ImageDocument.cpp » ('j') | 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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 m_frame.chromeClient().addMessageToConsole(&m_frame, consoleMessage->source( ), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumbe r(), messageURL, stackTrace); 83 m_frame.chromeClient().addMessageToConsole(&m_frame, consoleMessage->source( ), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumbe r(), messageURL, stackTrace);
84 } 84 }
85 85
86 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR efPtrWillBeRawPtr<ScriptCallStack> callStack) 86 String FrameConsole::formatStackTraceString(const String& originalMessage, PassR efPtrWillBeRawPtr<ScriptCallStack> callStack)
87 { 87 {
88 StringBuilder stackTrace; 88 StringBuilder stackTrace;
89 for (size_t i = 0; i < callStack->size(); ++i) { 89 for (size_t i = 0; i < callStack->size(); ++i) {
90 const ScriptCallFrame& frame = callStack->at(i); 90 const ScriptCallFrame& frame = callStack->at(i);
91 stackTrace.append("\n at " + (frame.functionName().length() ? frame.f unctionName() : "(anonymous function)")); 91 stackTrace.append("\n at " + (frame.functionName().length() ? frame.f unctionName() : "(anonymous function)"));
92 stackTrace.append(" ("); 92 stackTrace.appendLiteral(" (");
93 stackTrace.append(frame.sourceURL()); 93 stackTrace.append(frame.sourceURL());
94 stackTrace.append(':'); 94 stackTrace.append(':');
95 stackTrace.append(String::number(frame.lineNumber())); 95 stackTrace.append(String::number(frame.lineNumber()));
96 stackTrace.append(':'); 96 stackTrace.append(':');
97 stackTrace.append(String::number(frame.columnNumber())); 97 stackTrace.append(String::number(frame.columnNumber()));
98 stackTrace.append(')'); 98 stackTrace.append(')');
99 } 99 }
100 100
101 return stackTrace.toString(); 101 return stackTrace.toString();
102 } 102 }
103 103
104 void FrameConsole::mute() 104 void FrameConsole::mute()
105 { 105 {
106 muteCount++; 106 muteCount++;
107 } 107 }
108 108
109 void FrameConsole::unmute() 109 void FrameConsole::unmute()
110 { 110 {
111 ASSERT(muteCount > 0); 111 ASSERT(muteCount > 0);
112 muteCount--; 112 muteCount--;
113 } 113 }
114 114
115 void FrameConsole::adoptWorkerConsoleMessages(WorkerGlobalScopeProxy* proxy) 115 void FrameConsole::adoptWorkerConsoleMessages(WorkerGlobalScopeProxy* proxy)
116 { 116 {
117 InspectorInstrumentation::adoptWorkerConsoleMessages(m_frame.document(), pro xy); 117 InspectorInstrumentation::adoptWorkerConsoleMessages(m_frame.document(), pro xy);
118 } 118 }
119 119
120 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fileapi/FileReaderLoader.cpp ('k') | Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698