diff options
| author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
| commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
| tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/inspector/front-end/InjectedScriptAccess.js | |
| parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
| download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 | |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/inspector/front-end/InjectedScriptAccess.js')
| -rw-r--r-- | WebCore/inspector/front-end/InjectedScriptAccess.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js index 14a3a6b..2dd2908 100644 --- a/WebCore/inspector/front-end/InjectedScriptAccess.js +++ b/WebCore/inspector/front-end/InjectedScriptAccess.js @@ -29,11 +29,25 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var InjectedScriptAccess = {}; +function InjectedScriptAccess(injectedScriptId) { + this._injectedScriptId = injectedScriptId; +} + +InjectedScriptAccess.get = function(injectedScriptId) +{ + return new InjectedScriptAccess(injectedScriptId); +} + +InjectedScriptAccess.getDefault = function() +{ + return InjectedScriptAccess.get(0); +} + +InjectedScriptAccess.prototype = {}; InjectedScriptAccess._installHandler = function(methodName, async) { - InjectedScriptAccess[methodName] = function() + InjectedScriptAccess.prototype[methodName] = function() { var allArgs = Array.prototype.slice.call(arguments); var callback = allArgs[allArgs.length - 1]; @@ -47,7 +61,8 @@ InjectedScriptAccess._installHandler = function(methodName, async) WebInspector.console.addMessage(new WebInspector.ConsoleTextMessage("Error dispatching: " + methodName)); } var callId = WebInspector.Callback.wrap(myCallback); - InspectorBackend.dispatchOnInjectedScript(callId, methodName, argsString, !!async); + + InspectorBackend.dispatchOnInjectedScript(callId, this._injectedScriptId, methodName, argsString, !!async); }; } @@ -59,11 +74,13 @@ InjectedScriptAccess._installHandler("addInspectedNode"); InjectedScriptAccess._installHandler("addStyleSelector"); InjectedScriptAccess._installHandler("applyStyleRuleText"); InjectedScriptAccess._installHandler("applyStyleText"); +InjectedScriptAccess._installHandler("clearConsoleMessages"); InjectedScriptAccess._installHandler("evaluate"); InjectedScriptAccess._installHandler("evaluateInCallFrame"); InjectedScriptAccess._installHandler("getCompletions"); InjectedScriptAccess._installHandler("getComputedStyle"); InjectedScriptAccess._installHandler("getInlineStyle"); +InjectedScriptAccess._installHandler("getNodePropertyValue"); InjectedScriptAccess._installHandler("getProperties"); InjectedScriptAccess._installHandler("getPrototypes"); InjectedScriptAccess._installHandler("getStyles"); @@ -72,10 +89,12 @@ InjectedScriptAccess._installHandler("performSearch"); InjectedScriptAccess._installHandler("pushNodeToFrontend"); InjectedScriptAccess._installHandler("nodeByPath"); InjectedScriptAccess._installHandler("searchCanceled"); +InjectedScriptAccess._installHandler("setOuterHTML"); InjectedScriptAccess._installHandler("setPropertyValue"); InjectedScriptAccess._installHandler("setStyleProperty"); InjectedScriptAccess._installHandler("setStyleText"); InjectedScriptAccess._installHandler("toggleStyleEnabled"); +InjectedScriptAccess._installHandler("evaluateOnSelf"); // Some methods can't run synchronously even on the injected script side (such as DB transactions). // Mark them as asynchronous here. |
