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

Unified Diff: inspector/InspectorFrontend.cpp

Issue 542055: DevTools: injected script per context(WebCore part) (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « inspector/InspectorFrontend.h ('k') | inspector/front-end/AuditsPanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: inspector/InspectorFrontend.cpp
===================================================================
--- inspector/InspectorFrontend.cpp (revision 53180)
+++ inspector/InspectorFrontend.cpp (working copy)
@@ -34,6 +34,7 @@
#include "ConsoleMessage.h"
#include "Frame.h"
+#include "InjectedScriptHost.h"
#include "InspectorController.h"
#include "Node.h"
#include "ScriptFunctionCall.h"
@@ -93,19 +94,32 @@
function.call();
}
-void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, const Vector<ScriptValue> wrappedArguments, const String& message)
+void InspectorFrontend::addConsoleMessage(const ScriptObject& messageObj, const Vector<ScriptString>& frames, ScriptState* scriptState, const Vector<ScriptValue> arguments, const String& message)
{
ScriptFunctionCall function(m_scriptState, m_webInspector, "dispatch");
function.appendArgument("addConsoleMessage");
function.appendArgument(messageObj);
if (!frames.isEmpty()) {
+ function.appendArgument(false);
for (unsigned i = 0; i < frames.size(); ++i)
function.appendArgument(frames[i]);
- } else if (!wrappedArguments.isEmpty()) {
- for (unsigned i = 0; i < wrappedArguments.size(); ++i)
- function.appendArgument(m_inspectorController->wrapObject(wrappedArguments[i], "console"));
- } else
+ } else if (!arguments.isEmpty()) {
+ function.appendArgument(true);
+ ScriptObject injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptFor(scriptState);
+ for (unsigned i = 0; i < arguments.size(); ++i) {
+ ScriptFunctionCall wrapFunction(scriptState, injectedScript, "wrapAndStringifyObject");
+ wrapFunction.appendArgument(arguments[i]);
+ wrapFunction.appendArgument("console");
+ ScriptValue r = wrapFunction.call();
+ if (r.hasNoValue())
+ return;
+ String s = r.toString(scriptState);
+ function.appendArgument(s);
+ }
+ } else {
+ function.appendArgument(false);
function.appendArgument(message);
+ }
function.call();
}
@@ -312,7 +326,7 @@
function.call();
}
-void InspectorFrontend::pausedScript(const ScriptValue& callFrames)
+void InspectorFrontend::pausedScript(const String& callFrames)
{
ScriptFunctionCall function(m_scriptState, m_webInspector, "dispatch");
function.appendArgument("pausedScript");
« no previous file with comments | « inspector/InspectorFrontend.h ('k') | inspector/front-end/AuditsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698