[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yurys at chromium.org
yurys at chromium.org
Wed Dec 22 11:42:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 22fb5de78373e54349711e0404023ca1fa374dd4
Author: yurys at chromium.org <yurys at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 4 15:26:33 2010 +0000
2010-08-04 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: use InspectorValue to push dispatch results from the injected script
https://bugs.webkit.org/show_bug.cgi?id=43483
* bindings/js/JSInjectedScriptHostCustom.cpp:
(WebCore::JSInjectedScriptHost::reportDidDispatchOnInjectedScript):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::V8InjectedScriptHost::reportDidDispatchOnInjectedScriptCallback):
* inspector/InjectedScript.cpp:
(WebCore::InjectedScript::dispatch):
* inspector/InjectedScript.h:
* inspector/InjectedScriptHost.cpp:
(WebCore::InjectedScriptHost::reportDidDispatchOnInjectedScript):
(WebCore::InjectedScriptHost::remoteFrontend):
* inspector/InjectedScriptHost.h:
* inspector/Inspector.idl:
* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::dispatchOnInjectedScript):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::didContinue):
* inspector/InspectorFrontend.cpp:
* inspector/InspectorFrontend.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 22bcf07..16a7bf5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-08-04 Yury Semikhatsky <yurys at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: use InspectorValue to push dispatch results from the injected script
+ https://bugs.webkit.org/show_bug.cgi?id=43483
+
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ (WebCore::JSInjectedScriptHost::reportDidDispatchOnInjectedScript):
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ (WebCore::V8InjectedScriptHost::reportDidDispatchOnInjectedScriptCallback):
+ * inspector/InjectedScript.cpp:
+ (WebCore::InjectedScript::dispatch):
+ * inspector/InjectedScript.h:
+ * inspector/InjectedScriptHost.cpp:
+ (WebCore::InjectedScriptHost::reportDidDispatchOnInjectedScript):
+ (WebCore::InjectedScriptHost::remoteFrontend):
+ * inspector/InjectedScriptHost.h:
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::dispatchOnInjectedScript):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didContinue):
+ * inspector/InspectorFrontend.cpp:
+ * inspector/InspectorFrontend.h:
+
2010-08-04 Abhishek Arya <inferno at chromium.org>
Unreviewed. Put missing equivalent js bindings check.
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index a0d75f8..ec8b122 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -48,6 +48,7 @@
#include "InjectedScriptHost.h"
#include "InspectorController.h"
#include "InspectorResource.h"
+#include "InspectorValues.h"
#include "JSDOMWindow.h"
#include "JSDOMWindowCustom.h"
#include "JSNode.h"
@@ -55,7 +56,6 @@
#include "Node.h"
#include "Page.h"
#if ENABLE(DOM_STORAGE)
-#include "SerializedScriptValue.h"
#include "Storage.h"
#include "JSStorage.h"
#endif
@@ -201,12 +201,12 @@ JSValue JSInjectedScriptHost::reportDidDispatchOnInjectedScript(ExecState* exec)
return jsUndefined();
int callId = exec->argument(0).asInt32();
- RefPtr<SerializedScriptValue> result(SerializedScriptValue::create(exec, exec->argument(1)));
+ RefPtr<InspectorValue> result = ScriptValue(exec->argument(1)).toInspectorValue(exec);
bool isException;
if (!exec->argument(2).getBoolean(isException))
return jsUndefined();
- impl()->reportDidDispatchOnInjectedScript(callId, result.get(), isException);
+ impl()->reportDidDispatchOnInjectedScript(callId, result, isException);
return jsUndefined();
}
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index c7cd54c..31ef8db 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -37,10 +37,10 @@
#include "InjectedScript.h"
#include "InjectedScriptHost.h"
#include "InspectorController.h"
+#include "InspectorValues.h"
#include "Node.h"
#include "Page.h"
#include "ScriptDebugServer.h"
-#include "SerializedScriptValue.h"
#include "V8Binding.h"
#include "V8BindingState.h"
@@ -215,9 +215,9 @@ v8::Handle<v8::Value> V8InjectedScriptHost::reportDidDispatchOnInjectedScriptCal
return v8::Undefined();
InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
int callId = args[0]->ToInt32()->Value();
- RefPtr<SerializedScriptValue> result(SerializedScriptValue::create(args[1]));
+ RefPtr<InspectorValue> result = ScriptValue(args[1]).toInspectorValue(ScriptState::current());
bool isException = args[2]->ToBoolean()->Value();
- host->reportDidDispatchOnInjectedScript(callId, result.get(), isException);
+ host->reportDidDispatchOnInjectedScript(callId, result, isException);
return v8::Undefined();
}
diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp
index 931a238..4f29b8a 100644
--- a/WebCore/inspector/InjectedScript.cpp
+++ b/WebCore/inspector/InjectedScript.cpp
@@ -35,7 +35,6 @@
#include "InspectorValues.h"
#include "PlatformString.h"
-#include "SerializedScriptValue.h"
#include "ScriptFunctionCall.h"
namespace WebCore {
@@ -45,7 +44,7 @@ InjectedScript::InjectedScript(ScriptObject injectedScriptObject)
{
}
-void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<SerializedScriptValue>* result, bool* hadException)
+void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException)
{
ASSERT(!hasNoValue());
if (!canAccessInspectedWindow()) {
@@ -61,7 +60,7 @@ void InjectedScript::dispatch(long callId, const String& methodName, const Strin
*hadException = false;
ScriptValue resultValue = function.call(*hadException);
if (!*hadException)
- *result = resultValue.serialize(m_injectedScriptObject.scriptState());
+ *result = resultValue.toInspectorValue(m_injectedScriptObject.scriptState());
}
#if ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h
index 8035dc7..d07f5ac 100644
--- a/WebCore/inspector/InjectedScript.h
+++ b/WebCore/inspector/InjectedScript.h
@@ -39,7 +39,6 @@
namespace WebCore {
class InspectorValue;
-class SerializedScriptValue;
class String;
class InjectedScript {
@@ -49,7 +48,7 @@ public:
bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
- void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<SerializedScriptValue>* result, bool* hadException);
+ void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException);
#if ENABLE(JAVASCRIPT_DEBUGGER)
PassRefPtr<InspectorValue> callFrames();
#endif
diff --git a/WebCore/inspector/InjectedScriptHost.cpp b/WebCore/inspector/InjectedScriptHost.cpp
index e8a9fee..fa2e2cb 100644
--- a/WebCore/inspector/InjectedScriptHost.cpp
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -45,6 +45,7 @@
#include "InspectorFrontend.h"
#include "InspectorResource.h"
#include "Pasteboard.h"
+#include "RemoteInspectorFrontend.h"
#if ENABLE(JAVASCRIPT_DEBUGGER)
#include "ScriptDebugServer.h"
@@ -142,9 +143,9 @@ void InjectedScriptHost::selectDOMStorage(Storage* storage)
}
#endif
-void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException)
+void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException)
{
- if (InspectorFrontend* frontend = inspectorFrontend())
+ if (RemoteInspectorFrontend* frontend = remoteFrontend())
frontend->didDispatchOnInjectedScript(callId, result, isException);
}
@@ -185,6 +186,13 @@ InspectorFrontend* InjectedScriptHost::inspectorFrontend()
return m_inspectorController->m_frontend.get();
}
+RemoteInspectorFrontend* InjectedScriptHost::remoteFrontend()
+{
+ if (!m_inspectorController)
+ return 0;
+ return m_inspectorController->m_remoteFrontend.get();
+}
+
pair<long, ScriptObject> InjectedScriptHost::injectScript(const String& source, ScriptState* scriptState)
{
long id = m_nextInjectedScriptId++;
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
index b942148..f5061fb 100644
--- a/WebCore/inspector/InjectedScriptHost.h
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -45,7 +45,7 @@ class InjectedScript;
class InspectorDOMAgent;
class InspectorFrontend;
class Node;
-class SerializedScriptValue;
+class RemoteInspectorFrontend;
class Storage;
class InjectedScriptHost : public RefCounted<InjectedScriptHost>
@@ -82,7 +82,7 @@ public:
void didCreateWorker(long id, const String& url, bool isSharedWorker);
void didDestroyWorker(long id);
#endif
- void reportDidDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);
+ void reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException);
pair<long, ScriptObject> injectScript(const String& source, ScriptState*);
InjectedScript injectedScriptFor(ScriptState*);
@@ -96,6 +96,7 @@ private:
InjectedScriptHost(InspectorController* inspectorController);
InspectorDOMAgent* inspectorDOMAgent();
InspectorFrontend* inspectorFrontend();
+ RemoteInspectorFrontend* remoteFrontend();
ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id);
InspectorController* m_inspectorController;
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 70286f0..373dd51 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -112,8 +112,7 @@ module core {
[handler=Backend] void getProfilerLogLines(in long callId, in long inPosition, out long outPosition, out String log);
#endif
[handler=Backend] void setInjectedScriptSource(in String scriptSource);
- [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async);
-
+ [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async, out Value result, out boolean isException);
[handler=Controller] void addScriptToEvaluateOnLoad(in String scriptSource);
[handler=Controller] void removeAllScriptsToEvaluateOnLoad();
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 9a7f43b..cffff41 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -94,7 +94,7 @@ void InspectorBackend::setInjectedScriptSource(const String& source)
void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async)
{
- InspectorFrontend* frontend = inspectorFrontend();
+ RemoteInspectorFrontend* frontend = remoteFrontend();
if (!frontend)
return;
@@ -110,12 +110,12 @@ void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScript
if (injectedScript.hasNoValue())
return;
- RefPtr<SerializedScriptValue> result;
+ RefPtr<InspectorValue> result;
bool hadException = false;
injectedScript.dispatch(callId, methodName, arguments, async, &result, &hadException);
if (async)
return; // InjectedScript will return result asynchronously by means of ::reportDidDispatchOnInjectedScript.
- frontend->didDispatchOnInjectedScript(callId, result.get(), hadException);
+ frontend->didDispatchOnInjectedScript(callId, result, hadException);
}
void InspectorBackend::clearConsoleMessages(long callId)
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index da89000..d2b2df1 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -1856,7 +1856,7 @@ void InspectorController::didPause(ScriptState* scriptState)
void InspectorController::didContinue()
{
m_pausedScriptState = 0;
- m_frontend->resumedScript();
+ m_remoteFrontend->resumedScript();
}
#endif
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index ccc26c3..94f7db5 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -44,7 +44,6 @@
#include "ScriptState.h"
#include "ScriptString.h"
#include "ScriptValue.h"
-#include "SerializedScriptValue.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
@@ -286,20 +285,6 @@ void InspectorFrontend::failedToParseScriptSource(const String& url, const Strin
function.call();
}
-void InspectorFrontend::pausedScript(SerializedScriptValue* callFrames)
-{
- ScriptValue callFramesValue = ScriptValue::deserialize(scriptState(), callFrames);
- ScriptFunctionCall function(m_webInspector, "dispatch");
- function.appendArgument("pausedScript");
- function.appendArgument(callFramesValue);
- function.call();
-}
-
-void InspectorFrontend::resumedScript()
-{
- callSimpleFunction("resumedScript");
-}
-
void InspectorFrontend::profilerWasEnabled()
{
callSimpleFunction("profilerWasEnabled");
@@ -367,21 +352,6 @@ void InspectorFrontend::didGetCookies(long callId, const ScriptArray& cookies, c
function.call();
}
-void InspectorFrontend::didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException)
-{
- ScriptFunctionCall function(m_webInspector, "dispatch");
- function.appendArgument("didDispatchOnInjectedScript");
- function.appendArgument(callId);
- if (isException)
- function.appendArgument("");
- else {
- ScriptValue resultValue = ScriptValue::deserialize(scriptState(), result);
- function.appendArgument(resultValue);
- }
- function.appendArgument(isException);
- function.call();
-}
-
#if ENABLE(DOM_STORAGE)
bool InspectorFrontend::addDOMStorage(const ScriptObject& domStorageObj)
{
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index 8d984a3..630c582 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -38,14 +38,12 @@
namespace WebCore {
class ConsoleMessage;
- class Database;
class Frame;
class InspectorClient;
class InspectorResource;
class InspectorWorkerResource;
class Node;
class ScriptString;
- class SerializedScriptValue;
class Storage;
class InspectorFrontend : public Noncopyable {
@@ -97,8 +95,6 @@ namespace WebCore {
void parsedScriptSource(const String& sourceID, const String& url, const String& data, int firstLine, int scriptWorldType);
void restoredBreakpoint(const String& sourceID, const String& url, int line, bool enabled, const String& condition);
void failedToParseScriptSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
- void pausedScript(SerializedScriptValue* callFrames);
- void resumedScript();
void profilerWasEnabled();
void profilerWasDisabled();
@@ -132,7 +128,6 @@ namespace WebCore {
#endif // ENABLE(WORKER)
void didGetCookies(long callId, const ScriptArray& cookies, const String& cookiesString);
- void didDispatchOnInjectedScript(long callId, SerializedScriptValue* result, bool isException);
void contextMenuItemSelected(int itemId);
void contextMenuCleared();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list