<commit_before>// node-inspector version of on webkit-inspector/InspectorPageAgent.cpp
var fs = require('fs'),
  path = require('path'),
  async = require('async'),
  convert = require('./convert.js'),
  ScriptFileStorage = require('./ScriptFileStorage.js').ScriptFileStorage;


/**
 * @param {DebuggerClient} debuggerClient
 * @constructor
 */
function PageAgent(debuggerClient) {
  this._debuggerClient = debuggerClient;
  this._scriptStorage = new ScriptFileStorage();
}

PageAgent.prototype = {
  enable: function(params, done) {
    done();
  },

  canShowFPSCounter: function(params, done) {
    done(null, { show: false });
  },

  canContinuouslyPaint: function(params, done) {
    done(null, { value: false });
  },

  setTouchEmulationEnabled: function(params, done) {
    done();
  },

  getResourceTree: function(params, done) {
    if (this._debuggerClient.isRunning) {
      this._doGetResourceTree(params, done);
    } else {
      this._debuggerClient.once(
        'connect',
        this._doGetResourceTree.bind(this, params, done)
      );
    }
  },

  _doGetResourceTree: function(params, done) {
    async.waterfall(
      [
        this._debuggerClient.evaluateGlobal.bind(this._debuggerClient, 'process.argv[1]'),
        this._getResourceTreeForAppScript.bind(this)
      ],
      done
    );
  },

  _getResourceTreeForAppScript: function(mainAppScript, done) {
    console.log('mainAppScript %s', mainAppScript);
    async.waterfall(
      [
        this._scriptStorage.findAllApplicationScripts.bind(this._scriptStorage, mainAppScript),<commit_msg>PageAgent: removed forgotten console.log call.<commit_after>// node-inspector version of on webkit-inspector/InspectorPageAgent.cpp
var fs = require('fs'),
  path = require('path'),
  async = require('async'),
  convert = require('./convert.js'),
  ScriptFileStorage = require('./ScriptFileStorage.js').ScriptFileStorage;


/**
 * @param {DebuggerClient} debuggerClient
 * @constructor
 */
function PageAgent(debuggerClient) {
  this._debuggerClient = debuggerClient;
  this._scriptStorage = new ScriptFileStorage();
}

PageAgent.prototype = {
  enable: function(params, done) {
    done();
  },

  canShowFPSCounter: function(params, done) {
    done(null, { show: false });
  },

  canContinuouslyPaint: function(params, done) {
    done(null, { value: false });
  },

  setTouchEmulationEnabled: function(params, done) {
    done();
  },

  getResourceTree: function(params, done) {
    if (this._debuggerClient.isRunning) {
      this._doGetResourceTree(params, done);
    } else {
      this._debuggerClient.once(
        'connect',
        this._doGetResourceTree.bind(this, params, done)
      );
    }
  },

  _doGetResourceTree: function(params, done) {
    async.waterfall(
      [
        this._debuggerClient.evaluateGlobal.bind(this._debuggerClient, 'process.argv[1]'),
        this._getResourceTreeForAppScript.bind(this)
      ],
      done
    );
  },

  _getResourceTreeForAppScript: function(mainAppScript, done) {
    async.waterfall(
      [
        this._scriptStorage.findAllApplicationScripts.bind(this._scriptStorage, mainAppScript),
{'fraction_non_alphanumeric': 0.13182253431216087, 'fraction_numerical': 0.0006383657835939994, 'mean_word_length': 3.6986506746626686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5956377', 'n_tokens_mistral': 965, 'n_tokens_neox': 944, 'n_words': 158}