[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
pfeldman at chromium.org
pfeldman at chromium.org
Wed Dec 22 11:52:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit dd30289c2d4ff3d379f6775f68845c05e9517276
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 10 16:06:38 2010 +0000
2010-08-10 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: move database processing to native layer.
https://bugs.webkit.org/show_bug.cgi?id=43788
* English.lproj/localizedStrings.js:
* WebCore.gypi:
* bindings/js/JSInjectedScriptHostCustom.cpp:
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
* inspector/CodeGeneratorInspector.pm:
* inspector/InjectedScript.cpp:
(WebCore::InjectedScript::dispatch):
* inspector/InjectedScript.h:
* inspector/InjectedScriptHost.cpp:
* inspector/InjectedScriptHost.h:
* inspector/InjectedScriptHost.idl:
* inspector/Inspector.idl:
* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::dispatchOnInjectedScript):
(WebCore::InspectorBackend::executeSQL):
* inspector/InspectorBackend.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::releaseFrontendLifetimeAgents):
* inspector/InspectorController.h:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorStorageAgent.cpp: Added.
(WebCore::):
(WebCore::InspectorStorageAgent::InspectorStorageAgent):
(WebCore::InspectorStorageAgent::~InspectorStorageAgent):
(WebCore::InspectorStorageAgent::executeSQL):
(WebCore::InspectorStorageAgent::clearFrontend):
* inspector/InspectorStorageAgent.h: Added.
(WebCore::InspectorStorageAgent::create):
(WebCore::InspectorStorageAgent::frontend):
* inspector/front-end/Database.js:
(WebInspector.Database.prototype.executeSql):
(WebInspector.sqlTransactionSucceeded):
(WebInspector.sqlTransactionFailed):
* inspector/front-end/DatabaseQueryView.js:
(WebInspector.DatabaseQueryView.prototype._queryFinished):
(WebInspector.DatabaseQueryView.prototype._queryError):
* inspector/front-end/DatabaseTableView.js:
(WebInspector.DatabaseTableView.prototype._queryFinished):
* inspector/front-end/InjectedScript.js:
* inspector/front-end/InjectedScriptAccess.js:
(InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName):
(InjectedScriptAccess._installHandler):
* inspector/front-end/StoragePanel.js:
(WebInspector.StoragePanel.prototype.dataGridForResult):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index fdff627..0d4625c 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1062,6 +1062,7 @@ SET(WebCore_SOURCES
inspector/InspectorFrontendHost.cpp
inspector/InspectorResource.cpp
inspector/InspectorValues.cpp
+ inspector/InspectorStorageAgent.cpp
inspector/InspectorTimelineAgent.cpp
inspector/ScriptBreakpoint.cpp
inspector/TimelineRecordFactory.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 246524e..85e6aa8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,57 @@
+2010-08-10 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move database processing to native layer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43788
+
+ * English.lproj/localizedStrings.js:
+ * WebCore.gypi:
+ * bindings/js/JSInjectedScriptHostCustom.cpp:
+ * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+ * inspector/CodeGeneratorInspector.pm:
+ * inspector/InjectedScript.cpp:
+ (WebCore::InjectedScript::dispatch):
+ * inspector/InjectedScript.h:
+ * inspector/InjectedScriptHost.cpp:
+ * inspector/InjectedScriptHost.h:
+ * inspector/InjectedScriptHost.idl:
+ * inspector/Inspector.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::dispatchOnInjectedScript):
+ (WebCore::InspectorBackend::executeSQL):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::releaseFrontendLifetimeAgents):
+ * inspector/InspectorController.h:
+ * inspector/InspectorDebuggerAgent.h:
+ * inspector/InspectorStorageAgent.cpp: Added.
+ (WebCore::):
+ (WebCore::InspectorStorageAgent::InspectorStorageAgent):
+ (WebCore::InspectorStorageAgent::~InspectorStorageAgent):
+ (WebCore::InspectorStorageAgent::executeSQL):
+ (WebCore::InspectorStorageAgent::clearFrontend):
+ * inspector/InspectorStorageAgent.h: Added.
+ (WebCore::InspectorStorageAgent::create):
+ (WebCore::InspectorStorageAgent::frontend):
+ * inspector/front-end/Database.js:
+ (WebInspector.Database.prototype.executeSql):
+ (WebInspector.sqlTransactionSucceeded):
+ (WebInspector.sqlTransactionFailed):
+ * inspector/front-end/DatabaseQueryView.js:
+ (WebInspector.DatabaseQueryView.prototype._queryFinished):
+ (WebInspector.DatabaseQueryView.prototype._queryError):
+ * inspector/front-end/DatabaseTableView.js:
+ (WebInspector.DatabaseTableView.prototype._queryFinished):
+ * inspector/front-end/InjectedScript.js:
+ * inspector/front-end/InjectedScriptAccess.js:
+ (InjectedScriptAccess._installHandler.InjectedScriptAccess.prototype.methodName):
+ (InjectedScriptAccess._installHandler):
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.dataGridForResult):
+
2010-08-10 Steve Block <steveblock at google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 86fc5b1..388b687 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1622,6 +1622,8 @@ webcore_sources += \
WebCore/inspector/InspectorFrontendHost.h \
WebCore/inspector/InspectorResource.cpp \
WebCore/inspector/InspectorResource.h \
+ WebCore/inspector/InspectorStorageAgent.cpp \
+ WebCore/inspector/InspectorStorageAgent.h \
WebCore/inspector/InspectorTimelineAgent.cpp \
WebCore/inspector/InspectorTimelineAgent.h \
WebCore/inspector/InspectorValues.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 1959fd8..33645b5 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1761,6 +1761,8 @@
'inspector/InspectorFrontendHost.h',
'inspector/InspectorResource.cpp',
'inspector/InspectorResource.h',
+ 'inspector/InspectorStorageAgent.cpp',
+ 'inspector/InspectorStorageAgent.h',
'inspector/InspectorTimelineAgent.cpp',
'inspector/InspectorTimelineAgent.h',
'inspector/InspectorValues.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 64d86d0..652d443 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -758,6 +758,7 @@ SOURCES += \
inspector/InspectorFrontendClientLocal.cpp \
inspector/InspectorFrontendHost.cpp \
inspector/InspectorResource.cpp \
+ inspector/InspectorStorageAgent.cpp \
inspector/InspectorTimelineAgent.cpp \
inspector/InspectorValues.cpp \
inspector/ScriptBreakpoint.cpp \
@@ -1518,6 +1519,7 @@ HEADERS += \
inspector/InspectorFrontendClientLocal.h \
inspector/InspectorFrontendHost.h \
inspector/InspectorResource.h \
+ inspector/InspectorStorageAgent.h \
inspector/InspectorTimelineAgent.h \
inspector/ScriptGCEventListener.h \
inspector/TimelineRecordFactory.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 48a21f4..c309955 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -50989,6 +50989,14 @@
>
</File>
<File
+ RelativePath="..\inspector\InspectorStorageAgent.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\InspectorStorageAgent.h"
+ >
+ </File>
+ <File
RelativePath="..\inspector\InspectorTimelineAgent.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index c816795..9e54ab5 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1420,6 +1420,8 @@
7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECB8101839A500BF939E /* InspectorBackend.cpp */; };
7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorBackend.h */; };
7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; };
+ 7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorStorageAgent.cpp */; };
+ 7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorStorageAgent.h */; };
7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7256,6 +7258,8 @@
7A74ECB8101839A500BF939E /* InspectorBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBackend.cpp; sourceTree = "<group>"; };
7A74ECB9101839A600BF939E /* InspectorBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackend.h; sourceTree = "<group>"; };
7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; };
+ 7AB0B1BE1211A62200A76940 /* InspectorStorageAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorStorageAgent.cpp; sourceTree = "<group>"; };
+ 7AB0B1BF1211A62200A76940 /* InspectorStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorStorageAgent.h; sourceTree = "<group>"; };
7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; };
7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
@@ -11662,6 +11666,8 @@
7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
41F062000F5F0B6600A07EAC /* InspectorResource.cpp */,
41F061FF0F5F0B6600A07EAC /* InspectorResource.h */,
+ 7AB0B1BE1211A62200A76940 /* InspectorStorageAgent.cpp */,
+ 7AB0B1BF1211A62200A76940 /* InspectorStorageAgent.h */,
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
4F3289B311A42AAB005ABE7E /* InspectorValues.cpp */,
@@ -20133,6 +20139,7 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
+ 7AB0B1C11211A62200A76940 /* InspectorStorageAgent.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -22555,6 +22562,7 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+ 7AB0B1C01211A62200A76940 /* InspectorStorageAgent.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
index ec8b122..0c891a3 100644
--- a/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
@@ -103,23 +103,6 @@ ScriptObject InjectedScriptHost::createInjectedScript(const String& source, Scri
return ScriptObject();
}
-#if ENABLE(DATABASE)
-JSValue JSInjectedScriptHost::databaseForId(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return jsUndefined();
-
- InspectorController* ic = impl()->inspectorController();
- if (!ic)
- return jsUndefined();
-
- Database* database = impl()->databaseForId(exec->argument(0).toInt32(exec));
- if (!database)
- return jsUndefined();
- return toJS(exec, database);
-}
-#endif
-
#if ENABLE(JAVASCRIPT_DEBUGGER)
JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec)
{
@@ -192,24 +175,6 @@ JSValue JSInjectedScriptHost::selectDOMStorage(ExecState* exec)
}
#endif
-JSValue JSInjectedScriptHost::reportDidDispatchOnInjectedScript(ExecState* exec)
-{
- if (exec->argumentCount() < 3)
- return jsUndefined();
-
- if (!exec->argument(0).isInt32())
- return jsUndefined();
- int callId = exec->argument(0).asInt32();
-
- RefPtr<InspectorValue> result = ScriptValue(exec->argument(1)).toInspectorValue(exec);
-
- bool isException;
- if (!exec->argument(2).getBoolean(isException))
- return jsUndefined();
- impl()->reportDidDispatchOnInjectedScript(callId, result, isException);
- return jsUndefined();
-}
-
InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState)
{
JSLock lock(SilenceAssertionsOnly);
diff --git a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 31ef8db..435cf73 100644
--- a/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -164,19 +164,6 @@ v8::Handle<v8::Value> V8InjectedScriptHost::currentCallFrameCallback(const v8::A
#endif
#if ENABLE(DATABASE)
-v8::Handle<v8::Value> V8InjectedScriptHost::databaseForIdCallback(const v8::Arguments& args)
-{
- INC_STATS("InjectedScriptHost.databaseForId()");
- if (args.Length() < 1)
- return v8::Undefined();
-
- InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
- Database* database = host->databaseForId(args[0]->ToInt32()->Value());
- if (!database)
- return v8::Undefined();
- return toV8(database);
-}
-
v8::Handle<v8::Value> V8InjectedScriptHost::selectDatabaseCallback(const v8::Arguments& args)
{
INC_STATS("InjectedScriptHost.selectDatabase()");
@@ -208,19 +195,6 @@ v8::Handle<v8::Value> V8InjectedScriptHost::selectDOMStorageCallback(const v8::A
}
#endif
-v8::Handle<v8::Value> V8InjectedScriptHost::reportDidDispatchOnInjectedScriptCallback(const v8::Arguments& args)
-{
- INC_STATS("InjectedScriptHost.reportDidDispatchOnInjectedScript()");
- if (args.Length() < 3)
- return v8::Undefined();
- InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
- int callId = args[0]->ToInt32()->Value();
- RefPtr<InspectorValue> result = ScriptValue(args[1]).toInspectorValue(ScriptState::current());
- bool isException = args[2]->ToBoolean()->Value();
- host->reportDidDispatchOnInjectedScript(callId, result, isException);
- return v8::Undefined();
-}
-
InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScriptState)
{
v8::HandleScope handleScope;
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index 67ea1ae..9d0af53 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -237,8 +237,7 @@ sub generateFrontendFunction
my $function = shift;
my $notify = $function->signature->extendedAttributes->{"notify"};
- my $async = $function->signature->extendedAttributes->{"async"};
- return if !$async && !$notify;
+ return if !$notify;
my $functionName = $notify ? $function->signature->name : "did" . ucfirst($function->signature->name);
my @argsFiltered = grep($_->direction eq "out", @{$function->parameters}); # just keep only out parameters for frontend interface.
@@ -341,12 +340,11 @@ sub generateBackendFunction
push(@function, " " . $typeTransform{$_->type}->{"variable"} . " " . $_->name . "$initializer;");
}
- my $async = $function->signature->extendedAttributes->{"async"};
- my $args = join(", ", (grep($async || !($_ eq "callId"), map($_->name, @inArgs)), map("&" . $_->name, @outArgs)));
+ my $args = join(", ", (grep(!($_ eq "callId"), map($_->name, @inArgs)), map("&" . $_->name, @outArgs)));
push(@function, " $handlerAccessor->$functionName($args);");
- # The results of function call should be transfered back to frontend (except async methods - need to fix that).
- if (scalar(grep($_->name eq "callId", @inArgs)) && !$async) {
+ # The results of function call should be transfered back to frontend.
+ if (scalar(grep($_->name eq "callId", @inArgs))) {
my @pushArguments = map(" arguments->push" . $typeTransform{$_->type}->{"accessorSuffix"} . "(" . $_->name . ");", @outArgs);
push(@function, "");
diff --git a/WebCore/inspector/InjectedScript.cpp b/WebCore/inspector/InjectedScript.cpp
index 4f29b8a..3f4d819 100644
--- a/WebCore/inspector/InjectedScript.cpp
+++ b/WebCore/inspector/InjectedScript.cpp
@@ -44,7 +44,7 @@ InjectedScript::InjectedScript(ScriptObject injectedScriptObject)
{
}
-void InjectedScript::dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException)
+void InjectedScript::dispatch(const String& methodName, const String& arguments, RefPtr<InspectorValue>* result, bool* hadException)
{
ASSERT(!hasNoValue());
if (!canAccessInspectedWindow()) {
@@ -55,8 +55,6 @@ void InjectedScript::dispatch(long callId, const String& methodName, const Strin
ScriptFunctionCall function(m_injectedScriptObject, "dispatch");
function.appendArgument(methodName);
function.appendArgument(arguments);
- if (async)
- function.appendArgument(callId);
*hadException = false;
ScriptValue resultValue = function.call(*hadException);
if (!*hadException)
diff --git a/WebCore/inspector/InjectedScript.h b/WebCore/inspector/InjectedScript.h
index b2d88f4..17389ba 100644
--- a/WebCore/inspector/InjectedScript.h
+++ b/WebCore/inspector/InjectedScript.h
@@ -48,7 +48,7 @@ public:
bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
- void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException);
+ void dispatch(const String& methodName, const String& arguments, 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 5c05c73..37512be 100644
--- a/WebCore/inspector/InjectedScriptHost.cpp
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -142,12 +142,6 @@ void InjectedScriptHost::selectDOMStorage(Storage* storage)
}
#endif
-void InjectedScriptHost::reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException)
-{
- if (RemoteInspectorFrontend* frontend = remoteFrontend())
- frontend->didDispatchOnInjectedScript(callId, result, isException);
-}
-
InjectedScript InjectedScriptHost::injectedScriptForId(long id)
{
return m_idToInjectedScript.get(id);
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
index 78e00d4..997f340 100644
--- a/WebCore/inspector/InjectedScriptHost.h
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -82,7 +82,6 @@ public:
void didCreateWorker(long id, const String& url, bool isSharedWorker);
void didDestroyWorker(long id);
#endif
- void reportDidDispatchOnInjectedScript(long callId, PassRefPtr<InspectorValue> result, bool isException);
pair<long, ScriptObject> injectScript(const String& source, ScriptState*);
InjectedScript injectedScriptFor(ScriptState*);
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
index 21af938..9b2ed6c 100644
--- a/WebCore/inspector/InjectedScriptHost.idl
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -44,7 +44,6 @@ module core {
#endif
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
- [Custom] DOMObject databaseForId(in long databaseId);
[Custom] void selectDatabase(in DOMObject database);
#endif
@@ -57,6 +56,5 @@ module core {
void didDestroyWorker(in long id);
long nextWorkerId();
#endif
- [Custom] void reportDidDispatchOnInjectedScript(in long callId, in DOMObject result, in boolean isException);
};
}
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index d972bfe..9d3d102 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -157,7 +157,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, async] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, in boolean async, out Value result, out boolean isException);
+ [handler=Backend] void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in String methodName, in String arguments, out Value result, out boolean isException);
[handler=Controller] void addScriptToEvaluateOnLoad(in String scriptSource);
[handler=Controller] void removeAllScriptsToEvaluateOnLoad();
@@ -206,6 +206,9 @@ module core {
#if defined(ENABLE_DATABASE) && ENABLE_DATABASE
[handler=Backend] void getDatabaseTableNames(in long callId, in long databaseId, out Array tableNames);
+ [handler=Backend] void executeSQL(in long callId, in long databaseId, in String query, out boolean success, out long transactionId);
+ [notify] void sqlTransactionSucceeded(out long transactionId, out Value columnNames, out Value values);
+ [notify] void sqlTransactionFailed(out long transactionId, out Value sqlError);
#endif
#if defined(ENABLE_DOM_STORAGE) && ENABLE_DOM_STORAGE
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 22025fb..0a18e1c 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -40,6 +40,7 @@
#include "InjectedScriptHost.h"
#include "InspectorController.h"
#include "InspectorDOMAgent.h"
+#include "InspectorStorageAgent.h"
#include "RemoteInspectorFrontend.h"
#include "ScriptBreakpoint.h"
#include "ScriptProfiler.h"
@@ -85,7 +86,7 @@ void InspectorBackend::setInjectedScriptSource(const String& source)
m_inspectorController->injectedScriptHost()->setInjectedScriptSource(source);
}
-void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException)
+void InspectorBackend::dispatchOnInjectedScript(long injectedScriptId, const String& methodName, const String& arguments, RefPtr<InspectorValue>* result, bool* hadException)
{
if (!remoteFrontend())
return;
@@ -102,10 +103,7 @@ void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScript
if (injectedScript.hasNoValue())
return;
- injectedScript.dispatch(callId, methodName, arguments, async, result, hadException);
- if (async)
- return; // InjectedScript will return result asynchronously by means of ::reportDidDispatchOnInjectedScript.
- remoteFrontend()->didDispatchOnInjectedScript(callId, (*result).get(), *hadException);
+ injectedScript.dispatch(methodName, arguments, result, hadException);
}
void InspectorBackend::clearConsoleMessages()
@@ -129,6 +127,19 @@ void InspectorBackend::getDatabaseTableNames(long databaseId, RefPtr<InspectorAr
(*names)->pushString(tableNames[i]);
}
}
+
+void InspectorBackend::executeSQL(long databaseId, const String& query, bool* success, long* transactionId)
+{
+ Database* database = m_inspectorController->databaseForId(databaseId);
+ if (!m_inspectorController->m_storageAgent || !database) {
+ *success = false;
+ return;
+ }
+
+ *transactionId = m_inspectorController->m_storageAgent->executeSQL(database, query);
+ *success = true;
+}
+
#endif
RemoteInspectorFrontend* InspectorBackend::remoteFrontend()
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index f7bae4f..63c4a09 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -66,7 +66,7 @@ public:
#endif
void setInjectedScriptSource(const String& source);
- void dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async, RefPtr<InspectorValue>* result, bool* hadException);
+ void dispatchOnInjectedScript(long injectedScriptId, const String& methodName, const String& arguments, RefPtr<InspectorValue>* result, bool* hadException);
void clearConsoleMessages();
// Generic code called from custom implementations.
@@ -74,6 +74,7 @@ public:
#if ENABLE(DATABASE)
void getDatabaseTableNames(long databaseId, RefPtr<InspectorArray>* names);
+ void executeSQL(long databaseId, const String& query, bool* success, long* transactionId);
#endif
private:
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 9e55067..0b59617 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -63,9 +63,10 @@
#include "InspectorDatabaseResource.h"
#include "InspectorDebuggerAgent.h"
#include "InspectorResource.h"
+#include "InspectorStorageAgent.h"
+#include "InspectorTimelineAgent.h"
#include "InspectorValues.h"
#include "InspectorWorkerResource.h"
-#include "InspectorTimelineAgent.h"
#include "Page.h"
#include "ProgressTracker.h"
#include "Range.h"
@@ -477,6 +478,11 @@ void InspectorController::connectFrontend()
releaseFrontendLifetimeAgents();
m_remoteFrontend = new RemoteInspectorFrontend(m_client);
m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_remoteFrontend.get());
+
+#if ENABLE(DATABASE)
+ m_storageAgent = InspectorStorageAgent::create(m_remoteFrontend.get());
+#endif
+
if (m_timelineAgent)
m_timelineAgent->resetFrontendProxyObject(m_remoteFrontend.get());
@@ -598,6 +604,9 @@ void InspectorController::releaseFrontendLifetimeAgents()
if (m_domAgent)
m_domAgent->reset();
m_domAgent.clear();
+ if (m_storageAgent)
+ m_storageAgent->clearFrontend();
+ m_storageAgent.clear();
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
m_applicationCacheAgent.clear();
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 55252e9..2125003 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -65,6 +65,7 @@ class InspectorDatabaseResource;
class InspectorDebuggerAgent;
class InspectorFrontendClient;
class InspectorResource;
+class InspectorStorageAgent;
class InspectorTimelineAgent;
class InspectorValue;
class InspectorWorkerResource;
@@ -328,6 +329,7 @@ private:
bool m_openingFrontend;
OwnPtr<RemoteInspectorFrontend> m_remoteFrontend;
RefPtr<InspectorDOMAgent> m_domAgent;
+ RefPtr<InspectorStorageAgent> m_storageAgent;
OwnPtr<InspectorCSSStore> m_cssStore;
OwnPtr<InspectorTimelineAgent> m_timelineAgent;
diff --git a/WebCore/inspector/InspectorStorageAgent.cpp b/WebCore/inspector/InspectorStorageAgent.cpp
new file mode 100644
index 0000000..ad39434
--- /dev/null
+++ b/WebCore/inspector/InspectorStorageAgent.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "InspectorStorageAgent.h"
+
+#if ENABLE(INSPECTOR) && ENABLE(DATABASE)
+
+#include "Database.h"
+#include "ExceptionCode.h"
+#include "InspectorValues.h"
+#include "SQLError.h"
+#include "SQLStatementCallback.h"
+#include "SQLStatementErrorCallback.h"
+#include "SQLResultSetRowList.h"
+#include "SQLTransaction.h"
+#include "SQLTransactionCallback.h"
+#include "SQLTransactionErrorCallback.h"
+#include "SQLValue.h"
+#include "RemoteInspectorFrontend.h"
+#include "VoidCallback.h"
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+namespace {
+
+long lastTransactionId = 0;
+
+void reportTransactionFailed(InspectorStorageAgent* agent, long transactionId, SQLError* error)
+{
+ if (!agent->frontend())
+ return;
+ RefPtr<InspectorObject> errorObject = InspectorObject::create();
+ errorObject->setString("message", error->message());
+ errorObject->setNumber("code", error->code());
+ agent->frontend()->sqlTransactionFailed(transactionId, errorObject);
+}
+
+class StatementCallback : public SQLStatementCallback {
+public:
+ static PassRefPtr<StatementCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ {
+ return adoptRef(new StatementCallback(transactionId, agent));
+ }
+
+ virtual ~StatementCallback() { }
+
+ virtual bool handleEvent(SQLTransaction*, SQLResultSet* resultSet)
+ {
+ if (!m_agent->frontend())
+ return true;
+
+ SQLResultSetRowList* rowList = resultSet->rows();
+
+ RefPtr<InspectorArray> columnNames = InspectorArray::create();
+ const Vector<String>& columns = rowList->columnNames();
+ for (size_t i = 0; i < columns.size(); ++i)
+ columnNames->pushString(columns[i]);
+
+ RefPtr<InspectorArray> values = InspectorArray::create();
+ const Vector<SQLValue>& data = rowList->values();
+ for (size_t i = 0; i < data.size(); ++i) {
+ const SQLValue& value = rowList->values()[i];
+ switch (value.type()) {
+ case SQLValue::StringValue: values->pushString(value.string()); break;
+ case SQLValue::NumberValue: values->pushNumber(value.number()); break;
+ case SQLValue::NullValue: values->push(InspectorValue::null()); break;
+ }
+ }
+ m_agent->frontend()->sqlTransactionSucceeded(m_transactionId, columnNames, values);
+ return true;
+ }
+
+private:
+ StatementCallback(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ : m_transactionId(transactionId)
+ , m_agent(agent) { }
+ long m_transactionId;
+ RefPtr<InspectorStorageAgent> m_agent;
+};
+
+class StatementErrorCallback : public SQLStatementErrorCallback {
+public:
+ static PassRefPtr<StatementErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ {
+ return adoptRef(new StatementErrorCallback(transactionId, agent));
+ }
+
+ virtual ~StatementErrorCallback() { }
+
+ virtual bool handleEvent(SQLTransaction*, SQLError* error)
+ {
+ reportTransactionFailed(m_agent.get(), m_transactionId, error);
+ return true;
+ }
+
+private:
+ StatementErrorCallback(long transactionId, RefPtr<InspectorStorageAgent> agent)
+ : m_transactionId(transactionId)
+ , m_agent(agent) { }
+ long m_transactionId;
+ RefPtr<InspectorStorageAgent> m_agent;
+};
+
+class TransactionCallback : public SQLTransactionCallback {
+public:
+ static PassRefPtr<TransactionCallback> create(const String& sqlStatement, long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ {
+ return adoptRef(new TransactionCallback(sqlStatement, transactionId, agent));
+ }
+
+ virtual ~TransactionCallback() { }
+
+ virtual bool handleEvent(SQLTransaction* transaction)
+ {
+ if (!m_agent->frontend())
+ return true;
+
+ Vector<SQLValue> sqlValues;
+ RefPtr<SQLStatementCallback> callback(StatementCallback::create(m_transactionId, m_agent));
+ RefPtr<SQLStatementErrorCallback> errorCallback(StatementErrorCallback::create(m_transactionId, m_agent));
+ ExceptionCode ec = 0;
+ transaction->executeSQL(m_sqlStatement, sqlValues, callback.release(), errorCallback.release(), ec);
+ return true;
+ }
+private:
+ TransactionCallback(const String& sqlStatement, long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ : m_sqlStatement(sqlStatement)
+ , m_transactionId(transactionId)
+ , m_agent(agent) { }
+ String m_sqlStatement;
+ long m_transactionId;
+ RefPtr<InspectorStorageAgent> m_agent;
+};
+
+class TransactionErrorCallback : public SQLTransactionErrorCallback {
+public:
+ static PassRefPtr<TransactionErrorCallback> create(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ {
+ return adoptRef(new TransactionErrorCallback(transactionId, agent));
+ }
+
+ virtual ~TransactionErrorCallback() { }
+
+ virtual bool handleEvent(SQLError* error)
+ {
+ reportTransactionFailed(m_agent.get(), m_transactionId, error);
+ return true;
+ }
+private:
+ TransactionErrorCallback(long transactionId, PassRefPtr<InspectorStorageAgent> agent)
+ : m_transactionId(transactionId)
+ , m_agent(agent) { }
+ long m_transactionId;
+ RefPtr<InspectorStorageAgent> m_agent;
+};
+
+class TransactionSuccessCallback : public VoidCallback {
+public:
+ static PassRefPtr<TransactionSuccessCallback> create()
+ {
+ return adoptRef(new TransactionSuccessCallback());
+ }
+
+ virtual ~TransactionSuccessCallback() { }
+
+ virtual void handleEvent() { }
+
+private:
+ TransactionSuccessCallback() { }
+};
+
+} // namespace
+
+InspectorStorageAgent::InspectorStorageAgent(RemoteInspectorFrontend* frontend)
+ : m_frontend(frontend)
+{
+}
+
+InspectorStorageAgent::~InspectorStorageAgent()
+{
+}
+
+long InspectorStorageAgent::executeSQL(Database* database, const String& query)
+{
+ long transactionId = ++lastTransactionId;
+ RefPtr<SQLTransactionCallback> callback(TransactionCallback::create(query, transactionId, this));
+ RefPtr<SQLTransactionErrorCallback> errorCallback(TransactionErrorCallback::create(transactionId, this));
+ RefPtr<VoidCallback> successCallback(TransactionSuccessCallback::create());
+ database->transaction(callback.release(), errorCallback.release(), successCallback.release());
+ return transactionId;
+}
+
+void InspectorStorageAgent::clearFrontend()
+{
+ m_frontend = 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR) && ENABLE(DATABASE)
diff --git a/WebCore/inspector/InspectorStorageAgent.h b/WebCore/inspector/InspectorStorageAgent.h
new file mode 100644
index 0000000..b47e0d3
--- /dev/null
+++ b/WebCore/inspector/InspectorStorageAgent.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InspectorStorageAgent_h
+#define InspectorStorageAgent_h
+
+#include "PlatformString.h"
+#include "wtf/PassRefPtr.h"
+
+namespace WebCore {
+
+class Database;
+class RemoteInspectorFrontend;
+
+class InspectorStorageAgent : public RefCounted<InspectorStorageAgent> {
+public:
+ static PassRefPtr<InspectorStorageAgent> create(RemoteInspectorFrontend* frontend)
+ {
+ return adoptRef(new InspectorStorageAgent(frontend));
+ }
+
+ virtual ~InspectorStorageAgent();
+
+ long executeSQL(Database*, const String& query);
+
+ RemoteInspectorFrontend* frontend() { return m_frontend; }
+ void clearFrontend();
+
+private:
+ InspectorStorageAgent(RemoteInspectorFrontend*);
+
+ RemoteInspectorFrontend* m_frontend;
+};
+
+} // namespace WebCore
+
+#endif // !defined(InspectorStorageAgent_h)
diff --git a/WebCore/inspector/front-end/Database.js b/WebCore/inspector/front-end/Database.js
index 17ee4e6..45b7a0e 100644
--- a/WebCore/inspector/front-end/Database.js
+++ b/WebCore/inspector/front-end/Database.js
@@ -34,6 +34,9 @@ WebInspector.Database = function(id, domain, name, version)
this._version = version;
}
+WebInspector.Database.successCallbacks = {};
+WebInspector.Database.errorCallbacks = {};
+
WebInspector.Database.prototype = {
get id()
{
@@ -87,16 +90,33 @@ WebInspector.Database.prototype = {
executeSql: function(query, onSuccess, onError)
{
- function callback(result)
+ function callback(success, transactionId)
{
- if (!(result instanceof Array)) {
- onError(result);
+ if (!success) {
+ onError(WebInspector.UIString("Database not found."));
return;
}
- onSuccess(result);
+ WebInspector.Database.successCallbacks[transactionId] = onSuccess;
+ WebInspector.Database.errorCallbacks[transactionId] = onError;
}
- // FIXME: execute the query in the frame the DB comes from.
- InjectedScriptAccess.getDefault().executeSql(this._id, query, callback);
+ InspectorBackend.executeSQL(WebInspector.Callback.wrap(callback), this._id, query);
}
}
+WebInspector.sqlTransactionSucceeded = function(transactionId, columnNames, values)
+{
+ var callback = WebInspector.Database.successCallbacks[transactionId];
+ if (!callback)
+ return;
+ delete WebInspector.Database.successCallbacks[transactionId];
+ callback(columnNames, values);
+}
+
+WebInspector.sqlTransactionFailed = function(transactionId, errorObj)
+{
+ var callback = WebInspector.Database.errorCallbacks[transactionId];
+ if (!callback)
+ return;
+ delete WebInspector.Database.errorCallbacks[transactionId];
+ callback(errorObj);
+}
diff --git a/WebCore/inspector/front-end/DatabaseQueryView.js b/WebCore/inspector/front-end/DatabaseQueryView.js
index 38c8df4..a179eaa 100644
--- a/WebCore/inspector/front-end/DatabaseQueryView.js
+++ b/WebCore/inspector/front-end/DatabaseQueryView.js
@@ -137,9 +137,9 @@ WebInspector.DatabaseQueryView.prototype = {
this.database.executeSql(query, this._queryFinished.bind(this, query), this._queryError.bind(this, query));
},
- _queryFinished: function(query, result)
+ _queryFinished: function(query, columnNames, values)
{
- var dataGrid = WebInspector.panels.storage.dataGridForResult(result);
+ var dataGrid = WebInspector.panels.storage.dataGridForResult(columnNames, values);
var trimmedQuery = query.trim();
if (dataGrid) {
@@ -154,7 +154,7 @@ WebInspector.DatabaseQueryView.prototype = {
_queryError: function(query, error)
{
- if (error.code == 1)
+ if (error.message)
var message = error.message;
else if (error.code == 2)
var message = WebInspector.UIString("Database no longer has expected version.");
diff --git a/WebCore/inspector/front-end/DatabaseTableView.js b/WebCore/inspector/front-end/DatabaseTableView.js
index cd66ab7..9e6d374 100644
--- a/WebCore/inspector/front-end/DatabaseTableView.js
+++ b/WebCore/inspector/front-end/DatabaseTableView.js
@@ -54,11 +54,11 @@ WebInspector.DatabaseTableView.prototype = {
this.database.executeSql("SELECT * FROM " + this.tableName, this._queryFinished.bind(this), this._queryError.bind(this));
},
- _queryFinished: function(result)
+ _queryFinished: function(columnNames, values)
{
this.element.removeChildren();
- var dataGrid = WebInspector.panels.storage.dataGridForResult(result);
+ var dataGrid = WebInspector.panels.storage.dataGridForResult(columnNames, values);
if (!dataGrid) {
var emptyMsgElement = document.createElement("div");
emptyMsgElement.className = "storage-table-empty";
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index 3a114c0..b8bf9f2 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -472,45 +472,6 @@ InjectedScript.CallFrameProxy.prototype = {
}
}
-InjectedScript.executeSql = function(callId, databaseId, query)
-{
- function successCallback(tx, result)
- {
- var rows = result.rows;
- var result = [];
- var length = rows.length;
- for (var i = 0; i < length; ++i) {
- var data = {};
- result.push(data);
- var row = rows.item(i);
- for (var columnIdentifier in row) {
- // FIXME: (Bug 19439) We should specially format SQL NULL here
- // (which is represented by JavaScript null here, and turned
- // into the string "null" by the String() function).
- var text = row[columnIdentifier];
- data[columnIdentifier] = String(text);
- }
- }
- InjectedScriptHost.reportDidDispatchOnInjectedScript(callId, result, false);
- }
-
- function errorCallback(tx, error)
- {
- InjectedScriptHost.reportDidDispatchOnInjectedScript(callId, error, false);
- }
-
- function queryTransaction(tx)
- {
- tx.executeSql(query, null, successCallback, errorCallback);
- }
-
- var database = InjectedScriptHost.databaseForId(databaseId);
- if (!database)
- errorCallback(null, { code : 2 }); // Return as unexpected version.
- database.transaction(queryTransaction, errorCallback);
- return true;
-}
-
InjectedScript._isDefined = function(object)
{
return object || InjectedScript._isHTMLAllCollection(object);
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index ac28948..b5aa9c7 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -66,7 +66,7 @@ InjectedScriptAccess._installHandler = function(methodName, async)
}
var callId = WebInspector.Callback.wrap(myCallback);
- InspectorBackend.dispatchOnInjectedScript(callId, this._injectedScriptId, methodName, argsString, !!async);
+ InspectorBackend.dispatchOnInjectedScript(callId, this._injectedScriptId, methodName, argsString);
};
}
@@ -84,8 +84,3 @@ InjectedScriptAccess._installHandler("getPrototypes");
InjectedScriptAccess._installHandler("openInInspectedWindow");
InjectedScriptAccess._installHandler("pushNodeToFrontend");
InjectedScriptAccess._installHandler("setPropertyValue");
-
-// Some methods can't run synchronously even on the injected script side (such as DB transactions).
-// Mark them as asynchronous here.
-InjectedScriptAccess._installHandler("executeSql", true);
-
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index 68563de..2d17989 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -298,32 +298,28 @@ WebInspector.StoragePanel.prototype = {
database.getTableNames(tableNamesCallback);
},
- dataGridForResult: function(rows)
+ dataGridForResult: function(columnNames, values)
{
- if (!rows.length)
+ var numColumns = columnNames.length;
+ if (!numColumns)
return null;
var columns = {};
- var numColumns = 0;
- for (var columnIdentifier in rows[0]) {
+ for (var i = 0; i < columnNames.length; ++i) {
var column = {};
- column.width = columnIdentifier.length;
- column.title = columnIdentifier;
+ column.width = columnNames[i].length;
+ column.title = columnNames[i];
column.sortable = true;
- columns[columnIdentifier] = column;
- ++numColumns;
+ columns[columnNames[i]] = column;
}
var nodes = [];
- var length = rows.length;
- for (var i = 0; i < length; ++i) {
+ for (var i = 0; i < values.length / numColumns; ++i) {
var data = {};
-
- var row = rows[i];
- for (var columnIdentifier in row)
- data[columnIdentifier] = row[columnIdentifier];
+ for (var j = 0; j < columnNames.length; ++j)
+ data[columnNames[j]] = values[numColumns * i + j];
var node = new WebInspector.DataGridNode(data, false);
node.selectable = false;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list