| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 static TypeBuilder::Console::ConsoleMessage::Level::Enum messageLevelValue(Messa
geLevel level) | 157 static TypeBuilder::Console::ConsoleMessage::Level::Enum messageLevelValue(Messa
geLevel level) |
| 158 { | 158 { |
| 159 switch (level) { | 159 switch (level) { |
| 160 case DebugMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::
Debug; | 160 case DebugMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::
Debug; |
| 161 case LogMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::Lo
g; | 161 case LogMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::Lo
g; |
| 162 case WarningMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level
::Warning; | 162 case WarningMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level
::Warning; |
| 163 case ErrorMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::
Error; | 163 case ErrorMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::
Error; |
| 164 case InfoMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::I
nfo; | 164 case InfoMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::I
nfo; |
| 165 case RevokedErrorMessageLevel: return TypeBuilder::Console::ConsoleMessage::
Level::RevokedError; | |
| 166 } | 165 } |
| 167 return TypeBuilder::Console::ConsoleMessage::Level::Log; | 166 return TypeBuilder::Console::ConsoleMessage::Level::Log; |
| 168 } | 167 } |
| 169 | 168 |
| 170 void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
Message, bool generatePreview) | 169 void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console
Message, bool generatePreview) |
| 171 { | 170 { |
| 172 if (consoleMessage->workerGlobalScopeProxy()) | 171 if (consoleMessage->workerGlobalScopeProxy()) |
| 173 return; | 172 return; |
| 174 | 173 |
| 175 RefPtr<TypeBuilder::Console::ConsoleMessage> jsonObj = TypeBuilder::Console:
:ConsoleMessage::create() | 174 RefPtr<TypeBuilder::Console::ConsoleMessage> jsonObj = TypeBuilder::Console:
:ConsoleMessage::create() |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 214 } |
| 216 jsonObj->setParameters(jsonArgs); | 215 jsonObj->setParameters(jsonArgs); |
| 217 } | 216 } |
| 218 } | 217 } |
| 219 if (consoleMessage->callStack()) { | 218 if (consoleMessage->callStack()) { |
| 220 jsonObj->setStackTrace(consoleMessage->callStack()->buildInspectorArray(
)); | 219 jsonObj->setStackTrace(consoleMessage->callStack()->buildInspectorArray(
)); |
| 221 RefPtrWillBeRawPtr<ScriptAsyncCallStack> asyncCallStack = consoleMessage
->callStack()->asyncCallStack(); | 220 RefPtrWillBeRawPtr<ScriptAsyncCallStack> asyncCallStack = consoleMessage
->callStack()->asyncCallStack(); |
| 222 if (asyncCallStack) | 221 if (asyncCallStack) |
| 223 jsonObj->setAsyncStackTrace(asyncCallStack->buildInspectorObject()); | 222 jsonObj->setAsyncStackTrace(asyncCallStack->buildInspectorObject()); |
| 224 } | 223 } |
| 225 if (consoleMessage->messageId()) | |
| 226 jsonObj->setMessageId(consoleMessage->messageId()); | |
| 227 if (consoleMessage->relatedMessageId()) | |
| 228 jsonObj->setRelatedMessageId(consoleMessage->relatedMessageId()); | |
| 229 frontend()->messageAdded(jsonObj); | 224 frontend()->messageAdded(jsonObj); |
| 230 frontend()->flush(); | 225 frontend()->flush(); |
| 231 } | 226 } |
| 232 | 227 |
| 233 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |