| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void InspectorConsoleAgent::clearFrontend() | 162 void InspectorConsoleAgent::clearFrontend() |
| 163 { | 163 { |
| 164 m_frontend = 0; | 164 m_frontend = 0; |
| 165 String errorString; | 165 String errorString; |
| 166 disable(&errorString); | 166 disable(&errorString); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void InspectorConsoleAgent::addMessageToConsole(ConsoleMessage* consoleMessage) | 169 void InspectorConsoleAgent::addMessageToConsole(ConsoleMessage* consoleMessage) |
| 170 { | 170 { |
| 171 if (consoleMessage->callStack()) { | 171 if (consoleMessage->callStack()) { |
| 172 addConsoleMessage(adoptPtr(new InspectorConsoleMessage(!isWorkerAgent(),
consoleMessage->source(), LogMessageType, consoleMessage->level(), consoleMessa
ge->message(), consoleMessage->callStack(), consoleMessage->requestIdentifier())
)); | 172 addConsoleMessage(adoptPtr(new InspectorConsoleMessage(consoleMessage->s
ource(), LogMessageType, consoleMessage->level(), consoleMessage->message(), con
soleMessage->callStack(), consoleMessage->requestIdentifier()))); |
| 173 } else { | 173 } else { |
| 174 bool canGenerateCallStack = !isWorkerAgent() && m_frontend; | 174 bool canGenerateCallStack = !isWorkerAgent() && m_frontend; |
| 175 addConsoleMessage(adoptPtr(new InspectorConsoleMessage(canGenerateCallSt
ack, consoleMessage->source(), LogMessageType, consoleMessage->level(), consoleM
essage->message(), consoleMessage->url(), consoleMessage->lineNumber(), consoleM
essage->columnNumber(), consoleMessage->scriptState(), consoleMessage->requestId
entifier()))); | 175 addConsoleMessage(adoptPtr(new InspectorConsoleMessage(canGenerateCallSt
ack, consoleMessage->source(), LogMessageType, consoleMessage->level(), consoleM
essage->message(), consoleMessage->url(), consoleMessage->lineNumber(), consoleM
essage->columnNumber(), consoleMessage->scriptState(), consoleMessage->requestId
entifier()))); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 void InspectorConsoleAgent::addConsoleAPIMessageToConsole(MessageType type, Mess
ageLevel level, const String& message, ScriptState* scriptState, PassRefPtrWillB
eRawPtr<ScriptArguments> arguments, unsigned long requestIdentifier) | 179 void InspectorConsoleAgent::addConsoleAPIMessageToConsole(MessageType type, Mess
ageLevel level, const String& message, ScriptState* scriptState, PassRefPtrWillB
eRawPtr<ScriptArguments> arguments, unsigned long requestIdentifier) |
| 180 { | 180 { |
| 181 if (type == ClearMessageType) { | 181 if (type == ClearMessageType) { |
| 182 ErrorString error; | 182 ErrorString error; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void InspectorConsoleAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* scriptState) | 240 void InspectorConsoleAgent::consoleTimelineEnd(ExecutionContext* context, const
String& title, ScriptState* scriptState) |
| 241 { | 241 { |
| 242 if (m_state->getBoolean(ConsoleAgentState::tracingBasedTimeline)) | 242 if (m_state->getBoolean(ConsoleAgentState::tracingBasedTimeline)) |
| 243 m_tracingAgent->consoleTimelineEnd(title); | 243 m_tracingAgent->consoleTimelineEnd(title); |
| 244 else | 244 else |
| 245 m_timelineAgent->consoleTimelineEnd(context, title, scriptState); | 245 m_timelineAgent->consoleTimelineEnd(context, title, scriptState); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void InspectorConsoleAgent::consoleCount(ScriptState* scriptState, PassRefPtrWil
lBeRawPtr<ScriptArguments> arguments) | 248 void InspectorConsoleAgent::consoleCount(ScriptState* scriptState, PassRefPtrWil
lBeRawPtr<ScriptArguments> arguments) |
| 249 { | 249 { |
| 250 RefPtrWillBeRawPtr<ScriptCallStack> callStack(createScriptCallStackForConsol
e(scriptState, 1)); | 250 RefPtrWillBeRawPtr<ScriptCallStack> callStack(createScriptCallStack(1)); |
| 251 const ScriptCallFrame& lastCaller = callStack->at(0); | 251 const ScriptCallFrame& lastCaller = callStack->at(0); |
| 252 // Follow Firebug's behavior of counting with null and undefined title in | 252 // Follow Firebug's behavior of counting with null and undefined title in |
| 253 // the same bucket as no argument | 253 // the same bucket as no argument |
| 254 String title; | 254 String title; |
| 255 arguments->getFirstArgumentAsString(title); | 255 arguments->getFirstArgumentAsString(title); |
| 256 String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' +
String::number(lastCaller.lineNumber())) | 256 String identifier = title.isEmpty() ? String(lastCaller.sourceURL() + ':' +
String::number(lastCaller.lineNumber())) |
| 257 : String(title + '@'); | 257 : String(title + '@'); |
| 258 | 258 |
| 259 HashCountedSet<String>::AddResult result = m_counts.add(identifier); | 259 HashCountedSet<String>::AddResult result = m_counts.add(identifier); |
| 260 String message = title + ": " + String::number(result.storedValue->value); | 260 String message = title + ": " + String::number(result.storedValue->value); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 private: | 343 private: |
| 344 int m_heapObjectId; | 344 int m_heapObjectId; |
| 345 }; | 345 }; |
| 346 | 346 |
| 347 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) | 347 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) |
| 348 { | 348 { |
| 349 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); | 349 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace blink | 352 } // namespace blink |
| OLD | NEW |