<commit_before>#include "GetWindowHandles.h"
#include "WebPageManager.h"
#include "CommandFactory.h"
#include "WebPage.h"
#include <QStringList>

GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}

void GetWindowHandles::start() {
  QString handles = "[";
  QStringList stringList;

  foreach(WebPage *page, manager()->pages())
    stringList.append("\"" + page->uuid() + "\"");

  handles += stringList.join(",") + "]";

  emitFinished(true, handles);
}<commit_msg>Serialize window handles using JsonSerializer<commit_after>#include "GetWindowHandles.h"
#include "WebPageManager.h"
#include "CommandFactory.h"
#include "WebPage.h"
#include "JsonSerializer.h"
#include <QStringList>

GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}

void GetWindowHandles::start() {
  QVariantList handles;

  foreach(WebPage *page, manager()->pages())
    handles << page->uuid();

  JsonSerializer serializer;
  QString json = serializer.serialize(handles);

  emitFinished(true, json);
}
{'fraction_non_alphanumeric': 0.14590443686006827, 'fraction_numerical': 0.0, 'mean_word_length': 6.82, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3361682', 'n_tokens_mistral': 365, 'n_tokens_neox': 364, 'n_words': 75}