This repository has been archived by the owner. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
233 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* weinre is available under *either* the terms of the modified BSD license *or* the | ||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. | ||
* | ||
* Copyright (c) 2011 IBM Corporation | ||
*/ | ||
|
||
// extra messages from the client to the target | ||
|
||
module weinre { | ||
interface WeinreExtraClientCommands { | ||
|
||
void getDatabases(out Object[] databaseRecords); | ||
|
||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* weinre is available under *either* the terms of the modified BSD license *or* the | ||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. | ||
* | ||
* Copyright (c) 2011 IBM Corporation | ||
*/ | ||
|
||
// extra messages from the target to the client | ||
|
||
module weinre { | ||
interface WeinreExtraTargetEvents { | ||
|
||
void databaseOpened(in Object databaseRecord); | ||
|
||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
/* | ||
* weinre is available under *either* the terms of the modified BSD license *or* the | ||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. | ||
* | ||
* Copyright (c) 2011 IBM Corporation | ||
*/ | ||
|
||
//----------------------------------------------------------------------------- | ||
class WeinreExtraTargetEventsImpl | ||
|
||
//----------------------------------------------------------------------------- | ||
method databaseOpened(databaseRecord) | ||
WeinreExtraTargetEventsImpl.addDatabaseRecords([databaseRecord]) | ||
|
||
//----------------------------------------------------------------------------- | ||
static method addDatabaseRecords(databaseRecords) | ||
// databaseRecord.id | ||
// databaseRecord.domain | ||
// databaseRecord.name | ||
// databaseRecord.version | ||
|
||
if (!WebInspector.panels) return | ||
if (!WebInspector.panels.resources) return | ||
if (!WebInspector.panels.resources._databases) return | ||
|
||
var existingDbs = WebInspector.panels.resources._databases | ||
var existingDbNames = {} | ||
|
||
for (var i=0; i<existingDbs.length; i++) { | ||
existingDbNames[existingDbs[i].name] = existingDbs[i] | ||
} | ||
|
||
for (var i=0; i<databaseRecords.length; i++) { | ||
if (existingDbNames[databaseRecords[i].name]) continue | ||
|
||
var databaseRecord = databaseRecords[i] | ||
var database = new WebInspector.Database( | ||
databaseRecord.id, | ||
databaseRecord.domain, | ||
databaseRecord.name, | ||
databaseRecord.version | ||
) | ||
|
||
WebInspector.panels.resources.addDatabase(database) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
/* | ||
* weinre is available under *either* the terms of the modified BSD license *or* the | ||
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text. | ||
* | ||
* Copyright (c) 2010, 2011 IBM Corporation | ||
*/ | ||
|
||
requireClass ../common/Weinre | ||
|
||
requireClass ./WiDatabaseImpl | ||
requireClass ./Console | ||
|
||
//----------------------------------------------------------------------------- | ||
class WeinreExtraClientCommandsImpl | ||
|
||
//----------------------------------------------------------------------------- | ||
method getDatabases(callback) | ||
if (!callback) return | ||
|
||
var result = WiDatabaseImpl.getDatabases() | ||
|
||
Weinre.WeinreTargetCommands.sendClientCallback(callback, [result]) | ||
|
Oops, something went wrong.