summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/Database.js
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-10-08 17:19:54 +0100
committerSteve Block <steveblock@google.com>2009-10-20 00:41:58 +0100
commit231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch)
treea6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/inspector/front-end/Database.js
parente196732677050bd463301566a68a643b6d14b907 (diff)
downloadexternal_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/inspector/front-end/Database.js')
-rw-r--r--WebCore/inspector/front-end/Database.js51
1 files changed, 29 insertions, 22 deletions
diff --git a/WebCore/inspector/front-end/Database.js b/WebCore/inspector/front-end/Database.js
index ef42e15..1a348fc 100644
--- a/WebCore/inspector/front-end/Database.js
+++ b/WebCore/inspector/front-end/Database.js
@@ -26,25 +26,18 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.Database = function(database, domain, name, version)
+WebInspector.Database = function(id, domain, name, version)
{
- this.database = database;
- this.domain = domain;
- this.name = name;
- this.version = version;
+ this._id = id;
+ this._domain = domain;
+ this._name = name;
+ this._version = version;
}
WebInspector.Database.prototype = {
- get database()
+ get id()
{
- return this._database;
- },
-
- set database(x)
- {
- if (this._database === x)
- return;
- this._database = x;
+ return this._id;
},
get name()
@@ -54,8 +47,6 @@ WebInspector.Database.prototype = {
set name(x)
{
- if (this._name === x)
- return;
this._name = x;
},
@@ -66,8 +57,6 @@ WebInspector.Database.prototype = {
set version(x)
{
- if (this._version === x)
- return;
this._version = x;
},
@@ -78,8 +67,6 @@ WebInspector.Database.prototype = {
set domain(x)
{
- if (this._domain === x)
- return;
this._domain = x;
},
@@ -88,8 +75,28 @@ WebInspector.Database.prototype = {
return WebInspector.Resource.prototype.__lookupGetter__("displayDomain").call(this);
},
- get tableNames()
+ getTableNames: function(callback)
{
- return InspectorController.databaseTableNames(this.database).sort();
+ function sortingCallback(names)
+ {
+ callback(names.sort());
+ }
+ var callId = WebInspector.Callback.wrap(sortingCallback);
+ InspectorController.getDatabaseTableNames(callId, this._id);
+ },
+
+ executeSql: function(query, onSuccess, onError)
+ {
+ function callback(result)
+ {
+ if (!(result instanceof Array)) {
+ onError(result);
+ return;
+ }
+ onSuccess(result);
+ }
+ InjectedScriptAccess.executeSql(this._id, query, callback);
}
}
+
+WebInspector.didGetDatabaseTableNames = WebInspector.Callback.processCallback;