Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: sky/framework/inspector/runtime-agent.sky

Issue 662523003: Add a very minimal CSSAgent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/framework/inspector/runtime-agent.sky
diff --git a/sky/framework/inspector/runtime-agent.sky b/sky/framework/inspector/runtime-agent.sky
index 49f1ecc931bd07fe75bef4a75873d4e7e02cf9c6..ce42d4f9571c96731e74f7f87bf377dc2cce9294 100644
--- a/sky/framework/inspector/runtime-agent.sky
+++ b/sky/framework/inspector/runtime-agent.sky
@@ -1,20 +1,9 @@
+<link rel="import" href="debug.sky" as="debug" />
<script>
-
function Runtime(delegate) {
this.delegate_ = delegate;
}
-// FIXME: Move these to their own 'debug' module.
-function logParams(name, params) {
- console.log(name + "(" + JSON.stringify(params, null, " ") + ")")
-}
-
-function debug(name) {
- return function(params) {
- logParams(name, params);
- }
-}
-
Runtime.prototype.enable = function() {
this.delegate_.sendMessage("Runtime.executionContextCreated", {
"context": {
@@ -28,7 +17,6 @@ Runtime.prototype.enable = function() {
};
Runtime.prototype.callFunctionOn = function(params) {
- logParams("callFunctionOn", params);
var object = g_objectRegistry.lookup(params.objectId);
// This is a horrible hack:
var functionName = params.functionDeclaration.match(/^function (\w+)\(/)[1];
@@ -49,7 +37,7 @@ Runtime.prototype.callFunctionOn = function(params) {
// FIXME: This should release all objects associated with an object
// group, see InjectedScriptSource.js for an example. Just have to
// track which object ids are associated with which object groups first.
-Runtime.prototype.releaseObjectGroup = debug("releaseObjectGroup");
+Runtime.prototype.releaseObjectGroup = debug.loggingStub("releaseObjectGroup");
// See InjectedScript._bind for a fancier version of this:
@@ -115,7 +103,6 @@ function makeResult(params, value, wasThrown) {
// FIXME: See Blink"s inspected-script-source.js InjectedScript.RemoteObject.
Runtime.prototype.evaluate = function(params) {
- logParams("evaluate", params);
var wasThrown = false;
var value;
try {
@@ -128,7 +115,7 @@ Runtime.prototype.evaluate = function(params) {
return makeResult(params, value, wasThrown);
}
-Runtime.prototype.getProperties = debug("getProperties");
+Runtime.prototype.getProperties = debug.loggingStub("getProperties");
this.exports = Runtime;
</script>

Powered by Google App Engine
This is Rietveld 408576698