OLD | NEW |
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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 disable(&errorString); | 152 disable(&errorString); |
153 } | 153 } |
154 | 154 |
155 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> c
allStack, unsigned long requestIdentifier) | 155 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> c
allStack, unsigned long requestIdentifier) |
156 { | 156 { |
157 if (type == ClearMessageType) { | 157 if (type == ClearMessageType) { |
158 ErrorString error; | 158 ErrorString error; |
159 clearMessages(&error); | 159 clearMessages(&error); |
160 } | 160 } |
161 | 161 |
162 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type
, level, message, callStack, requestIdentifier))); | 162 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type
, level, message, String(), callStack, requestIdentifier))); |
163 } | 163 } |
164 | 164 |
165 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, ScriptState* state, PassRefPt
r<ScriptArguments> arguments, unsigned long requestIdentifier) | 165 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, ScriptState* state, PassRefPt
r<ScriptArguments> arguments, unsigned long requestIdentifier) |
166 { | 166 { |
167 if (type == ClearMessageType) { | 167 if (type == ClearMessageType) { |
168 ErrorString error; | 168 ErrorString error; |
169 clearMessages(&error); | 169 clearMessages(&error); |
170 } | 170 } |
171 | 171 |
172 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type
, level, message, arguments, state, requestIdentifier))); | 172 addConsoleMessage(adoptPtr(new ConsoleMessage(!isWorkerAgent(), source, type
, level, message, String(), arguments, state, requestIdentifier))); |
| 173 } |
| 174 |
| 175 void InspectorConsoleAgent::addMessageToConsole(PassOwnPtr<ConsoleMessage> messa
ge, InspectorAgent::CheckFrontendBehavior behavior) |
| 176 { |
| 177 bool generateCallStack = !isWorkerAgent() && (behavior == InspectorAgent::Do
ntCheckFrontend || m_frontend); |
| 178 if (generateCallStack && !message->hasGeneratedCallStack()) |
| 179 message->generateCallStack(ScriptCallStack::maxCallStackSizeToCapture); |
| 180 addConsoleMessage(message); |
173 } | 181 } |
174 | 182 |
175 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, const String& scriptId, unsig
ned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long request
Identifier) | 183 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
e type, MessageLevel level, const String& message, const String& scriptId, unsig
ned lineNumber, unsigned columnNumber, ScriptState* state, unsigned long request
Identifier) |
176 { | 184 { |
177 if (type == ClearMessageType) { | 185 if (type == ClearMessageType) { |
178 ErrorString error; | 186 ErrorString error; |
179 clearMessages(&error); | 187 clearMessages(&error); |
180 } | 188 } |
181 | 189 |
182 bool canGenerateCallStack = !isWorkerAgent() && m_frontend; | 190 bool canGenerateCallStack = !isWorkerAgent() && m_frontend; |
183 addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source,
type, level, message, scriptId, lineNumber, columnNumber, state, requestIdentifi
er))); | 191 addConsoleMessage(adoptPtr(new ConsoleMessage(canGenerateCallStack, source,
type, level, message, String(), scriptId, lineNumber, columnNumber, state, reque
stIdentifier))); |
184 } | 192 } |
185 | 193 |
186 Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() | 194 Vector<unsigned> InspectorConsoleAgent::consoleMessageArgumentCounts() |
187 { | 195 { |
188 Vector<unsigned> result(m_consoleMessages.size()); | 196 Vector<unsigned> result(m_consoleMessages.size()); |
189 for (size_t i = 0; i < m_consoleMessages.size(); i++) | 197 for (size_t i = 0; i < m_consoleMessages.size(); i++) |
190 result[i] = m_consoleMessages[i]->argumentCount(); | 198 result[i] = m_consoleMessages[i]->argumentCount(); |
191 return result; | 199 return result; |
192 } | 200 } |
193 | 201 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 int m_heapObjectId; | 345 int m_heapObjectId; |
338 }; | 346 }; |
339 | 347 |
340 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) | 348 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) |
341 { | 349 { |
342 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); | 350 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); |
343 } | 351 } |
344 | 352 |
345 } // namespace WebCore | 353 } // namespace WebCore |
346 | 354 |
OLD | NEW |