Index: Source/WebCore/inspector/ConsoleMessage.cpp |
diff --git a/Source/WebCore/inspector/ConsoleMessage.cpp b/Source/WebCore/inspector/ConsoleMessage.cpp |
index 62d6394f601e99d25d999bd7ffe615db2fa75d23..1ce21c98729fbbc867fb76fab29bf34a6900dead 100644 |
--- a/Source/WebCore/inspector/ConsoleMessage.cpp |
+++ b/Source/WebCore/inspector/ConsoleMessage.cpp |
@@ -139,20 +139,10 @@ void ConsoleMessage::addToFrontend(InspectorFrontend::Console* frontend, Injecte |
jsonObj->setString("text", m_message); |
if (m_source == NetworkMessageSource && !m_requestId.isEmpty()) |
jsonObj->setString("networkRequestId", m_requestId); |
- if (m_arguments && m_arguments->argumentCount()) { |
- InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(m_arguments->globalState()); |
- if (!injectedScript.hasNoValue()) { |
- RefPtr<InspectorArray> jsonArgs = InspectorArray::create(); |
- for (unsigned i = 0; i < m_arguments->argumentCount(); ++i) { |
- RefPtr<InspectorValue> inspectorValue = injectedScript.wrapObject(m_arguments->argumentAt(i), "console"); |
- if (!inspectorValue) { |
- ASSERT_NOT_REACHED(); |
- return; |
- } |
- jsonArgs->pushValue(inspectorValue); |
- } |
- jsonObj->setArray("parameters", jsonArgs); |
- } |
+ if (m_arguments) { |
+ RefPtr<InspectorArray> jsonArgs = m_arguments->wrap(injectedScriptManager); |
+ if (jsonArgs) |
+ jsonObj->setArray("parameters", jsonArgs.release()); |
} |
if (m_callStack) |
jsonObj->setArray("stackTrace", m_callStack->buildInspectorArray()); |
@@ -189,9 +179,7 @@ bool ConsoleMessage::isEqual(ConsoleMessage* msg) const |
void ConsoleMessage::windowCleared(DOMWindow* window) |
{ |
- if (!m_arguments) |
- return; |
- if (domWindowFromScriptState(m_arguments->globalState()) != window) |
+ if (!m_arguments || m_arguments->domWindow() != window) |
return; |
if (!m_message) |
m_message = "<message collected>"; |